aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-09 07:24:47 +0000
committerRichard M. Stallman1998-05-09 07:24:47 +0000
commitf13c1dae6222beeea6d6798642b057f33337f3d8 (patch)
treecfafd056efeeed382f46f0d97a38212189fc920b
parentbe96282a734be4704746d54f0bcc890ad0532a6f (diff)
downloademacs-f13c1dae6222beeea6d6798642b057f33337f3d8.tar.gz
emacs-f13c1dae6222beeea6d6798642b057f33337f3d8.zip
(mail-signature): Allow expression as value.
Improve prompts in custom type. Add risky-local-variable property. (mail-setup): Implement that feature.
-rw-r--r--lisp/mail/sendmail.el19
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 0435b94b804..967655e7a2d 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -187,9 +187,18 @@ removed from alias expansions."
187;;;###autoload 187;;;###autoload
188(defcustom mail-signature nil 188(defcustom mail-signature nil
189 "*Text inserted at end of mail buffer when a message is initialized. 189 "*Text inserted at end of mail buffer when a message is initialized.
190If t, it means to insert the contents of the file `mail-signature-file'." 190If t, it means to insert the contents of the file `mail-signature-file'.
191 :type '(choice (const nil) (const t) string) 191If a string, that string is inserted.
192 (To make a proper signature, the string should begin with \\n\\n-- \\n,
193 which is the standard way to delimit a signature in a message.)
194Otherwise, it should be an expression; it is evaluated
195and should insert whatever you want to insert."
196 :type '(choice (const "None" nil)
197 (const :tag "Use `.signature' file" t)
198 (string :tag "String to insert")
199 (sexp :tag "Expression to evaluate"))
192 :group 'sendmail) 200 :group 'sendmail)
201(put 'mail-signature 'risky-local-variable t)
193 202
194(defcustom mail-signature-file "~/.signature" 203(defcustom mail-signature-file "~/.signature"
195 "*File containing the text inserted at end of mail buffer." 204 "*File containing the text inserted at end of mail buffer."
@@ -359,8 +368,10 @@ actually occur.")
359 (progn 368 (progn
360 (insert "\n\n-- \n") 369 (insert "\n\n-- \n")
361 (insert-file-contents mail-signature-file)))) 370 (insert-file-contents mail-signature-file))))
362 (mail-signature 371 ((stringp mail-signature)
363 (insert mail-signature))) 372 (insert mail-signature))
373 (t
374 (eval mail-signature)))
364 (goto-char (point-max)) 375 (goto-char (point-max))
365 (or (bolp) (newline))) 376 (or (bolp) (newline)))
366 (if to (goto-char to)) 377 (if to (goto-char to))