Mercurial > emacs
comparison lisp/gnus/message.el @ 66966:477d7ac04b7b
* message.el (message-courtesy-message)
(message-mark-insert-begin, message-mark-insert-end)
(message-elide-ellipsis, message-cancel-message)
(message-add-header, message-change-subject)
(message-cross-post-followup-to-header)
(message-cross-post-insert-note, message-reduce-to-to-cc)
(message-widen-reply, message-delete-not-region)
(message-kill-to-signature, message-insert-signature)
(message-insert-importance-high, message-insert-importance-low)
(message-insert-or-toggle-importance)
(message-insert-disposition-notification-to)
(message-indent-citation, message-yank-original)
(message-cite-original-without-signature, message-cite-original)
(message-insert-citation-line, message-position-on-field)
(message-fix-before-sending, message-send-mail-partially)
(message-send-mail, message-send-mail-with-sendmail)
(message-send-mail-with-qmail, message-send-news)
(message-check-news-header-syntax, message-generate-headers)
(message-insert-courtesy-copy, message-fill-address)
(message-fill-header, message-shorten-references)
(message-setup-1, message-cancel-news)
(message-forward-make-body-plain) (message-forward-make-body-mime)
(message-forward-make-body-mml) (message-encode-message-body)
(message-forward-make-body-digest-plain)
(message-forward-make-body-digest-mime)
(message-use-alternative-email-as-from): Insert `hard-newline'
instead of ordinary newlines.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Thu, 17 Nov 2005 16:31:22 +0000 |
parents | a93385a3e7a2 |
children | 572ca24101c2 |
comparison
equal
deleted
inserted
replaced
66965:1bca10e9d192 | 66966:477d7ac04b7b |
---|---|
139 :version "22.1" | 139 :version "22.1" |
140 :type 'boolean | 140 :type 'boolean |
141 :group 'message-sending) | 141 :group 'message-sending) |
142 | 142 |
143 (defcustom message-courtesy-message | 143 (defcustom message-courtesy-message |
144 "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n" | 144 (concat |
145 "The following message is a courtesy copy of an article" | |
146 hard-newline | |
147 "that has been posted to %s as well." | |
148 hard-newline hard-newline) | |
145 "*This is inserted at the start of a mailed copy of a posted message. | 149 "*This is inserted at the start of a mailed copy of a posted message. |
146 If the string contains the format spec \"%s\", the Newsgroups | 150 If the string contains the format spec \"%s\", the Newsgroups |
147 the article has been posted to will be inserted there. | 151 the article has been posted to will be inserted there. |
148 If this variable is nil, no such courtesy message will be added." | 152 If this variable is nil, no such courtesy message will be added." |
149 :group 'message-sending | 153 :group 'message-sending |
337 :type 'regexp) | 341 :type 'regexp) |
338 | 342 |
339 ;;; marking inserted text | 343 ;;; marking inserted text |
340 | 344 |
341 (defcustom message-mark-insert-begin | 345 (defcustom message-mark-insert-begin |
342 "--8<---------------cut here---------------start------------->8---\n" | 346 (concat |
347 "--8<---------------cut here---------------start------------->8---" | |
348 hard-newline) | |
343 "How to mark the beginning of some inserted text." | 349 "How to mark the beginning of some inserted text." |
344 :version "22.1" | 350 :version "22.1" |
345 :type 'string | 351 :type 'string |
346 :link '(custom-manual "(message)Insertion Variables") | 352 :link '(custom-manual "(message)Insertion Variables") |
347 :group 'message-various) | 353 :group 'message-various) |
348 | 354 |
349 (defcustom message-mark-insert-end | 355 (defcustom message-mark-insert-end |
350 "--8<---------------cut here---------------end--------------->8---\n" | 356 (concat |
357 "--8<---------------cut here---------------end--------------->8---" | |
358 hard-newline) | |
351 "How to mark the end of some inserted text." | 359 "How to mark the end of some inserted text." |
352 :version "22.1" | 360 :version "22.1" |
353 :type 'string | 361 :type 'string |
354 :link '(custom-manual "(message)Insertion Variables") | 362 :link '(custom-manual "(message)Insertion Variables") |
355 :group 'message-various) | 363 :group 'message-various) |
356 | 364 |
357 (defcustom message-archive-header "X-No-Archive: Yes\n" | 365 (defcustom message-archive-header "X-No-Archive: Yes" |
358 "Header to insert when you don't want your article to be archived. | 366 "Header to insert when you don't want your article to be archived. |
359 Archives \(such as groups.google.com\) respect this header." | 367 Archives \(such as groups.google.com\) respect this header." |
360 :version "22.1" | 368 :version "22.1" |
361 :type 'string | 369 :type 'string |
362 :link '(custom-manual "(message)Header Commands") | 370 :link '(custom-manual "(message)Header Commands") |
416 "Regexp matching the signature separator." | 424 "Regexp matching the signature separator." |
417 :type 'regexp | 425 :type 'regexp |
418 :link '(custom-manual "(message)Various Message Variables") | 426 :link '(custom-manual "(message)Various Message Variables") |
419 :group 'message-various) | 427 :group 'message-various) |
420 | 428 |
421 (defcustom message-elide-ellipsis "\n[...]\n\n" | 429 (defcustom message-elide-ellipsis |
430 (concat hard-newline "[...]" hard-newline hard-newline) | |
422 "*The string which is inserted for elided text." | 431 "*The string which is inserted for elided text." |
423 :type 'string | 432 :type 'string |
424 :link '(custom-manual "(message)Various Commands") | 433 :link '(custom-manual "(message)Various Commands") |
425 :group 'message-various) | 434 :group 'message-various) |
426 | 435 |
576 :version "22.1" | 585 :version "22.1" |
577 :group 'message-insertion | 586 :group 'message-insertion |
578 :link '(custom-manual "(message)Insertion Variables") | 587 :link '(custom-manual "(message)Insertion Variables") |
579 :type 'regexp) | 588 :type 'regexp) |
580 | 589 |
581 (defcustom message-cancel-message "I am canceling my own article.\n" | 590 (defcustom message-cancel-message |
591 (concat "I am canceling my own article." hard-newline) | |
582 "Message to be inserted in the cancel message." | 592 "Message to be inserted in the cancel message." |
583 :group 'message-interface | 593 :group 'message-interface |
584 :link '(custom-manual "(message)Canceling News") | 594 :link '(custom-manual "(message)Canceling News") |
585 :type 'string) | 595 :type 'string) |
586 | 596 |
1732 (message-narrow-to-headers) | 1742 (message-narrow-to-headers) |
1733 (unless (re-search-forward (concat "^" (regexp-quote hclean) ":") nil t) | 1743 (unless (re-search-forward (concat "^" (regexp-quote hclean) ":") nil t) |
1734 (goto-char (point-max)) | 1744 (goto-char (point-max)) |
1735 (if (string-match "\n$" (car headers)) | 1745 (if (string-match "\n$" (car headers)) |
1736 (insert (car headers)) | 1746 (insert (car headers)) |
1737 (insert (car headers) ?\n))))) | 1747 (insert (car headers) hard-newline))))) |
1738 (setq headers (cdr headers)))) | 1748 (setq headers (cdr headers)))) |
1739 | 1749 |
1740 (defmacro message-with-reply-buffer (&rest forms) | 1750 (defmacro message-with-reply-buffer (&rest forms) |
1741 "Evaluate FORMS in the reply buffer, if it exists." | 1751 "Evaluate FORMS in the reply buffer, if it exists." |
1742 `(when (and message-reply-buffer | 1752 `(when (and message-reply-buffer |
1839 (message-goto-subject) | 1849 (message-goto-subject) |
1840 (message-delete-line) | 1850 (message-delete-line) |
1841 (insert (concat "Subject: " | 1851 (insert (concat "Subject: " |
1842 new-subject | 1852 new-subject |
1843 " (was: " | 1853 " (was: " |
1844 old-subject ")\n"))))))))) | 1854 old-subject ")" hard-newline))))))))) |
1845 | 1855 |
1846 (defun message-mark-inserted-region (beg end) | 1856 (defun message-mark-inserted-region (beg end) |
1847 "Mark some region in the current article with enclosing tags. | 1857 "Mark some region in the current article with enclosing tags. |
1848 See `message-mark-insert-begin' and `message-mark-insert-end'." | 1858 See `message-mark-insert-begin' and `message-mark-insert-end'." |
1849 (interactive "r") | 1859 (interactive "r") |
1923 ;; make a new Followup-To line | 1933 ;; make a new Followup-To line |
1924 (if (not (string-match (concat "^[ \t]*" | 1934 (if (not (string-match (concat "^[ \t]*" |
1925 target-group | 1935 target-group |
1926 "[ \t]*$") | 1936 "[ \t]*$") |
1927 (message-fetch-field "Newsgroups"))) | 1937 (message-fetch-field "Newsgroups"))) |
1928 (insert (concat "\nFollowup-To: " target-group))) | 1938 (insert (concat hard-newline "Followup-To: " target-group))) |
1929 (setq message-cross-post-old-target target-group)) | 1939 (setq message-cross-post-old-target target-group)) |
1930 | 1940 |
1931 (defun message-cross-post-insert-note (target-group cross-post in-old | 1941 (defun message-cross-post-insert-note (target-group cross-post in-old |
1932 old-groups) | 1942 old-groups) |
1933 "Insert a in message body note about a set Followup or Crosspost. | 1943 "Insert a in message body note about a set Followup or Crosspost. |
1955 (if (message-goto-signature) | 1965 (if (message-goto-signature) |
1956 (re-search-backward message-signature-separator)) | 1966 (re-search-backward message-signature-separator)) |
1957 (if (or in-old | 1967 (if (or in-old |
1958 (not cross-post) | 1968 (not cross-post) |
1959 (string-match "^[ \t]*poster[ \t]*$" target-group)) | 1969 (string-match "^[ \t]*poster[ \t]*$" target-group)) |
1960 (insert (concat message-followup-to-note target-group "\n")) | 1970 (insert message-followup-to-note target-group hard-newline) |
1961 (insert (concat message-cross-post-note target-group "\n"))))) | 1971 (insert message-cross-post-note target-group hard-newline)))) |
1962 | 1972 |
1963 (defun message-cross-post-followup-to (target-group) | 1973 (defun message-cross-post-followup-to (target-group) |
1964 "Crossposts message and set Followup-To to TARGET-GROUP. | 1974 "Crossposts message and set Followup-To to TARGET-GROUP. |
1965 With prefix-argument just set Follow-Up, don't cross-post." | 1975 With prefix-argument just set Follow-Up, don't cross-post." |
1966 (interactive | 1976 (interactive |
2016 (setq bcc t)) | 2026 (setq bcc t)) |
2017 (cond (cc-content | 2027 (cond (cc-content |
2018 (save-excursion | 2028 (save-excursion |
2019 (message-goto-to) | 2029 (message-goto-to) |
2020 (message-delete-line) | 2030 (message-delete-line) |
2021 (insert (concat "To: " cc-content "\n")) | 2031 (insert (concat "To: " cc-content hard-newline)) |
2022 (save-restriction | 2032 (save-restriction |
2023 (message-narrow-to-headers) | 2033 (message-narrow-to-headers) |
2024 (message-remove-header (if bcc | 2034 (message-remove-header (if bcc |
2025 "bcc" | 2035 "bcc" |
2026 "cc")))))))) | 2036 "cc")))))))) |
2781 (message-narrow-to-headers) | 2791 (message-narrow-to-headers) |
2782 (dolist (elem follow-to) | 2792 (dolist (elem follow-to) |
2783 (message-remove-header (symbol-name (car elem))) | 2793 (message-remove-header (symbol-name (car elem))) |
2784 (goto-char (point-min)) | 2794 (goto-char (point-min)) |
2785 (insert (symbol-name (car elem)) ": " | 2795 (insert (symbol-name (car elem)) ": " |
2786 (cdr elem) "\n")))))) | 2796 (cdr elem) hard-newline)))))) |
2787 | 2797 |
2788 (defun message-insert-newsgroups () | 2798 (defun message-insert-newsgroups () |
2789 "Insert the Newsgroups header from the article being replied to." | 2799 "Insert the Newsgroups header from the article being replied to." |
2790 (interactive) | 2800 (interactive) |
2791 (when (and (message-position-on-field "Newsgroups") | 2801 (when (and (message-position-on-field "Newsgroups") |
2811 (goto-char end) | 2821 (goto-char end) |
2812 (delete-region (point) (if (not (message-goto-signature)) | 2822 (delete-region (point) (if (not (message-goto-signature)) |
2813 (point) | 2823 (point) |
2814 (forward-line -2) | 2824 (forward-line -2) |
2815 (point))) | 2825 (point))) |
2816 (insert "\n") | 2826 (insert hard-newline) |
2817 (goto-char beg) | 2827 (goto-char beg) |
2818 (delete-region beg (progn (message-goto-body) | 2828 (delete-region beg (progn (message-goto-body) |
2819 (forward-line 2) | 2829 (forward-line 2) |
2820 (point))) | 2830 (point))) |
2821 (when citeprefix | 2831 (when citeprefix |
2830 (message-goto-signature) | 2840 (message-goto-signature) |
2831 (unless (eobp) | 2841 (unless (eobp) |
2832 (end-of-line -1)) | 2842 (end-of-line -1)) |
2833 (kill-region point (point)) | 2843 (kill-region point (point)) |
2834 (unless (bolp) | 2844 (unless (bolp) |
2835 (insert "\n")))) | 2845 (insert hard-newline)))) |
2836 | 2846 |
2837 (defun message-newline-and-reformat (&optional arg not-break) | 2847 (defun message-newline-and-reformat (&optional arg not-break) |
2838 "Insert four newlines, and then reformat if inside quoted text. | 2848 "Insert four newlines, and then reformat if inside quoted text. |
2839 Prefix arg means justify as well." | 2849 Prefix arg means justify as well." |
2840 (interactive (list (if current-prefix-arg 'full))) | 2850 (interactive (list (if current-prefix-arg 'full))) |
2972 signature)))) | 2982 signature)))) |
2973 (when signature | 2983 (when signature |
2974 (goto-char (point-max)) | 2984 (goto-char (point-max)) |
2975 ;; Insert the signature. | 2985 ;; Insert the signature. |
2976 (unless (bolp) | 2986 (unless (bolp) |
2977 (insert "\n")) | 2987 (insert hard-newline)) |
2978 (when message-signature-insert-empty-line | 2988 (when message-signature-insert-empty-line |
2979 (insert "\n")) | 2989 (insert hard-newline)) |
2980 (insert "-- \n") | 2990 (insert "-- " hard-newline) |
2981 (if (eq signature t) | 2991 (if (eq signature t) |
2982 (insert-file-contents message-signature-file) | 2992 (insert-file-contents message-signature-file) |
2983 (insert signature)) | 2993 (insert signature)) |
2984 (goto-char (point-max)) | 2994 (goto-char (point-max)) |
2985 (or (bolp) (insert "\n"))))) | 2995 (or (bolp) (insert hard-newline))))) |
2986 | 2996 |
2987 (defun message-insert-importance-high () | 2997 (defun message-insert-importance-high () |
2988 "Insert header to mark message as important." | 2998 "Insert header to mark message as important." |
2989 (interactive) | 2999 (interactive) |
2990 (save-excursion | 3000 (save-excursion |
2991 (save-restriction | 3001 (save-restriction |
2992 (message-narrow-to-headers) | 3002 (message-narrow-to-headers) |
2993 (message-remove-header "Importance")) | 3003 (message-remove-header "Importance")) |
2994 (message-goto-eoh) | 3004 (message-goto-eoh) |
2995 (insert "Importance: high\n"))) | 3005 (insert "Importance: high" hard-newline))) |
2996 | 3006 |
2997 (defun message-insert-importance-low () | 3007 (defun message-insert-importance-low () |
2998 "Insert header to mark message as unimportant." | 3008 "Insert header to mark message as unimportant." |
2999 (interactive) | 3009 (interactive) |
3000 (save-excursion | 3010 (save-excursion |
3001 (save-restriction | 3011 (save-restriction |
3002 (message-narrow-to-headers) | 3012 (message-narrow-to-headers) |
3003 (message-remove-header "Importance")) | 3013 (message-remove-header "Importance")) |
3004 (message-goto-eoh) | 3014 (message-goto-eoh) |
3005 (insert "Importance: low\n"))) | 3015 (insert "Importance: low" hard-newline))) |
3006 | 3016 |
3007 (defun message-insert-or-toggle-importance () | 3017 (defun message-insert-or-toggle-importance () |
3008 "Insert a \"Importance: high\" header, or cycle through the header values. | 3018 "Insert a \"Importance: high\" header, or cycle through the header values. |
3009 The three allowed values according to RFC 1327 are `high', `normal' | 3019 The three allowed values according to RFC 1327 are `high', `normal' |
3010 and `low'." | 3020 and `low'." |
3022 ((string= cur "low") | 3032 ((string= cur "low") |
3023 "normal") | 3033 "normal") |
3024 (t | 3034 (t |
3025 "high"))))) | 3035 "high"))))) |
3026 (message-goto-eoh) | 3036 (message-goto-eoh) |
3027 (insert (format "Importance: %s\n" new))))) | 3037 (insert (format "Importance: %s" new) hard-newline)))) |
3028 | 3038 |
3029 (defun message-insert-disposition-notification-to () | 3039 (defun message-insert-disposition-notification-to () |
3030 "Request a disposition notification (return receipt) to this message. | 3040 "Request a disposition notification (return receipt) to this message. |
3031 Note that this should not be used in newsgroups." | 3041 Note that this should not be used in newsgroups." |
3032 (interactive) | 3042 (interactive) |
3033 (save-excursion | 3043 (save-excursion |
3034 (save-restriction | 3044 (save-restriction |
3035 (message-narrow-to-headers) | 3045 (message-narrow-to-headers) |
3036 (message-remove-header "Disposition-Notification-To")) | 3046 (message-remove-header "Disposition-Notification-To")) |
3037 (message-goto-eoh) | 3047 (message-goto-eoh) |
3038 (insert (format "Disposition-Notification-To: %s\n" | 3048 (insert (format "Disposition-Notification-To: %s" |
3039 (or (message-field-value "Reply-to") | 3049 (or (message-field-value "Reply-to") |
3040 (message-field-value "From") | 3050 (message-field-value "From") |
3041 (message-make-from)))))) | 3051 (message-make-from))) |
3052 hard-newline))) | |
3042 | 3053 |
3043 (defun message-elide-region (b e) | 3054 (defun message-elide-region (b e) |
3044 "Elide the text in the region. | 3055 "Elide the text in the region. |
3045 An ellipsis (from `message-elide-ellipsis') will be inserted where the | 3056 An ellipsis (from `message-elide-ellipsis') will be inserted where the |
3046 text was killed." | 3057 text was killed." |
3171 (not (eobp))) | 3182 (not (eobp))) |
3172 (message-delete-line)) | 3183 (message-delete-line)) |
3173 ;; Delete blank lines at the end of the buffer. | 3184 ;; Delete blank lines at the end of the buffer. |
3174 (goto-char (point-max)) | 3185 (goto-char (point-max)) |
3175 (unless (eolp) | 3186 (unless (eolp) |
3176 (insert "\n")) | 3187 (insert hard-newline)) |
3177 (while (and (zerop (forward-line -1)) | 3188 (while (and (zerop (forward-line -1)) |
3178 (looking-at "$")) | 3189 (looking-at "$")) |
3179 (message-delete-line)) | 3190 (message-delete-line)) |
3180 ;; Do the indentation. | 3191 ;; Do the indentation. |
3181 (if (null message-yank-prefix) | 3192 (if (null message-yank-prefix) |
3209 (point))) | 3220 (point))) |
3210 (unless arg | 3221 (unless arg |
3211 (funcall message-cite-function)) | 3222 (funcall message-cite-function)) |
3212 (message-exchange-point-and-mark) | 3223 (message-exchange-point-and-mark) |
3213 (unless (bolp) | 3224 (unless (bolp) |
3214 (insert ?\n)) | 3225 (insert hard-newline)) |
3215 (unless modified | 3226 (unless modified |
3216 (setq message-checksum (message-checksum)))))) | 3227 (setq message-checksum (message-checksum)))))) |
3217 | 3228 |
3218 (defun message-yank-buffer (buffer) | 3229 (defun message-yank-buffer (buffer) |
3219 "Insert BUFFER into the current buffer and quote it." | 3230 "Insert BUFFER into the current buffer and quote it." |
3267 (forward-line -1)) | 3278 (forward-line -1)) |
3268 (forward-line 1) | 3279 (forward-line 1) |
3269 (delete-region (point) end) | 3280 (delete-region (point) end) |
3270 (unless (search-backward "\n\n" start t) | 3281 (unless (search-backward "\n\n" start t) |
3271 ;; Insert a blank line if it is peeled off. | 3282 ;; Insert a blank line if it is peeled off. |
3272 (insert "\n"))) | 3283 (insert hard-newline))) |
3273 (goto-char start) | 3284 (goto-char start) |
3274 (while functions | 3285 (while functions |
3275 (funcall (pop functions))) | 3286 (funcall (pop functions))) |
3276 (when message-citation-line-function | 3287 (when message-citation-line-function |
3277 (unless (bolp) | 3288 (unless (bolp) |
3278 (insert "\n")) | 3289 (insert hard-newline)) |
3279 (funcall message-citation-line-function)))) | 3290 (funcall message-citation-line-function)))) |
3280 | 3291 |
3281 (eval-when-compile (defvar mail-citation-hook)) ;Compiler directive | 3292 (eval-when-compile (defvar mail-citation-hook)) ;Compiler directive |
3282 (defun message-cite-original () | 3293 (defun message-cite-original () |
3283 "Cite function in the standard Message manner." | 3294 "Cite function in the standard Message manner." |
3309 (goto-char start) | 3320 (goto-char start) |
3310 (while functions | 3321 (while functions |
3311 (funcall (pop functions))) | 3322 (funcall (pop functions))) |
3312 (when message-citation-line-function | 3323 (when message-citation-line-function |
3313 (unless (bolp) | 3324 (unless (bolp) |
3314 (insert "\n")) | 3325 (insert hard-newline)) |
3315 (funcall message-citation-line-function))))) | 3326 (funcall message-citation-line-function))))) |
3316 | 3327 |
3317 (defun message-insert-citation-line () | 3328 (defun message-insert-citation-line () |
3318 "Insert a simple citation line." | 3329 "Insert a simple citation line." |
3319 (when message-reply-headers | 3330 (when message-reply-headers |
3320 (insert (mail-header-from message-reply-headers) " writes:\n\n"))) | 3331 (insert (mail-header-from message-reply-headers) |
3332 " writes:" hard-newline hard-newline))) | |
3321 | 3333 |
3322 (defun message-position-on-field (header &rest afters) | 3334 (defun message-position-on-field (header &rest afters) |
3323 (let ((case-fold-search t)) | 3335 (let ((case-fold-search t)) |
3324 (save-restriction | 3336 (save-restriction |
3325 (narrow-to-region | 3337 (narrow-to-region |
3341 nil t))) | 3353 nil t))) |
3342 (pop afters)) | 3354 (pop afters)) |
3343 (when afters | 3355 (when afters |
3344 (re-search-forward "^[^ \t]" nil 'move) | 3356 (re-search-forward "^[^ \t]" nil 'move) |
3345 (beginning-of-line)) | 3357 (beginning-of-line)) |
3346 (insert header ": \n") | 3358 (insert header ": " hard-newline) |
3347 (forward-char -1) | 3359 (forward-char -1) |
3348 nil)))) | 3360 nil)))) |
3349 | 3361 |
3350 (defun message-remove-signature () | 3362 (defun message-remove-signature () |
3351 "Remove the signature from the text between point and mark. | 3363 "Remove the signature from the text between point and mark. |
3537 (defun message-fix-before-sending () | 3549 (defun message-fix-before-sending () |
3538 "Do various things to make the message nice before sending it." | 3550 "Do various things to make the message nice before sending it." |
3539 ;; Make sure there's a newline at the end of the message. | 3551 ;; Make sure there's a newline at the end of the message. |
3540 (goto-char (point-max)) | 3552 (goto-char (point-max)) |
3541 (unless (bolp) | 3553 (unless (bolp) |
3542 (insert "\n")) | 3554 (insert hard-newline)) |
3543 ;; Make the hidden headers visible. | 3555 ;; Make the hidden headers visible. |
3544 (let ((points (message-text-with-property 'message-hidden))) | 3556 (let ((points (message-text-with-property 'message-hidden))) |
3545 (when points | 3557 (when points |
3546 (goto-char (car points)) | 3558 (goto-char (car points)) |
3547 (dolist (point points) | 3559 (dolist (point points) |
3642 "Send mail as message/partial." | 3654 "Send mail as message/partial." |
3643 ;; replace the header delimiter with a blank line | 3655 ;; replace the header delimiter with a blank line |
3644 (goto-char (point-min)) | 3656 (goto-char (point-min)) |
3645 (re-search-forward | 3657 (re-search-forward |
3646 (concat "^" (regexp-quote mail-header-separator) "\n")) | 3658 (concat "^" (regexp-quote mail-header-separator) "\n")) |
3647 (replace-match "\n") | 3659 (replace-match hard-newline) |
3648 (run-hooks 'message-send-mail-hook) | 3660 (run-hooks 'message-send-mail-hook) |
3649 (let ((p (goto-char (point-min))) | 3661 (let ((p (goto-char (point-min))) |
3650 (tembuf (message-generate-new-buffer-clone-locals " message temp")) | 3662 (tembuf (message-generate-new-buffer-clone-locals " message temp")) |
3651 (curbuf (current-buffer)) | 3663 (curbuf (current-buffer)) |
3652 (id (message-make-message-id)) (n 1) | 3664 (id (message-make-message-id)) (n 1) |
3684 (message-remove-header "Content-Type") | 3696 (message-remove-header "Content-Type") |
3685 (message-remove-header "Content-Transfer-Encoding") | 3697 (message-remove-header "Content-Transfer-Encoding") |
3686 (message-remove-header "Message-ID") | 3698 (message-remove-header "Message-ID") |
3687 (message-remove-header "Lines") | 3699 (message-remove-header "Lines") |
3688 (goto-char (point-max)) | 3700 (goto-char (point-max)) |
3689 (insert "Mime-Version: 1.0\n") | 3701 (insert "Mime-Version: 1.0" hard-newline) |
3690 (setq header (buffer-string))) | 3702 (setq header (buffer-string))) |
3691 (goto-char (point-max)) | 3703 (goto-char (point-max)) |
3692 (insert (format "Content-Type: message/partial; id=\"%s\"; number=%d; total=%d\n\n" | 3704 (insert (format "Content-Type: message/partial; id=\"%s\"; number=%d; total=%d" |
3693 id n total)) | 3705 id n total) |
3706 hard-newline hard-newline) | |
3694 (forward-char -1) | 3707 (forward-char -1) |
3695 (let ((mail-header-separator "")) | 3708 (let ((mail-header-separator "")) |
3696 (when (memq 'Message-ID message-required-mail-headers) | 3709 (when (memq 'Message-ID message-required-mail-headers) |
3697 (insert "Message-ID: " (message-make-message-id) "\n")) | 3710 (insert "Message-ID: " (message-make-message-id) hard-newline)) |
3698 (when (memq 'Lines message-required-mail-headers) | 3711 (when (memq 'Lines message-required-mail-headers) |
3699 (insert "Lines: " (message-make-lines) "\n")) | 3712 (insert "Lines: " (message-make-lines) hard-newline)) |
3700 (message-goto-subject) | 3713 (message-goto-subject) |
3701 (end-of-line) | 3714 (end-of-line) |
3702 (insert (format " (%d/%d)" n total)) | 3715 (insert (format " (%d/%d)" n total)) |
3703 (widen) | 3716 (widen) |
3704 (mm-with-unibyte-current-buffer | 3717 (mm-with-unibyte-current-buffer |
3759 (let ((mail-parse-charset message-default-charset)) | 3772 (let ((mail-parse-charset message-default-charset)) |
3760 (mail-encode-encoded-word-buffer))) | 3773 (mail-encode-encoded-word-buffer))) |
3761 (goto-char (point-max)) | 3774 (goto-char (point-max)) |
3762 ;; require one newline at the end. | 3775 ;; require one newline at the end. |
3763 (or (= (preceding-char) ?\n) | 3776 (or (= (preceding-char) ?\n) |
3764 (insert ?\n)) | 3777 (insert hard-newline)) |
3765 (message-cleanup-headers) | 3778 (message-cleanup-headers) |
3766 ;; FIXME: we're inserting the courtesy copy after encoding. | 3779 ;; FIXME: we're inserting the courtesy copy after encoding. |
3767 ;; This is wrong if the courtesy copy string contains | 3780 ;; This is wrong if the courtesy copy string contains |
3768 ;; non-ASCII characters. -- jh | 3781 ;; non-ASCII characters. -- jh |
3769 (when | 3782 (when |
3835 (setq resend-to-addresses (message-fetch-field "resent-to"))) | 3848 (setq resend-to-addresses (message-fetch-field "resent-to"))) |
3836 ;; Change header-delimiter to be what sendmail expects. | 3849 ;; Change header-delimiter to be what sendmail expects. |
3837 (goto-char (point-min)) | 3850 (goto-char (point-min)) |
3838 (re-search-forward | 3851 (re-search-forward |
3839 (concat "^" (regexp-quote mail-header-separator) "\n")) | 3852 (concat "^" (regexp-quote mail-header-separator) "\n")) |
3840 (replace-match "\n") | 3853 (replace-match hard-newline) |
3841 (backward-char 1) | 3854 (backward-char 1) |
3842 (setq delimline (point-marker)) | 3855 (setq delimline (point-marker)) |
3843 (run-hooks 'message-send-mail-hook) | 3856 (run-hooks 'message-send-mail-hook) |
3844 ;; Insert an extra newline if we need it to work around | 3857 ;; Insert an extra newline if we need it to work around |
3845 ;; Sun's bug that swallows newlines. | 3858 ;; Sun's bug that swallows newlines. |
3897 to find out how to use this." | 3910 to find out how to use this." |
3898 ;; replace the header delimiter with a blank line | 3911 ;; replace the header delimiter with a blank line |
3899 (goto-char (point-min)) | 3912 (goto-char (point-min)) |
3900 (re-search-forward | 3913 (re-search-forward |
3901 (concat "^" (regexp-quote mail-header-separator) "\n")) | 3914 (concat "^" (regexp-quote mail-header-separator) "\n")) |
3902 (replace-match "\n") | 3915 (replace-match hard-newline) |
3903 (run-hooks 'message-send-mail-hook) | 3916 (run-hooks 'message-send-mail-hook) |
3904 ;; send the message | 3917 ;; send the message |
3905 (case | 3918 (case |
3906 (let ((coding-system-for-write message-send-coding-system)) | 3919 (let ((coding-system-for-write message-send-coding-system)) |
3907 (apply | 3920 (apply |
4065 (let ((mail-parse-charset message-default-charset)) | 4078 (let ((mail-parse-charset message-default-charset)) |
4066 (mail-encode-encoded-word-buffer))) | 4079 (mail-encode-encoded-word-buffer))) |
4067 (goto-char (point-max)) | 4080 (goto-char (point-max)) |
4068 ;; require one newline at the end. | 4081 ;; require one newline at the end. |
4069 (or (= (preceding-char) ?\n) | 4082 (or (= (preceding-char) ?\n) |
4070 (insert ?\n)) | 4083 (insert hard-newline)) |
4071 (let ((case-fold-search t)) | 4084 (let ((case-fold-search t)) |
4072 ;; Remove the delimiter. | 4085 ;; Remove the delimiter. |
4073 (goto-char (point-min)) | 4086 (goto-char (point-min)) |
4074 (re-search-forward | 4087 (re-search-forward |
4075 (concat "^" (regexp-quote mail-header-separator) "\n")) | 4088 (concat "^" (regexp-quote mail-header-separator) "\n")) |
4076 (replace-match "\n") | 4089 (replace-match hard-newline) |
4077 (backward-char 1)) | 4090 (backward-char 1)) |
4078 (run-hooks 'message-send-news-hook) | 4091 (run-hooks 'message-send-news-hook) |
4079 (gnus-open-server method) | 4092 (gnus-open-server method) |
4080 (message "Sending news via %s..." (gnus-server-string method)) | 4093 (message "Sending news via %s..." (gnus-server-string method)) |
4081 (setq result (let ((mail-header-separator "")) | 4094 (setq result (let ((mail-header-separator "")) |
4198 (mapcar #'list | 4211 (mapcar #'list |
4199 (cons "poster" | 4212 (cons "poster" |
4200 (message-tokenize-header | 4213 (message-tokenize-header |
4201 newsgroups))))))))) | 4214 newsgroups))))))))) |
4202 (goto-char (point-min)) | 4215 (goto-char (point-min)) |
4203 (insert "Followup-To: " to "\n")) | 4216 (insert "Followup-To: " to hard-newline)) |
4204 t)) | 4217 t)) |
4205 ;; Check "Shoot me". | 4218 ;; Check "Shoot me". |
4206 (message-check 'shoot | 4219 (message-check 'shoot |
4207 (if (re-search-forward | 4220 (if (re-search-forward |
4208 "Message-ID.*.i-did-not-set--mail-host-address--so-tickle-me" nil t) | 4221 "Message-ID.*.i-did-not-set--mail-host-address--so-tickle-me" nil t) |
5097 (funcall formatter header value) | 5110 (funcall formatter header value) |
5098 (insert header-string ": " value)) | 5111 (insert header-string ": " value)) |
5099 ;; We check whether the value was ended by a | 5112 ;; We check whether the value was ended by a |
5100 ;; newline. If now, we insert one. | 5113 ;; newline. If now, we insert one. |
5101 (unless (bolp) | 5114 (unless (bolp) |
5102 (insert "\n")) | 5115 (insert hard-newline)) |
5103 (forward-line -1))) | 5116 (forward-line -1))) |
5104 ;; The value of this header was empty, so we clear | 5117 ;; The value of this header was empty, so we clear |
5105 ;; totally and insert the new value. | 5118 ;; totally and insert the new value. |
5106 (delete-region (point) (gnus-point-at-eol)) | 5119 (delete-region (point) (gnus-point-at-eol)) |
5107 ;; If the header is optional, and the header was | 5120 ;; If the header is optional, and the header was |
5137 (beginning-of-line) | 5150 (beginning-of-line) |
5138 (insert "Original-") | 5151 (insert "Original-") |
5139 (beginning-of-line)) | 5152 (beginning-of-line)) |
5140 (when (or (message-news-p) | 5153 (when (or (message-news-p) |
5141 (string-match "@.+\\.." secure-sender)) | 5154 (string-match "@.+\\.." secure-sender)) |
5142 (insert "Sender: " secure-sender "\n")))) | 5155 (insert "Sender: " secure-sender hard-newline)))) |
5143 ;; Check for IDNA | 5156 ;; Check for IDNA |
5144 (message-idna-to-ascii-rhs)))) | 5157 (message-idna-to-ascii-rhs)))) |
5145 | 5158 |
5146 (defun message-insert-courtesy-copy () | 5159 (defun message-insert-courtesy-copy () |
5147 "Insert a courtesy message in mail copies of combined messages." | 5160 "Insert a courtesy message in mail copies of combined messages." |
5149 (save-excursion | 5162 (save-excursion |
5150 (save-restriction | 5163 (save-restriction |
5151 (message-narrow-to-headers) | 5164 (message-narrow-to-headers) |
5152 (when (setq newsgroups (message-fetch-field "newsgroups")) | 5165 (when (setq newsgroups (message-fetch-field "newsgroups")) |
5153 (goto-char (point-max)) | 5166 (goto-char (point-max)) |
5154 (insert "Posted-To: " newsgroups "\n"))) | 5167 (insert "Posted-To: " newsgroups hard-newline))) |
5155 (forward-line 1) | 5168 (forward-line 1) |
5156 (when message-courtesy-message | 5169 (when message-courtesy-message |
5157 (cond | 5170 (cond |
5158 ((string-match "%s" message-courtesy-message) | 5171 ((string-match "%s" message-courtesy-message) |
5159 (insert (format message-courtesy-message newsgroups))) | 5172 (insert (format message-courtesy-message newsgroups))) |
5168 (save-restriction | 5181 (save-restriction |
5169 (narrow-to-region (point) (point)) | 5182 (narrow-to-region (point) (point)) |
5170 (insert (capitalize (symbol-name header)) | 5183 (insert (capitalize (symbol-name header)) |
5171 ": " | 5184 ": " |
5172 (if (consp value) (car value) value) | 5185 (if (consp value) (car value) value) |
5173 "\n") | 5186 hard-newline) |
5174 (narrow-to-region (point-min) (1- (point-max))) | 5187 (narrow-to-region (point-min) (1- (point-max))) |
5175 (let (quoted last) | 5188 (let (quoted last) |
5176 (goto-char (point-min)) | 5189 (goto-char (point-min)) |
5177 (while (not (eobp)) | 5190 (while (not (eobp)) |
5178 (skip-chars-forward "^,\"" (point-max)) | 5191 (skip-chars-forward "^,\"" (point-max)) |
5182 (if (and (> (current-column) 78) | 5195 (if (and (> (current-column) 78) |
5183 last) | 5196 last) |
5184 (progn | 5197 (progn |
5185 (save-excursion | 5198 (save-excursion |
5186 (goto-char last) | 5199 (goto-char last) |
5187 (insert "\n\t")) | 5200 (insert hard-newline "\t")) |
5188 (setq last (1+ (point)))) | 5201 (setq last (1+ (point)))) |
5189 (setq last (1+ (point))))) | 5202 (setq last (1+ (point))))) |
5190 (setq quoted (not quoted))) | 5203 (setq quoted (not quoted))) |
5191 (unless (eobp) | 5204 (unless (eobp) |
5192 (forward-char 1)))) | 5205 (forward-char 1)))) |
5208 (fill-column 78) | 5221 (fill-column 78) |
5209 (fill-prefix "\t")) | 5222 (fill-prefix "\t")) |
5210 (insert (capitalize (symbol-name header)) | 5223 (insert (capitalize (symbol-name header)) |
5211 ": " | 5224 ": " |
5212 (if (consp value) (car value) value) | 5225 (if (consp value) (car value) value) |
5213 "\n") | 5226 hard-newline) |
5214 (save-restriction | 5227 (save-restriction |
5215 (narrow-to-region begin (point)) | 5228 (narrow-to-region begin (point)) |
5216 (fill-region-as-paragraph begin (point)) | 5229 (fill-region-as-paragraph begin (point)) |
5217 ;; Tapdance around looong Message-IDs. | 5230 ;; Tapdance around looong Message-IDs. |
5218 (forward-line -1) | 5231 (forward-line -1) |
5277 ;; Finally, collect the references back into a string and insert | 5290 ;; Finally, collect the references back into a string and insert |
5278 ;; it into the buffer. | 5291 ;; it into the buffer. |
5279 (let ((refstring (mapconcat #'identity refs " "))) | 5292 (let ((refstring (mapconcat #'identity refs " "))) |
5280 (if (and message-this-is-news message-cater-to-broken-inn) | 5293 (if (and message-this-is-news message-cater-to-broken-inn) |
5281 (insert (capitalize (symbol-name header)) ": " | 5294 (insert (capitalize (symbol-name header)) ": " |
5282 refstring "\n") | 5295 refstring hard-newline) |
5283 (message-fill-header header refstring))))) | 5296 (message-fill-header header refstring))))) |
5284 | 5297 |
5285 (defun message-position-point () | 5298 (defun message-position-point () |
5286 "Move point to where the user probably wants to find it." | 5299 "Move point to where the user probably wants to find it." |
5287 (message-narrow-to-headers) | 5300 (message-narrow-to-headers) |
5506 alist) | 5519 alist) |
5507 headers) | 5520 headers) |
5508 (delete-region (point) (progn (forward-line -1) (point))) | 5521 (delete-region (point) (progn (forward-line -1) (point))) |
5509 (when message-default-headers | 5522 (when message-default-headers |
5510 (insert message-default-headers) | 5523 (insert message-default-headers) |
5511 (or (bolp) (insert ?\n))) | 5524 (or (bolp) (insert hard-newline))) |
5512 (put-text-property | 5525 (put-text-property |
5513 (point) | 5526 (point) |
5514 (progn | 5527 (progn |
5515 (insert mail-header-separator "\n") | 5528 (insert mail-header-separator hard-newline) |
5516 (1- (point))) | 5529 (1- (point))) |
5517 'read-only nil) | 5530 'read-only nil) |
5518 (forward-line -1) | 5531 (forward-line -1) |
5519 (when (message-news-p) | 5532 (when (message-news-p) |
5520 (when message-default-news-headers | 5533 (when message-default-news-headers |
5521 (insert message-default-news-headers) | 5534 (insert message-default-news-headers) |
5522 (or (bolp) (insert ?\n))) | 5535 (or (bolp) (insert hard-newline))) |
5523 (when message-generate-headers-first | 5536 (when message-generate-headers-first |
5524 (message-generate-headers | 5537 (message-generate-headers |
5525 (message-headers-to-generate | 5538 (message-headers-to-generate |
5526 (append message-required-news-headers | 5539 (append message-required-news-headers |
5527 message-required-headers) | 5540 message-required-headers) |
5528 message-generate-headers-first | 5541 message-generate-headers-first |
5529 '(Lines Subject))))) | 5542 '(Lines Subject))))) |
5530 (when (message-mail-p) | 5543 (when (message-mail-p) |
5531 (when message-default-mail-headers | 5544 (when message-default-mail-headers |
5532 (insert message-default-mail-headers) | 5545 (insert message-default-mail-headers) |
5533 (or (bolp) (insert ?\n))) | 5546 (or (bolp) (insert hard-newline))) |
5534 (save-restriction | 5547 (save-restriction |
5535 (message-narrow-to-headers) | 5548 (message-narrow-to-headers) |
5536 (if message-alternative-emails | 5549 (if message-alternative-emails |
5537 (message-use-alternative-email-as-from))) | 5550 (message-use-alternative-email-as-from))) |
5538 (when message-generate-headers-first | 5551 (when message-generate-headers-first |
6010 ;; Make control message. | 6023 ;; Make control message. |
6011 (if arg | 6024 (if arg |
6012 (message-news) | 6025 (message-news) |
6013 (setq buf (set-buffer (get-buffer-create " *message cancel*")))) | 6026 (setq buf (set-buffer (get-buffer-create " *message cancel*")))) |
6014 (erase-buffer) | 6027 (erase-buffer) |
6015 (insert "Newsgroups: " newsgroups "\n" | 6028 (insert "Newsgroups: " newsgroups hard-newline |
6016 "From: " from "\n" | 6029 "From: " from hard-newline |
6017 "Subject: cmsg cancel " message-id "\n" | 6030 "Subject: cmsg cancel " message-id hard-newline |
6018 "Control: cancel " message-id "\n" | 6031 "Control: cancel " message-id hard-newline |
6019 (if distribution | 6032 (if distribution |
6020 (concat "Distribution: " distribution "\n") | 6033 (concat "Distribution: " distribution hard-newline) |
6021 "") | 6034 "") |
6022 mail-header-separator "\n" | 6035 mail-header-separator hard-newline |
6023 message-cancel-message) | 6036 message-cancel-message) |
6024 (run-hooks 'message-cancel-hook) | 6037 (run-hooks 'message-cancel-hook) |
6025 (unless arg | 6038 (unless arg |
6026 (message "Canceling your article...") | 6039 (message "Canceling your article...") |
6027 (if (let ((message-syntax-checks | 6040 (if (let ((message-syntax-checks |
6206 (message-mail nil subject)) | 6219 (message-mail nil subject)) |
6207 (message-forward-make-body cur digest))) | 6220 (message-forward-make-body cur digest))) |
6208 | 6221 |
6209 (defun message-forward-make-body-plain (forward-buffer) | 6222 (defun message-forward-make-body-plain (forward-buffer) |
6210 (insert | 6223 (insert |
6211 "\n-------------------- Start of forwarded message --------------------\n") | 6224 hard-newline |
6225 "-------------------- Start of forwarded message --------------------" | |
6226 hard-newline) | |
6212 (let ((b (point)) e) | 6227 (let ((b (point)) e) |
6213 (insert | 6228 (insert |
6214 (with-temp-buffer | 6229 (with-temp-buffer |
6215 (mm-disable-multibyte) | 6230 (mm-disable-multibyte) |
6216 (insert | 6231 (insert |
6222 (when (looking-at "From ") | 6237 (when (looking-at "From ") |
6223 (replace-match "X-From-Line: ")) | 6238 (replace-match "X-From-Line: ")) |
6224 (buffer-string))) | 6239 (buffer-string))) |
6225 (setq e (point)) | 6240 (setq e (point)) |
6226 (insert | 6241 (insert |
6227 "\n-------------------- End of forwarded message --------------------\n") | 6242 hard-newline |
6243 "-------------------- End of forwarded message --------------------" | |
6244 hard-newline) | |
6228 (when message-forward-ignored-headers | 6245 (when message-forward-ignored-headers |
6229 (save-restriction | 6246 (save-restriction |
6230 (narrow-to-region b e) | 6247 (narrow-to-region b e) |
6231 (goto-char b) | 6248 (goto-char b) |
6232 (narrow-to-region (point) | 6249 (narrow-to-region (point) |
6233 (or (search-forward "\n\n" nil t) (point))) | 6250 (or (search-forward "\n\n" nil t) (point))) |
6234 (message-remove-header message-forward-ignored-headers t))))) | 6251 (message-remove-header message-forward-ignored-headers t))))) |
6235 | 6252 |
6236 (defun message-forward-make-body-mime (forward-buffer) | 6253 (defun message-forward-make-body-mime (forward-buffer) |
6237 (insert "\n\n<#part type=message/rfc822 disposition=inline raw=t>\n") | 6254 (insert |
6255 hard-newline hard-newline | |
6256 "<#part type=message/rfc822 disposition=inline raw=t>" | |
6257 hard-newline) | |
6238 (let ((b (point)) e) | 6258 (let ((b (point)) e) |
6239 (save-restriction | 6259 (save-restriction |
6240 (narrow-to-region (point) (point)) | 6260 (narrow-to-region (point) (point)) |
6241 (mml-insert-buffer forward-buffer) | 6261 (mml-insert-buffer forward-buffer) |
6242 (goto-char (point-min)) | 6262 (goto-char (point-min)) |
6243 (when (looking-at "From ") | 6263 (when (looking-at "From ") |
6244 (replace-match "X-From-Line: ")) | 6264 (replace-match "X-From-Line: ")) |
6245 (goto-char (point-max))) | 6265 (goto-char (point-max))) |
6246 (setq e (point)) | 6266 (setq e (point)) |
6247 (insert "<#/part>\n"))) | 6267 (insert "<#/part>" hard-newline))) |
6248 | 6268 |
6249 (defun message-forward-make-body-mml (forward-buffer) | 6269 (defun message-forward-make-body-mml (forward-buffer) |
6250 (insert "\n\n<#mml type=message/rfc822 disposition=inline>\n") | 6270 (insert |
6271 hard-newline hard-newline | |
6272 "<#mml type=message/rfc822 disposition=inline>" | |
6273 hard-newline) | |
6251 (let ((b (point)) e) | 6274 (let ((b (point)) e) |
6252 (if (not message-forward-decoded-p) | 6275 (if (not message-forward-decoded-p) |
6253 (insert | 6276 (insert |
6254 (with-temp-buffer | 6277 (with-temp-buffer |
6255 (mm-disable-multibyte) | 6278 (mm-disable-multibyte) |
6268 (goto-char (point-min)) | 6291 (goto-char (point-min)) |
6269 (when (looking-at "From ") | 6292 (when (looking-at "From ") |
6270 (replace-match "X-From-Line: ")) | 6293 (replace-match "X-From-Line: ")) |
6271 (goto-char (point-max)))) | 6294 (goto-char (point-max)))) |
6272 (setq e (point)) | 6295 (setq e (point)) |
6273 (insert "<#/mml>\n") | 6296 (insert "<#/mml>" hard-newline) |
6274 (when (and (not message-forward-decoded-p) | 6297 (when (and (not message-forward-decoded-p) |
6275 message-forward-ignored-headers) | 6298 message-forward-ignored-headers) |
6276 (save-restriction | 6299 (save-restriction |
6277 (narrow-to-region b e) | 6300 (narrow-to-region b e) |
6278 (goto-char b) | 6301 (goto-char b) |
6280 (or (search-forward "\n\n" nil t) (point))) | 6303 (or (search-forward "\n\n" nil t) (point))) |
6281 (message-remove-header message-forward-ignored-headers t))))) | 6304 (message-remove-header message-forward-ignored-headers t))))) |
6282 | 6305 |
6283 (defun message-forward-make-body-digest-plain (forward-buffer) | 6306 (defun message-forward-make-body-digest-plain (forward-buffer) |
6284 (insert | 6307 (insert |
6285 "\n-------------------- Start of forwarded message --------------------\n") | 6308 hard-newline |
6309 "-------------------- Start of forwarded message --------------------" | |
6310 hard-newline) | |
6286 (let ((b (point)) e) | 6311 (let ((b (point)) e) |
6287 (mml-insert-buffer forward-buffer) | 6312 (mml-insert-buffer forward-buffer) |
6288 (setq e (point)) | 6313 (setq e (point)) |
6289 (insert | 6314 (insert |
6290 "\n-------------------- End of forwarded message --------------------\n"))) | 6315 hard-newline |
6316 "-------------------- End of forwarded message --------------------" | |
6317 hard-newline))) | |
6291 | 6318 |
6292 (defun message-forward-make-body-digest-mime (forward-buffer) | 6319 (defun message-forward-make-body-digest-mime (forward-buffer) |
6293 (insert "\n<#multipart type=digest>\n") | 6320 (insert hard-newline "<#multipart type=digest>" hard-newline) |
6294 (let ((b (point)) e) | 6321 (let ((b (point)) e) |
6295 (insert-buffer-substring forward-buffer) | 6322 (insert-buffer-substring forward-buffer) |
6296 (setq e (point)) | 6323 (setq e (point)) |
6297 (insert "<#/multipart>\n") | 6324 (insert "<#/multipart>" hard-newline) |
6298 (save-restriction | 6325 (save-restriction |
6299 (narrow-to-region b e) | 6326 (narrow-to-region b e) |
6300 (goto-char b) | 6327 (goto-char b) |
6301 (narrow-to-region (point) | 6328 (narrow-to-region (point) |
6302 (or (search-forward "\n\n" nil t) (point))) | 6329 (or (search-forward "\n\n" nil t) (point))) |
6797 (delete-region (point-min) (point)))))) | 6824 (delete-region (point-min) (point)))))) |
6798 (save-restriction | 6825 (save-restriction |
6799 (message-narrow-to-headers-or-head) | 6826 (message-narrow-to-headers-or-head) |
6800 (message-remove-header "Mime-Version") | 6827 (message-remove-header "Mime-Version") |
6801 (goto-char (point-max)) | 6828 (goto-char (point-max)) |
6802 (insert "MIME-Version: 1.0\n") | 6829 (insert "MIME-Version: 1.0" hard-newline) |
6803 (when lines | 6830 (when lines |
6804 (insert lines)) | 6831 (insert lines)) |
6805 (setq content-type-p | 6832 (setq content-type-p |
6806 (or mml-boundary | 6833 (or mml-boundary |
6807 (re-search-backward "^Content-Type:" nil t)))) | 6834 (re-search-backward "^Content-Type:" nil t)))) |
6817 (unless content-type-p | 6844 (unless content-type-p |
6818 (goto-char (point-min)) | 6845 (goto-char (point-min)) |
6819 ;; For unknown reason, MIME-Version doesn't exist. | 6846 ;; For unknown reason, MIME-Version doesn't exist. |
6820 (when (re-search-forward "^MIME-Version:" nil t) | 6847 (when (re-search-forward "^MIME-Version:" nil t) |
6821 (forward-line 1) | 6848 (forward-line 1) |
6822 (insert "Content-Type: text/plain; charset=us-ascii\n")))))) | 6849 (insert "Content-Type: text/plain; charset=us-ascii" hard-newline)))))) |
6823 | 6850 |
6824 (defun message-read-from-minibuffer (prompt &optional initial-contents) | 6851 (defun message-read-from-minibuffer (prompt &optional initial-contents) |
6825 "Read from the minibuffer while providing abbrev expansion." | 6852 "Read from the minibuffer while providing abbrev expansion." |
6826 (if (fboundp 'mail-abbrevs-setup) | 6853 (if (fboundp 'mail-abbrevs-setup) |
6827 (let ((mail-abbrev-mode-regexp "") | 6854 (let ((mail-abbrev-mode-regexp "") |
6846 (setq email (car emails) | 6873 (setq email (car emails) |
6847 emails nil)) | 6874 emails nil)) |
6848 (pop emails)) | 6875 (pop emails)) |
6849 (unless (or (not email) (equal email user-mail-address)) | 6876 (unless (or (not email) (equal email user-mail-address)) |
6850 (goto-char (point-max)) | 6877 (goto-char (point-max)) |
6851 (insert "From: " email "\n")))) | 6878 (insert "From: " email hard-newline)))) |
6852 | 6879 |
6853 (defun message-options-get (symbol) | 6880 (defun message-options-get (symbol) |
6854 (cdr (assq symbol message-options))) | 6881 (cdr (assq symbol message-options))) |
6855 | 6882 |
6856 (defun message-options-set (symbol value) | 6883 (defun message-options-set (symbol value) |