# HG changeset patch # User Chong Yidong # Date 1132457471 0 # Node ID 572ca24101c29e39699f4c347fc5d6b8ee7b6989 # Parent 911421314d0e27a8e2726084e29777f7b36bf394 message.el: Revert last changes. diff -r 911421314d0e -r 572ca24101c2 lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Sun Nov 20 02:15:26 2005 +0000 +++ b/lisp/gnus/ChangeLog Sun Nov 20 03:31:11 2005 +0000 @@ -1,3 +1,7 @@ +2005-11-19 Chong Yidong + + * message.el: Revert last changes. + 2005-11-17 Chong Yidong * message.el (message-courtesy-message) diff -r 911421314d0e -r 572ca24101c2 lisp/gnus/message.el --- a/lisp/gnus/message.el Sun Nov 20 02:15:26 2005 +0000 +++ b/lisp/gnus/message.el Sun Nov 20 03:31:11 2005 +0000 @@ -141,11 +141,7 @@ :group 'message-sending) (defcustom message-courtesy-message - (concat - "The following message is a courtesy copy of an article" - hard-newline - "that has been posted to %s as well." - hard-newline hard-newline) + "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n" "*This is inserted at the start of a mailed copy of a posted message. If the string contains the format spec \"%s\", the Newsgroups the article has been posted to will be inserted there. @@ -343,9 +339,7 @@ ;;; marking inserted text (defcustom message-mark-insert-begin - (concat - "--8<---------------cut here---------------start------------->8---" - hard-newline) + "--8<---------------cut here---------------start------------->8---\n" "How to mark the beginning of some inserted text." :version "22.1" :type 'string @@ -353,16 +347,14 @@ :group 'message-various) (defcustom message-mark-insert-end - (concat - "--8<---------------cut here---------------end--------------->8---" - hard-newline) + "--8<---------------cut here---------------end--------------->8---\n" "How to mark the end of some inserted text." :version "22.1" :type 'string :link '(custom-manual "(message)Insertion Variables") :group 'message-various) -(defcustom message-archive-header "X-No-Archive: Yes" +(defcustom message-archive-header "X-No-Archive: Yes\n" "Header to insert when you don't want your article to be archived. Archives \(such as groups.google.com\) respect this header." :version "22.1" @@ -426,8 +418,7 @@ :link '(custom-manual "(message)Various Message Variables") :group 'message-various) -(defcustom message-elide-ellipsis - (concat hard-newline "[...]" hard-newline hard-newline) +(defcustom message-elide-ellipsis "\n[...]\n\n" "*The string which is inserted for elided text." :type 'string :link '(custom-manual "(message)Various Commands") @@ -587,8 +578,7 @@ :link '(custom-manual "(message)Insertion Variables") :type 'regexp) -(defcustom message-cancel-message - (concat "I am canceling my own article." hard-newline) +(defcustom message-cancel-message "I am canceling my own article.\n" "Message to be inserted in the cancel message." :group 'message-interface :link '(custom-manual "(message)Canceling News") @@ -1744,7 +1734,7 @@ (goto-char (point-max)) (if (string-match "\n$" (car headers)) (insert (car headers)) - (insert (car headers) hard-newline))))) + (insert (car headers) ?\n))))) (setq headers (cdr headers)))) (defmacro message-with-reply-buffer (&rest forms) @@ -1851,7 +1841,7 @@ (insert (concat "Subject: " new-subject " (was: " - old-subject ")" hard-newline))))))))) + old-subject ")\n"))))))))) (defun message-mark-inserted-region (beg end) "Mark some region in the current article with enclosing tags. @@ -1935,7 +1925,7 @@ target-group "[ \t]*$") (message-fetch-field "Newsgroups"))) - (insert (concat hard-newline "Followup-To: " target-group))) + (insert (concat "\nFollowup-To: " target-group))) (setq message-cross-post-old-target target-group)) (defun message-cross-post-insert-note (target-group cross-post in-old @@ -1967,8 +1957,8 @@ (if (or in-old (not cross-post) (string-match "^[ \t]*poster[ \t]*$" target-group)) - (insert message-followup-to-note target-group hard-newline) - (insert message-cross-post-note target-group hard-newline)))) + (insert (concat message-followup-to-note target-group "\n")) + (insert (concat message-cross-post-note target-group "\n"))))) (defun message-cross-post-followup-to (target-group) "Crossposts message and set Followup-To to TARGET-GROUP. @@ -2028,7 +2018,7 @@ (save-excursion (message-goto-to) (message-delete-line) - (insert (concat "To: " cc-content hard-newline)) + (insert (concat "To: " cc-content "\n")) (save-restriction (message-narrow-to-headers) (message-remove-header (if bcc @@ -2793,7 +2783,7 @@ (message-remove-header (symbol-name (car elem))) (goto-char (point-min)) (insert (symbol-name (car elem)) ": " - (cdr elem) hard-newline)))))) + (cdr elem) "\n")))))) (defun message-insert-newsgroups () "Insert the Newsgroups header from the article being replied to." @@ -2823,7 +2813,7 @@ (point) (forward-line -2) (point))) - (insert hard-newline) + (insert "\n") (goto-char beg) (delete-region beg (progn (message-goto-body) (forward-line 2) @@ -2842,7 +2832,7 @@ (end-of-line -1)) (kill-region point (point)) (unless (bolp) - (insert hard-newline)))) + (insert "\n")))) (defun message-newline-and-reformat (&optional arg not-break) "Insert four newlines, and then reformat if inside quoted text. @@ -2984,15 +2974,15 @@ (goto-char (point-max)) ;; Insert the signature. (unless (bolp) - (insert hard-newline)) + (insert "\n")) (when message-signature-insert-empty-line - (insert hard-newline)) - (insert "-- " hard-newline) + (insert "\n")) + (insert "-- \n") (if (eq signature t) (insert-file-contents message-signature-file) (insert signature)) (goto-char (point-max)) - (or (bolp) (insert hard-newline))))) + (or (bolp) (insert "\n"))))) (defun message-insert-importance-high () "Insert header to mark message as important." @@ -3002,7 +2992,7 @@ (message-narrow-to-headers) (message-remove-header "Importance")) (message-goto-eoh) - (insert "Importance: high" hard-newline))) + (insert "Importance: high\n"))) (defun message-insert-importance-low () "Insert header to mark message as unimportant." @@ -3012,7 +3002,7 @@ (message-narrow-to-headers) (message-remove-header "Importance")) (message-goto-eoh) - (insert "Importance: low" hard-newline))) + (insert "Importance: low\n"))) (defun message-insert-or-toggle-importance () "Insert a \"Importance: high\" header, or cycle through the header values. @@ -3034,7 +3024,7 @@ (t "high"))))) (message-goto-eoh) - (insert (format "Importance: %s" new) hard-newline)))) + (insert (format "Importance: %s\n" new))))) (defun message-insert-disposition-notification-to () "Request a disposition notification (return receipt) to this message. @@ -3045,11 +3035,10 @@ (message-narrow-to-headers) (message-remove-header "Disposition-Notification-To")) (message-goto-eoh) - (insert (format "Disposition-Notification-To: %s" + (insert (format "Disposition-Notification-To: %s\n" (or (message-field-value "Reply-to") (message-field-value "From") - (message-make-from))) - hard-newline))) + (message-make-from)))))) (defun message-elide-region (b e) "Elide the text in the region. @@ -3184,7 +3173,7 @@ ;; Delete blank lines at the end of the buffer. (goto-char (point-max)) (unless (eolp) - (insert hard-newline)) + (insert "\n")) (while (and (zerop (forward-line -1)) (looking-at "$")) (message-delete-line)) @@ -3222,7 +3211,7 @@ (funcall message-cite-function)) (message-exchange-point-and-mark) (unless (bolp) - (insert hard-newline)) + (insert ?\n)) (unless modified (setq message-checksum (message-checksum)))))) @@ -3280,13 +3269,13 @@ (delete-region (point) end) (unless (search-backward "\n\n" start t) ;; Insert a blank line if it is peeled off. - (insert hard-newline))) + (insert "\n"))) (goto-char start) (while functions (funcall (pop functions))) (when message-citation-line-function (unless (bolp) - (insert hard-newline)) + (insert "\n")) (funcall message-citation-line-function)))) (eval-when-compile (defvar mail-citation-hook)) ;Compiler directive @@ -3322,14 +3311,13 @@ (funcall (pop functions))) (when message-citation-line-function (unless (bolp) - (insert hard-newline)) + (insert "\n")) (funcall message-citation-line-function))))) (defun message-insert-citation-line () "Insert a simple citation line." (when message-reply-headers - (insert (mail-header-from message-reply-headers) - " writes:" hard-newline hard-newline))) + (insert (mail-header-from message-reply-headers) " writes:\n\n"))) (defun message-position-on-field (header &rest afters) (let ((case-fold-search t)) @@ -3355,7 +3343,7 @@ (when afters (re-search-forward "^[^ \t]" nil 'move) (beginning-of-line)) - (insert header ": " hard-newline) + (insert header ": \n") (forward-char -1) nil)))) @@ -3551,7 +3539,7 @@ ;; Make sure there's a newline at the end of the message. (goto-char (point-max)) (unless (bolp) - (insert hard-newline)) + (insert "\n")) ;; Make the hidden headers visible. (let ((points (message-text-with-property 'message-hidden))) (when points @@ -3656,7 +3644,7 @@ (goto-char (point-min)) (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) - (replace-match hard-newline) + (replace-match "\n") (run-hooks 'message-send-mail-hook) (let ((p (goto-char (point-min))) (tembuf (message-generate-new-buffer-clone-locals " message temp")) @@ -3698,18 +3686,17 @@ (message-remove-header "Message-ID") (message-remove-header "Lines") (goto-char (point-max)) - (insert "Mime-Version: 1.0" hard-newline) + (insert "Mime-Version: 1.0\n") (setq header (buffer-string))) (goto-char (point-max)) - (insert (format "Content-Type: message/partial; id=\"%s\"; number=%d; total=%d" - id n total) - hard-newline hard-newline) + (insert (format "Content-Type: message/partial; id=\"%s\"; number=%d; total=%d\n\n" + id n total)) (forward-char -1) (let ((mail-header-separator "")) (when (memq 'Message-ID message-required-mail-headers) - (insert "Message-ID: " (message-make-message-id) hard-newline)) + (insert "Message-ID: " (message-make-message-id) "\n")) (when (memq 'Lines message-required-mail-headers) - (insert "Lines: " (message-make-lines) hard-newline)) + (insert "Lines: " (message-make-lines) "\n")) (message-goto-subject) (end-of-line) (insert (format " (%d/%d)" n total)) @@ -3774,7 +3761,7 @@ (goto-char (point-max)) ;; require one newline at the end. (or (= (preceding-char) ?\n) - (insert hard-newline)) + (insert ?\n)) (message-cleanup-headers) ;; FIXME: we're inserting the courtesy copy after encoding. ;; This is wrong if the courtesy copy string contains @@ -3850,7 +3837,7 @@ (goto-char (point-min)) (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) - (replace-match hard-newline) + (replace-match "\n") (backward-char 1) (setq delimline (point-marker)) (run-hooks 'message-send-mail-hook) @@ -3912,7 +3899,7 @@ (goto-char (point-min)) (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) - (replace-match hard-newline) + (replace-match "\n") (run-hooks 'message-send-mail-hook) ;; send the message (case @@ -4080,13 +4067,13 @@ (goto-char (point-max)) ;; require one newline at the end. (or (= (preceding-char) ?\n) - (insert hard-newline)) + (insert ?\n)) (let ((case-fold-search t)) ;; Remove the delimiter. (goto-char (point-min)) (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) - (replace-match hard-newline) + (replace-match "\n") (backward-char 1)) (run-hooks 'message-send-news-hook) (gnus-open-server method) @@ -4213,7 +4200,7 @@ (message-tokenize-header newsgroups))))))))) (goto-char (point-min)) - (insert "Followup-To: " to hard-newline)) + (insert "Followup-To: " to "\n")) t)) ;; Check "Shoot me". (message-check 'shoot @@ -5112,7 +5099,7 @@ ;; We check whether the value was ended by a ;; newline. If now, we insert one. (unless (bolp) - (insert hard-newline)) + (insert "\n")) (forward-line -1))) ;; The value of this header was empty, so we clear ;; totally and insert the new value. @@ -5152,7 +5139,7 @@ (beginning-of-line)) (when (or (message-news-p) (string-match "@.+\\.." secure-sender)) - (insert "Sender: " secure-sender hard-newline)))) + (insert "Sender: " secure-sender "\n")))) ;; Check for IDNA (message-idna-to-ascii-rhs)))) @@ -5164,7 +5151,7 @@ (message-narrow-to-headers) (when (setq newsgroups (message-fetch-field "newsgroups")) (goto-char (point-max)) - (insert "Posted-To: " newsgroups hard-newline))) + (insert "Posted-To: " newsgroups "\n"))) (forward-line 1) (when message-courtesy-message (cond @@ -5183,7 +5170,7 @@ (insert (capitalize (symbol-name header)) ": " (if (consp value) (car value) value) - hard-newline) + "\n") (narrow-to-region (point-min) (1- (point-max))) (let (quoted last) (goto-char (point-min)) @@ -5197,7 +5184,7 @@ (progn (save-excursion (goto-char last) - (insert hard-newline "\t")) + (insert "\n\t")) (setq last (1+ (point)))) (setq last (1+ (point))))) (setq quoted (not quoted))) @@ -5223,7 +5210,7 @@ (insert (capitalize (symbol-name header)) ": " (if (consp value) (car value) value) - hard-newline) + "\n") (save-restriction (narrow-to-region begin (point)) (fill-region-as-paragraph begin (point)) @@ -5292,7 +5279,7 @@ (let ((refstring (mapconcat #'identity refs " "))) (if (and message-this-is-news message-cater-to-broken-inn) (insert (capitalize (symbol-name header)) ": " - refstring hard-newline) + refstring "\n") (message-fill-header header refstring))))) (defun message-position-point () @@ -5521,18 +5508,18 @@ (delete-region (point) (progn (forward-line -1) (point))) (when message-default-headers (insert message-default-headers) - (or (bolp) (insert hard-newline))) + (or (bolp) (insert ?\n))) (put-text-property (point) (progn - (insert mail-header-separator hard-newline) + (insert mail-header-separator "\n") (1- (point))) 'read-only nil) (forward-line -1) (when (message-news-p) (when message-default-news-headers (insert message-default-news-headers) - (or (bolp) (insert hard-newline))) + (or (bolp) (insert ?\n))) (when message-generate-headers-first (message-generate-headers (message-headers-to-generate @@ -5543,7 +5530,7 @@ (when (message-mail-p) (when message-default-mail-headers (insert message-default-mail-headers) - (or (bolp) (insert hard-newline))) + (or (bolp) (insert ?\n))) (save-restriction (message-narrow-to-headers) (if message-alternative-emails @@ -6025,14 +6012,14 @@ (message-news) (setq buf (set-buffer (get-buffer-create " *message cancel*")))) (erase-buffer) - (insert "Newsgroups: " newsgroups hard-newline - "From: " from hard-newline - "Subject: cmsg cancel " message-id hard-newline - "Control: cancel " message-id hard-newline + (insert "Newsgroups: " newsgroups "\n" + "From: " from "\n" + "Subject: cmsg cancel " message-id "\n" + "Control: cancel " message-id "\n" (if distribution - (concat "Distribution: " distribution hard-newline) + (concat "Distribution: " distribution "\n") "") - mail-header-separator hard-newline + mail-header-separator "\n" message-cancel-message) (run-hooks 'message-cancel-hook) (unless arg @@ -6221,9 +6208,7 @@ (defun message-forward-make-body-plain (forward-buffer) (insert - hard-newline - "-------------------- Start of forwarded message --------------------" - hard-newline) + "\n-------------------- Start of forwarded message --------------------\n") (let ((b (point)) e) (insert (with-temp-buffer @@ -6239,9 +6224,7 @@ (buffer-string))) (setq e (point)) (insert - hard-newline - "-------------------- End of forwarded message --------------------" - hard-newline) + "\n-------------------- End of forwarded message --------------------\n") (when message-forward-ignored-headers (save-restriction (narrow-to-region b e) @@ -6251,10 +6234,7 @@ (message-remove-header message-forward-ignored-headers t))))) (defun message-forward-make-body-mime (forward-buffer) - (insert - hard-newline hard-newline - "<#part type=message/rfc822 disposition=inline raw=t>" - hard-newline) + (insert "\n\n<#part type=message/rfc822 disposition=inline raw=t>\n") (let ((b (point)) e) (save-restriction (narrow-to-region (point) (point)) @@ -6264,13 +6244,10 @@ (replace-match "X-From-Line: ")) (goto-char (point-max))) (setq e (point)) - (insert "<#/part>" hard-newline))) + (insert "<#/part>\n"))) (defun message-forward-make-body-mml (forward-buffer) - (insert - hard-newline hard-newline - "<#mml type=message/rfc822 disposition=inline>" - hard-newline) + (insert "\n\n<#mml type=message/rfc822 disposition=inline>\n") (let ((b (point)) e) (if (not message-forward-decoded-p) (insert @@ -6293,7 +6270,7 @@ (replace-match "X-From-Line: ")) (goto-char (point-max)))) (setq e (point)) - (insert "<#/mml>" hard-newline) + (insert "<#/mml>\n") (when (and (not message-forward-decoded-p) message-forward-ignored-headers) (save-restriction @@ -6305,23 +6282,19 @@ (defun message-forward-make-body-digest-plain (forward-buffer) (insert - hard-newline - "-------------------- Start of forwarded message --------------------" - hard-newline) + "\n-------------------- Start of forwarded message --------------------\n") (let ((b (point)) e) (mml-insert-buffer forward-buffer) (setq e (point)) (insert - hard-newline - "-------------------- End of forwarded message --------------------" - hard-newline))) + "\n-------------------- End of forwarded message --------------------\n"))) (defun message-forward-make-body-digest-mime (forward-buffer) - (insert hard-newline "<#multipart type=digest>" hard-newline) + (insert "\n<#multipart type=digest>\n") (let ((b (point)) e) (insert-buffer-substring forward-buffer) (setq e (point)) - (insert "<#/multipart>" hard-newline) + (insert "<#/multipart>\n") (save-restriction (narrow-to-region b e) (goto-char b) @@ -6826,7 +6799,7 @@ (message-narrow-to-headers-or-head) (message-remove-header "Mime-Version") (goto-char (point-max)) - (insert "MIME-Version: 1.0" hard-newline) + (insert "MIME-Version: 1.0\n") (when lines (insert lines)) (setq content-type-p @@ -6846,7 +6819,7 @@ ;; For unknown reason, MIME-Version doesn't exist. (when (re-search-forward "^MIME-Version:" nil t) (forward-line 1) - (insert "Content-Type: text/plain; charset=us-ascii" hard-newline)))))) + (insert "Content-Type: text/plain; charset=us-ascii\n")))))) (defun message-read-from-minibuffer (prompt &optional initial-contents) "Read from the minibuffer while providing abbrev expansion." @@ -6875,7 +6848,7 @@ (pop emails)) (unless (or (not email) (equal email user-mail-address)) (goto-char (point-max)) - (insert "From: " email hard-newline)))) + (insert "From: " email "\n")))) (defun message-options-get (symbol) (cdr (assq symbol message-options)))