unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "Masson\, Julien" <massonju.eseo@gmail.com>
To: Mark Walters <markwalters1009@gmail.com>,
	Julien Masson <massonju.eseo@gmail.com>,
	notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: tree: support fold/unfold thread
Date: Mon, 25 Mar 2019 16:16:55 +0100	[thread overview]
Message-ID: <8636nbrnko.fsf@gmail.com> (raw)
In-Reply-To: <874l7um2te.fsf@qmul.ac.uk>

Hello

Thanks for the reviews, I appreciate.

On Sat 23 Mar 2019 at 08:07, Mark Walters <markwalters1009@gmail.com> wrote:

> Hello
>
>> This patch allow the user to fold/unfold a thread in the current tree
>> buffer by pressing "t" key.
>
> This looks like a really nice feature! I will try and review the code
> properly soon, but have some preliminary comments.
>
>> By default a string is displayed at the beginning of the overlay to
>> indicate that this thread is folded.
>
> I wonder if it would make sense to make the [....] replace the "tree
> symbol" (-> etc)? This would mean that it was always on the screen and the
> tree symbol looks a little odd with a collapsed thread.

The range of the overlay is from the end of the line of the subject to
end of the line of the last message.
So on the screen the string "[...]" is placed at the end of the Subject.

If I change the range from the "tree symbol" the subject will be
invisible.

I chose to placed the overlay like this to make sure I still see the
subject of the folded thread.

But if you prefer I can place the overlay from the "tree symbol" position.

>
> Secondly, I wonder whether making it collapse just the subthread below
> the current message (ie a subtree) would be nice? To me that feels more
> generic, but might be more effort than it's worth as the code would need
> to deal with nested folds. Then C-u t could do exactly the current
> folding (ie the whole thread). But this is just a thought.

yes sure I'll send a v2 which handle sub-thread folding.

>
> Finally a comment on the code
>
>> +The overlay found is located between START and END position in BUFFER."
>> +  (seq-find (lambda (ov)
>
>> +(defun notmuch-tree-clean-up-overlays ()
>> +  "Remove overlays not referenced to any buffer"
>> +  (setq notmuch-tree-overlays (seq-filter #'overlay-buffer notmuch-tree-overlays)))
>
> seq-find and seq-filter are emacs 25+ only I think; at least they don't
> seem to be in emacs24 which I think we still support. Perhaps some cl
> functions can be used (eg remove-if-not) instead?

Ah yes sorry, I'll change this in the v2.

>
> Best wishes
>
> Mark

Thanks


Julien Masson

      reply	other threads:[~2019-03-25 15:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 14:26 [PATCH] emacs: tree: support fold/unfold thread Julien Masson
2019-03-23  8:07 ` Mark Walters
2019-03-25 15:16   ` Masson, Julien [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=8636nbrnko.fsf@gmail.com \
    --to=massonju.eseo@gmail.com \
    --cc=markwalters1009@gmail.com \
    --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).