Re: [PATCH v2] emacs: tree: support fold/unfold thread or sub-thread

Subject: Re: [PATCH v2] emacs: tree: support fold/unfold thread or sub-thread

Date: Fri, 03 May 2019 14:43:51 -0300

To: Julien Masson,


From: David Bremner

Julien Masson <> writes:
> +(defcustom notmuch-tree-overlay-string " [...]"
> +  "String displayed at the beginning of the overlay"
> +  :type 'string
> +  :group 'notmuch-tree)

I initially thought this wasn't working because the end of my line was
outside the visible window in Emacs. I'm not sure if this is fixable
with a sensible amount of effort.

I think the docstring needs more context in order to be helpful to

> @@ -294,6 +309,7 @@ FUNC."
>      (define-key map " " 'notmuch-tree-scroll-or-next)
>      (define-key map (kbd "DEL") 'notmuch-tree-scroll-message-window-back)
>      (define-key map "e" 'notmuch-tree-resume-message)
> +    (define-key map "t" 'notmuch-tree-toggle-folding-thread)
>      map))

What do people think about the choice of 't'? It does something pretty
different in notmuch-show-mode

> +(defun notmuch-tree-clean-up-overlays ()
> +  "Remove overlays not referenced to any buffer"
> +  (setq notmuch-tree-overlays (cl-remove-if #'overlay-buffer notmuch-tree-overlays)))

This probably my confusion, but doesn't that remove all of the
non-deleted buffers?

> +(defun notmuch-tree-toggle-folding-thread (&optional arg)
> +  "Fold / Unfold the current thread or sub-thread.
> +
> +With prefix arg (C-u) the whole thread is folded"

Since this is the main entry point, I wonder if you should mention the
behaviour with notmuch-tree-overlay-string here.

In general we'd like at least one or two two tests for a new
feature. Maybe Mark or (other) David in copy can give some suggestions
for that.

notmuch mailing list