]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch.el
Revert "emacs: notmuch-search: avoid wiping out buffer-local variables"
[notmuch] / emacs / notmuch.el
index babddbb6fef87652ed7204fb4dc65351d12f72b1..132e7724d3fabe61f50f3338bd0e7f8111441d54 100644 (file)
@@ -194,7 +194,6 @@ there will be called at other points of notmuch execution."
     (define-key map "U" 'notmuch-unthreaded-from-search-current-query)
     map)
   "Keymap for \"notmuch search\" buffers.")
     (define-key map "U" 'notmuch-unthreaded-from-search-current-query)
     map)
   "Keymap for \"notmuch search\" buffers.")
-(fset 'notmuch-search-mode-map notmuch-search-mode-map)
 
 (defvar notmuch-search-stash-map
   (let ((map (make-sparse-keymap)))
 
 (defvar notmuch-search-stash-map
   (let ((map (make-sparse-keymap)))
@@ -275,10 +274,10 @@ there will be called at other points of notmuch execution."
 (defface notmuch-message-summary-face
   `((((class color) (background light))
      ,@(and (>= emacs-major-version 27) '(:extend t))
 (defface notmuch-message-summary-face
   `((((class color) (background light))
      ,@(and (>= emacs-major-version 27) '(:extend t))
-     (:background "#f0f0f0"))
+     :background "#f0f0f0")
     (((class color) (background dark))
      ,@(and (>= emacs-major-version 27) '(:extend t))
     (((class color) (background dark))
      ,@(and (>= emacs-major-version 27) '(:extend t))
-     (:background "#303030")))
+     :background "#303030"))
   "Face for the single-line message summary in notmuch-show-mode."
   :group 'notmuch-show
   :group 'notmuch-faces)
   "Face for the single-line message summary in notmuch-show-mode."
   :group 'notmuch-show
   :group 'notmuch-faces)
@@ -343,7 +342,7 @@ there will be called at other points of notmuch execution."
   "Face used in search mode face for flagged threads.
 
 This face is the default value for the \"flagged\" tag in
   "Face used in search mode face for flagged threads.
 
 This face is the default value for the \"flagged\" tag in
-`notmuch-search-line-faces`."
+`notmuch-search-line-faces'."
   :group 'notmuch-search
   :group 'notmuch-faces)
 
   :group 'notmuch-search
   :group 'notmuch-faces)
 
@@ -353,7 +352,7 @@ This face is the default value for the \"flagged\" tag in
   "Face used in search mode for unread threads.
 
 This face is the default value for the \"unread\" tag in
   "Face used in search mode for unread threads.
 
 This face is the default value for the \"unread\" tag in
-`notmuch-search-line-faces`."
+`notmuch-search-line-faces'."
   :group 'notmuch-search
   :group 'notmuch-faces)
 
   :group 'notmuch-search
   :group 'notmuch-faces)
 
@@ -392,7 +391,7 @@ Complete list of currently available key bindings:
   (make-local-variable 'notmuch-search-target-thread)
   (make-local-variable 'notmuch-search-target-line)
   (setq notmuch-buffer-refresh-function #'notmuch-search-refresh-view)
   (make-local-variable 'notmuch-search-target-thread)
   (make-local-variable 'notmuch-search-target-line)
   (setq notmuch-buffer-refresh-function #'notmuch-search-refresh-view)
-  (set (make-local-variable 'scroll-preserve-screen-position) t)
+  (setq-local scroll-preserve-screen-position t)
   (add-to-invisibility-spec (cons 'ellipsis t))
   (setq truncate-lines t)
   (setq buffer-read-only t)
   (add-to-invisibility-spec (cons 'ellipsis t))
   (setq truncate-lines t)
   (setq buffer-read-only t)
@@ -545,7 +544,7 @@ thread."
                notmuch-search-query-string
                nil
                (notmuch-prettify-subject (notmuch-search-find-subject))
                notmuch-search-query-string
                nil
                (notmuch-prettify-subject (notmuch-search-find-subject))
-               t))
+               t nil (current-buffer)))
 
 (defun notmuch-search-reply-to-thread (&optional prompt-for-sender)
   "Begin composing a reply-all to the entire current thread in a new buffer."
 
 (defun notmuch-search-reply-to-thread (&optional prompt-for-sender)
   "Begin composing a reply-all to the entire current thread in a new buffer."
@@ -994,12 +993,8 @@ the configured default sort order."
         (buffer (get-buffer-create (notmuch-search-buffer-title query))))
     (if no-display
        (set-buffer buffer)
         (buffer (get-buffer-create (notmuch-search-buffer-title query))))
     (if no-display
        (set-buffer buffer)
-      (switch-to-buffer buffer))
-    ;; 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))
+      (pop-to-buffer-same-window buffer))
+    (notmuch-search-mode)
     ;; Don't track undo information for this buffer
     (set 'buffer-undo-list t)
     (set 'notmuch-search-query-string query)
     ;; Don't track undo information for this buffer
     (set 'buffer-undo-list t)
     (set 'notmuch-search-query-string query)
@@ -1134,7 +1129,7 @@ notmuch buffers exist, run `notmuch'."
        ;; If the first one we found is any other than the starting
        ;; buffer, switch to it.
        (unless (eq first start)
        ;; If the first one we found is any other than the starting
        ;; buffer, switch to it.
        (unless (eq first start)
-         (switch-to-buffer first))
+         (pop-to-buffer-same-window first))
       (notmuch))))
 
 ;;;; Imenu Support
       (notmuch))))
 
 ;;;; Imenu Support