all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* docstring: mail-signature
@ 2023-09-03  1:58 T.V Raman
  2023-09-03  2:03 ` Emanuel Berg
  2023-09-03  5:45 ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: T.V Raman @ 2023-09-03  1:58 UTC (permalink / raw)
  To: emacs-devel

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  🦮



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-03 15:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-03  1:58 docstring: mail-signature T.V Raman
2023-09-03  2:03 ` Emanuel Berg
2023-09-03 15:05   ` T.V Raman
2023-09-03  5:45 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.