diff lisp/gnus/message.el @ 111082:9d01a8aadec3

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.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Thu, 21 Oct 2010 22:12:01 +0000
parents a7fee19797df
children d1079095427d
line wrap: on
line diff
--- a/lisp/gnus/message.el	Thu Oct 21 22:12:38 2010 +0200
+++ b/lisp/gnus/message.el	Thu Oct 21 22:12:01 2010 +0000
@@ -1139,9 +1139,10 @@
   :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 @@
 
   (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 @@
    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)