ox-publish: Allow external references outside of publishing

* lisp/ox-publish.el (org-publish-resolve-external-link): Warn instead
  of throwing an error when a reference to a non-published external
  file is encountered.
This commit is contained in:
Nicolas Goaziou 2015-05-07 22:15:00 +02:00
parent 9aa69058bc
commit a35c4332f2
1 changed files with 21 additions and 19 deletions

View File

@ -1144,11 +1144,13 @@ This function allows to resolve external links like:
[[file.org::*fuzzy][description]] [[file.org::*fuzzy][description]]
[[file.org::#custom-id][description]] [[file.org::#custom-id][description]]
[[file.org::fuzzy][description]]" [[file.org::fuzzy][description]]"
(unless org-publish-cache (if (not org-publish-cache)
(user-error (progn
"Reference \"%s\" in file \"%s\" cannot be resolved without publishing" (message "Reference \"%s\" in file \"%s\" cannot be resolved without \
publishing"
search search
file)) file)
"MissingReference")
(let ((references (org-publish-cache-get-file-property (let ((references (org-publish-cache-get-file-property
(expand-file-name file) :references nil t))) (expand-file-name file) :references nil t)))
(cond (cond
@ -1162,7 +1164,7 @@ This function allows to resolve external links like:
(assoc (cons 'other s) references) (assoc (cons 'other s) references)
(assoc (cons 'headline s) references))))))) (assoc (cons 'headline s) references)))))))
(t (message "Unknown cross-reference \"%s\" in file \"%s\"" search file) (t (message "Unknown cross-reference \"%s\" in file \"%s\"" search file)
"MissingReference")))) "MissingReference")))))