emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master d315531: * lisp/mail/rmailsum.el: Commas no longer


From: Glenn Morris
Subject: [Emacs-diffs] master d315531: * lisp/mail/rmailsum.el: Commas no longer separate regexps. (Bug#19026)
Date: Wed, 27 May 2015 01:04:32 +0000

branch: master
commit d3155315c85212f224fc5df0239182dafdfd6284
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    * lisp/mail/rmailsum.el: Commas no longer separate regexps.  (Bug#19026)
    
    (rmail-summary-by-recipients, rmail-summary-by-topic)
    (rmail-summary-by-senders): No longer use mail-comma-list-regexp.
    
    * doc/emacs/rmail.texi (Rmail Make Summary): Update for this change.
    
    ; * etc/NEWS: Mention this.
---
 doc/emacs/rmail.texi  |   11 ++++-------
 etc/NEWS              |   14 ++++++++------
 lisp/mail/rmailsum.el |   18 ++++++++----------
 3 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index 82ac99f..6cad280 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -926,8 +926,7 @@ commas.
 @findex rmail-summary-by-recipients
   @kbd{C-M-r @var{rcpts} @key{RET}} (@code{rmail-summary-by-recipients})
 makes a partial summary mentioning only the messages that have one or
-more recipients matching the regular expression @var{rcpts}.  You can
-use commas to separate multiple regular expressions.  These are matched
+more recipients matching the regular expression @var{rcpts}.  This is matched
 against the @samp{To}, @samp{From}, and @samp{CC} headers (supply a prefix
 argument to exclude this header).
 
@@ -935,9 +934,8 @@ argument to exclude this header).
 @findex rmail-summary-by-topic
   @kbd{C-M-t @var{topic} @key{RET}} (@code{rmail-summary-by-topic})
 makes a partial summary mentioning only the messages whose subjects have
-a match for the regular expression @var{topic}.  You can use commas to
-separate multiple regular expressions.  With a prefix argument, the
-match is against the whole message, not just the subject.
+a match for the regular expression @var{topic}.  With a prefix argument,
+the match is against the whole message, not just the subject.
 
 @kindex C-M-s @r{(Rmail)}
 @findex rmail-summary-by-regexp
@@ -950,8 +948,7 @@ expression @var{regexp}.
 @findex rmail-summary-by-senders
   @kbd{C-M-f @var{senders} @key{RET}} (@code{rmail-summary-by-senders})
 makes a partial summary that mentions only the messages whose @samp{From}
-fields match the regular expression @var{senders}.  You can use commas to
-separate multiple regular expressions.
+fields match the regular expression @var{senders}.
 
   Note that there is only one summary buffer for any Rmail buffer;
 making any kind of summary discards any previous summary.
diff --git a/etc/NEWS b/etc/NEWS
index 1cccc31..24f6d58 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -520,16 +520,21 @@ alternatives to currently visited manuals.
 ---
 ** ntlm.el has support for NTLM2.
 
----
-** The Rmail commands d, C-d and u now handle repeat counts to delete or
+** Rmail
+
+*** The Rmail commands d, C-d and u take optional repeat counts to delete or
 undelete multiple messages.
 
-** Rmail can now render HTML mail messages if your Emacs was built with
+*** Rmail can now render HTML mail messages if your Emacs was built with
 libxml2 or if you have the Lynx browser installed.  By default, Rmail
 will display the HTML version of a mail message that has both HTML and
 plain text parts, if display of HTML email is possible; customize the
 `rmail-mime-prefer-html' option to `nil' if you don't want that.
 
++++
+*** In the commands that make summaries by subject, recipients, or senders,
+you can no longer use commas to separate regular expressions.
+
 ** SES now supports local printer functions; see `ses-define-local-printer'.
 
 ** In sh-mode, you can now use `sh-shell' as a file-local variable to
@@ -875,9 +880,6 @@ permissions set to temporary values (e.g., for creating 
private files).
 
 ** You can access the slots of structures using `cl-struct-slot-value'.
 
-** Functions `rmail-delete-forward' and `rmail-delete-backward' take an
-optional repeat-count argument.
-
 ** Function `sort' can deal with vectors.
 
 ** Function `system-name' now returns an updated value if the current
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 7097fef..ed4d58c 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -287,23 +287,20 @@ LABELS should be a string containing the desired labels, 
separated by commas."
                             (mail-comma-list-regexp labels)
                             "\\)\\(,\\|\\'\\)")))
 
-;; FIXME "a string of regexps separated by commas" makes no sense because:
-;;  i) it's pointless (you can just use \\|)
-;; ii) it's broken (you can't specify a literal comma)
-;; rmail-summary-by-topic and rmail-summary-by-senders have the same issue.
 ;;;###autoload
 (defun rmail-summary-by-recipients (recipients &optional primary-only)
   "Display a summary of all messages with the given RECIPIENTS.
 Normally checks the To, From and Cc fields of headers;
 but if PRIMARY-ONLY is non-nil (prefix arg given),
  only look in the To and From fields.
-RECIPIENTS is a string of regexps separated by commas."
+RECIPIENTS is a regular expression."
   (interactive "sRecipients to summarize by: \nP")
   (rmail-new-summary
    (concat "recipients " recipients)
    (list 'rmail-summary-by-recipients recipients primary-only)
    'rmail-message-recipients-p
-   (mail-comma-list-regexp recipients) primary-only))
+   (replace-regexp-in-string "\\`[ \t]*\\(.*?\\)[ \t]*\\'" "\\1" recipients)
+   primary-only))
 
 (defun rmail-message-recipients-p (msg recipients &optional primary-only)
   (rmail-apply-in-message msg 'rmail-message-recipients-p-1
@@ -370,7 +367,7 @@ Emacs will list the message in the summary."
   "Display a summary of all messages with the given SUBJECT.
 Normally checks just the Subject field of headers; but with prefix
 argument WHOLE-MESSAGE is non-nil, looks in the whole message.
-SUBJECT is a string of regexps separated by commas."
+SUBJECT is a regular expression."
   (interactive
    ;; We quote the default subject, because if it contains regexp
    ;; special characters (eg "?"), it can fail to match itself.  (Bug#2333)
@@ -383,7 +380,8 @@ SUBJECT is a string of regexps separated by commas."
    (concat "about " subject)
    (list 'rmail-summary-by-topic subject whole-message)
    'rmail-message-subject-p
-   (mail-comma-list-regexp subject) whole-message))
+   (replace-regexp-in-string "\\`[ \t]*\\(.*?\\)[ \t]*\\'" "\\1" subject)
+   whole-message))
 
 (defun rmail-message-subject-p (msg subject &optional whole-message)
   (if whole-message
@@ -395,13 +393,13 @@ SUBJECT is a string of regexps separated by commas."
 ;;;###autoload
 (defun rmail-summary-by-senders (senders)
   "Display a summary of all messages whose \"From\" field matches SENDERS.
-SENDERS is a string of regexps separated by commas."
+SENDERS is a regular expression."
   (interactive "sSenders to summarize by: ")
   (rmail-new-summary
    (concat "senders " senders)
    (list 'rmail-summary-by-senders senders)
    'rmail-message-senders-p
-   (mail-comma-list-regexp senders)))
+   (replace-regexp-in-string "\\`[ \t]*\\(.*?\\)[ \t]*\\'" "\\1" senders)))
 
 (defun rmail-message-senders-p (msg senders)
   (string-match senders (or (rmail-get-header "From" msg) "")))



reply via email to

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