summaryrefslogtreecommitdiff
path: root/lisp/mail/emacsbug.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-11-16 00:22:20 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2014-11-16 00:22:20 -0500
commit9075fcc1937a211bc91e8bc49c332bc55ac99e24 (patch)
tree1cff4991107011e0b5d13fac46b0881c30d31a63 /lisp/mail/emacsbug.el
parent86009dd5d886f1101358990e4f8f69a5d1467eb8 (diff)
parent4f4cf9c855f5818d4c3c0fb772db8bbcf4f33780 (diff)
downloademacs-9075fcc1937a211bc91e8bc49c332bc55ac99e24.tar.gz
Merge from emacs-24
Diffstat (limited to 'lisp/mail/emacsbug.el')
-rw-r--r--lisp/mail/emacsbug.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 4e3eb324e59..5dde90b9fe4 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -137,6 +137,12 @@ This requires either the OS X \"open\" command, or the freedesktop
(concat "mailto:" to)))
(error "Subject, To or body not found")))))
+;; It's the default mail mode, so it seems OK to use its features.
+(autoload 'message-bogus-recipient-p "message")
+(autoload 'message-make-address "message")
+(defvar message-send-mail-function)
+(defvar message-sendmail-envelope-from)
+
;;;###autoload
(defun report-emacs-bug (topic &optional unused)
"Report a bug in GNU Emacs.
@@ -164,7 +170,12 @@ Prompts for bug subject. Leaves you in a mail buffer."
;; that report-emacs-bug-orig-text remains valid. (Bug#5178)
(message-sort-headers)
;; Stop message-mode stealing the properties we will add.
- (set (make-local-variable 'message-strip-special-text-properties) nil))
+ (set (make-local-variable 'message-strip-special-text-properties) nil)
+ ;; Make sure we default to the From: address as envelope when sending
+ ;; through sendmail.
+ (when (and (not message-sendmail-envelope-from)
+ (message-bogus-recipient-p (message-make-address)))
+ (set (make-local-variable 'message-sendmail-envelope-from) 'header)))
(rfc822-goto-eoh)
(forward-line 1)
;; Move the mail signature to the proper place.
@@ -346,10 +357,6 @@ usually do not have translators for other languages.\n\n")))
(define-obsolete-function-alias 'report-emacs-bug-info 'info-emacs-bug "24.3")
-;; It's the default mail mode, so it seems OK to use its features.
-(autoload 'message-bogus-recipient-p "message")
-(defvar message-send-mail-function)
-
(defun report-emacs-bug-hook ()
"Do some checking before sending a bug report."
(save-excursion