From: Carl Worth Date: Tue, 27 Apr 2010 05:49:45 +0000 (-0700) Subject: emacs: Match entire saved-search when computing search-view buffer name X-Git-Tag: 0.3~15 X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=f2ebe3ac446afda9ced6507dc391865464ccdcaa;p=notmuch emacs: Match entire saved-search when computing search-view buffer name I happen to have a lot of saved searches that are variants of the tag:inbox search, (such as "tag:inbox and tag:notmuch"). The logic for these was always matching inbox first, resulting in "[ inbox ] and tag:notmuch" rather than "notmuch" as desired. Anchor the regular expression on both ends to make it look harder for the better match. --- diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 9b2b5924..27e3a409 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -663,7 +663,7 @@ characters as well as `_.+-'. (defun notmuch-search-buffer-title (query) "Returns the title for a buffer with notmuch search results." (let* ((folder (rassoc-if (lambda (key) - (string-match (concat "^" (regexp-quote key)) + (string-match (concat "^" (regexp-quote key) "$") query)) (notmuch-saved-searches))) (folder-name (car folder))