Mercurial > emacs
comparison lisp/mail/unrmail.el @ 102927:510e9d4f2aa4
(unrmail): If "Mail-From" header is found, append a newline to it.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 10 Apr 2009 11:53:59 +0000 |
parents | d5ecb9cfd7cb |
children | 5cc45bab5282 |
comparison
equal
deleted
inserted
replaced
102926:928b6319c991 | 102927:510e9d4f2aa4 |
---|---|
189 (narrow-to-region | 189 (narrow-to-region |
190 (point-min) | 190 (point-min) |
191 (save-excursion (search-forward "\n\n" nil 'move) (point))) | 191 (save-excursion (search-forward "\n\n" nil 'move) (point))) |
192 | 192 |
193 ;; Fetch or construct what we should use in the `From ' line. | 193 ;; Fetch or construct what we should use in the `From ' line. |
194 (setq mail-from (or (mail-fetch-field "Mail-From") | 194 (setq mail-from (or (let ((from (mail-fetch-field "Mail-From"))) |
195 ;; mail-mbox-from (below) returns a | |
196 ;; string that ends in a newline, but | |
197 ;; but mail-fetch-field does not, so | |
198 ;; we append a newline here. | |
199 (if from | |
200 (format "%s\n" from))) | |
195 (mail-mbox-from))) | 201 (mail-mbox-from))) |
196 | 202 |
197 ;; If the message specifies a coding system, use it. | 203 ;; If the message specifies a coding system, use it. |
198 (let ((maybe-coding (mail-fetch-field "X-Coding-System"))) | 204 (let ((maybe-coding (mail-fetch-field "X-Coding-System"))) |
199 (if maybe-coding | 205 (if maybe-coding |
211 (delete-region (point) | 217 (delete-region (point) |
212 (progn (forward-line 1) (point))))) | 218 (progn (forward-line 1) (point))))) |
213 | 219 |
214 (goto-char (point-min)) | 220 (goto-char (point-min)) |
215 ;; Insert the `From ' line. | 221 ;; Insert the `From ' line. |
216 (insert mail-from "\n") | 222 (insert mail-from) |
217 ;; Record the keywords and attributes in our special way. | 223 ;; Record the keywords and attributes in our special way. |
218 (insert "X-RMAIL-ATTRIBUTES: " (apply 'string attrs) "\n") | 224 (insert "X-RMAIL-ATTRIBUTES: " (apply 'string attrs) "\n") |
219 (when keywords | 225 (when keywords |
220 (insert "X-RMAIL-KEYWORDS: " keywords "\n")) | 226 (insert "X-RMAIL-KEYWORDS: " keywords "\n")) |
221 (goto-char (point-min)) | 227 (goto-char (point-min)) |