]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: notmuch-search: avoid wiping out buffer-local variables
authorSean Whitton <spwhitton@spwhitton.name>
Wed, 22 Jul 2020 15:11:32 +0000 (08:11 -0700)
committerDavid Bremner <david@tethera.net>
Wed, 22 Jul 2020 22:48:24 +0000 (19:48 -0300)
emacs/notmuch.el

index dd18f2e13666bca5ad50d796586296209691cb08..c97997fef9c48cbee650edbf86b9f6d582d1892f 100644 (file)
@@ -987,7 +987,11 @@ the configured default sort order."
     (if no-display
        (set-buffer buffer)
       (switch-to-buffer buffer))
-    (notmuch-search-mode)
+    ;; avoid wiping out third party buffer-local variables in the case
+    ;; where we're just refreshing or changing the sort order of an
+    ;; existing search results buffer
+    (unless (eq major-mode 'notmuch-search-mode)
+      (notmuch-search-mode))
     ;; Don't track undo information for this buffer
     (set 'buffer-undo-list t)
     (set 'notmuch-search-query-string query)