]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch.el
emacs: Tweak search-buffer naming to search list in reverse order
[notmuch] / emacs / notmuch.el
index ba9bbdad7814407e1baf41c1d0b3d77c736fc522..488458af98bf516cd55a712ca45567caa49a11e7 100644 (file)
@@ -663,9 +663,9 @@ characters as well as `_.+-'.
 (defun notmuch-search-buffer-title (query)
   "Returns the title for a buffer with notmuch search results."
   (let* ((saved-search (rassoc-if (lambda (key)
-                                   (string-match (concat "^" (regexp-quote key) "$")
+                                   (string-match (concat "^" (regexp-quote key))
                                                  query))
-                                 (notmuch-saved-searches)))
+                                 (reverse (notmuch-saved-searches))))
         (saved-search-name (car saved-search))
         (saved-search-query (cdr saved-search)))
     (cond ((and saved-search (equal saved-search-query query))