emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog mail/sendmail.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp ChangeLog mail/sendmail.el
Date: Sat, 14 Mar 2009 20:25:12 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/03/14 20:25:12

Modified files:
        lisp           : ChangeLog 
        lisp/mail      : sendmail.el 

Log message:
        (mail-interactive): Doc fix.
        (mail-yank-ignored-headers): Add X-RMAIL- headers, bump :version.
        (mail-setup): Use the function mail-signature.
        (mail-to, mail-subject, mail-cc, mail-bcc, mail-reply-to)
        (mail-mail-reply-to, mail-mail-followup-to): Doc fixes.
        (mail-signature): Check the signature file is readable.
        With the argument ATPOINT, really insert at point.
        Handle the case when the variable mail-signature is an expression.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15473&r2=1.15474
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/sendmail.el?cvsroot=emacs&r1=1.323&r2=1.324

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15473
retrieving revision 1.15474
diff -u -b -r1.15473 -r1.15474
--- ChangeLog   14 Mar 2009 17:42:18 -0000      1.15473
+++ ChangeLog   14 Mar 2009 20:25:06 -0000      1.15474
@@ -1,3 +1,14 @@
+2009-03-14  Glenn Morris  <address@hidden>
+
+       * mail/sendmail.el (mail-interactive): Doc fix.
+       (mail-yank-ignored-headers): Add X-RMAIL- headers, bump :version.
+       (mail-setup): Use the function mail-signature.
+       (mail-to, mail-subject, mail-cc, mail-bcc, mail-reply-to)
+       (mail-mail-reply-to, mail-mail-followup-to): Doc fixes.
+       (mail-signature): Check the signature file is readable.
+       With the argument ATPOINT, really insert at point.
+       Handle the case when the variable mail-signature is an expression.
+
 2009-03-14  Chong Yidong  <address@hidden>
 
        * simple.el (undo-outer-limit-truncate): Mention that

Index: mail/sendmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/sendmail.el,v
retrieving revision 1.323
retrieving revision 1.324
diff -u -b -r1.323 -r1.324
--- mail/sendmail.el    10 Mar 2009 07:20:38 -0000      1.323
+++ mail/sendmail.el    14 Mar 2009 20:25:11 -0000      1.324
@@ -121,7 +121,7 @@
   ;; bounce message to be delivered anywhere, least of all to the
   ;; user's mailbox.
   "Non-nil means when sending a message wait for and display errors.
-nil means let mailer mail back a message to report errors."
+Otherwise, let mailer send back a message to report errors."
   :type 'boolean
   :version "23.1"                      ; changed from nil to t
   :group 'sendmail)
@@ -131,11 +131,16 @@
           (regexp-opt '("via" "mail-from" "origin" "status" "remailed"
                         "received" "message-id" "summary-line" "to" "subject"
                         "in-reply-to" "return-path" "mail-reply-to"
+                        ;; Should really be rmail-attribute-header and
+                        ;; rmail-keyword-header, but this file does not
+                        ;; require rmail (at run time).
+                        "x-rmail-attributes" "x-rmail-keywords"
                         "mail-followup-to") "\\(?:")
           ":")
   "Delete these headers from old message when it's inserted in a reply."
   :type 'regexp
-  :group 'sendmail)
+  :group 'sendmail
+  :version "23.1")
 
 ;; Prevent problems with `window-system' not having the correct value
 ;; when loaddefs.el is loaded. `custom-reevaluate-setting' needs the
@@ -248,6 +253,7 @@
   :type 'integer
   :group 'sendmail)
 
