emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r103238: Make rmail-default-dont-repl


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103238: Make rmail-default-dont-reply-to-names nil (Bug#7888); rename rmail-dont-reply-*.
Date: Sat, 12 Feb 2011 16:45:42 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103238
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2011-02-12 16:45:42 -0500
message:
  Make rmail-default-dont-reply-to-names nil (Bug#7888); rename 
rmail-dont-reply-*.
  
  * lisp/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.
  
  * lisp/mail/rmail.el (rmail-default-dont-reply-to-names): Default to
  nil, and make obsolete.
  (rmail-dont-reply-to-names): Alias to mail-dont-reply-to-names.
  
  * lisp/mail/rmailsum.el (rmail-summary-sort-by-correspondent): Doc fix.
  
  * lisp/mail/rmailsort.el (rmail-sort-by-correspondent)
  (rmail-select-correspondent): Doc fix.  Use mail-dont-reply-to.
  
  * lisp/mail/rmail.el (rmail-reply): Use mail-dont-reply-to.
modified:
  lisp/ChangeLog
  lisp/mail/mail-utils.el
  lisp/mail/rmail.el
  lisp/mail/rmailsort.el
  lisp/mail/rmailsum.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-02-12 19:34:50 +0000
+++ b/lisp/ChangeLog    2011-02-12 21:45:42 +0000
@@ -1,3 +1,21 @@
+2011-02-12  Chong Yidong  <address@hidden>
+
+       * 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  <address@hidden>
 
        * files.el (copy-directory): New argument COPY-CONTENTS for

=== modified file 'lisp/mail/mail-utils.el'
--- a/lisp/mail/mail-utils.el   2011-01-25 04:08:28 +0000
+++ b/lisp/mail/mail-utils.el   2011-02-12 21:45:42 +0000
@@ -35,6 +35,17 @@
   :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)
@@ -213,36 +224,31 @@
                                        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
-                       ;; "address@hidden".
-                        (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 "address@hidden".
+                (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))
@@ -262,7 +268,7 @@
              (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))))
@@ -278,6 +284,9 @@
       (substring destinations (match-end 0))
     destinations))
 
+;; Legacy name
+(define-obsolete-function-alias 'rmail-dont-reply-to 'mail-dont-reply-to 
"24.1")
+
 
 ;;;###autoload
 (defun mail-fetch-field (field-name &optional last all list)

=== modified file 'lisp/mail/rmail.el'
--- a/lisp/mail/rmail.el        2011-02-10 16:56:00 +0000
+++ b/lisp/mail/rmail.el        2011-02-12 21:45:42 +0000
@@ -191,7 +191,7 @@
   :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)
@@ -283,26 +283,16 @@
   :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)
-
-;;;###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?
+(defvaralias 'rmail-dont-reply-to-names 'mail-dont-reply-to-names)
+
+;;;###autoload
+(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
@@ -3578,15 +3568,14 @@
      ;; 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)))
@@ -4359,7 +4348,7 @@
 
 ;;;### (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" "\
@@ -4393,7 +4382,7 @@
 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)
@@ -4418,7 +4407,7 @@
 
 ;;;### (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" "\

=== modified file 'lisp/mail/rmailsort.el'
--- a/lisp/mail/rmailsort.el    2011-01-25 04:08:28 +0000
+++ b/lisp/mail/rmailsort.el    2011-02-12 21:45:42 +0000
@@ -87,7 +87,7 @@
   "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
@@ -98,13 +98,12 @@
                           '("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)))

=== modified file 'lisp/mail/rmailsum.el'
--- a/lisp/mail/rmailsum.el     2011-02-10 16:56:00 +0000
+++ b/lisp/mail/rmailsum.el     2011-02-12 21:45:42 +0000
@@ -1796,7 +1796,7 @@
   "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))


reply via email to

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