Skip to content

commands/search: Add option --all-folded to select#1618

Merged
lucc merged 1 commit intopazz:masterfrom
guludo:nx/select-all-folded
Jan 2, 2024
Merged

commands/search: Add option --all-folded to select#1618
lucc merged 1 commit intopazz:masterfrom
guludo:nx/select-all-folded

Conversation

@guludo
Copy link
Contributor

@guludo guludo commented Apr 18, 2023

Allow users who prefer to have all messages collapsed by default to have that behavior. For example, with this change, a user can change her default binding of "enter" to execute "select --all-folded".

Allow users who prefer to have all messages collapsed by default to have
that behavior. For example, with this change, a user can change her
default binding of "enter" to execute "select --all-folded".
@guludo
Copy link
Contributor Author

guludo commented Apr 18, 2023

Personal note: I prefer to have all messages in the thread closed and just open those I'm interested in. With this change, I have the binding enter = select --all-folded to get the behavior I want.

@lucc
Copy link
Collaborator

lucc commented Apr 18, 2023

Why not just

[bindings]
[[search]]
enter = select; fold *

I even had this in my config for a while

enter = select; fold *; unfold tag:unread; move last; unfold

@guludo
Copy link
Contributor Author

guludo commented Apr 19, 2023

Hm... I just tried enter = select; fold * but I end up with some messages unfolded.

@guludo
Copy link
Contributor Author

guludo commented Jan 2, 2024

Ping. Is this PR still under consideration or should I give it up? :-)

Copy link
Collaborator

@lucc lucc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks very simple and I quickly tested it on some thread with several messages.

As noted by @guludo my suggested a alternative of select; fold * seems to invert the folding of all messages in the thread so it folds all messages that match the search query but unfolds all others. Only select; fold *; fold * seems to fold all messages.

But as these workarounds are quite slow and work unreliable I would accept this PR. @pazz what do you think?

@pazz
Copy link
Owner

pazz commented Jan 2, 2024 via email

@lucc lucc merged commit 0ba39cc into pazz:master Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants