Commit 707efe1a authored by David Byers's avatar David Byers
Browse files

Fix bug 1282. Boldify, underlinify and italicify text.

Detailed changes:
> 	Fix bug 1282:
> 	* services.el (initiate-query-read-texts): Call correct membership
> 	parser. Use new names.
> 	(initiate-get-membership): Ditto.
> 	(initiate-get-part-of-membership): Ditto.
>
> 	* parse.el (lyskom-parse-membership-10) New name.
> 	(lyskom-parse-membership-list-10): New name.
>
> 	Goofing off:
> 	* lyskom-rest.el (lyskom-format-plaintext-fonts): New function.
>
parent e625f4ff
2004-02-29 David Byers <byers@lysator.liu.se>
Fix bug 1282:
* services.el (initiate-query-read-texts): Call correct membership
parser. Use new names.
(initiate-get-membership): Ditto.
(initiate-get-part-of-membership): Ditto.
* parse.el (lyskom-parse-membership-10) New name.
(lyskom-parse-membership-list-10): New name.
Goofing off:
* lyskom-rest.el (lyskom-format-plaintext-fonts): New function.
* macros.el (lyskom-mime-content-type-get): Moved here from
mime.el.
(lyskom-mime-content-type): Moved here from mime.el.
......
......@@ -2131,6 +2131,7 @@ Deferred insertions are not supported."
(or formatted text)))
(defun lyskom-format-plaintext (text text-stat)
(lyskom-format-plaintext-fonts text)
(let ((tmp (if kom-text-properties
(lyskom-button-transform-text
(lyskom-fill-message text)
......@@ -2167,6 +2168,20 @@ Deferred insertions are not supported."
gr nil t))))
(error nil))))
(defun lyskom-format-plaintext-fonts (text)
(let ((start 0))
(while (string-match "\\(_[^ \n\r\t_]\\([^_<>=%$\n]*[^ \n\r\t_]\\)?_\\)\\|\\(/[^ \n\r\t_]\\([^/<>=%$\n]*[^ \n\r\t_]\\)?/\\)\\|\\(\\*[^ \n\r\t_]\\([^*<>=%$\n]*[^ \n\r\t_]\\)?\\*\\)"
text start)
(add-text-properties (1+ (match-beginning 0))
(1- (match-end 0))
`(face ,(cond ((match-beginning 1) 'underline)
((match-beginning 3) 'italic)
((match-beginning 5) 'bold)))
text)
(setq start (1- (match-end 0))))))
(defun lyskom-signal-reformatted-text (how)
......
......@@ -676,7 +676,7 @@ than 0. Args: ITEMS-TO-PARSE PRE-FETCHED. Returns -1 if ITEMS-TO-PARSE is
(lyskom-parse-time) ;added-at
(lyskom-parse-membership-type))))
(defun lyskom-parse-membership ()
(defun lyskom-parse-membership-10 ()
"Parse a membership."
(lyskom-create-membership
(lyskom-parse-num) ;position
......@@ -1136,9 +1136,9 @@ Args: TEXT-NO. Value: text-stat."
"Parse a membership-list. Returns a vector."
(lyskom-parse-vector (lyskom-parse-num) 'lyskom-parse-membership-11))
(defun lyskom-parse-membership-list ()
(defun lyskom-parse-membership-list-10 ()
"Parse a membership-list. Returns a vector."
(lyskom-parse-vector (lyskom-parse-num) 'lyskom-parse-membership))
(lyskom-parse-vector (lyskom-parse-num) 'lyskom-parse-membership-10))
(defun lyskom-parse-membership-list-old ()
"Parse a membership-list. Returns a vector."
......
......@@ -210,7 +210,7 @@ Args: KOM-QUEUE HANDLER PERS-NO CONF-NO &rest DATA"
max-ranges)))
((lyskom-have-call 98)
(lyskom-call kom-queue lyskom-ref-no handler data
'lyskom-parse-membership)
'lyskom-parse-membership-10)
(lyskom-send-packet kom-queue
(lyskom-format-objects 98 pers-no conf-no)))
(t
......@@ -694,12 +694,12 @@ Args: KOM-QUEUE HANDLER PERS-NO &rest DATA."
1 lyskom-max-int)))
((lyskom-have-call 99)
(lyskom-call kom-queue lyskom-ref-no handler data
'lyskom-parse-membership-list-old)
'lyskom-parse-membership-list-10)
(lyskom-send-packet
kom-queue
(lyskom-format-objects 99 pers-no 0 lyskom-max-int 1)))
(t (lyskom-call kom-queue lyskom-ref-no handler data
'lyskom-parse-membership-list)
'lyskom-parse-membership-list-old)
(lyskom-send-packet
kom-queue
(lyskom-format-objects 46 pers-no 0 lyskom-max-int 1))))))
......@@ -719,7 +719,7 @@ Args: KOM-QUEUE HANDLER PERS-NO FIRST-IN-LIST LENGHT &rest DATA."
0 0)))
((lyskom-have-call 99)
(lyskom-call kom-queue lyskom-ref-no handler data
'lyskom-parse-membership-list)
'lyskom-parse-membership-list-10)
(lyskom-send-packet
kom-queue
(lyskom-format-objects 99 pers-no first length 0)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment