diff options
Diffstat (limited to 'lisp/mail/sendmail.el')
-rw-r--r-- | lisp/mail/sendmail.el | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index fee11c06aa7..d1e8a2f3c69 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -277,6 +277,7 @@ The default value matches citations like `foo-bar>' plus whitespace." (define-key map "\C-c\C-f\C-r" 'mail-reply-to) (define-key map "\C-c\C-f\C-a" 'mail-mail-reply-to) ; author (define-key map "\C-c\C-f\C-l" 'mail-mail-followup-to) ; list + (define-key map "\C-c\C-f\C-d" 'mail-insert-disposition-notification-to) (define-key map "\C-c\C-t" 'mail-text) (define-key map "\C-c\C-y" 'mail-yank-original) (define-key map "\C-c\C-r" 'mail-yank-region) @@ -325,6 +326,9 @@ The default value matches citations like `foo-bar>' plus whitespace." (define-key map [menu-bar headers expand-aliases] '("Expand Aliases" . expand-mail-aliases)) + (define-key map [menu-bar headers disposition-notification] + '("Disposition-Notification-To" . mail-insert-disposition-notification-to)) + (define-key map [menu-bar headers mail-reply-to] '("Mail-Reply-To" . mail-mail-reply-to)) @@ -1387,8 +1391,7 @@ just append to the file, in Babyl format if necessary." (unless (markerp header-end) (error "Value of `header-end' must be a marker")) (let (fcc-list - (mailbuf (current-buffer)) - (time (current-time))) + (mailbuf (current-buffer))) (save-excursion (goto-char (point-min)) (let ((case-fold-search t)) @@ -1404,14 +1407,11 @@ just append to the file, in Babyl format if necessary." (with-temp-buffer ;; This initial newline is not written out if we create a new ;; file (see below). - (insert "\nFrom " (user-login-name) " " (current-time-string time) "\n") - ;; Insert the time zone before the year. - (forward-char -1) - (forward-word-strictly -1) (require 'mail-utils) - (insert (mail-rfc822-time-zone time) " ") - (goto-char (point-max)) - (insert "Date: " (message-make-date) "\n") + (insert "\nFrom " (user-login-name) " " + (let ((system-time-locale "C")) + (format-time-string "%a %b %e %T %z %Y")) + "\nDate: " (message-make-date) "\n") (insert-buffer-substring mailbuf) ;; Make sure messages are separated. (goto-char (point-max)) @@ -1598,6 +1598,25 @@ Returns non-nil if FIELD was originally present." (interactive) (expand-abbrev) (goto-char (mail-text-start))) + +(defun mail-insert-disposition-notification-to () + "Insert a Disposition-Notification-To header, if it doesn't already exist." + (interactive) + (expand-abbrev) + (save-excursion + (or (mail-position-on-field "Disposition-Notification-To") + (insert + (format + "%s" + (save-excursion + (save-restriction + (message-narrow-to-headers) + (or (mail-fetch-field "Reply-To") + (mail-fetch-field "From") + (with-temp-buffer + (mail-insert-from-field) + (substring (buffer-string) (length "From: ") -1)))))))))) + (defun mail-signature (&optional atpoint) "Sign letter with signature. @@ -1927,7 +1946,8 @@ The seventh argument ACTIONS is a list of actions to take (setq initialized t))) (if (and buffer-auto-save-file-name (file-exists-p buffer-auto-save-file-name)) - (message "Auto save file for draft message exists; consider M-x mail-recover")) + (message (substitute-command-keys + "Auto save file for draft message exists; consider \\[mail-recover]"))) initialized)) (declare-function dired-view-file "dired" ()) |