mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 10:58:10 +01:00
emacs: notmuch-search-refresh-view: reuse buffer
There's no reason to completely kill a buffer while refreshing its search results because the buffer name is constant between refreshes (based on the search query), only its contents may change and notmuch search kills all local variables, so it's safe to reuse. Reusing the same buffer also makes it possible to do things like refreshing a buffer which is not focused or even not shown in any window - this will be used in the next commits to add auto-refresh capabilities to all existing notmuch buffers + a function to call after syncing mail to refresh everything. Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
This commit is contained in:
parent
e37a64da7a
commit
fae3d361f2
1 changed files with 3 additions and 3 deletions
|
@ -991,7 +991,7 @@ the configured default sort order."
|
||||||
(defun notmuch-search-refresh-view ()
|
(defun notmuch-search-refresh-view ()
|
||||||
"Refresh the current view.
|
"Refresh the current view.
|
||||||
|
|
||||||
Kills the current buffer and runs a new search with the same
|
Erases the current buffer and runs a new search with the same
|
||||||
query string as the current search. If the current thread is in
|
query string as the current search. If the current thread is in
|
||||||
the new search results, then point will be placed on the same
|
the new search results, then point will be placed on the same
|
||||||
thread. Otherwise, point will be moved to attempt to be in the
|
thread. Otherwise, point will be moved to attempt to be in the
|
||||||
|
@ -1001,8 +1001,8 @@ same relative position within the new buffer."
|
||||||
(oldest-first notmuch-search-oldest-first)
|
(oldest-first notmuch-search-oldest-first)
|
||||||
(target-thread (notmuch-search-find-thread-id 'bare))
|
(target-thread (notmuch-search-find-thread-id 'bare))
|
||||||
(query notmuch-search-query-string))
|
(query notmuch-search-query-string))
|
||||||
(notmuch-bury-or-kill-this-buffer)
|
;; notmuch-search erases the current buffer.
|
||||||
(notmuch-search query oldest-first target-thread target-line)
|
(notmuch-search query oldest-first target-thread target-line t)
|
||||||
(goto-char (point-min))))
|
(goto-char (point-min))))
|
||||||
|
|
||||||
(defun notmuch-search-toggle-order ()
|
(defun notmuch-search-toggle-order ()
|
||||||
|
|
Loading…
Reference in a new issue