branch: externals/org commit cb866bf1ae14ccce3b1e75d6b573985c6fb01051 Author: Thomas Ingram <tho...@taingram.org> Commit: Ihor Radchenko <yanta...@posteo.net>
ox-publish.el: Fix hash-table nil error in find title/date * lisp/ox-publish.el (org-publish-find-title, org-publish-find-date) (org-publish-index-generate-theindex): Ensure cache is initiated by providing project-name to `org-publish-cache-get-file-property' or `org-publish-cache-set-file-property'. TINYCHANGE --- lisp/ox-publish.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index 3532bdbb49..1183281e73 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -856,7 +856,7 @@ PROPERTY, i.e. \"behavior\" parameter from `org-export-options-alist'." (defun org-publish-find-title (file project) "Find the title of FILE in PROJECT." (let ((file (org-publish--expand-file-name file project))) - (or (org-publish-cache-get-file-property file :title nil t) + (or (org-publish-cache-get-file-property file :title nil t (car project)) (let* ((parsed-title (org-publish-find-property file :title project)) (title (if parsed-title @@ -865,7 +865,7 @@ PROPERTY, i.e. \"behavior\" parameter from `org-export-options-alist'." (org-no-properties (org-element-interpret-data parsed-title)) (file-name-nondirectory (file-name-sans-extension file))))) - (org-publish-cache-set-file-property file :title title))))) + (org-publish-cache-set-file-property file :title title (car project)))))) (defun org-publish-find-date (file project) "Find the date of FILE in PROJECT. @@ -874,7 +874,7 @@ If FILE is an Org file and provides a DATE keyword use it. In any other case use the file system's modification time. Return time in `current-time' format." (let ((file (org-publish--expand-file-name file project))) - (or (org-publish-cache-get-file-property file :date nil t) + (or (org-publish-cache-get-file-property file :date nil t (car project)) (org-publish-cache-set-file-property file :date (if (file-directory-p file) @@ -890,7 +890,8 @@ time in `current-time' format." (org-time-string-to-time value)))))) ((file-exists-p file) (file-attribute-modification-time (file-attributes file))) - (t (error "No such file: \"%s\"" file))))))))) + (t (error "No such file: \"%s\"" file))))) + (car project))))) (defun org-publish-sitemap-default-entry (entry style project) "Default format for site map ENTRY, as a string. @@ -1061,8 +1062,9 @@ publishing directory." (setq full-index (sort (nreverse full-index) (lambda (a b) (string< (downcase (car a)) - (downcase (car b))))))) - (let ((index (org-publish-cache-get-file-property file :index))) + (downcase (car b))))))) + (let ((index (org-publish-cache-get-file-property + file :index nil nil (car project)))) (dolist (term index) (unless (member term full-index) (push term full-index))))) ;; Write "theindex.inc" in DIRECTORY.