mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 18:36:26 +00:00
org-macs: Make org-mks window navigable when needed
* lisp/org-macs.el (org-mks): Activate keys for scrolling when the whole text does not fit into the visible portion of the window. https://orgmode.org/list/trinity-ac492dc8-9edb-46e6-871a-fdbb9eaa3116-1607796126691@3c-app-mailcom-bs06/
This commit is contained in:
parent
162e0e3e6e
commit
01f57aa0df
|
@ -461,9 +461,15 @@ is selected, only the bare key is returned."
|
|||
;; Display UI and let user select an entry or
|
||||
;; a sub-level prefix.
|
||||
(goto-char (point-min))
|
||||
(unless (pos-visible-in-window-p (point-max))
|
||||
(org-fit-window-to-buffer))
|
||||
(setq header-line-format nil)
|
||||
(org-fit-window-to-buffer)
|
||||
(unless (pos-visible-in-window-p (1- (point-max)))
|
||||
(setq header-line-format "Use C-n, C-p or C-v to navigate.")
|
||||
(setq allowed-keys (append allowed-keys '("\C-n" "\C-p" "\C-v"))))
|
||||
(let ((pressed (org--mks-read-key allowed-keys prompt)))
|
||||
(while (and (member pressed '("\C-n" "\C-p" "\C-v")))
|
||||
(org-scroll (string-to-char pressed))
|
||||
(setq pressed (org--mks-read-key allowed-keys prompt)))
|
||||
(setq current (concat current pressed))
|
||||
(cond
|
||||
((equal pressed "\C-g") (user-error "Abort"))
|
||||
|
|
Loading…
Reference in a new issue