Mercurial > emacs
comparison lisp/mail/sendmail.el @ 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 | eeb4e3a385db |
children | 1ad8bfc81600 |
comparison
equal
deleted
inserted
replaced
22004:79a3c4eba19f | 22005:863230e3e248 |
---|---|
185 nil) | 185 nil) |
186 | 186 |
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. |
190 If t, it means to insert the contents of the file `mail-signature-file'." | 190 If t, it means to insert the contents of the file `mail-signature-file'. |
191 :type '(choice (const nil) (const t) string) | 191 If a string, that string is inserted. |
192 :group 'sendmail) | 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.) | |
194 Otherwise, it should be an expression; it is evaluated | |
195 and 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")) | |
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." |
196 :type 'file | 205 :type 'file |
197 :group 'sendmail) | 206 :group 'sendmail) |
357 (cond ((eq mail-signature t) | 366 (cond ((eq mail-signature t) |
358 (if (file-exists-p mail-signature-file) | 367 (if (file-exists-p mail-signature-file) |
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)) |
367 (or to subject in-reply-to | 378 (or to subject in-reply-to |
368 (set-buffer-modified-p nil)) | 379 (set-buffer-modified-p nil)) |