mu/mu4e
Ævar Arnfjörð Bjarmason 14af0d28c8 mu4e-headers: Add hook executed when we're opening bookmarks (again)
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.
2016-02-18 21:37:21 +01:00
..
Makefile.am mu4e: update copyright years 2016-01-09 21:28:03 +02:00
TODO * rename emacs/ => mu4e/ 2012-07-10 20:00:06 +03:00
fdl.texi * fix guile / mu4e doc building 2012-10-20 15:49:53 +03:00
mu4e-about.org Update mu4e-about.org 2016-02-09 13:09:07 +00:00
mu4e-actions.el mu4e: explicitly specify utf8 for html-view actions 2016-02-02 20:21:37 +02:00
mu4e-compose.el mu4e: implement resending 2016-02-16 08:29:06 +02:00
mu4e-context.el mu4e: also quote the context label in the modeline 2016-02-16 08:28:59 +02:00
mu4e-contrib.el mu4e: default to mu4e-shr2text when available 2016-02-07 14:33:24 +02:00
mu4e-draft.el mu4e: implement resending 2016-02-16 08:29:06 +02:00
mu4e-headers.el mu4e-headers: Add hook executed when we're opening bookmarks (again) 2016-02-18 21:37:21 +01:00
mu4e-lists.el mu4e: update copyright years 2016-01-09 21:28:03 +02:00
mu4e-main.el mu4e: update copyright years 2016-01-09 21:28:03 +02:00
mu4e-mark.el mu4e: Add mu4e-mark-execute-pre-hook 2016-02-02 20:28:49 +02:00
mu4e-message.el mu4e: default to mu4e-shr2text when available 2016-02-07 14:33:24 +02:00
mu4e-meta.el.in mu4e: add NEWS(.org) as a main menu item 2015-06-09 21:08:02 +03:00
mu4e-proc.el mu4e: implement resending 2016-02-16 08:29:06 +02:00
mu4e-speedbar.el mu4e: update copyright years 2016-01-09 21:28:03 +02:00
mu4e-utils.el mu4e: by default, don't ignore any address 2016-02-18 19:28:21 +02:00
mu4e-vars.el mu4e: use To rather than T as shortname 2016-02-14 17:06:03 +02:00
mu4e-view.el mu4e: resend: add to view/headers menu 2016-02-16 08:29:06 +02:00
mu4e.el Merge pull request #765 from declanqian/emacs-lib-conv 2016-01-12 20:55:16 +02:00
mu4e.texi mu4e: add mu4e-headers-search-pre-hook 2016-02-18 20:59:02 +02:00
org-mu4e.el mu4e: update copyright years 2016-01-09 21:28:03 +02:00
org-old-mu4e.el mu4e: update copyright years 2016-01-09 21:28:03 +02:00
texi.texi.in * fix guile / mu4e doc building 2012-10-20 15:49:53 +03:00