X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch.el;h=bba4ca036662b72240012e527e4cefeffd399241;hb=778950872d699fc0b49c14ee2a2276a0e9a8abe5;hp=4fc338e2a3358a718a4b427962b371d615380676;hpb=e1a700067a22214f54064c281219fbbbef87de06;p=notmuch
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 4fc338e2..bba4ca03 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -18,7 +18,7 @@
;; along with Notmuch. If not, see .
;;
;; Authors: Carl Worth
-;; Homepage: https://notmuchmail.org/
+;; Homepage: https://notmuchmail.org
;;; Commentary:
@@ -62,7 +62,7 @@
;;
;; TL;DR: notmuch-emacs from MELPA and notmuch from distro packages is
;; NOT SUPPORTED.
-;;
+
;;; Code:
(eval-when-compile (require 'cl-lib))
@@ -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.")
-(fset 'notmuch-search-mode-map notmuch-search-mode-map)
(defvar notmuch-search-stash-map
(let ((map (make-sparse-keymap)))
@@ -273,8 +272,12 @@ there will be called at other points of notmuch execution."
(goto-char (point-min)))
(defface notmuch-message-summary-face
- '((((class color) (background light)) (:background "#f0f0f0"))
- (((class color) (background dark)) (:background "#303030")))
+ `((((class color) (background light))
+ ,@(and (>= emacs-major-version 27) '(:extend t))
+ :background "#f0f0f0")
+ (((class color) (background dark))
+ ,@(and (>= emacs-major-version 27) '(:extend t))
+ :background "#303030"))
"Face for the single-line message summary in notmuch-show-mode."
:group 'notmuch-show
:group 'notmuch-faces)
@@ -339,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
-`notmuch-search-line-faces`."
+`notmuch-search-line-faces'."
:group 'notmuch-search
:group 'notmuch-faces)
@@ -349,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
-`notmuch-search-line-faces`."
+`notmuch-search-line-faces'."
:group 'notmuch-search
:group 'notmuch-faces)
@@ -388,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)
- (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)
@@ -428,11 +431,10 @@ returns nil."
(defun notmuch-search-foreach-result (beg end fn)
"Invoke FN for each result between BEG and END.
-FN should take one argument. It will be applied to the
-character position of the beginning of each result that overlaps
-the region between points BEG and END. As a special case, if (=
-BEG END), FN will be applied to the result containing point
-BEG."
+FN should take one argument. It will be applied to the character
+position of the beginning of each result that overlaps the region
+between points BEG and END. As a special case, if (= BEG END),
+FN will be applied to the result containing point BEG."
(let ((pos (notmuch-search-result-beginning beg))
;; End must be a marker in case fn changes the
;; text.
@@ -542,7 +544,7 @@ thread."
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."
@@ -691,7 +693,7 @@ of the result."
(throw 'return nil))
(when (and atbob
(not (string= notmuch-search-target-thread "found")))
- (set 'never-found-target-thread t)))))
+ (setq never-found-target-thread t)))))
(when (and never-found-target-thread
notmuch-search-target-line)
(goto-char (point-min))
@@ -991,18 +993,14 @@ the configured default sort order."
(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)
- (set 'notmuch-search-oldest-first oldest-first)
- (set 'notmuch-search-target-thread target-thread)
- (set 'notmuch-search-target-line target-line)
+ (setq buffer-undo-list t)
+ (setq notmuch-search-query-string query)
+ (setq notmuch-search-oldest-first oldest-first)
+ (setq notmuch-search-target-thread target-thread)
+ (setq notmuch-search-target-line target-line)
(notmuch-tag-clear-cache)
(let ((proc (get-buffer-process (current-buffer)))
(inhibit-read-only t))
@@ -1050,7 +1048,7 @@ same relative position within the new buffer."
This command toggles the sort order for the current search. The
default sort order is defined by `notmuch-search-oldest-first'."
(interactive)
- (set 'notmuch-search-oldest-first (not notmuch-search-oldest-first))
+ (setq notmuch-search-oldest-first (not notmuch-search-oldest-first))
(notmuch-search-refresh-view))
(defun notmuch-group-disjunctive-query-string (query-string)
@@ -1131,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)
- (switch-to-buffer first))
+ (pop-to-buffer-same-window first))
(notmuch))))
;;;; Imenu Support