# HG changeset patch # User Richard M. Stallman # Date 894698687 0 # Node ID 863230e3e2488b479837828e26b20e3225bee4f4 # Parent 79a3c4eba19f78180bb39da5c50e27b44d556182 (mail-signature): Allow expression as value. Improve prompts in custom type. Add risky-local-variable property. (mail-setup): Implement that feature. diff -r 79a3c4eba19f -r 863230e3e248 lisp/mail/sendmail.el --- 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))