branch: externals/org
commit 4702a73031c77ba03b480b0848c137d5d8773e07
Author: TEC <g...@tecosaur.net>
Commit: TEC <g...@tecosaur.net>

    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.
---
 lisp/org.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index f8977bba58..7da6f46b9f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -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))
                                    ""

Reply via email to