diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 41069f3b..ecd3933c 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -501,11 +501,9 @@ after the end of the search results." ;; change the number of headers (define-key map (kbd "C-+") 'mu4e-headers-split-view-resize) - (define-key map (kbd "C--") - (lambda () (interactive) (mu4e-headers-split-view-resize -1))) + (define-key map (kbd "C--") 'mu4e-headers-split-view-shrink) (define-key map (kbd "") 'mu4e-headers-split-view-resize) - (define-key map (kbd "") - (lambda () (interactive) (mu4e-headers-split-view-resize -1))) + (define-key map (kbd "") 'mu4e-headers-split-view-shrink) ;; switching to view mode (if it's visible) @@ -1304,9 +1302,11 @@ maildir)." (mu4e-headers-search (concat "\"maildir:" maildir "\"")))) (defun mu4e-headers-split-view-resize (n) - "In horizontal split-view, increase the number of lines shown by -N; in vertical split-view, increase the number of columns shown by -N. Otherwise, don't do anything." + "In split-view grow the headers window. +In horizontal split-view, increase the number of lines shown by N. +In vertical split-view, increase the number of columns shown by N. +If N is negative shrink the headers window. +When not in split-view do nothing." (interactive "P") (let ((n (or n 1)) (hwin (get-buffer-window mu4e~headers-buffer))) @@ -1321,6 +1321,15 @@ N. Otherwise, don't do anything." (window-resize hwin n t) (incf mu4e-headers-visible-columns n))))))) +(defun mu4e-headers-split-view-shrink (n) + "In split-view shrink the headers window. +In horizontal split-view, decrease the number of lines shown by N. +In vertical split-view, decrease the number of columns shown by N. +If N is negative grow the headers window. +When not in split-view do nothing." + (interactive "P") + (mu4e-headers-split-view-resize (- n))) + (defun mu4e-headers-action () "Ask user what to do with message-at-point, then do it. The actions are specified in `mu4e-headers-actions'." diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 9e7ded1b..4ba6d6cb 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -499,22 +499,16 @@ FUNC should be a function taking two arguments: ;; change the number of headers (define-key map (kbd "C-+") 'mu4e-headers-split-view-resize) - (define-key map (kbd "C--") - (lambda () (interactive) (mu4e-headers-split-view-resize -1))) - (define-key map (kbd "") 'mu4e-headers-split-view-resize) - (define-key map (kbd "") - (lambda () (interactive) (mu4e-headers-split-view-resize -1))) + (define-key map (kbd "C--") 'mu4e-headers-split-view-shrink) + (define-key map (kbd "") 'mu4e-headers-split-view-resize) + (define-key map (kbd "") 'mu4e-headers-split-view-shrink) ;; intra-message navigation (define-key map (kbd "SPC") 'mu4e-view-scroll-up-or-next) - (define-key map (kbd "") - #'(lambda () (interactive) (goto-char (point-min)))) - (define-key map (kbd "") - #'(lambda () (interactive) (goto-char (point-max)))) - (define-key map (kbd "RET") - #'(lambda () (interactive) (scroll-up 1))) - (define-key map (kbd "") - #'(lambda () (interactive) (scroll-up -1))) + (define-key map (kbd "") 'beginning-of-buffer) + (define-key map (kbd "") 'end-of-buffer) + (define-key map (kbd "RET") 'mu4e-scroll-up) + (define-key map (kbd "") 'mu4e-scroll-up) ;; navigation between messages (define-key map "p" 'mu4e-view-headers-prev) @@ -1071,6 +1065,16 @@ anymore, go the next message." (when mu4e-view-scroll-to-next (mu4e-view-headers-next))))) +(defun mu4e-scroll-up () + "Scroll text of selected window up one line." + (interactive) + (scroll-up 1)) + +(defun mu4e-scroll-down () + "Scroll text of selected window down one line." + (interactive) + (scroll-down 1)) + (defun mu4e-view-unmark-all () "If we're in split-view, unmark all messages. Otherwise, warn user that unmarking only works in the header