diff --git a/NEWS.org b/NEWS.org index 7d6060ff..d663f630 100644 --- a/NEWS.org +++ b/NEWS.org @@ -64,8 +64,9 @@ - also, there are now actions ('a' in view/header) to get to online archives for some (selected) mailing-list archives. - - In the main-view, by default ~q~ is now bound to ~mu4e-main-quit-or-bury~, - which calls either ~mu4e-quit~ or, with prefix argument, ~bury-buffer~. + - ~mu4e-quit~ now takes a prefix argument which, if provided, causes it to + bury he mu main buffer, rather than quitting mu. ~mu4e~ will now just switch + the mu4e buffer if it exists (otherwise it starts ~mu4e~). - ~mu4e~ benefits from the mentioned speed-ups in querying, and adds some of its own - e.g., for showing 500 messages (debug build), we went from 642ms diff --git a/mu4e/mu4e-main.el b/mu4e/mu4e-main.el index ab1f1d86..3bc06524 100644 --- a/mu4e/mu4e-main.el +++ b/mu4e/mu4e-main.el @@ -110,17 +110,10 @@ the personal addresses." (current-time-string baseline-t) "Never")))) -(defun mu4e-main-quit-or-bury (&optional bury) - "Quit mu4e, or, with prefix-argument, bury the buffer." - (interactive "P") - (if bury - (bury-buffer) - (mu4e-quit))) - (defvar mu4e-main-mode-map (let ((map (make-sparse-keymap))) - (define-key map "q" #'mu4e-main-quit-or-bury) + (define-key map "q" #'mu4e-quit) (define-key map "C" #'mu4e-compose-new) (define-key map "m" #'mu4e--main-toggle-mail-sending-mode) @@ -335,7 +328,7 @@ Otherwise, do nothing." (mu4e--main-action "\t* [@]News\n" #'mu4e-news nil "N") (mu4e--main-action "\t* [@]About mu4e\n" #'mu4e-about nil "A") (mu4e--main-action "\t* [@]Help\n" #'mu4e-display-manual nil "H") - (mu4e--main-action "\t* [@]quit\n" #'mu4e-main-quit-or-bury nil "q") + (mu4e--main-action "\t* [@]quit\n" #'mu4e-quit nil "q") "\n" (propertize " Info\n\n" 'face 'mu4e-title-face) (mu4e--key-val "last updated" diff --git a/mu4e/mu4e.el b/mu4e/mu4e.el index 8ea5692b..7e2c1ce5 100644 --- a/mu4e/mu4e.el +++ b/mu4e/mu4e.el @@ -61,18 +61,26 @@ Then, show the main window, unless BACKGROUND (prefix-argument) is non-nil." (interactive "P") - ;; start mu4e, then show the main view - (mu4e--init-handlers) - (mu4e--start - (unless background #'mu4e--main-view))) + (if (and (not background) (buffer-live-p mu4e-main-buffer-name)) + ;; already running. + (switch-to-buffer mu4e-main-buffer-name) + ;; start mu4e, then show the main view + (mu4e--init-handlers) + (mu4e--start + (unless background #'mu4e--main-view)))) -(defun mu4e-quit() - "Quit the mu4e session." - (interactive) - (if mu4e-confirm-quit - (when (y-or-n-p (mu4e-format "Are you sure you want to quit?")) - (mu4e--stop)) - (mu4e--stop))) +(defun mu4e-quit(&optional bury) + "Quit the mu4e session or bury the buffer. + +If prefix-argument BURY is non-nil, merely bury the buffer. +Otherwise, completely quit mu4e, including automatic updating." + (interactive "P") + (if bury + (bury-buffer) + (if mu4e-confirm-quit + (when (y-or-n-p (mu4e-format "Are you sure you want to quit?")) + (mu4e--stop)) + (mu4e--stop)))) ;;; Internals diff --git a/mu4e/mu4e.texi b/mu4e/mu4e.texi index e654945c..0a5ae0b5 100644 --- a/mu4e/mu4e.texi +++ b/mu4e/mu4e.texi @@ -858,16 +858,17 @@ visible only if you have actually set up mail-queuing. @ref{Queuing mail} @item @t{[A]bout mu4e} provides general information about the program @item @t{[H]elp} shows help information for this view -@item Finally, @t{[q]uit mu4e} quits your @t{mu4e}-session +@item Finally, @t{[q]uit mu4e} quits your @t{mu4e}-session@footnote{@t{mu4e-quit}; or with a @t{C-u} +prefix argument, it merely buries the buffer} @end itemize @node Headers view @chapter The headers view -The headers view shows the results of a query. The header-line shows -the names of the fields. Below that, there is a line with those -fields, for each matching message, followed by a footer line. The -major-mode for the headers view is @code{mu4e-headers-mode}. +The headers view shows the results of a query. The header-line shows the names +of the fields. Below that, there is a line with those fields, for each matching +message, followed by a footer line. The major-mode for the headers view is +@code{mu4e-headers-mode}. @menu * Overview: HV Overview. What is the Header View