unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: Ioan-Adrian Ratiu <adi@adirat.com>,
	David Bremner <david@tethera.net>,
	notmuch@notmuchmail.org
Subject: Re: [PATCH v2 0/4] Add refresh all buffers functionality
Date: Sun, 25 Sep 2016 07:20:12 +0100	[thread overview]
Message-ID: <87fuoowler.fsf@qmul.ac.uk> (raw)
In-Reply-To: <87bmzcde3q.fsf@adiPC.i-did-not-set--mail-host-address--so-tickle-me>


On Sun, 25 Sep 2016, Ioan-Adrian Ratiu <adi@adirat.com> wrote:
> On Sat, 24 Sep 2016, David Bremner <david@tethera.net> wrote:
>> Ioan-Adrian Ratiu <adi@adirat.com> writes:
>>
>>> On Sat, 24 Sep 2016, Ioan-Adrian Ratiu <adi@adirat.com> wrote:
>>>> Argh, so right after I posted this I found a bug: for every new window
>>>> in which you open the same notmuch-show buffer it creates a new buffer.
>>>>
>>>> For example if from notmuch-search you open a thread "hello" in multiple
>>>> windows, each window will show a different "hello<1>" "hello<2>" etc
>>>> buffer instead of showing a single "hello" buffer for all windows.
>>>
>>> This is really weird. I'm experiencing this bug even without my patches
>>> so it's not a fault in my code. I've tried with both emacs 25.1 and the
>>> latest emacs git rev, does anyone else experience this behaviour?
>>>
>>> Am I missing something, is this an expected behaviour and not a bug?
>>
>> I don't (yet) have an opinion on whether this is a bug, but I can
>> confirm the behaviour exists, e.g. using devel/try-emacs-mua -Q in emacs 24.5.1
>
> It's caused by the generate-new-buffer-name call in notmuch-show(), it's
> been there since cca 2010 by 9bee20aed (notmuch.el: Make notmuch-show
> buffer name first subject...)
>
> I don't quite understand why generate-new-buffer-name is called at all
> there. What's wrong with the existing buffer names and why do we want
> to create others? :)

Hi

I think this behaviour is expected in the sense that this is what the
code has always done. It could be that the current behaviour made more
sense before dme's commit 30f1c43e which made q only kill the current
buffer if it was the only copy.

If I understand this code correctly the buffer gets the name the subject
of the thread. Obviously we can't reuse (i.e. overwrite/kill) a buffer
just because it has the same subject as the new thread so some
care would be needed.

Plausibly we could reuse the existing buffer it was for the same
thread. However, there are some things to consider before doing this
since a notmuch-show buffer does have a fair amount of internal state,
some of which could be lost if it is refreshed, and some of which could
linger into the new buffer and be confusing.

For example:

1) tags deleted or added since the last refresh are shown in the show
buffer (red strikethough, green underline by default) and these visual
cues would be lost (the tag changes have already happened so that is
fine)

2) Which messages are collapsed or expanded. Notmuch normally attempts
to keep this the same when the buffer is refreshed (see
notmuch-show-capture-state and notmuch-show-apply-state). Keeping the
old state would be confusing as some matching messages might not be
expanded, but removing the old state could lose information.

I am definitely not saying that we don't want to change to just allowing
one show buffer for a particular search -- indeed the above two are
probably pretty trivial -- but I think they, and other similar
things, should be thought about first.

Best wishes

Mark

  reply	other threads:[~2016-09-25  6:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-24 20:07 [PATCH v2 0/4] Add refresh all buffers functionality Ioan-Adrian Ratiu
2016-09-24 20:07 ` [PATCH v2 1/4] emacs: reuse buffer when refreshing searches Ioan-Adrian Ratiu
2016-09-25 10:17   ` Mark Walters
2016-09-24 20:07 ` [PATCH v2 2/4] emacs: notmuch-show: refresh all windows showing a buffer Ioan-Adrian Ratiu
2016-09-25 10:14   ` Mark Walters
2016-09-25 12:28     ` Ioan-Adrian Ratiu
2016-09-24 20:07 ` [PATCH v2 3/4] emacs: add refresh buffer optional no-display arg Ioan-Adrian Ratiu
2016-09-25 11:07   ` Mark Walters
2016-10-06 12:25     ` Ioan-Adrian Ratiu
2016-09-24 20:07 ` [PATCH v2 4/4] emacs: notmuch-lib: add refresh all buffers function Ioan-Adrian Ratiu
2016-09-25 11:11   ` Mark Walters
2016-09-24 20:23 ` [PATCH v2 0/4] Add refresh all buffers functionality Ioan-Adrian Ratiu
2016-09-24 21:02   ` Ioan-Adrian Ratiu
2016-09-25  0:09     ` David Bremner
2016-09-25  0:20       ` Ioan-Adrian Ratiu
2016-09-25  6:20         ` Mark Walters [this message]
2016-09-25  7:32           ` Tomi Ollila
2016-10-06 13:59             ` Daniel Kahn Gillmor
2016-10-06 14:32               ` Tomi Ollila
2016-10-06 15:00               ` Ioan-Adrian Ratiu

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://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fuoowler.fsf@qmul.ac.uk \
    --to=markwalters1009@gmail.com \
    --cc=adi@adirat.com \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.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://yhetil.org/notmuch.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).