emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

docstring: mail-signature


From: T.V Raman
Subject: docstring: mail-signature
Date: Sat, 2 Sep 2023 18:58:09 -0700

from sendmail.el:
Note that the docstring says mail-signature determines what happens,
but also says that the .signature file is used if this var is t or
nil.

Shouldn't the sign not happen if that var is nil?
The code actually checks for (memq t nil)

(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))))))


-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮

--

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮



reply via email to

[Prev in Thread] Current Thread [Next in Thread]