[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master ff6727d 4/6: Handle empty string as mail-header-separator
From: |
Richard M. Stallman |
Subject: |
master ff6727d 4/6: Handle empty string as mail-header-separator |
Date: |
Tue, 11 May 2021 23:09:48 -0400 (EDT) |
branch: master
commit ff6727dbbdeb44322439872fe0239bdca3ef6bce
Author: Richard Stallman <rms@gnu.org>
Commit: Richard Stallman <rms@gnu.org>
Handle empty string as mail-header-separator
* lisp/mail/sendmail.el (mail-mode):
(mail-sendmail-undelimit-header): Handle mail-header-separator empty.
(mail-send): Search for mail-header-separator as entire contents of line.
---
lisp/mail/sendmail.el | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index a64f086..c959634 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -726,14 +726,21 @@ Turning on Mail mode runs the normal hooks
`text-mode-hook' and
;; Lines containing just >= 3 dashes, perhaps after whitespace,
;; are also sometimes used and should be separators.
(setq paragraph-separate
- (concat (regexp-quote mail-header-separator)
+ (if (zerop (length mail-header-separator))
+ (concat
;; This is based on adaptive-fill-regexp (presumably
;; the idea is to allow navigation etc of cited paragraphs).
- "$\\|\t*[-–!|#%;>*·•‣⁃◦ ]+$"
+ "\t*[-–!|#%;>*·•‣⁃◦ ]+$"
"\\|[ \t]*[-[:alnum:]]*>+[ \t]*$\\|[ \t]*$\\|"
"--\\( \\|-+\\)$\\|"
- page-delimiter)))
-
+ page-delimiter)
+ (concat (regexp-quote mail-header-separator)
+ ;; This is based on adaptive-fill-regexp (presumably
+ ;; the idea is to allow navigation etc of cited paragraphs).
+ "$\\|\t*[-–!|#%;>*·•‣⁃◦ ]+$"
+ "\\|[ \t]*[-[:alnum:]]*>+[ \t]*$\\|[ \t]*$\\|"
+ "--\\( \\|-+\\)$\\|"
+ page-delimiter))))
(defun mail-header-end ()
"Return the buffer location of the end of headers, as a number."
@@ -763,10 +770,11 @@ Concretely: replace the first blank line in the header
with the separator."
"Remove header separator to put the message in correct form for sendmail.
Leave point at the start of the delimiter line."
(goto-char (point-min))
- (when (re-search-forward
- (concat "^" (regexp-quote mail-header-separator) "\n")
- nil t)
- (replace-match "\n"))
+ (unless (zerop (length mail-header-separator))
+ (when (re-search-forward
+ (concat "^" (regexp-quote mail-header-separator) "\n")
+ nil t)
+ (replace-match "\n")))
(rfc822-goto-eoh))
(defun mail-mode-auto-fill ()
@@ -931,7 +939,9 @@ the user from the mailer."
(error "Message contains non-ASCII characters"))))
;; Complain about any invalid line.
(goto-char (point-min))
- (re-search-forward (regexp-quote mail-header-separator) (point-max) t)
+ ;; Search for mail-header-eeparator as whole line.
+ (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$")
+ (point-max) t)
(let ((header-end (or (match-beginning 0) (point-max))))
(goto-char (point-min))
(while (< (point) header-end)
- master updated (5784b42 -> 47070ed), Richard M. Stallman, 2021/05/11
- master 19d0cf5 1/6: Use rfc822-goto-eoh rather that mail-header-separator., Richard M. Stallman, 2021/05/11
- master 42596bd 2/6: Little improvements in rmail.el. Recognize encryped override headers., Richard M. Stallman, 2021/05/11
- master ec8aff1 3/6: Handle multi-line FROM., Richard M. Stallman, 2021/05/11
- master ff6727d 4/6: Handle empty string as mail-header-separator,
Richard M. Stallman <=
- master 67722ab 5/6: Avoid querying in a noninteractive Emacs., Richard M. Stallman, 2021/05/11
- master 47070ed 6/6: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs, Richard M. Stallman, 2021/05/11