summaryrefslogtreecommitdiff
path: root/lisp/gnus/ietf-drums.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/ietf-drums.el')
-rw-r--r--lisp/gnus/ietf-drums.el41
1 files changed, 27 insertions, 14 deletions
diff --git a/lisp/gnus/ietf-drums.el b/lisp/gnus/ietf-drums.el
index a02762804f7..81d66aa3093 100644
--- a/lisp/gnus/ietf-drums.el
+++ b/lisp/gnus/ietf-drums.el
@@ -99,14 +99,14 @@ backslash and doublequote.")
(push c out)))
(range
(while (<= b c)
- (push (mm-make-char 'ascii b) out)
+ (push (make-char 'ascii b) out)
(incf b))
(setq range nil))
((= i (length token))
- (push (mm-make-char 'ascii c) out))
+ (push (make-char 'ascii c) out))
(t
(when b
- (push (mm-make-char 'ascii b) out))
+ (push (make-char 'ascii b) out))
(setq b c))))
(nreverse out)))
@@ -200,7 +200,9 @@ backslash and doublequote.")
(buffer-substring
(1+ (point))
(progn (forward-sexp 1) (1- (point))))))))
- (t (error "Unknown symbol: %c" c))))
+ (t
+ (message "Unknown symbol: %c" c)
+ (forward-char 1))))
;; If we found no display-name, then we look for comments.
(if display-name
(setq display-string
@@ -213,8 +215,10 @@ backslash and doublequote.")
(ietf-drums-get-comment string)))
(cons mailbox display-string)))))
-(defun ietf-drums-parse-addresses (string)
- "Parse STRING and return a list of MAILBOX / DISPLAY-NAME pairs."
+(defun ietf-drums-parse-addresses (string &optional rawp)
+ "Parse STRING and return a list of MAILBOX / DISPLAY-NAME pairs.
+If RAWP, don't actually parse the addresses, but instead return
+a list of address strings."
(if (null string)
nil
(with-temp-buffer
@@ -231,20 +235,24 @@ backslash and doublequote.")
(skip-chars-forward "^,"))))
((eq c ?,)
(setq address
- (condition-case nil
- (ietf-drums-parse-address
- (buffer-substring beg (point)))
- (error nil)))
+ (if rawp
+ (buffer-substring beg (point))
+ (condition-case nil
+ (ietf-drums-parse-address
+ (buffer-substring beg (point)))
+ (error nil))))
(if address (push address pairs))
(forward-char 1)
(setq beg (point)))
(t
(forward-char 1))))
(setq address
- (condition-case nil
- (ietf-drums-parse-address
- (buffer-substring beg (point)))
- (error nil)))
+ (if rawp
+ (buffer-substring beg (point))
+ (condition-case nil
+ (ietf-drums-parse-address
+ (buffer-substring beg (point)))
+ (error nil))))
(if address (push address pairs))
(nreverse pairs)))))
@@ -274,6 +282,11 @@ backslash and doublequote.")
(concat "\"" string "\"")
string))
+(defun ietf-drums-make-address (name address)
+ (if name
+ (concat (ietf-drums-quote-string name) " <" address ">")
+ address))
+
(provide 'ietf-drums)
;;; arch-tag: 379a0191-dbae-4ca6-a0f5-d4202c209ef9