]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch.el
Merge branch '0.3.x' immediately after the 0.3.1 release
[notmuch] / emacs / notmuch.el
index ba9bbdad7814407e1baf41c1d0b3d77c736fc522..57e11400a526cf4b81433430d1ce0f65245f989d 100644 (file)
@@ -56,6 +56,7 @@
 (require 'notmuch-mua)
 (require 'notmuch-hello)
 (require 'notmuch-maildir-fcc)
+(require 'notmuch-message)
 
 (defcustom notmuch-search-result-format
   `(("date" . "%s ")
@@ -663,9 +664,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))