aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1997-07-19 08:11:51 +0000
committerRichard M. Stallman1997-07-19 08:11:51 +0000
commit1b8def58576bfd0b881f3d0b34c06b158bf607a6 (patch)
tree946d182b75a01bd85c33cda197dd6d857df97dc1 /lisp
parent3affe22ddf92734868cf2ccd66c43c912f50d8e4 (diff)
downloademacs-1b8def58576bfd0b881f3d0b34c06b158bf607a6.tar.gz
emacs-1b8def58576bfd0b881f3d0b34c06b158bf607a6.zip
(mail-mode): Set adaptive-fill-regexp specially to cater to supercite.
(mail-indent-citation): Take region args. (mail-yank-original, mail-yank-region): Pass the args.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mail/sendmail.el25
1 files changed, 16 insertions, 9 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index f4c75e020f7..a200e9a2d83 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -346,6 +346,9 @@ C-c C-v mail-sent-via (add a Sent-via field for each To or CC)."
346 (setq normal-auto-fill-function 'mail-mode-auto-fill) 346 (setq normal-auto-fill-function 'mail-mode-auto-fill)
347 (make-local-variable 'fill-paragraph-function) 347 (make-local-variable 'fill-paragraph-function)
348 (setq fill-paragraph-function 'mail-mode-fill-paragraph) 348 (setq fill-paragraph-function 'mail-mode-fill-paragraph)
349 (make-local-variable 'adaptive-fill-regexp)
350 (setq adaptive-fill-regexp
351 (concat "[ \t]+[a-z0-9A-Z]+> *\\|" adaptive-fill-regexp))
349 ;; `-- ' precedes the signature. `-----' appears at the start of the 352 ;; `-- ' precedes the signature. `-----' appears at the start of the
350 ;; lines that delimit forwarded messages. 353 ;; lines that delimit forwarded messages.
351 ;; Lines containing just >= 3 dashes, perhaps after whitespace, 354 ;; Lines containing just >= 3 dashes, perhaps after whitespace,
@@ -1008,22 +1011,26 @@ Numeric argument means justify as well."
1008 justifyp 1011 justifyp
1009 t))) 1012 t)))
1010 1013
1011(defun mail-indent-citation () 1014(defun mail-indent-citation (beg end)
1012 "Modify text just inserted from a message to be cited. 1015 "Modify text just inserted from a message to be cited.
1013The inserted text should be the region. 1016The inserted text should be the region.
1014When this function returns, the region is again around the modified text. 1017When this function returns, the region is again around the modified text.
1015 1018
1016Normally, indent each nonblank line `mail-indentation-spaces' spaces. 1019Normally, indent each nonblank line `mail-indentation-spaces' spaces.
1017However, if `mail-yank-prefix' is non-nil, insert that prefix on each line." 1020However, if `mail-yank-prefix' is non-nil, insert that prefix on each line."
1018 (mail-yank-clear-headers (region-beginning) (region-end)) 1021 (if (> beg end)
1022 (let ((temp beg))
1023 (setq beg end end temp)))
1024 (mail-yank-clear-headers beg end)
1019 (if (null mail-yank-prefix) 1025 (if (null mail-yank-prefix)
1020 (indent-rigidly (region-beginning) (region-end) 1026 (indent-rigidly beg end mail-indentation-spaces)
1021 mail-indentation-spaces)
1022 (save-excursion 1027 (save-excursion
1023 (goto-char (region-beginning)) 1028 (goto-char beg)
1024 (while (< (point) (region-end)) 1029 (setq end (set-marker (make-marker) end))
1030 (while (< (point) end)
1025 (insert mail-yank-prefix) 1031 (insert mail-yank-prefix)
1026 (forward-line 1))))) 1032 (forward-line 1))
1033 (set-marker end nil))))
1027 1034
1028(defun mail-yank-original (arg) 1035(defun mail-yank-original (arg)
1029 "Insert the message being replied to, if any (in rmail). 1036 "Insert the message being replied to, if any (in rmail).
@@ -1055,7 +1062,7 @@ and don't delete any header fields."
1055 (run-hooks 'mail-citation-hook) 1062 (run-hooks 'mail-citation-hook)
1056 (if mail-yank-hooks 1063 (if mail-yank-hooks
1057 (run-hooks 'mail-yank-hooks) 1064 (run-hooks 'mail-yank-hooks)
1058 (mail-indent-citation))))) 1065 (mail-indent-citation (point) (mark))))))
1059 ;; This is like exchange-point-and-mark, but doesn't activate the mark. 1066 ;; This is like exchange-point-and-mark, but doesn't activate the mark.
1060 ;; It is cleaner to avoid activation, even though the command 1067 ;; It is cleaner to avoid activation, even though the command
1061 ;; loop would deactivate the mark because we inserted text. 1068 ;; loop would deactivate the mark because we inserted text.
@@ -1108,7 +1115,7 @@ and don't delete any header fields."
1108 (run-hooks 'mail-citation-hook) 1115 (run-hooks 'mail-citation-hook)
1109 (if mail-yank-hooks 1116 (if mail-yank-hooks
1110 (run-hooks 'mail-yank-hooks) 1117 (run-hooks 'mail-yank-hooks)
1111 (mail-indent-citation)))))))) 1118 (mail-indent-citation (point) (mark)))))))))
1112 1119
1113(defun mail-attach-file (&optional file) 1120(defun mail-attach-file (&optional file)
1114 "Insert a file at the end of the buffer, with separator lines around it." 1121 "Insert a file at the end of the buffer, with separator lines around it."