From eb4e0ea2ab4d2515ab9575ee99ad024d03765199 Mon Sep 17 00:00:00 2001 From: Daniel Schoepe Date: Wed, 25 May 2011 23:21:54 +0200 Subject: emacs: Make the queries used in the all-tags section configurable This patch adds a customization variable that controls what queries are used to construct the all-tags section in notmuch-hello. It allows the user to specify a function to construct the query given a tag or a string that is used as a filter for each tag. It also adds a variable to hide various tags from the all-tags section. Signed-off-by: Daniel Schoepe --- emacs/notmuch-lib.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'emacs/notmuch-lib.el') diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index cc80fb2..d5ca0f4 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -120,6 +120,15 @@ within the current window." (or (memq prop buffer-invisibility-spec) (assq prop buffer-invisibility-spec))))) +(defun notmuch-remove-if-not (predicate list) + "Return a copy of LIST with all items not satisfying PREDICATE removed." + (let (out) + (while list + (when (funcall predicate (car list)) + (push (car list) out)) + (setq list (cdr list))) + (nreverse out))) + ; This lets us avoid compiling these replacement functions when emacs ; is sufficiently new enough to supply them alone. We do the macro ; treatment rather than just wrapping our defun calls in a when form -- cgit v1.2.3