Re: [PATCH v7 1/1] emacs: notmuch-tree-outline-mode

Subject: Re: [PATCH v7 1/1] emacs: notmuch-tree-outline-mode

Date: Mon, 12 Dec 2022 15:39:25 +0000

To: David Bremner


From: Jose A. Ortega Ruiz

On Mon, Dec 12 2022, David Bremner wrote:

>>>> +		       (buffer-name notmuch-tree-message-buffer))))
>>> At first glance, depending on the buffer name seems fragile?
>> not sure why, or how to make it more robust...
> It depends on the buffer being named after the message-id. If I
> understand the current code correctly, this depends on the default
> naming in notmuch show, but that could change e.g. like it did for
> notmuch-search. OTOH, I guess I don't really understand what this is
> checking for, since I was using something based on
> #'notmuch-tree-get-message-properties

the intent is to know whether the notmuch-tree-message-buffer is
displaying the message the point in notmuch-tree is at, so it's not
enough that there's a window showing it.  but yes, you're right that's
not a good way of checking.  Perhaps this:

     (defsubst notmuch-tree-outline--message-open-p ()
       (and (buffer-live-p notmuch-tree-message-buffer)
            (get-buffer-window notmuch-tree-message-buffer)
            (let ((id (notmuch-tree-get-message-id)))
              (with-current-buffer notmuch-tree-message-buffer
                (string= (notmuch-show-get-message-id) (or id ""))))))

notmuch mailing list --
To unsubscribe send an email to