From: Richard M. Stallman Date: Mon, 13 Feb 1995 06:49:27 +0000 (+0000) Subject: (mail-reply-to): New command, on C-c C-f C-r and in menu. X-Git-Tag: emacs-19.34~5132 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3a3ffba4fc6ad1a5196985aa86453e21d927c162;p=emacs.git (mail-reply-to): New command, on C-c C-f C-r and in menu. (mail-do-fcc): Find buffer to add to using truename, if can't find it by real name. --- diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 1c98a9c9083..f20da2b44fa 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -315,6 +315,7 @@ C-c C-v mail-sent-via (add a sent-via field for each To or CC)." (define-key mail-mode-map "\C-c\C-f\C-f" 'mail-fcc) (define-key mail-mode-map "\C-c\C-f\C-c" 'mail-cc) (define-key mail-mode-map "\C-c\C-f\C-s" 'mail-subject) + (define-key mail-mode-map "\C-c\C-f\C-r" 'mail-reply-to) (define-key mail-mode-map "\C-c\C-t" 'mail-text) (define-key mail-mode-map "\C-c\C-y" 'mail-yank-original) (define-key mail-mode-map "\C-c\C-q" 'mail-fill-yanked-message) @@ -347,6 +348,9 @@ C-c C-v mail-sent-via (add a sent-via field for each To or CC)." (define-key mail-mode-map [menu-bar headers] (cons "Headers" (make-sparse-keymap "Headers"))) +(define-key mail-mode-map [menu-bar headers reply-to] + '("Reply-To" . mail-reply-to)) + (define-key mail-mode-map [menu-bar headers sent-via] '("Sent Via" . mail-sent-via)) @@ -615,11 +619,24 @@ the user from the mailer." (forward-char -5) (insert ?>))) (while fcc-list - (let ((buffer (get-file-buffer (car fcc-list))) - (curbuf (current-buffer)) - (beg (point-min)) (end (point-max)) - (beg2 (save-excursion (goto-char (point-min)) - (forward-line 2) (point)))) + (let* ((truename (file-truename (car fcc-list))) + (buffer + (or (get-file-buffer (car fcc-list)) + (get-file-buffer truename) + ;; Look for a buffer whose truename + ;; matches that of the file we want. + (let ((buflist (buffer-list))) + (save-excursion + (while buflist + (set-buffer (car buflist)) + (if (equal buffer-file-truename truename) + (setq buflist nil)) + (setq buflist (cdr buflist))) + (current-buffer))))) + (curbuf (current-buffer)) + (beg (point-min)) (end (point-max)) + (beg2 (save-excursion (goto-char (point-min)) + (forward-line 2) (point)))) (if buffer ;; File is present in a buffer => append to that buffer. (save-excursion @@ -739,6 +756,12 @@ the user from the mailer." (mail-position-on-field "to")) (insert "\nFCC: " folder)) +(defun mail-reply-to () + "Move point to end of Reply-To-field." + (interactive) + (expand-abbrev) + (mail-position-on-field "Reply-To")) + (defun mail-position-on-field (field &optional soft) (let (end (case-fold-search t))