~bzg/org-mode

4702a73031c77ba03b480b0848c137d5d8773e07 — TEC 15 days ago 3626f03
org: Fix resource prompt in non-file buffers

* lisp/org.el (org--confirm-resource-safe): When `buffer-file-name' is
nil, skip over file-specific behaviour.
1 files changed, 9 insertions(+), 5 deletions(-)

M lisp/org.el
M lisp/org.el => lisp/org.el +9 -5
@@ 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)


@@ 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))
                                   ""