: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.
;;; 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
: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"
: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")
: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")
(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)
(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.
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
(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.
(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
(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."
(point)
(forward-line -2)
(point)))
- (insert hard-newline)
+ (insert "\n")
(goto-char beg)
(delete-region beg (progn (message-goto-body)
(forward-line 2)
(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.
(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."
(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."
(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.
(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.
(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.
;; 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))
(funcall message-cite-function))
(message-exchange-point-and-mark)
(unless (bolp)
- (insert hard-newline))
+ (insert ?\n))
(unless modified
(setq message-checksum (message-checksum))))))
(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
(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))
(when afters
(re-search-forward "^[^ \t]" nil 'move)
(beginning-of-line))
- (insert header ": " hard-newline)
+ (insert header ": \n")
(forward-char -1)
nil))))
;; 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
(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"))
(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))
(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
(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)
(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
(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)
(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
;; 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.
(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))))
(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
(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))
(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)))
(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))
(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 ()
(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
(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
(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
(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
(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)
(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))
(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
(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
(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)
(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
;; 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."
(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)))