X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch.el;h=b32230e03672cd5bb6283e0469bf425d40f9861f;hp=9ff376786c476cd17ea8783fbe8a4e1f58baf3cc;hb=9bee20aed34a9ed035b1a0dc89de89af1c65fd1b;hpb=fbec989fe3272d6eff038369587be076347b96f0 diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 9ff37678..b32230e0 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -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 ()