mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 13:32:52 +00:00
org: Use buffer-base-buffer in safe resource fns
* lisp/org.el (org--confirm-resource-safe, org--safe-remote-resource-p): Replace instances of buffer-file-name with (buffer-file-name (buffer-base-buffer)) so these functions work in indirect buffers.
This commit is contained in:
parent
0db972ad63
commit
88329143c8
|
@ -4597,8 +4597,8 @@ is available. This option applies only if FILE is a URL."
|
|||
This checks every pattern in `org-safe-remote-resources', and
|
||||
returns non-nil if any of them match."
|
||||
(let ((uri-patterns org-safe-remote-resources)
|
||||
(file-uri (and buffer-file-name
|
||||
(concat "file://" (file-truename buffer-file-name))))
|
||||
(file-uri (and (buffer-file-name (buffer-base-buffer))
|
||||
(concat "file://" (file-truename (buffer-file-name (buffer-base-buffer))))))
|
||||
match-p)
|
||||
(while (and (not match-p) uri-patterns)
|
||||
(setq match-p (or (string-match-p (car uri-patterns) uri)
|
||||
|
@ -4609,7 +4609,8 @@ returns non-nil if any of them match."
|
|||
(defun org--confirm-resource-safe (uri)
|
||||
"Ask the user if URI should be considered safe, returning non-nil if so."
|
||||
(unless noninteractive
|
||||
(let ((current-file (and buffer-file-name (file-truename buffer-file-name)))
|
||||
(let ((current-file (and (buffer-file-name (buffer-base-buffer))
|
||||
(file-truename (buffer-file-name (buffer-base-buffer)))))
|
||||
(domain (and (string-match
|
||||
(rx (seq "http" (? "s") "://")
|
||||
(optional (+ (not (any "@/\n"))) "@")
|
||||
|
|
Loading…
Reference in a new issue