agenda: Enable navigation for the agenda dispatch buffer
* lisp/org-agenda.el (org-agenda-get-restriction-and-command): Use keys C-n, C-p, SPC, DEL analogue to export dispatcher. See function org-export--dispatch-action. Reported by Nathan Neff https://lists.gnu.org/archive/html/emacs-orgmode/2019-10/msg00179.html.
This commit is contained in:
parent
42b8db0d34
commit
80b29acba3
|
@ -3109,16 +3109,42 @@ s Search for keywords M Like m, but only TODO entries
|
||||||
(setq second-time t)
|
(setq second-time t)
|
||||||
(org-fit-window-to-buffer))
|
(org-fit-window-to-buffer))
|
||||||
|
|
||||||
|
;; Hint to navigation if window too small for all information
|
||||||
|
(setq header-line-format
|
||||||
|
(when (not (pos-visible-in-window-p (point-max)))
|
||||||
|
"Use SPC, DEL, C-n or C-p to navigate."))
|
||||||
|
|
||||||
;; Ask for selection
|
;; Ask for selection
|
||||||
(message "Press key for agenda command%s:"
|
(cl-loop
|
||||||
(if (or restrict-ok org-agenda-overriding-restriction)
|
do (progn
|
||||||
(if org-agenda-overriding-restriction
|
(message "Press key for agenda command%s:"
|
||||||
" (restriction lock active)"
|
(if (or restrict-ok org-agenda-overriding-restriction)
|
||||||
(if restriction
|
(if org-agenda-overriding-restriction
|
||||||
(format " (restricted to %s)" restriction)
|
" (restriction lock active)"
|
||||||
" (unrestricted)"))
|
(if restriction
|
||||||
""))
|
(format " (restricted to %s)" restriction)
|
||||||
(setq c (read-char-exclusive))
|
" (unrestricted)"))
|
||||||
|
""))
|
||||||
|
(setq c (read-char-exclusive)))
|
||||||
|
until (not (memq c '(14 16 ?\s ?\d)))
|
||||||
|
do (cl-case c
|
||||||
|
(14 (if (not (pos-visible-in-window-p (point-max)))
|
||||||
|
(ignore-errors (scroll-up 1))
|
||||||
|
(message "End of buffer")
|
||||||
|
(sit-for 1)))
|
||||||
|
(16 (if (not (pos-visible-in-window-p (point-min)))
|
||||||
|
(ignore-errors (scroll-down 1))
|
||||||
|
(message "Beginning of buffer")
|
||||||
|
(sit-for 1)))
|
||||||
|
(?\s (if (not (pos-visible-in-window-p (point-max)))
|
||||||
|
(scroll-up nil)
|
||||||
|
(message "End of buffer")
|
||||||
|
(sit-for 1)))
|
||||||
|
(?\d (if (not (pos-visible-in-window-p (point-min)))
|
||||||
|
(scroll-down nil)
|
||||||
|
(message "Beginning of buffer")
|
||||||
|
(sit-for 1)))))
|
||||||
|
|
||||||
(message "")
|
(message "")
|
||||||
(cond
|
(cond
|
||||||
((assoc (char-to-string c) custom)
|
((assoc (char-to-string c) custom)
|
||||||
|
|
Loading…
Reference in New Issue