comparison lisp/mail/sendmail.el @ 39479:eae96dc1dbb3

(send-mail-function): Doc fix. (mail-do-fcc): Error if header-end is not a marker. (mail-do-fcc): Add a comment. (mail-reply-to): Doc fix. (mail-signature): Make ATPOINT optional. (mail-yank-original): Use cond instead of nestled if.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 27 Sep 2001 11:02:40 +0000
parents 8c3457d1371c
children cfc82f90a7d4
comparison
equal deleted inserted replaced
39478:4e38854cd410 39479:eae96dc1dbb3
108 ;; Useful to set in site-init.el 108 ;; Useful to set in site-init.el
109 ;;;###autoload 109 ;;;###autoload
110 (defcustom send-mail-function 'sendmail-send-it 110 (defcustom send-mail-function 'sendmail-send-it
111 "Function to call to send the current buffer as mail. 111 "Function to call to send the current buffer as mail.
112 The headers should be delimited by a line which is 112 The headers should be delimited by a line which is
113 not a valid RFC822 header or continuation line. 113 not a valid RFC822 header or continuation line,
114 that matches the variable `mail-header-separator'.
114 This is used by the default mail-sending commands. See also 115 This is used by the default mail-sending commands. See also
115 `message-send-mail-function' for use with the Message package." 116 `message-send-mail-function' for use with the Message package."
116 :type '(radio (function-item sendmail-send-it :tag "Use Sendmail package") 117 :type '(radio (function-item sendmail-send-it :tag "Use Sendmail package")
117 (function-item smtpmail-send-it :tag "Use SMTPmail package") 118 (function-item smtpmail-send-it :tag "Use SMTPmail package")
118 (function-item feedmail-send-it :tag "Use Feedmail package") 119 (function-item feedmail-send-it :tag "Use Feedmail package")
1017 (let (fcc-list 1018 (let (fcc-list
1018 (rmailbuf (current-buffer)) 1019 (rmailbuf (current-buffer))
1019 (time (current-time)) 1020 (time (current-time))
1020 (tembuf (generate-new-buffer " rmail output")) 1021 (tembuf (generate-new-buffer " rmail output"))
1021 (case-fold-search t)) 1022 (case-fold-search t))
1023 (unless (markerp header-end)
1024 (error "Value of `header-end' must be a marker"))
1022 (save-excursion 1025 (save-excursion
1023 (goto-char (point-min)) 1026 (goto-char (point-min))
1024 (while (re-search-forward "^FCC:[ \t]*" header-end t) 1027 (while (re-search-forward "^FCC:[ \t]*" header-end t)
1025 (setq fcc-list (cons (buffer-substring (point) 1028 (setq fcc-list (cons (buffer-substring (point)
1026 (progn 1029 (progn
1079 (msg (and (boundp 'rmail-current-message) 1082 (msg (and (boundp 'rmail-current-message)
1080 rmail-current-message))) 1083 rmail-current-message)))
1081 ;; If MSG is non-nil, buffer is in RMAIL mode. 1084 ;; If MSG is non-nil, buffer is in RMAIL mode.
1082 (if msg 1085 (if msg
1083 (progn 1086 (progn
1087 ;; Append to an ordinary buffer as a
1088 ;; Unix mail message.
1084 (rmail-maybe-set-message-counters) 1089 (rmail-maybe-set-message-counters)
1085 (widen) 1090 (widen)
1086 (narrow-to-region (point-max) (point-max)) 1091 (narrow-to-region (point-max) (point-max))
1087 (insert "\C-l\n0, unseen,,\n*** EOOH ***\n" 1092 (insert "\C-l\n0, unseen,,\n*** EOOH ***\n"
1088 "Date: " (mail-rfc822-date) "\n") 1093 "Date: " (mail-rfc822-date) "\n")
1197 (or (mail-position-on-field "fcc" t) ;Put new field after exiting FCC. 1202 (or (mail-position-on-field "fcc" t) ;Put new field after exiting FCC.
1198 (mail-position-on-field "to")) 1203 (mail-position-on-field "to"))
1199 (insert "\nFCC: " folder)) 1204 (insert "\nFCC: " folder))
1200 1205
1201 (defun mail-reply-to () 1206 (defun mail-reply-to ()
1202 "Move point to end of Reply-To-field." 1207 "Move point to end of Reply-To-field. Create a Reply-To field if none."
1203 (interactive) 1208 (interactive)
1204 (expand-abbrev) 1209 (expand-abbrev)
1205 (mail-position-on-field "Reply-To")) 1210 (mail-position-on-field "Reply-To"))
1206 1211
1207 (defun mail-position-on-field (field &optional soft) 1212 (defun mail-position-on-field (field &optional soft)
1225 "Move point to beginning of message text." 1230 "Move point to beginning of message text."
1226 (interactive) 1231 (interactive)
1227 (expand-abbrev) 1232 (expand-abbrev)
1228 (goto-char (mail-text-start))) 1233 (goto-char (mail-text-start)))
1229 1234
1230 (defun mail-signature (atpoint) 1235 (defun mail-signature (&optional atpoint)
1231 "Sign letter with contents of the file `mail-signature-file'. 1236 "Sign letter with contents of the file `mail-signature-file'.
1232 Prefix arg means put contents at point." 1237 Prefix arg means put contents at point."
1233 (interactive "P") 1238 (interactive "P")
1234 (save-excursion 1239 (save-excursion
1235 (or atpoint 1240 (or atpoint
1298 (let ((mail-indentation-spaces (if arg (prefix-numeric-value arg) 1303 (let ((mail-indentation-spaces (if arg (prefix-numeric-value arg)
1299 mail-indentation-spaces)) 1304 mail-indentation-spaces))
1300 ;; Avoid error in Transient Mark mode 1305 ;; Avoid error in Transient Mark mode
1301 ;; on account of mark's being inactive. 1306 ;; on account of mark's being inactive.
1302 (mark-even-if-inactive t)) 1307 (mark-even-if-inactive t))
1303 (if mail-citation-hook 1308 (cond (mail-citation-hook
1304 ;; Bind mail-citation-header to the inserted message's header. 1309 ;; Bind mail-citation-header to the inserted
1305 (let ((mail-citation-header 1310 ;; message's header.
1306 (buffer-substring-no-properties 1311 (let ((mail-citation-header
1307 start 1312 (buffer-substring-no-properties
1308 (save-excursion 1313 start
1309 (save-restriction 1314 (save-excursion
1310 (narrow-to-region start (point-max)) 1315 (save-restriction
1311 (goto-char start) 1316 (narrow-to-region start (point-max))
1312 (rfc822-goto-eoh) 1317 (goto-char start)
1313 (point)))))) 1318 (rfc822-goto-eoh)
1314 (run-hooks 'mail-citation-hook)) 1319 (point))))))
1315 (if mail-yank-hooks 1320 (run-hooks 'mail-citation-hook)))
1316 (run-hooks 'mail-yank-hooks) 1321 (mail-yank-hooks
1317 (mail-indent-citation))))) 1322 (run-hooks 'mail-yank-hooks))
1323 (t
1324 (mail-indent-citation)))))
1318 ;; This is like exchange-point-and-mark, but doesn't activate the mark. 1325 ;; This is like exchange-point-and-mark, but doesn't activate the mark.
1319 ;; It is cleaner to avoid activation, even though the command 1326 ;; It is cleaner to avoid activation, even though the command
1320 ;; loop would deactivate the mark because we inserted text. 1327 ;; loop would deactivate the mark because we inserted text.
1321 (goto-char (prog1 (mark t) 1328 (goto-char (prog1 (mark t)
1322 (set-marker (mark-marker) (point) (current-buffer)))) 1329 (set-marker (mark-marker) (point) (current-buffer))))