unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: Simon Castellan <simon_notmuch@phis.me>, notmuch@notmuchmail.org
Subject: Re: [BUG] [notmuch-tree] Display problems when database is locked
Date: Wed, 21 Sep 2016 09:19:35 +0100	[thread overview]
Message-ID: <87y42l4qco.fsf@qmul.ac.uk> (raw)
In-Reply-To: <874mev4nnk.fsf@goyave.phis.me>


Hi

On Sat, 02 Jan 2016, Simon Castellan <simon_notmuch@phis.me> wrote:
> Hi,
>
> I'm using notmuch-tree and I encountered a slightly annoying bug. When
> browsing through a notmuch-tree buffer, if I open up a message whose
> tags needs to be changed (eg. the message needs to be marked read), then
> on the /next/ message, the bottom part of the pane does not get killed
> and thus, the top part (which is tiny) of the pane gets split again.

Sorry I overlooked this originally. I think this is fixed in latest
master (by commit dd5cd6964fe074c79c1850abb82d805bca35a5c5 ). I don't
think the fix has made it into any release yet but 0.23 will be released
fairly soon. If you can reproduce it on current master please let me
know.

Many thanks for the bug-report and sorry again for overlooking it
before.

Best wishes

Mark



>
> How to reproduce [I'm using notmuch-0.21 and emacs 24.4.1 from debian]
> ----------------
>
> 1. Mark some messages to be unread and then run (notmuch-tree
> "is:unread")
>
> 2. Make sure your notmuch database is locked (for that purpose I run a
>    `while true; do notmuch new; done` in a side terminal)
>
> 3. Open the first unread message, then press "n" to go the next one.
>    At this point, the screen should be split in three instead of two.
>
> How to fix it
> -------------
>
> This is due to notmuch-show not returning when the database is locked
> and the message cannot be marked read. This results in the end of
> notmuch-tree-show-message-in not being executed and some variable
> (namely notmuch-tree-message-buffer) having wrong values.
>
> I am not sure what is the best way to fix it, but what I'm using at a
> hack is to wrap around the call to notmuch-show in a
> `with-demoted-errors` so that the execution can continue in case of
> failure, and close the bottom part in case of a failure. Hence when this
> happens, the bottom part disappears which is better than messing up the
> window configuration. This is what it looks like:
>
>     (defun notmuch-tree-show-message-in ()
>       "Show the current message (in split-pane)."
>       (interactive)
>       (let ((id (notmuch-tree-get-message-id))
>     	(inhibit-read-only t)
>     	buffer)
>         (when id
>           ;; We close and reopen the window to kill off un-needed buffers
>           ;; this might cause flickering but seems ok.
>           (notmuch-tree-close-message-window)
>           (setq notmuch-tree-message-window
>     	    (split-window-vertically (/ (window-height) 4)))
>           (with-selected-window notmuch-tree-message-window
>     	;; Since we are only displaying one message do not indent.
>     	(let ((notmuch-show-indent-messages-width 0)
>     	      (notmuch-show-only-matching-messages t))
>     	  (setq buffer (with-demoted-errors (notmuch-show id)))))
>           (unless buffer
>             (delete-window notmuch-tree-message-window))
>           (when buffer
>             ;; We need the `let' as notmuch-tree-message-window is buffer local.
>             (let ((window notmuch-tree-message-window))
>               (with-current-buffer buffer
>                 (setq notmuch-tree-message-window window)
>                 (add-hook 'kill-buffer-hook 'notmuch-tree-message-window-kill-hook)))
>             (setq notmuch-tree-message-buffer buffer)
>             (when notmuch-show-mark-read-tags
>               (notmuch-tree-tag-update-display notmuch-show-mark-read-tags))
>             ))))
>     
>
> Cheers,
>
> Simon.
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

      reply	other threads:[~2016-09-21  8:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-02 22:33 [BUG] [notmuch-tree] Display problems when database is locked Simon Castellan
2016-09-21  8:19 ` Mark Walters [this message]

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=87y42l4qco.fsf@qmul.ac.uk \
    --to=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=simon_notmuch@phis.me \
    /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).