org-attach: Show Org Attach UI starting from top

* org-attach.el (org-attach): Move cursor to the top of the
UI-description buffer.

This matters when the buffer does not fit completely in the window for
display.  Without the change the user would see the bottom part.
This commit is contained in:
Marco Wahl 2023-01-30 23:01:17 +01:00
parent 4a751709b5
commit 0d01a198bc
1 changed files with 2 additions and 1 deletions

View File

@ -343,7 +343,8 @@ Shows a list of commands and prompts for another key to execute a command."
"Invalid `org-attach-commands' item: %S"
entry))))
org-attach-commands
"\n")))))
"\n"))))
(goto-char (point-min)))
(org-fit-window-to-buffer (get-buffer-window "*Org Attach*"))
(let ((msg (format "Select command: [%s]"
(concat (mapcar #'caar org-attach-commands)))))