Changes committed gnus/contrib (ChangeLog sendmail.el smtpmail.el)

"Miles Bader" <[email protected]> Fri, 10 Apr 2009 10:45:57 +0200
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: ChangeLog sendmail.el smtpmail.el

Merge from emacs--devo--0

Patches applied:

 * emacs--devo--0  (patch 1561, 1564, 1575-1577)

   - Merge from gnus--devo--0
   - Update from CVS

2009-04-02  Glenn Morris  <[email protected]>

   * texi/auth.texi: Capitalize direntry.

2009-03-03  Glenn Morris  <[email protected]>

   * texi/auth.texi: Fix @setfilename.

Revision: [email protected]/gnus--devo--0--patch-586


Index: ChangeLog
diff -u gnus/contrib/ChangeLog:7.82 gnus/contrib/ChangeLog:7.83
--- ChangeLog:7.82	Fri Feb 27 00:35:59 2009
+++ ChangeLog	Fri Apr 10 10:45:57 2009
@@ -1,4 +1,41 @@
-2009-02-26  Tobias C. Rittweiler  <[email protected]>  (tiny change)
+2009-04-09  Richard M Stallman  <[email protected]>
+
+	* sendmail.el (sendmail-send-it): Replace any
+	pre-existing Content-type header if we insert one.
+
+2009-03-15  Glenn Morris  <[email protected]>
+
+	* sendmail.el (mail-yank-prefix): Doc fix.
+	(mail-mode-map): Only enable the "Cite Original" menu-item when
+	appropriate.  Standardize the text used for other headers re hyphens.
+
+2009-03-14  Glenn Morris  <[email protected]>
+
+	* sendmail.el (mail-interactive): Doc fix.
+	(mail-yank-ignored-headers): Add X-RMAIL- headers, bump :version.
+	(mail-setup): Use the function mail-signature.
+	(mail-mode-hook): Doc fix.
+	(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-10  Glenn Morris  <[email protected]>
+
+	* sendmail.el (mail-archive-file-name, mail-default-headers):
+	Doc fixes.
+	(mail-mailing-lists): Remove leading `*' from defcustom doc.
+
+2009-03-03  Simon Josefsson  <[email protected]>
+
+	* smtpmail.el (smtpmail-auth-supported): Mention that list is
+	in preference order.
+	(smtpmail-try-auth-methods): Improve which authentication
+	mechanism to use, so that the locally most preferred and mutually
+	supported mechanism is used.
+
+009-02-26  Tobias C. Rittweiler  <[email protected]>  (tiny change)
 
 	* sendmail.el (sendmail-send-it): `call-process-region' can return a
 	string.  (Bug#2428)
@@ -42,7 +79,7 @@
 
 2008-05-19  Teodor Zlatanov  <[email protected]>
 
-	* mail/smtpmail.el: Add autoload for `auth-source-user-or-password'.
+	* smtpmail.el: Add autoload for `auth-source-user-or-password'.
 	(smtpmail-try-auth-methods): Use it.
 
 2008-05-15  Andreas Schwab  <[email protected]>
@@ -135,7 +172,7 @@
 
 2007-12-09  Dan Nicolaescu  <[email protected]>
 
-	* mail/sendmail.el (dired-view-file, dired-get-filename): Declare as
+	* sendmail.el (dired-view-file, dired-get-filename): Declare as
 	functions.
 
 2007-11-24  Kenichi Handa  <[email protected]>
Index: sendmail.el
diff -u gnus/contrib/sendmail.el:7.15 gnus/contrib/sendmail.el:7.16
--- sendmail.el:7.15	Fri Feb 27 00:35:59 2009
+++ sendmail.el	Fri Apr 10 10:45:57 2009
@@ -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
   :group 'sendmail)
 
@@ -130,11 +130,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
@@ -182,7 +187,8 @@
 ;;;###autoload
 (defcustom mail-archive-file-name nil
   "Name of file to write all outgoing messages in, or nil for none.
-This can be an inbox file or an Rmail file."
+This is normally an mbox file, but for backwards compatibility may also
+be a Babyl file."
   :type '(choice file (const nil))
   :group 'sendmail)
 
@@ -235,7 +241,7 @@
 ;;;###autoload
 (defcustom mail-yank-prefix nil
   "Prefix insert on lines of yanked message being replied to.
-nil means use indentation."
+If this is nil, use indentation, as specified by `mail-indentation-spaces'."
   :type '(choice (const nil) string)
   :group 'sendmail)
 
@@ -246,6 +252,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).
@@ -307,6 +314,8 @@
     (define-key map "\C-c\C-c" 'mail-send-and-exit)
     (define-key map "\C-c\C-s" 'mail-send)
     (define-key map "\C-c\C-i" 'mail-attach-file)
+    ;; FIXME add this? "b" = bury buffer.  It's in the menu-bar.
+;;;    (define-key map "\C-c\C-b" 'mail-dont-send)
 
     (define-key map [menu-bar mail]
       (cons "Mail" (make-sparse-keymap "Mail")))
@@ -315,7 +324,7 @@
       '("Fill Citation" . mail-fill-yanked-message))
 
     (define-key map [menu-bar mail yank]
-      '("Cite Original" . mail-yank-original))
+      '(menu-item "Cite Original" mail-yank-original :enable mail-reply-action))
 
     (define-key map [menu-bar mail signature]
       '("Insert Signature" . mail-signature))
@@ -342,13 +351,13 @@
       '("Expand Aliases" . expand-mail-aliases))
 
     (define-key map [menu-bar headers sent-via]
-      '("Sent Via" . mail-sent-via))
+      '("Sent-Via" . mail-sent-via))
 
     (define-key map [menu-bar headers mail-reply-to]
-      '("Mail Reply To" . mail-mail-reply-to))
+      '("Mail-Reply-To" . mail-mail-reply-to))
 
     (define-key map [menu-bar headers mail-followup-to]
-      '("Mail Followup To" . mail-mail-followup-to))
+      '("Mail-Followup-To" . mail-mail-followup-to))
 
     (define-key map [menu-bar headers reply-to]
       '("Reply-To" . mail-reply-to))
@@ -421,11 +430,12 @@
 ;;;###autoload
 (defcustom mail-default-headers nil
   "A string containing header lines, to be inserted in outgoing messages.
-It is inserted before you edit the message,
-so you can edit or delete these lines."
+It can contain newlines, and should end in one.  It is inserted
+before you edit the message, so you can edit or delete the lines."
   :type '(choice (const nil) string)
   :group 'sendmail)
 
+;; FIXME no need for autoload
 ;;;###autoload
 (defcustom mail-bury-selects-summary t
   "If non-nil, try to show Rmail summary buffer after returning from mail.
@@ -435,6 +445,7 @@
   :type 'boolean
   :group 'sendmail)
 
+;; FIXME no need for autoload
 ;;;###autoload
 (defcustom mail-send-nonascii 'mime
   "Specify whether to allow sending non-ASCII characters in mail.
@@ -478,8 +489,12 @@
 actually occur.")
 
 (defvar mail-mode-syntax-table
+  ;; define-derived-mode will make it inherit from text-mode-syntax-table.
   (let ((st (make-syntax-table)))
-    ;; define-derived-mode will make it inherit from text-mode-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'.")
@@ -591,15 +606,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))
@@ -608,7 +615,9 @@
   (run-hooks 'mail-setup-hook))
 
 (defcustom mail-mode-hook nil
-  "Hook run by Mail mode."
+  "Hook run by Mail mode.
+When composing a mail, this runs immediately after creating, or
+switching to, the `*mail*' buffer.  See also `mail-setup-hook'."
   :group 'sendmail
   :type 'hook
   :options '(footnote-mode))
@@ -811,9 +820,8 @@
   :group 'sendmail)
 
 ;;;###autoload
-(defcustom mail-mailing-lists nil "\
-*List of mailing list addresses the user is subscribed to.
-
+(defcustom mail-mailing-lists nil
+"List of mailing list addresses the user is subscribed to.
 The variable is used to trigger insertion of the \"Mail-Followup-To\"
 header when sending a message to a mailing list."
   :type '(repeat string)
@@ -1104,7 +1112,10 @@
 	    (if (not (re-search-forward "^From:" delimline t))
 		(mail-insert-from-field))
 	    ;; Possibly add a MIME header for the current coding system
-	    (let (charset)
+	    (let (charset where-content-type)
+	      (goto-char (point-min))
+	      (setq where-content-type
+		    (re-search-forward "^Content-type:" delimline t))
 	      (goto-char (point-min))
 	      (and (eq mail-send-nonascii 'mime)
 		   (not (re-search-forward "^MIME-version:" delimline t))
@@ -1113,11 +1124,19 @@
 		   selected-coding
 		   (setq charset
 			 (coding-system-get selected-coding 'mime-charset))
-		   (goto-char delimline)
-		   (insert "MIME-version: 1.0\n"
-			   "Content-type: text/plain; charset="
-			   (symbol-name charset)
-			   "\nContent-Transfer-Encoding: 8bit\n")))
+		   (progn
+		     (goto-char delimline)
+		     (insert "MIME-version: 1.0\n"
+			     "Content-type: text/plain; charset="
+			     (symbol-name charset)
+			     "\nContent-Transfer-Encoding: 8bit\n")
+		     ;; The character set we will actually use
+		     ;; should override any specified in the message itself.
+		     (when where-content-type
+		       (goto-char where-content-type)
+		       (beginning-of-line)
+		       (delete-region (point)
+				      (progn (forward-line 1) (point)))))))
 	    ;; Insert an extra newline if we need it to work around
 	    ;; Sun's bug that swallows newlines.
 	    (goto-char (1+ delimline))
@@ -1325,19 +1344,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)
@@ -1345,7 +1364,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)
@@ -1361,14 +1380,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)
@@ -1376,8 +1394,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)
@@ -1408,20 +1425,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")
-  (save-excursion
-    (or atpoint
-	(goto-char (point-max)))
-    (skip-chars-backward " \t\n")
-    (end-of-line)
-    (or 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 (interactive-p)
+	  (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)))
-    (if (stringp mail-signature)
-	(insert mail-signature)
-      (insert "\n\n-- \n")
-      (insert-file-contents (expand-file-name mail-signature-file)))))
+      (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))))))
 
 (defun mail-fill-yanked-message (&optional justifyp)
   "Fill the paragraphs of a message yanked into this one.
Index: smtpmail.el
diff -u gnus/contrib/smtpmail.el:7.17 gnus/contrib/smtpmail.el:7.18
--- smtpmail.el:7.17	Thu Jan 22 08:02:18 2009
+++ smtpmail.el	Fri Apr 10 10:45:57 2009
@@ -219,7 +219,8 @@
 				     smtpmail-queue-index-file))
 
 (defconst smtpmail-auth-supported '(cram-md5 plain login)
-  "List of supported SMTP AUTH mechanisms.")
+  "List of supported SMTP AUTH mechanisms.
+The list is in preference order.")
 
 ;;;
 ;;;
@@ -540,7 +541,7 @@
 
 (defun smtpmail-try-auth-methods (process supported-extensions host port)
   (let* ((mechs (cdr-safe (assoc 'auth supported-extensions)))
-	 (mech (car (smtpmail-intersection smtpmail-auth-supported mechs)))
+	 (mech (car (smtpmail-intersection mechs smtpmail-auth-supported)))
 	 (auth-user (auth-source-user-or-password
 		     "login" host (or port "smtp")))
 	 (auth-pass (auth-source-user-or-password