Merge pull request #2253 from tsdh/simplify-mu4e-view-mode-map-and-make-minus-work

Simplify mu4e-view-mode-map creation and fix `-` binding
This commit is contained in:
Dirk-Jan C. Binnema 2022-05-12 08:55:56 +03:00 committed by GitHub
commit 9b3979219e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 22 deletions

View File

@ -862,21 +862,20 @@ This is useful for advising some Gnus-functionality that does not work in mu4e."
(apply func args)))
(defvar mu4e-view-mode-map
(let ((map (make-sparse-keymap)))
(let ((map (make-keymap)))
(define-key map (kbd "C-S-u") #'mu4e-update-mail-and-index)
(define-key map (kbd "C-c C-u") #'mu4e-update-mail-and-index)
(define-key map (kbd "C-S-u") 'mu4e-update-mail-and-index)
(define-key map (kbd "C-c C-u") 'mu4e-update-mail-and-index)
(define-key map "q" 'mu4e~view-quit-buffer)
(define-key map "q" #'mu4e~view-quit-buffer)
;; note, 'z' is by-default bound to 'bury-buffer'
;; but that's not very useful in this case
(define-key map "z" 'ignore)
(define-key map "z" #'ignore)
(define-key map "%" #'mu4e-view-mark-pattern)
(define-key map "t" #'mu4e-view-mark-subthread)
(define-key map "T" #'mu4e-view-mark-thread)
(define-key map "j" 'mu4e~headers-jump-to-maildir)
(define-key map "j" #'mu4e~headers-jump-to-maildir)
(define-key map "g" #'mu4e-view-go-to-url)
(define-key map "k" #'mu4e-view-save-url)
@ -1012,12 +1011,18 @@ This is useful for advising some Gnus-functionality that does not work in mu4e."
(define-key menumap [next] '("Next" . mu4e-view-headers-next))
(define-key menumap [previous] '("Previous" . mu4e-view-headers-prev)))
;; Make 0..9 shortcuts for digit-argument. Actually, none of the bound
;; functions seem to use a prefix arg but those bindings existed because we
;; used to use `suppress-keymap'. And possibly users added their own
;; prefix arg consuming commands.
(dotimes (i 10)
(define-key map (kbd (format "%d" i)) #'digit-argument))
(set-keymap-parent map special-mode-map)
map)
"Keymap for mu4e-view mode.")
(set-keymap-parent mu4e-view-mode-map button-buffer-map)
(suppress-keymap mu4e-view-mode-map)
(defcustom mu4e-view-mode-hook nil
"Hook run when entering Mu4e-View mode."