diff options
Diffstat (limited to 'lisp/org/ox-publish.el')
-rw-r--r-- | lisp/org/ox-publish.el | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el index 957b0da7c59..c2416dba381 100644 --- a/lisp/org/ox-publish.el +++ b/lisp/org/ox-publish.el @@ -349,7 +349,6 @@ You can overwrite this default per project in your -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Timestamp-related functions (defun org-publish-timestamp-filename (filename &optional pub-dir pub-func) @@ -392,7 +391,6 @@ If there is no timestamp, create one." -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Getting project information out of `org-publish-project-alist' (defun org-publish-property (property project &optional default) @@ -525,7 +523,6 @@ publishing FILENAME." -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Tools for publishing functions in back-ends (defun org-publish-org-to (backend filename extension plist &optional pub-dir) @@ -899,7 +896,6 @@ representation for the files to include, as returned by (org-list-to-org list))) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Interactive publishing functions ;;;###autoload @@ -1154,7 +1150,8 @@ references with `org-export-get-reference'." (let* ((filename (file-truename file)) (crossrefs (org-publish-cache-get-file-property filename :crossrefs nil t)) - (cells (org-export-string-to-search-cell search))) + (cells + (org-export-string-to-search-cell (org-link-unescape search)))) (or ;; Look for reference associated to search cells triggered by ;; LINK. It can match when targeted file has been published @@ -1169,6 +1166,17 @@ references with `org-export-get-reference'." (org-publish-cache-set-file-property filename :crossrefs crossrefs) (org-export-format-reference new)))))) +(defun org-publish-file-relative-name (filename info) + "Convert FILENAME to be relative to current project's base directory. +INFO is the plist containing the current export state. The +function does not change relative file names." + (let ((base (plist-get info :base-directory))) + (if (and base + (file-name-absolute-p filename) + (file-in-directory-p filename base)) + (file-relative-name filename base) + filename))) + ;;; Caching functions |