changeset 22005:863230e3e248

(mail-signature): Allow expression as value. Improve prompts in custom type. Add risky-local-variable property. (mail-setup): Implement that feature.
author Richard M. Stallman <rms@gnu.org>
date Sat, 09 May 1998 07:24:47 +0000
parents 79a3c4eba19f
children 31c39cdc9e11
files lisp/mail/sendmail.el
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/sendmail.el	Sat May 09 07:12:14 1998 +0000
+++ b/lisp/mail/sendmail.el	Sat May 09 07:24:47 1998 +0000
@@ -187,9 +187,18 @@
 ;;;###autoload
 (defcustom mail-signature nil
   "*Text inserted at end of mail buffer when a message is initialized.
-If t, it means to insert the contents of the file `mail-signature-file'."
-  :type '(choice (const nil) (const t) string)
+If t, it means to insert the contents of the file `mail-signature-file'.
+If a string, that string is inserted.
+ (To make a proper signature, the string should begin with \\n\\n-- \\n,
+  which is the standard way to delimit a signature in a message.)
+Otherwise, it should be an expression; it is evaluated
+and should insert whatever you want to insert."
+  :type '(choice (const "None" nil)
+		 (const :tag "Use `.signature' file" t)
+		 (string :tag "String to insert")
+		 (sexp :tag "Expression to evaluate"))
   :group 'sendmail)
+(put 'mail-signature 'risky-local-variable t)
 
 (defcustom mail-signature-file "~/.signature"
   "*File containing the text inserted at end of mail buffer."
@@ -359,8 +368,10 @@
 	       (progn
 		 (insert "\n\n-- \n")
 		 (insert-file-contents mail-signature-file))))
-	  (mail-signature
-	   (insert mail-signature)))
+	  ((stringp mail-signature)
+	   (insert mail-signature))
+	  (t
+	   (eval mail-signature)))
     (goto-char (point-max))
     (or (bolp) (newline)))
   (if to (goto-char to))