comparison lisp/mail/sendmail.el @ 18870:d86beb823996

(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.
author Richard M. Stallman <rms@gnu.org>
date Sat, 19 Jul 1997 08:11:51 +0000
parents 9b92c85d0dc2
children 32c4a961d11f
comparison
equal deleted inserted replaced
18869:3874dbc1bdcf 18870:d86beb823996
344 (make-local-variable 'paragraph-start) 344 (make-local-variable 'paragraph-start)
345 (make-local-variable 'normal-auto-fill-function) 345 (make-local-variable 'normal-auto-fill-function)
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,
352 ;; are also sometimes used and should be separators. 355 ;; are also sometimes used and should be separators.
353 (setq paragraph-start (concat (regexp-quote mail-header-separator) 356 (setq paragraph-start (concat (regexp-quote mail-header-separator)
1006 (fill-individual-paragraphs (point) 1009 (fill-individual-paragraphs (point)
1007 (point-max) 1010 (point-max)
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.
1013 The inserted text should be the region. 1016 The inserted text should be the region.
1014 When this function returns, the region is again around the modified text. 1017 When this function returns, the region is again around the modified text.
1015 1018
1016 Normally, indent each nonblank line `mail-indentation-spaces' spaces. 1019 Normally, indent each nonblank line `mail-indentation-spaces' spaces.
1017 However, if `mail-yank-prefix' is non-nil, insert that prefix on each line." 1020 However, 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).
1030 Puts point after the text and mark before. 1037 Puts point after the text and mark before.
1031 Normally, indents each nonblank line ARG spaces (default 3). 1038 Normally, indents each nonblank line ARG spaces (default 3).
1053 mail-indentation-spaces))) 1060 mail-indentation-spaces)))
1054 (if mail-citation-hook 1061 (if mail-citation-hook
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.
1062 (goto-char (prog1 (mark t) 1069 (goto-char (prog1 (mark t)
1063 (set-marker (mark-marker) (point) (current-buffer)))) 1070 (set-marker (mark-marker) (point) (current-buffer))))
1106 mail-indentation-spaces))) 1113 mail-indentation-spaces)))
1107 (if mail-citation-hook 1114 (if mail-citation-hook
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."
1115 (interactive "fAttach file: ") 1122 (interactive "fAttach file: ")
1116 (save-excursion 1123 (save-excursion