comparison lisp/mail/mail-utils.el @ 220:2ea306376f97

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Mon, 01 Apr 1991 20:15:20 +0000
parents 9697c13298e5
children 7e4c7ef44243
comparison
equal deleted inserted replaced
219:6f8afe7308eb 220:2ea306376f97
21 (provide 'mail-utils) 21 (provide 'mail-utils)
22 22
23 ;; should be in loaddefs 23 ;; should be in loaddefs
24 (defvar mail-use-rfc822 nil 24 (defvar mail-use-rfc822 nil
25 "*If non-nil, use a full, hairy RFC822 parser on mail addresses. 25 "*If non-nil, use a full, hairy RFC822 parser on mail addresses.
26 Otherwise, (the default) use a smaller, somewhat faster and 26 Otherwise, (the default) use a smaller, somewhat faster, and
27 often-correct parser.") 27 often correct parser.")
28 28
29 (defun mail-string-delete (string start end) 29 (defun mail-string-delete (string start end)
30 "Returns a string containing all of STRING except the part 30 "Returns a string containing all of STRING except the part
31 from START (inclusive) to END (exclusive)." 31 from START (inclusive) to END (exclusive)."
32 (if (null end) (substring string 0 start) 32 (if (null end) (substring string 0 start)
101 (setq rmail-default-dont-reply-to-names "info-")) 101 (setq rmail-default-dont-reply-to-names "info-"))
102 102
103 ; rmail-dont-reply-to-names is defined in loaddefs 103 ; rmail-dont-reply-to-names is defined in loaddefs
104 (defun rmail-dont-reply-to (userids) 104 (defun rmail-dont-reply-to (userids)
105 "Returns string of mail addresses USERIDS sans any recipients 105 "Returns string of mail addresses USERIDS sans any recipients
106 that start with matches for rmail-dont-reply-to-names. 106 that start with matches for `rmail-dont-reply-to-names'.
107 Usenet paths ending in an element that matches are removed also." 107 Usenet paths ending in an element that matches are removed also."
108 (if (null rmail-dont-reply-to-names) 108 (if (null rmail-dont-reply-to-names)
109 (setq rmail-dont-reply-to-names 109 (setq rmail-dont-reply-to-names
110 (concat (if rmail-default-dont-reply-to-names 110 (concat (if rmail-default-dont-reply-to-names
111 (concat rmail-default-dont-reply-to-names "\\|") 111 (concat rmail-default-dont-reply-to-names "\\|")
133 (if (string-match "\\s *" userids) 133 (if (string-match "\\s *" userids)
134 (substring userids (match-end 0)) 134 (substring userids (match-end 0))
135 userids))) 135 userids)))
136 136
137 (defun mail-fetch-field (field-name &optional last all) 137 (defun mail-fetch-field (field-name &optional last all)
138 "Return the value of the header field FIELD. 138 "Return the value of the header field FIELD-NAME.
139 The buffer is expected to be narrowed to just the headers of the message. 139 The buffer is expected to be narrowed to just the headers of the message.
140 If 2nd arg LAST is non-nil, use the last such field if there are several. 140 If second arg LAST is non-nil, use the last such field if there are several.
141 If 3rd arg ALL is non-nil, concatenate all such fields, with commas between." 141 If third arg ALL is non-nil, concatenate all such fields with commas between."
142 (save-excursion 142 (save-excursion
143 (goto-char (point-min)) 143 (goto-char (point-min))
144 (let ((case-fold-search t) 144 (let ((case-fold-search t)
145 (name (concat "^" (regexp-quote field-name) "[ \t]*:[ \t]*"))) 145 (name (concat "^" (regexp-quote field-name) "[ \t]*:[ \t]*")))
146 (goto-char (point-min)) 146 (goto-char (point-min))