]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch.el
notmuch.el: Make notmuch-show buffer name first subject, instead of thread-id (supers...
[notmuch] / emacs / notmuch.el
index 9ff376786c476cd17ea8783fbe8a4e1f58baf3cc..b32230e03672cd5bb6283e0469bf425d40f9861f 100644 (file)
@@ -411,9 +411,19 @@ Complete list of currently available key bindings:
 (defun notmuch-search-show-thread ()
   "Display the currently selected thread."
   (interactive)
-  (let ((thread-id (notmuch-search-find-thread-id)))
+  (let ((thread-id (notmuch-search-find-thread-id))
+       (subject (notmuch-search-find-subject))
+       buffer-name)
+    (when (string-match "^[ \t]*$" subject)
+      (setq subject "[No Subject]"))
+    (setq buffer-name (concat "*"
+                             (truncate-string-to-width subject 32 nil nil t)
+                             "*"))
     (if (> (length thread-id) 0)
-       (notmuch-show thread-id (current-buffer) notmuch-search-query-string)
+       (notmuch-show thread-id
+                     (current-buffer)
+                     notmuch-search-query-string
+                     buffer-name)
       (error "End of search results"))))
 
 (defun notmuch-search-reply-to-thread ()