org-offer-links-in-entry: Kill *Select Link* buffer on C-g

* lisp/org.el (org-offer-links-in-entry): When selection is aborted
via C-g, kill *Select Link* buffer.  This is useful when the location
of the buffer is customized via `display-buffer-alist' to be not in
the same frame - then, `save-window-configuration' is not enough get
rid of the temporary window.
This commit is contained in:
Ihor Radchenko 2024-04-07 16:03:10 +03:00
parent be80f4319f
commit 6d864526b7
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 2 deletions

View File

@ -8781,8 +8781,8 @@ there is one, return it."
(match-string 1 l)))))))
(org-fit-window-to-buffer (get-buffer-window "*Select Link*"))
(message "Select link to open, RET to open all:")
(setq c (read-char-exclusive))
(and (get-buffer "*Select Link*") (kill-buffer "*Select Link*"))))
(unwind-protect (setq c (read-char-exclusive))
(and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))))
(when (equal c ?q) (user-error "Abort"))
(if (equal c ?\C-m)
(setq link links)