From: Eli Zaretskii <eliz@gnu.org>
To: Andrea Monaco <andrea.monaco@autistici.org>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Jumping to message by ID
Date: Fri, 20 Oct 2023 13:26:19 +0300 [thread overview]
Message-ID: <83sf65si7o.fsf@gnu.org> (raw)
In-Reply-To: <87bkctiujw.fsf@autistici.org> (message from Andrea Monaco on Fri, 20 Oct 2023 10:09:55 +0200)
> From: Andrea Monaco <andrea.monaco@autistici.org>
> Cc: emacs-devel@gnu.org
> Date: Fri, 20 Oct 2023 10:09:55 +0200
>
>
> +(defun rmail-get-email-address-at-point ()
> + "Return the email address or message id around point, or nil if none is present."
The name of the function doesn't seem to reflect what it does. Can
you come up with a better name?
> +(defun rmail-show-message-by-id (&optional id)
> + "Show message with given Message ID, defaulting to the id around point."
> + (interactive
> + (list (rmail-get-email-address-at-point)))
> + (unless id
> + (error "No message ID around point"))
> + (let ((id (rmail-get-email-address-at-point)))
> + (when id
> + (unless (and rmail-summary-message-parents-vector
> + (= (length rmail-summary-message-parents-vector)
> + (1+ rmail-total-messages)))
> + (rmail-summary-fill-message-parents-and-descs-vectors))
> + (let ((entry (assoc id (gethash id rmail-summary-message-ids-hash-table))))
> + (if entry
> + (rmail-show-message (cdr entry))
> + (error (concat "No message with ID " id " found")))))))
> +
If I have many hundreds of messages in my INBOX (e.g., I have almost
2100 now where I'm typing this, and this number is not an anomaly in
my Rmail use patterns), wouldn't
rmail-summary-fill-message-parents-and-descs-vectors take a
significant time? If so, perhaps it would make sense to update the
data each time we update the summary, instead of punishing the first
call after getting new email?
Thanks.
next prev parent reply other threads:[~2023-10-20 10:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-09 9:00 Jumping to message by ID Andrea Monaco
2023-09-09 9:15 ` Eli Zaretskii
2023-10-20 8:09 ` [PATCH] " Andrea Monaco
2023-10-20 10:26 ` Eli Zaretskii [this message]
2023-10-20 17:26 ` Andrea Monaco
2023-10-20 23:44 ` Adam Porter
2023-10-23 2:08 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83sf65si7o.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=andrea.monaco@autistici.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).