+;; FIXME make it really obsolete.
 (defvar mail-yank-hooks nil
   "Obsolete hook for modifying a citation just inserted in the mail buffer.
 Each hook function can find the citation between (point) and (mark t).
@@ -482,8 +488,12 @@
 actually occur.")
 
 (defvar mail-mode-syntax-table
-  (let ((st (make-syntax-table)))
     ;; define-derived-mode will make it inherit from text-mode-syntax-table.
+  (let ((st (make-syntax-table)))
+    ;; FIXME this is probably very obsolete now ("percent hack").
+    ;; sending.texi used to say:
+    ;;   Mail mode defines the character `%' as a word separator; this
+    ;;   is helpful for using the word commands to edit mail addresses.
     (modify-syntax-entry ?% ". " st)
     st)
   "Syntax table used while in `mail-mode'.")
@@ -595,15 +605,7 @@
                       'category 'mail-header-separator)
     ;; Insert the signature.  But remember the beginning of the message.
     (if to (setq to (point)))
-    (cond ((eq mail-signature t)
-          (if (file-exists-p mail-signature-file)
-              (progn
-                (insert "\n\n-- \n")
-                (insert-file-contents mail-signature-file))))
-         ((stringp mail-signature)
-          (insert mail-signature))
-         (t
-          (eval mail-signature)))
+    (if mail-signature (mail-signature t))
     (goto-char (point-max))
     (or (bolp) (newline)))
   (if to (goto-char to))
@@ -1328,19 +1330,19 @@
          (insert-before-markers "Sent-via:" to-line))))))
 
 (defun mail-to ()
-  "Move point to end of To-field."
+  "Move point to end of To field, creating it if necessary."
   (interactive)
   (expand-abbrev)
   (mail-position-on-field "To"))
 
 (defun mail-subject ()
-  "Move point to end of Subject-field."
+  "Move point to end of Subject field, creating it if necessary."
   (interactive)
   (expand-abbrev)
   (mail-position-on-field "Subject"))
 
 (defun mail-cc ()
-  "Move point to end of CC-field.  Create a CC field if none."
+  "Move point to end of CC field, creating it if necessary."
   (interactive)
   (expand-abbrev)
   (or (mail-position-on-field "cc" t)
@@ -1348,7 +1350,7 @@
             (insert "\nCC: "))))
 
 (defun mail-bcc ()
-  "Move point to end of BCC-field.  Create a BCC field if none."
+  "Move point to end of BCC field, creating it if necessary."
   (interactive)
   (expand-abbrev)
   (or (mail-position-on-field "bcc" t)
@@ -1364,14 +1366,13 @@
   (insert "\nFCC: " folder))
 
 (defun mail-reply-to ()
-  "Move point to end of Reply-To-field.  Create a Reply-To field if none."
+  "Move point to end of Reply-To field, creating it if necessary."
   (interactive)
   (expand-abbrev)
   (mail-position-on-field "Reply-To"))
 
 (defun mail-mail-reply-to ()
-  "Move point to end of Mail-Reply-To field.
-Create a Mail-Reply-To field if none."
+  "Move point to end of Mail-Reply-To field, creating it if necessary."
   (interactive)
   (expand-abbrev)
   (or (mail-position-on-field "mail-reply-to" t)
@@ -1379,8 +1380,7 @@
            (insert "\nMail-Reply-To: "))))
 
 (defun mail-mail-followup-to ()
-  "Move point to end of Mail-Followup-To field.
-Create a Mail-Followup-To field if none."
+  "Move point to end of Mail-Followup-To field, creating it if necessary."
   (interactive)
   (expand-abbrev)
   (or (mail-position-on-field "mail-followup-to" t)
@@ -1411,20 +1411,34 @@
   (goto-char (mail-text-start)))
 
 (defun mail-signature (&optional atpoint)
-  "Sign letter with signature based on `mail-signature-file'.
-Prefix arg means put contents at point."
-  (interactive "P")
+  "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 (interactive-p)
+         (message "The signature file `%s' could not be read"
+                  mail-signature-file))
   (save-excursion
-    (or atpoint
-       (goto-char (point-max)))
+      (unless atpoint
+       (goto-char (point-max))
+       ;; Delete trailing whitespace and blank lines.
     (skip-chars-backward " \t\n")
     (end-of-line)
-    (or atpoint
        (delete-region (point) (point-max)))
-    (if (stringp mail-signature)
-       (insert mail-signature)
+      (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)))))
+            (insert-file-contents (expand-file-name mail-signature-file)))
+           (t
+            ;; FIXME add condition-case error handling?
+            (eval mail-signature))))))
 
 (defun mail-fill-yanked-message (&optional justifyp)
   "Fill the paragraphs of a message yanked into this one.




reply via email to

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