14af0d28c862531ccab4af6c0d5fa2120dd4369f
This was merged in as part of pull request #718 but changed to a more
general facility in 7716e00.
It's fantastic that we have the more general hook facility for any
search, but the primary use-case I had for the bookmark hook can't be
satisfied by the more general mu4e-headers-search-pre-hook.
The reason I added this hook was to emulate the folders I used in
Icedove as mu4e bookmarks. E.g. some folders are threaded, others are
not. By default mu4e only allows you to set this globally via options
like mu4e-headers-show-threads.
So I have a mu4e-headers-search-bookmark-hook which is basically a long
line of cond statements like:
((string-equal expr "NOT flag:trashed AND date:365d..now AND (flag:flagged)")
(setq mu4e-headers-show-threads nil)
(setq mu4e-headers-include-related nil)
(setq mu4e-headers-skip-duplicates t)
(setq mu4e-headers-results-limit 500))
For this to work properly it's critical that the hook doesn't execute on
any search, but *only* those where we enter it via the bookmark.
As an example, I have a "b+" search which finds messages I've flagged,
most of my searches have related & threading turned on, but for that
search I only want to show the specific messages I've flagged, so the
hook turns both of those settings off before executing the search.
But I might still want to change my mind and look at the related
messages as threads by pressing P and then W. This works with the
mu4e-headers-search-bookmark-hook because it only executes when we get
the search via a bookmark.
But it doesn't work with the mu4e-headers-search-pre-hook because when I
toggle the setting my settings hook (which matches the search executed
by the bookmark) will just turn it back off again.
Perhaps there's some clever way to know if we're getting to the
mu4e-headers-search-pre-hook via the bookmark that I've missed. But if
there isn't I need a hook that works like this.
README
======
Welcome to mu!
---------------
Given the enormous amounts of e-mail many people gather and the importance of
e-mail message in our work-flows, it's essential to quickly deal with all that
mail - in particular, to instantly find that one important e-mail you need right
now.
[mu] is a tool for dealing with e-mail messages stored in the
Maildir-format. =mu='s purpose in life is to help you to quickly find the
messages you need; in addition, it allows you to view messages, extract
attachments, create new maildirs, and so on. See the [mu cheatsheet] for some
examples. =mu= is fully documented.
After indexing your messages into a [Xapian]-database, you can search them using
a custom query language. You can use various message fields or words in the
body text to find the right messages.
Built on top of the mu, are some extensions (included in this package):
- mu-for-emacs ([mu4e]): a full-featured e-mail client that runs inside emacs
- [mu-guile]: bindings for the Guile/Scheme programming language (version 2.0
and later)
- a toy GTK+-interface called 'mug' (in the 'toys/' subdir)
=mu= is written in C and a bit of C++ (to interface with Xapian), with =mu4e=
written in [Emacs-Lisp] and =mu-guile= in a mix of C and Scheme.
Note, =mu= is available in Debian/Ubuntu under the name =maildir-utils=;
apparently because they don't like short name. It's also possible to confuse
that name with the [GNU Mailutils] project (which is totally unrelated) - but
now you have been warned.
[mu]: http://www.djcbsoftware.nl/code/mu
[mu cheatsheet]: http://www.djcbsoftware.nl/code/mu/cheatsheet.html
[Xapian]: http://www.xapian.org
[mu4e]: http://www.djcbsoftware.nl/code/mu/mu4e.html
[mu-guile]: http://www.djcbsoftware.nl/code/mu/mu-guile.html
[Emacs-Lisp]: http://en.wikipedia.org/wiki/Emacs-Lisp
[GNU Mailutils]: http://mailutils.org/
Description
Languages
C++
61.5%
Emacs Lisp
29.1%
Scheme
5%
Meson
3.1%
Shell
0.3%
Other
1%