]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-tree.el
emacs: customizable names for search buffers
[notmuch] / emacs / notmuch-tree.el
index d74869040f54b9abecc3323037b14db6a6aabfc1..303c6fadcdb2da81cc0189bfe062d8b77b6bd753 100644 (file)
@@ -1191,11 +1191,11 @@ The arguments are:
     (setq query (notmuch-read-query (concat "Notmuch "
                                            (if unthreaded "unthreaded " "tree ")
                                            "view search: "))))
-  (let ((buffer (get-buffer-create (generate-new-buffer-name
-                                   (or buffer-name
-                                       (concat "*notmuch-"
-                                               (if unthreaded "unthreaded-" "tree-")
-                                               query "*")))))
+  (let* ((name
+         (or buffer-name
+             (notmuch-search-buffer-title query
+                                          (if unthreaded "unthreaded" "tree"))))
+        (buffer (get-buffer-create (generate-new-buffer-name name)))
        (inhibit-read-only t))
     (pop-to-buffer-same-window buffer))
   ;; Don't track undo information for this buffer