From: Gnus developers Date: Thu, 21 Oct 2010 22:12:01 +0000 (+0000) Subject: message.el (message-setup-1): Allow message-default-headers to be a function. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~529 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d806c8722219298e9342c39138abc9b26dcb0d9b;p=emacs.git message.el (message-setup-1): Allow message-default-headers to be a function. message.el (message-mode-map): Don't bind M-; to comment region, to allow the global comment-dwim to work. --- diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 5327bf415e6..a87fb9e610e 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,8 @@ +2010-10-21 Julien Danjou + + * message.texi (Message Headers): Allow message-default-headers to be a + function. + 2010-10-21 Lars Magne Ingebrigtsen * gnus-news.texi: Mention new archive defaults. diff --git a/doc/misc/message.texi b/doc/misc/message.texi index 8e9eca55177..76845e4aafe 100644 --- a/doc/misc/message.texi +++ b/doc/misc/message.texi @@ -1451,7 +1451,7 @@ Allegedly. @item message-default-headers @vindex message-default-headers This string is inserted at the end of the headers in all message -buffers. +buffers. If set to a function, the returned results is inserted. @item message-subject-re-regexp @vindex message-subject-re-regexp diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 7236a164ab8..0e41b71b2ce 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,13 @@ +2010-10-21 Lars Magne Ingebrigtsen + + * message.el (message-mode-map): Don't bind M-; to comment region, to + allow the global comment-dwim to work. + +2010-10-21 Julien Danjou + + * message.el (message-setup-1): Allow message-default-headers to be a + function. + 2010-10-21 Katsumi Yamaoka * shr.el (shr-tag-table): Simplify. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index f4c21aa5b4a..49bfd4bb934 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1139,9 +1139,10 @@ It is a vector of the following headers: :error "All header lines must be newline terminated") (defcustom message-default-headers "" - "*A string containing header lines to be inserted in outgoing messages. -It is inserted before you edit the message, so you can edit or delete -these lines." + "A string containing header lines to be inserted in outgoing messages. +It is inserted before you edit the message, so you can edit or +delete these lines. If set to a function, it is called and its +result is inserted." :version "23.2" :group 'message-headers :link '(custom-manual "(message)Message Headers") @@ -2639,7 +2640,6 @@ PGG manual, depending on the value of `mml2015-use'." (define-key message-mode-map "\C-a" 'message-beginning-of-line) (define-key message-mode-map "\t" 'message-tab) - (define-key message-mode-map "\M-;" 'comment-region) (define-key message-mode-map "\M-n" 'message-display-abbrev)) @@ -6363,7 +6363,10 @@ are not included." headers) (delete-region (point) (progn (forward-line -1) (point))) (when message-default-headers - (insert message-default-headers) + (insert + (if (functionp message-default-headers) + (funcall message-default-headers) + message-default-headers)) (or (bolp) (insert ?\n))) (insert mail-header-separator "\n") (forward-line -1)