From a90e87fa2eb92b16f43d5904396466ada49f0e97 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 10 Apr 2009 08:45:57 +0000 Subject: [PATCH] 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 * texi/auth.texi: Capitalize direntry. 2009-03-03 Glenn Morris * texi/auth.texi: Fix @setfilename. Revision: emacs@sv.gnu.org/gnus--devo--0--patch-586 --- contrib/ChangeLog | 43 +++++++++++++- contrib/sendmail.el | 135 +++++++++++++++++++++++++++----------------- contrib/smtpmail.el | 5 +- lisp/ChangeLog.2 | 4 +- texi/ChangeLog | 11 ++++ texi/auth.texi | 6 +- 6 files changed, 144 insertions(+), 60 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 14a29b0a5..3ac467683 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,4 +1,41 @@ -2009-02-26 Tobias C. Rittweiler (tiny change) +2009-04-09 Richard M Stallman + + * sendmail.el (sendmail-send-it): Replace any + pre-existing Content-type header if we insert one. + +2009-03-15 Glenn Morris + + * 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 + + * 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 + + * sendmail.el (mail-archive-file-name, mail-default-headers): + Doc fixes. + (mail-mailing-lists): Remove leading `*' from defcustom doc. + +2009-03-03 Simon Josefsson + + * 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 (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 - * 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 @@ -135,7 +172,7 @@ 2007-12-09 Dan Nicolaescu - * 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 diff --git a/contrib/sendmail.el b/contrib/sendmail.el index 10163873e..33544f91f 100644 --- a/contrib/sendmail.el +++ b/contrib/sendmail.el @@ -121,7 +121,7 @@ so you can remove or alter the BCC field to override the default." ;; 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 @@ nil means let mailer mail back a message to report errors." (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 @@ This is used by the default mail-sending commands. See also ;;;###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 @@ The alias definitions in the file have this form: ;;;###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 @@ Used by `mail-yank-original' via `mail-indent-citation'." :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 @@ The default value matches citations like `foo-bar>' plus whitespace." (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 @@ The default value matches citations like `foo-bar>' plus whitespace." '("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 @@ The default value matches citations like `foo-bar>' plus whitespace." '("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 @@ This directory is used for auto-save files of mail buffers." ;;;###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 @@ is non-nil." :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 @@ The value should be an expression to test whether the problem will 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 @@ actually occur.") '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 @@ actually occur.") (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 @@ Prefix arg means don't delete this window." :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 @@ external program defined by `sendmail-program'." (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 @@ external program defined by `sendmail-program'." 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 @@ just append to the file, in Babyl format if necessary." (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 @@ just append to the file, in Babyl format if necessary." (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 @@ just append to the file, in Babyl format if necessary." (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 @@ Create a Mail-Reply-To field if none." (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 @@ Create a Mail-Followup-To field if none." (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. diff --git a/contrib/smtpmail.el b/contrib/smtpmail.el index 6ac7d7650..f6323ea12 100644 --- a/contrib/smtpmail.el +++ b/contrib/smtpmail.el @@ -219,7 +219,8 @@ This is relative to `smtpmail-queue-dir'.") 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 @@ This is relative to `smtpmail-queue-dir'.") (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 diff --git a/lisp/ChangeLog.2 b/lisp/ChangeLog.2 index af3227ac1..a64ff5fcb 100644 --- a/lisp/ChangeLog.2 +++ b/lisp/ChangeLog.2 @@ -16782,8 +16782,8 @@ 2001-01-01 00:52:44 Ed L. Cashin - A revoked patch. - * gnus-sum.el (gnus-summary-expire-articles): Save excursion. + * gnus-sum.el (gnus-summary-expire-articles): A revoked patch. + Save excursion. 2000-12-31 11:00:00 ShengHuo ZHU diff --git a/texi/ChangeLog b/texi/ChangeLog index bbf33339e..9c639793a 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,8 +1,19 @@ +--- orig/doc/misc/ChangeLog ++++ mod/doc/misc/ChangeLog +@@ -1,3 +1,27 @@ 2009-04-05 Reiner Steib * gnus-faq.texi (FAQ 8-4): Fix wrong group name of news.software.readers. Reported by Florian Rehnisch. +2009-04-02 Glenn Morris + + * auth.texi: Capitalize direntry. + +2009-03-03 Glenn Morris + + * auth.texi: Fix @setfilename. + 2009-02-26 Glenn Morris * gnus.texi: Minor updates for mbox Rmail. diff --git a/texi/auth.texi b/texi/auth.texi index 7a9031a0c..381ec73ca 100644 --- a/texi/auth.texi +++ b/texi/auth.texi @@ -1,6 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename auth.info +@settitle Emacs auth-source Library @value{VERSION} @set VERSION 0.1 @@ -37,7 +38,10 @@ license to the document, as described in section 6 of the license. @end quotation @end copying -@tex +@dircategory Emacs +@direntry +* Auth-source: (auth). The Emacs auth-source library. +@end direntry @titlepage @title Emacs auth-source Library -- 2.34.1