* mu4e-headers: make refreshing default when changing sort etc.; also turn off
threading when sorting for anything but date
This commit is contained in:
@ -962,9 +962,9 @@ the last search expression."
|
|||||||
(format "(%s) AND %s" mu4e~headers-last-query filter)))
|
(format "(%s) AND %s" mu4e~headers-last-query filter)))
|
||||||
|
|
||||||
|
|
||||||
(defun mu4e-headers-change-sorting (&optional rerun)
|
(defun mu4e-headers-change-sorting (&optional dont-refresh)
|
||||||
"Interactively change the sorting/threading parameters. With prefix-argument,
|
"Interactively change the sorting/threading parameters. With prefix-argument,
|
||||||
rerun the last search with the new parameters."
|
do _not_ refresh the last search with the new parameters."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(let* ((sortfield
|
(let* ((sortfield
|
||||||
(mu4e-read-option "Sortfield: " mu4e~headers-sortfield-choices))
|
(mu4e-read-option "Sortfield: " mu4e~headers-sortfield-choices))
|
||||||
@ -974,34 +974,41 @@ rerun the last search with the new parameters."
|
|||||||
(setq
|
(setq
|
||||||
mu4e-headers-sortfield sortfield
|
mu4e-headers-sortfield sortfield
|
||||||
mu4e-headers-sort-revert revert) ;; "descending" means "revert"
|
mu4e-headers-sort-revert revert) ;; "descending" means "revert"
|
||||||
|
;; turn off threading if we don't sort by date (FIXME)
|
||||||
|
(unless (eq sortfield 'date)
|
||||||
|
(setq mu4e-headers-show-threads nil))
|
||||||
(mu4e-message "Sorting by %s (%s)%s"
|
(mu4e-message "Sorting by %s (%s)%s"
|
||||||
(symbol-name sortfield)
|
(symbol-name sortfield)
|
||||||
(if revert "descending" "ascending")
|
(if revert "descending" "ascending")
|
||||||
(if rerun
|
(if dont-refresh
|
||||||
"" " (press 'g' to refresh)"))
|
" (press 'g' to refresh)" ""))
|
||||||
(when rerun
|
(unless dont-refresh
|
||||||
(mu4e-headers-rerun-search))))
|
(mu4e-headers-rerun-search))))
|
||||||
|
|
||||||
(defun mu4e-headers-toggle-threading (&optional rerun)
|
(defun mu4e-headers-toggle-threading (&optional dont-refresh)
|
||||||
"Toggle threading on/off for the search results. With prefix-argument,
|
"Toggle threading on/off for the search results. With prefix-argument,
|
||||||
rerun the last search with the new setting for threading."
|
do _not_ refresh the last search with the new setting for
|
||||||
|
threading."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(setq mu4e-headers-show-threads (not mu4e-headers-show-threads))
|
(setq mu4e-headers-show-threads (not mu4e-headers-show-threads))
|
||||||
(mu4e-message "Threading turned %s%s"
|
(mu4e-message "Threading turned %s%s"
|
||||||
(if mu4e-headers-show-threads "on" "off")
|
(if mu4e-headers-show-threads "on" "off")
|
||||||
(if rerun "" " (press 'g' to refresh)"))
|
(if dont-refresh
|
||||||
(when rerun
|
" (press 'g' to refresh)" ""))
|
||||||
|
(unless dont-refresh
|
||||||
(mu4e-headers-rerun-search)))
|
(mu4e-headers-rerun-search)))
|
||||||
|
|
||||||
(defun mu4e-headers-toggle-full-search (&optional rerun)
|
(defun mu4e-headers-toggle-full-search (&optional dont-refresh)
|
||||||
"Toggle full-search on/off for the search results. With prefix-argument,
|
"Toggle full-search on/off for the search results. With prefix-argument,
|
||||||
rerun the last search with the new setting for threading."
|
do _not_ refresh the last search with the new setting for
|
||||||
|
threading."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(setq mu4e-headers-full-search (not mu4e-headers-full-search))
|
(setq mu4e-headers-full-search (not mu4e-headers-full-search))
|
||||||
(mu4e-message "Full search turned %s%s"
|
(mu4e-message "Full search turned %s%s"
|
||||||
(if mu4e-headers-full-search "on" "off")
|
(if mu4e-headers-full-search "on" "off")
|
||||||
(if rerun "" " (press 'g' to refresh)"))
|
(if dont-refresh
|
||||||
(when rerun
|
" (press 'g' to refresh)" ""))
|
||||||
|
(unless dont-refresh
|
||||||
(mu4e-headers-rerun-search)))
|
(mu4e-headers-rerun-search)))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -617,8 +617,8 @@ affects the sort order.
|
|||||||
|
|
||||||
You can change the sort order with @t{M-x mu4e-headers-change-sorting} or
|
You can change the sort order with @t{M-x mu4e-headers-change-sorting} or
|
||||||
@key{O}, and you can toggle threading on/off using @t{M-x
|
@key{O}, and you can toggle threading on/off using @t{M-x
|
||||||
mu4e-headers-toggle-threading} or @key{P}. For both of these functions, if you
|
mu4e-headers-toggle-threading} or @key{P}. For both of these functions, unless
|
||||||
provide a prefix argument (@key{C-u}), the current search is updated
|
you provide a prefix argument (@key{C-u}), the current search is updated
|
||||||
immediately using the new parameters. You can toggle full-search
|
immediately using the new parameters. You can toggle full-search
|
||||||
(@ref{Searching}) using @t{M-x mu4e-headers-toggle-full-search} or @key{Q}.
|
(@ref{Searching}) using @t{M-x mu4e-headers-toggle-full-search} or @key{Q}.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user