+2011-02-12 Chong Yidong <cyd@stupidchicken.com>
+
+ * mail/mail-utils.el (mail-dont-reply-to-names): New variable,
+ from rmail-dont-reply-to-names. Callers changed.
+ (mail-dont-reply-to): Rename from mail-dont-reply-to.
+ (rmail-dont-reply-to): Make it an obsolete alias.
+
+ * mail/rmail.el (rmail-default-dont-reply-to-names): Default to
+ nil, and make obsolete (Bug#7888).
+ (rmail-dont-reply-to-names): Alias to mail-dont-reply-to-names.
+
+ * mail/rmailsum.el (rmail-summary-sort-by-correspondent): Doc fix.
+
+ * mail/rmailsort.el (rmail-sort-by-correspondent)
+ (rmail-select-correspondent): Doc fix. Use mail-dont-reply-to.
+
+ * mail/rmail.el (rmail-reply): Use mail-dont-reply-to.
+
2011-02-12 Thierry Volpiatto <thierry.volpiatto@gmail.com>
* files.el (copy-directory): New argument COPY-CONTENTS for
:type 'boolean
:group 'mail)
+;;;###autoload
+(defcustom mail-dont-reply-to-names nil
+ "Regexp specifying addresses to prune from a reply message.
+If this is nil, it is set the first time you compose a reply, to
+a value which excludes your own email address.
+
+Matching addresses are excluded from the CC field in replies, and
+also the To field, unless this would leave an empty To field."
+ :type '(choice regexp (const :tag "Your Name" nil))
+ :group 'mail)
+
;; Returns t if file FILE is an Rmail file.
;;;###autoload
(defun mail-file-babyl-p (file)
nil 'literal address 2)))
address))))
-;; The following piece of ugliness is legacy code. The name was an
-;; unfortunate choice --- a flagrant violation of the Emacs Lisp
-;; coding conventions. `mail-dont-reply-to' would have been
-;; infinitely better. Also, `rmail-dont-reply-to-names' might have
-;; been better named `mail-dont-reply-to-names' and sourced from this
-;; file instead of in rmail.el. Yuck. -pmr
-(defun rmail-dont-reply-to (destinations)
+(defun mail-dont-reply-to (destinations)
"Prune addresses from DESTINATIONS, a list of recipient addresses.
-All addresses matching `rmail-dont-reply-to-names' are removed from
-the comma-separated list. The pruned list is returned."
+Remove all addresses matching `mail-dont-reply-to-names' from the
+comma-separated list, and return the pruned list."
;; FIXME this (setting a user option the first time a command is used)
;; is somewhat strange. Normally one would never set the option,
;; but instead fall back to the default so long as it was nil.
;; Or just set the default directly in the defcustom.
- (if (null rmail-dont-reply-to-names)
- (setq rmail-dont-reply-to-names
- (concat (if rmail-default-dont-reply-to-names
- (concat rmail-default-dont-reply-to-names "\\|")
- "")
- (if (and user-mail-address
- (not (equal user-mail-address user-login-name)))
- ;; Anchor the login name and email address so
- ;; that we don't match substrings: if the
- ;; login name is "foo", we shouldn't match
- ;; "barfoo@baz.com".
- (concat "\\`"
- (regexp-quote user-mail-address)
- "\\'\\|")
- "")
- (concat "\\`" (regexp-quote user-login-name) "@"))))
+ (if (null mail-dont-reply-to-names)
+ (setq mail-dont-reply-to-names
+ (concat
+ ;; `rmail-default-dont-reply-to-names' is obsolete.
+ (if rmail-default-dont-reply-to-names
+ (concat rmail-default-dont-reply-to-names "\\|")
+ "")
+ (if (and user-mail-address
+ (not (equal user-mail-address user-login-name)))
+ ;; Anchor the login name and email address so that we
+ ;; don't match substrings: if the login name is
+ ;; "foo", we shouldn't match "barfoo@baz.com".
+ (concat "\\`"
+ (regexp-quote user-mail-address)
+ "\\'\\|")
+ "")
+ (concat "\\`" (regexp-quote user-login-name) "@"))))
;; Split up DESTINATIONS and match each element separately.
(let ((start-pos 0) (cur-pos 0)
(case-fold-search t))
(setq cur-pos start-pos)))
(let* ((address (substring destinations start-pos cur-pos))
(naked-address (mail-strip-quoted-names address)))
- (if (string-match rmail-dont-reply-to-names naked-address)
+ (if (string-match mail-dont-reply-to-names naked-address)
(setq destinations (concat (substring destinations 0 start-pos)
(and cur-pos (substring destinations
(1+ cur-pos))))
(substring destinations (match-end 0))
destinations))
+;; Legacy name
+(define-obsolete-function-alias 'rmail-dont-reply-to 'mail-dont-reply-to "24.1")
+
\f
;;;###autoload
(defun mail-fetch-field (field-name &optional last all list)
:group 'rmail-retrieve
:type '(repeat (directory)))
-(declare-function rmail-dont-reply-to "mail-utils" (destinations))
+(declare-function mail-dont-reply-to "mail-utils" (destinations))
(declare-function rmail-update-summary "rmailsum" (&rest ignore))
(defun rmail-probe (prog)
:version "21.1")
;;;###autoload
-(defcustom rmail-dont-reply-to-names nil
- "A regexp specifying addresses to prune from a reply message.
-If this is nil, it is set the first time you compose a reply, to
-a value which excludes your own email address, plus whatever is
-specified by `rmail-default-dont-reply-to-names'.
-
-Matching addresses are excluded from the CC field in replies, and
-also the To field, unless this would leave an empty To field."
- :type '(choice regexp (const :tag "Your Name" nil))
- :group 'rmail-reply)
+(defvaralias 'rmail-dont-reply-to-names 'mail-dont-reply-to-names)
;;;###autoload
-(defvar rmail-default-dont-reply-to-names (purecopy "\\`info-")
- "Regexp specifying part of the default value of `rmail-dont-reply-to-names'.
-This is used when the user does not set `rmail-dont-reply-to-names'
-explicitly. (The other part of the default value is the user's
-email address and name.) It is useful to set this variable in
-the site customization file. The default value is conventionally
-used for large mailing lists to broadcast announcements.")
-;; Is it really useful to set this site-wide?
+(defvar rmail-default-dont-reply-to-names nil
+ "Regexp specifying part of the default value of `mail-dont-reply-to-names'.
+This is used when the user does not set `mail-dont-reply-to-names'
+explicitly.")
+;;;###autoload
+(make-obsolete-variable 'rmail-default-dont-reply-to-names
+ 'mail-dont-reply-to-names "24.1")
;;;###autoload
(defcustom rmail-ignored-headers
;; Remove unwanted names from reply-to, since Mail-Followup-To
;; header causes all the names in it to wind up in reply-to, not
;; in cc. But if what's left is an empty list, use the original.
- (let* ((reply-to-list (rmail-dont-reply-to reply-to)))
+ (let* ((reply-to-list (mail-dont-reply-to reply-to)))
(if (string= reply-to-list "") reply-to reply-to-list))
subject
(rmail-make-in-reply-to-field from date message-id)
(if just-sender
nil
- ;; mail-strip-quoted-names is NOT necessary for rmail-dont-reply-to
- ;; to do its job.
- (let* ((cc-list (rmail-dont-reply-to
+ ;; `mail-dont-reply-to' doesn't need `mail-strip-quoted-names'.
+ (let* ((cc-list (mail-dont-reply-to
(mail-strip-quoted-names
(if (null cc) to (concat to ", " cc))))))
(if (string= cc-list "") nil cc-list)))
\f
;;;### (autoloads (rmail-sort-by-labels rmail-sort-by-lines rmail-sort-by-correspondent
;;;;;; rmail-sort-by-recipient rmail-sort-by-author rmail-sort-by-subject
-;;;;;; rmail-sort-by-date) "rmailsort" "rmailsort.el" "f297fd33c8f7fa74baf16d2da99acb35")
+;;;;;; rmail-sort-by-date) "rmailsort" "rmailsort.el" "ad1c98fe868c0e5804cf945d6c980d0b")
;;; Generated autoloads from rmailsort.el
(autoload 'rmail-sort-by-date "rmailsort" "\
Sort messages of current Rmail buffer by other correspondent.
This uses either the \"From\", \"Sender\", \"To\", or
\"Apparently-To\" header, downcased. Uses the first header not
-excluded by `rmail-dont-reply-to-names'. If prefix argument
+excluded by `mail-dont-reply-to-names'. If prefix argument
REVERSE is non-nil, sorts in reverse order.
\(fn REVERSE)" t nil)
\f
;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic
;;;;;; rmail-summary-by-regexp rmail-summary-by-recipients rmail-summary-by-labels
-;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "adad96c9eb13cae4bae0769f731d8784")
+;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "3817e21639db697abe5832d3223ecfc2")
;;; Generated autoloads from rmailsum.el
(autoload 'rmail-summary "rmailsum" "\
"Sort messages of current Rmail buffer by other correspondent.
This uses either the \"From\", \"Sender\", \"To\", or
\"Apparently-To\" header, downcased. Uses the first header not
-excluded by `rmail-dont-reply-to-names'. If prefix argument
+excluded by `mail-dont-reply-to-names'. If prefix argument
REVERSE is non-nil, sorts in reverse order."
(interactive "P")
(rmail-sort-messages reverse
'("From" "Sender" "To" "Apparently-To"))))))
(defun rmail-select-correspondent (msg fields)
- "Find the first header not excluded by `rmail-dont-reply-to-names'.
+ "Find the first header not excluded by `mail-dont-reply-to-names'.
MSG is a message number. FIELDS is a list of header names."
(let ((ans ""))
(while (and fields (string= ans ""))
(setq ans
- ;; NB despite the name, this lives in mail-utils.el.
- (rmail-dont-reply-to
+ (mail-dont-reply-to
(mail-strip-quoted-names
(or (rmail-get-header (car fields) msg) ""))))
(setq fields (cdr fields)))
"Sort messages of current Rmail summary by other correspondent.
This uses either the \"From\", \"Sender\", \"To\", or
\"Apparently-To\" header, downcased. Uses the first header not
-excluded by `rmail-dont-reply-to-names'. If prefix argument
+excluded by `mail-dont-reply-to-names'. If prefix argument
REVERSE is non-nil, sorts in reverse order."
(interactive "P")
(rmail-sort-from-summary (function rmail-sort-by-correspondent) reverse))