Skip to content

Commit

Permalink
org: Fix resource prompt in non-file buffers
Browse files Browse the repository at this point in the history
* lisp/org.el (org--confirm-resource-safe): When `buffer-file-name' is
nil, skip over file-specific behaviour.
  • Loading branch information
tecosaur committed Aug 3, 2022
1 parent 3626f03 commit 4702a73
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lisp/org.el
Original file line number Diff line number Diff line change
Expand Up @@ -4563,9 +4563,12 @@ returns non-nil if any of them match."
(propertize "!" 'face 'success)
" to download this resource, and permanantly mark it as safe.\n "
(propertize "f" 'face 'success)
" to download this resource, and permanantly mark all resources in "
(propertize current-file 'face 'fixed-pitch-serif)
" as safe.\n "
(if current-file
(concat
" to download this resource, and permanantly mark all resources in "
(propertize current-file 'face 'fixed-pitch-serif)
" as safe.\n ")
"")
(propertize "y" 'face 'warning)
" to download this resource, just this once.\n "
(propertize "n" 'face 'error)
Expand All @@ -4576,8 +4579,9 @@ returns non-nil if any of them match."
;; Display the buffer and read a choice.
(save-window-excursion
(pop-to-buffer buf)
(let* ((exit-chars '(?y ?n ?! ?f ?\s))
(prompt (format "Please type y, n, f, or !%s: "
(let* ((exit-chars (append '(?y ?n ?! ?\s) (and current-file '(?f))))
(prompt (format "Please type y, n%s, or !%s: "
(if current-file ", f" "")
(if (< (line-number-at-pos (point-max))
(window-body-height))
""
Expand Down

0 comments on commit 4702a73

Please sign in to comment.