* Re: master f320663239: Improve progressive summaries in Rmail, master f320663239: Improve progressive summaries in Rmail
[not found] ` <20221117133321.3876CC0E4BC@vcs2.savannah.gnu.org>
@ 2022-11-17 15:49 ` Robert Pluim
2022-11-17 17:02 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Robert Pluim @ 2022-11-17 15:49 UTC (permalink / raw)
To: emacs-devel; +Cc: Andrea Monaco
[-- Attachment #1: Type: text/plain, Size: 671 bytes --]
>>>>> On Thu, 17 Nov 2022 08:33:20 -0500 (EST), Eli Zaretskii <eliz@gnu.org> said:
Eli> branch: master
Eli> commit f320663239a14aceee01868c465a4461e3a69954
Eli> Author: Andrea Monaco <andrea.monaco@autistici.org>
Eli> Commit: Eli Zaretskii <eliz@gnu.org>
>>>>> On Thu, 17 Nov 2022 08:33:20 -0500 (EST), Eli Zaretskii <eliz@gnu.org> said:
Eli> branch: master
Eli> commit f320663239a14aceee01868c465a4461e3a69954
Eli> Author: Andrea Monaco <andrea.monaco@autistici.org>
Eli> Commit: Eli Zaretskii <eliz@gnu.org>
Eli, how about this (I donʼt use rmail, so I canʼt test it, but itʼs
fairly mechanical).
Robert
--
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-boolean-values-directly-in-rmailsum.patch --]
[-- Type: text/x-diff, Size: 4550 bytes --]
From 3d8c5dcc6ff4b609498c0b3c67a8a4798771c1d6 Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
Date: Thu, 17 Nov 2022 16:45:36 +0100
Subject: [PATCH] Use boolean values directly in rmailsum
To: emacs-devel@gnu.org
* lisp/mail/rmailsum.el (rmail-summary-invert):
(rmail-summary-direct-descendants):
(rmail-summary--walk-thread-message-recursively):
(rmail-summary-by-thread):
(rmail-summary-by-labels):
(rmail-summary-by-recipients):
(rmail-summary-by-regexp):
(rmail-summary-by-topic):
(rmail-summary-by-senders): Use the boolean values in
'rmail-summary-currently-displayed-msgs' and similar directly instead
of comparing them to t and nil.
---
lisp/mail/rmailsum.el | 29 +++++++++++------------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 93fc0f5d2b..1aa28bac34 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -371,8 +371,7 @@ rmail-summary-invert
'(rmail-summary-by-regexp ".*")
(lambda (msg)
(if
- (eq (aref rmail-summary-currently-displayed-msgs msg)
- nil)
+ (not (aref rmail-summary-currently-displayed-msgs msg))
(aset rmail-summary-currently-displayed-msgs msg t)
(aset rmail-summary-currently-displayed-msgs msg nil)))))
@@ -396,7 +395,7 @@ rmail-summary-direct-descendants
(msg 1))
(while (<= msg rmail-total-messages)
(when (and
- (eq nil (aref encountered-msgs msg))
+ (not (aref encountered-msgs msg))
(memq msgnum (aref rmail-summary-message-parents-vector msg)))
(setq desc (cons msg desc)))
(setq msg (1+ msg)))
@@ -404,7 +403,7 @@ rmail-summary-direct-descendants
(defun rmail-summary--walk-thread-message-recursively (msgnum encountered-msgs)
"Add parents and descendants of message MSGNUM to ENCOUNTERED-MSGS, recursively."
- (unless (eq (aref encountered-msgs msgnum) t)
+ (unless (aref encountered-msgs msgnum)
(aset encountered-msgs msgnum t)
(let ((walk-thread-msg
(lambda (msg)
@@ -439,10 +438,9 @@ rmail-summary-by-thread
(if (and rmail-summary-intersect-consecutive-filters
(rmail-summary--exists-1))
(lambda (msg msgnum)
- (and (eq (aref rmail-summary-currently-displayed-msgs msg)
- t)
- (eq (aref enc-msgs msg) t)))
- (lambda (msg msgnum) (eq (aref enc-msgs msg) t)))
+ (and (aref rmail-summary-currently-displayed-msgs msg)
+ (aref enc-msgs msg)))
+ (lambda (msg msgnum) (aref enc-msgs msg)))
msgnum))))
;;;###autoload
@@ -462,8 +460,7 @@ rmail-summary-by-labels
(if (and rmail-summary-progressively-narrow
(rmail-summary--exists-1))
(lambda (msg l)
- (and (eq (aref rmail-summary-currently-displayed-msgs msg)
- t)
+ (and (aref rmail-summary-currently-displayed-msgs msg)
(rmail-message-labels-p msg l)))
'rmail-message-labels-p)
(concat " \\("
@@ -487,8 +484,7 @@ rmail-summary-by-recipients
(if (and rmail-summary-progressively-narrow
(rmail-summary--exists-1))
(lambda (msg r &optional po)
- (and (eq (aref rmail-summary-currently-displayed-msgs msg)
- t)
+ (and (aref rmail-summary-currently-displayed-msgs msg)
(rmail-message-recipients-p msg r po)))
'rmail-message-recipients-p)
recipients primary-only))
@@ -527,8 +523,7 @@ rmail-summary-by-regexp
(if (and rmail-summary-progressively-narrow
(rmail-summary--exists-1))
(lambda (msg r)
- (and (eq (aref rmail-summary-currently-displayed-msgs msg)
- t)
+ (and (aref rmail-summary-currently-displayed-msgs msg)
(rmail-message-regexp-p msg r)))
'rmail-message-regexp-p)
regexp))
@@ -585,8 +580,7 @@ rmail-summary-by-topic
(if (and rmail-summary-progressively-narrow
(rmail-summary--exists-1))
(lambda (msg s &optional wm)
- (and (eq (aref rmail-summary-currently-displayed-msgs msg)
- t)
+ (and (aref rmail-summary-currently-displayed-msgs msg)
(rmail-message-subject-p msg s wm)))
'rmail-message-subject-p)
subject whole-message))
@@ -621,8 +615,7 @@ rmail-summary-by-senders
(if (and rmail-summary-progressively-narrow
(rmail-summary--exists-1))
(lambda (msg s)
- (and (eq (aref rmail-summary-currently-displayed-msgs msg)
- t)
+ (and (aref rmail-summary-currently-displayed-msgs msg)
(rmail-message-senders-p msg s)))
'rmail-message-senders-p)
senders))
--
2.38.1.420.g319605f8f0
^ permalink raw reply related [flat|nested] 3+ messages in thread