[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Jumping to message by ID
From: |
Eli Zaretskii |
Subject: |
Re: [PATCH] Jumping to message by ID |
Date: |
Fri, 20 Oct 2023 13:26:19 +0300 |
> 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.