mirror of https://github.com/djcb/mu.git
mu4e: main: add mu4e-main-quit-or-bury
So instead of quitting, you can do C-u q to merely bury the buffer.
This commit is contained in:
parent
c5f3894374
commit
c3a756a207
4
NEWS.org
4
NEWS.org
|
@ -12,7 +12,7 @@
|
||||||
that should _not_ be included in the contacts-cache (i.e., for ~mu cfind~ and
|
that should _not_ be included in the contacts-cache (i.e., for ~mu cfind~ and
|
||||||
Mu4e address completion). See the ~mu-init~ manpage for details.
|
Mu4e address completion). See the ~mu-init~ manpage for details.
|
||||||
|
|
||||||
It's not unusual for 'noreply`-type e-mail addresses to be the majority in
|
It's not unusual for 'noreply'-type e-mail addresses to be the majority in
|
||||||
an e-mail corpus, so it useful to get rid of those, with
|
an e-mail corpus, so it useful to get rid of those, with
|
||||||
'=--ignored-address=/.*noreply*/'=
|
'=--ignored-address=/.*noreply*/'=
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@
|
||||||
- also, there are now actions ('a' in view/header) to get to online archives
|
- also, there are now actions ('a' in view/header) to get to online archives
|
||||||
for some (selected) mailing-list 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~.
|
||||||
|
|
||||||
* 1.10 (released on March 26, 2023)
|
* 1.10 (released on March 26, 2023)
|
||||||
|
|
||||||
|
|
|
@ -110,10 +110,17 @@ the personal addresses."
|
||||||
(current-time-string baseline-t)
|
(current-time-string baseline-t)
|
||||||
"Never"))))
|
"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
|
(defvar mu4e-main-mode-map
|
||||||
(let ((map (make-sparse-keymap)))
|
(let ((map (make-sparse-keymap)))
|
||||||
|
|
||||||
(define-key map "q" #'mu4e-quit)
|
(define-key map "q" #'mu4e-main-quit-or-bury)
|
||||||
(define-key map "C" #'mu4e-compose-new)
|
(define-key map "C" #'mu4e-compose-new)
|
||||||
|
|
||||||
(define-key map "m" #'mu4e--main-toggle-mail-sending-mode)
|
(define-key map "m" #'mu4e--main-toggle-mail-sending-mode)
|
||||||
|
@ -286,70 +293,70 @@ Otherwise, do nothing."
|
||||||
(when-let* ((buffer (get-buffer mu4e-main-buffer-name))
|
(when-let* ((buffer (get-buffer mu4e-main-buffer-name))
|
||||||
(buffer (and (buffer-live-p buffer) buffer)))
|
(buffer (and (buffer-live-p buffer) buffer)))
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(let* ((inhibit-read-only t)
|
(let* ((inhibit-read-only t)
|
||||||
(pos (point))
|
(pos (point))
|
||||||
(addrs (mu4e-personal-addresses))
|
(addrs (mu4e-personal-addresses))
|
||||||
(max-length (seq-reduce (lambda (a b)
|
(max-length (seq-reduce (lambda (a b)
|
||||||
(max a (length (plist-get b :name))))
|
(max a (length (plist-get b :name))))
|
||||||
(mu4e-query-items) 0)))
|
(mu4e-query-items) 0)))
|
||||||
(mu4e-main-mode)
|
(mu4e-main-mode)
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(insert
|
(insert
|
||||||
"* "
|
"* "
|
||||||
(propertize "mu4e" 'face 'mu4e-header-key-face)
|
(propertize "mu4e" 'face 'mu4e-header-key-face)
|
||||||
(propertize " - mu for emacs version " 'face 'mu4e-title-face)
|
(propertize " - mu for emacs version " 'face 'mu4e-title-face)
|
||||||
(propertize mu4e-mu-version 'face 'mu4e-header-key-face)
|
(propertize mu4e-mu-version 'face 'mu4e-header-key-face)
|
||||||
"\n\n"
|
"\n\n"
|
||||||
(propertize " Basics\n\n" 'face 'mu4e-title-face)
|
(propertize " Basics\n\n" 'face 'mu4e-title-face)
|
||||||
(mu4e--main-action
|
(mu4e--main-action
|
||||||
"\t* [@]jump to some maildir\n" #'mu4e-search-maildir nil "j")
|
"\t* [@]jump to some maildir\n" #'mu4e-search-maildir nil "j")
|
||||||
(mu4e--main-action
|
(mu4e--main-action
|
||||||
"\t* enter a [@]search query\n" #'mu4e-search nil "s")
|
"\t* enter a [@]search query\n" #'mu4e-search nil "s")
|
||||||
(mu4e--main-action
|
(mu4e--main-action
|
||||||
"\t* [@]Compose a new message\n" #'mu4e-compose-new nil "C")
|
"\t* [@]Compose a new message\n" #'mu4e-compose-new nil "C")
|
||||||
"\n"
|
"\n"
|
||||||
(propertize " Bookmarks\n\n" 'face 'mu4e-title-face)
|
(propertize " Bookmarks\n\n" 'face 'mu4e-title-face)
|
||||||
(mu4e--main-items 'bookmarks max-length)
|
(mu4e--main-items 'bookmarks max-length)
|
||||||
"\n"
|
"\n"
|
||||||
(propertize " Maildirs\n\n" 'face 'mu4e-title-face)
|
(propertize " Maildirs\n\n" 'face 'mu4e-title-face)
|
||||||
(mu4e--main-items 'maildirs max-length)
|
(mu4e--main-items 'maildirs max-length)
|
||||||
"\n"
|
"\n"
|
||||||
(propertize " Misc\n\n" 'face 'mu4e-title-face)
|
(propertize " Misc\n\n" 'face 'mu4e-title-face)
|
||||||
|
|
||||||
(mu4e--main-action "\t* [@]Switch context\n"
|
(mu4e--main-action "\t* [@]Switch context\n"
|
||||||
#'mu4e-context-switch nil ";")
|
#'mu4e-context-switch nil ";")
|
||||||
(mu4e--main-action "\t* [@]Update email & database\n"
|
(mu4e--main-action "\t* [@]Update email & database\n"
|
||||||
#'mu4e-update-mail-and-index nil "U")
|
#'mu4e-update-mail-and-index nil "U")
|
||||||
;; show the queue functions if `smtpmail-queue-dir' is defined
|
;; show the queue functions if `smtpmail-queue-dir' is defined
|
||||||
(if (file-directory-p smtpmail-queue-dir)
|
(if (file-directory-p smtpmail-queue-dir)
|
||||||
(mu4e--main-view-queue)
|
(mu4e--main-view-queue)
|
||||||
"")
|
"")
|
||||||
"\n"
|
"\n"
|
||||||
(mu4e--main-action "\t* [@]News\n" #'mu4e-news nil "N")
|
(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* [@]About mu4e\n" #'mu4e-about nil "A")
|
||||||
(mu4e--main-action "\t* [@]Help\n" #'mu4e-display-manual nil "H")
|
(mu4e--main-action "\t* [@]Help\n" #'mu4e-display-manual nil "H")
|
||||||
(mu4e--main-action "\t* [@]quit\n" #'mu4e-quit nil "q")
|
(mu4e--main-action "\t* [@]quit\n" #'mu4e-main-quit-or-bury nil "q")
|
||||||
"\n"
|
"\n"
|
||||||
(propertize " Info\n\n" 'face 'mu4e-title-face)
|
(propertize " Info\n\n" 'face 'mu4e-title-face)
|
||||||
(mu4e--key-val "last updated"
|
(mu4e--key-val "last updated"
|
||||||
(current-time-string
|
(current-time-string
|
||||||
(plist-get mu4e-index-update-status :tstamp)))
|
(plist-get mu4e-index-update-status :tstamp)))
|
||||||
(mu4e--key-val "database-path" (mu4e-database-path))
|
(mu4e--key-val "database-path" (mu4e-database-path))
|
||||||
(mu4e--key-val "maildir" (mu4e-root-maildir))
|
(mu4e--key-val "maildir" (mu4e-root-maildir))
|
||||||
(mu4e--key-val "in store"
|
(mu4e--key-val "in store"
|
||||||
(format "%d" (plist-get mu4e--server-props :doccount))
|
(format "%d" (plist-get mu4e--server-props :doccount))
|
||||||
"messages")
|
"messages")
|
||||||
(if mu4e-main-hide-personal-addresses ""
|
(if mu4e-main-hide-personal-addresses ""
|
||||||
(mu4e--key-val "personal addresses"
|
(mu4e--key-val "personal addresses"
|
||||||
(if addrs (mapconcat #'identity addrs ", " ) "none"))))
|
(if addrs (mapconcat #'identity addrs ", " ) "none"))))
|
||||||
|
|
||||||
(if mu4e-main-hide-personal-addresses ""
|
(if mu4e-main-hide-personal-addresses ""
|
||||||
(unless (mu4e-personal-address-p user-mail-address)
|
(unless (mu4e-personal-address-p user-mail-address)
|
||||||
(mu4e-message (concat
|
(mu4e-message (concat
|
||||||
"Tip: `user-mail-address' ('%s') is not part "
|
"Tip: `user-mail-address' ('%s') is not part "
|
||||||
"of mu's addresses; add it with 'mu init
|
"of mu's addresses; add it with 'mu init
|
||||||
--my-address='") user-mail-address)))
|
--my-address='") user-mail-address)))
|
||||||
(goto-char pos)))))
|
(goto-char pos)))))
|
||||||
|
|
||||||
(defun mu4e--main-view-queue ()
|
(defun mu4e--main-view-queue ()
|
||||||
"Display queue-related actions in the main view."
|
"Display queue-related actions in the main view."
|
||||||
|
|
Loading…
Reference in New Issue