Function: mail-signature

mail-signature is an interactive and byte-compiled function defined in sendmail.el.gz.

Signature

(mail-signature &optional ATPOINT)

Documentation

Sign letter with signature.

If the variable mail-signature(var)/mail-signature(fun) is a string, inserts it. If it is t or nil, inserts the contents of the file mail-signature-file. Otherwise, evals mail-signature(var)/mail-signature(fun). Prefix argument ATPOINT means insert at point rather than the end.

View in manual

Probably introduced at or before Emacs version 19.20.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mail/sendmail.el.gz
(defun mail-signature (&optional atpoint)
  "Sign letter with signature.
If the variable `mail-signature' is a string, inserts it.
If it is t or nil, inserts the contents of the file `mail-signature-file'.
Otherwise, evals `mail-signature'.
Prefix argument ATPOINT means insert at point rather than the end."
  (interactive "*P")
  ;; Test for an unreadable file here, before we delete trailing
  ;; whitespace, so that we don't modify the buffer needlessly.
  (if (and (memq mail-signature '(t nil))
	   (not (file-readable-p mail-signature-file)))
      (if (called-interactively-p 'interactive)
	  (message "The signature file `%s' could not be read"
		   mail-signature-file))
    (save-excursion
      (unless atpoint
	(goto-char (point-max))
	;; Delete trailing whitespace and blank lines.
	(skip-chars-backward " \t\n")
	(end-of-line)
	(delete-region (point) (point-max)))
      (cond ((stringp mail-signature)
	     (insert mail-signature))
	    ((memq mail-signature '(t nil))
	     (insert "\n\n-- \n")
	     (insert-file-contents (expand-file-name mail-signature-file)))
	    (t
	     ;; FIXME add condition-case error handling?
	     (eval mail-signature))))))