mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-05 05:42:58 +00:00
ox: Handle failure to localize link
* lisp/ox.el (org-export-link-localise): When no local copy of the link resource could be fetched, produce a warning message and do nothing instead of setting the link :path to nil.
This commit is contained in:
parent
42153ea2fe
commit
a6fc8d3f1f
17
lisp/ox.el
17
lisp/ox.el
|
@ -4612,12 +4612,17 @@ If LINK refers to a remote resource, modify it to point to a local
|
||||||
downloaded copy. Otherwise, return unchanged LINK."
|
downloaded copy. Otherwise, return unchanged LINK."
|
||||||
(when (org-export-link-remote-p link)
|
(when (org-export-link-remote-p link)
|
||||||
(let* ((local-path (org-export-link--remote-local-copy link)))
|
(let* ((local-path (org-export-link--remote-local-copy link)))
|
||||||
(setcdr link
|
(if local-path
|
||||||
(thread-first (cadr link)
|
(setcdr link
|
||||||
(plist-put :type "file")
|
(thread-first (cadr link)
|
||||||
(plist-put :path local-path)
|
(plist-put :type "file")
|
||||||
(plist-put :raw-link (concat "file:" local-path))
|
(plist-put :path local-path)
|
||||||
list))))
|
(plist-put :raw-link (concat "file:" local-path))
|
||||||
|
list))
|
||||||
|
(display-warning
|
||||||
|
'(org export)
|
||||||
|
(format "unable to obtain local copy of %s"
|
||||||
|
(org-element-property :raw-link link))))))
|
||||||
link)
|
link)
|
||||||
|
|
||||||
;;;; For References
|
;;;; For References
|
||||||
|
|
Loading…
Reference in a new issue