From 4b8d74150f33043c62a3467379a87364e087205c Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 16 Feb 2011 11:39:13 +0100 Subject: [PATCH] Fix bug: fetch the updated title of a page when creating the sitemap. * org-publish.el (org-publish-cache-ctime-of-src): improve docstring. (org-publish-find-title): New option to explicitly reset the title in the cache. (org-publish-format-file-entry): Use this new option. Thanks to Jonathan Bisson for reporting this. --- lisp/org-publish.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lisp/org-publish.el b/lisp/org-publish.el index 3a29d06c9..208d9a9d5 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -818,15 +818,15 @@ Default for SITEMAP-FILENAME is 'sitemap.org'." (defun org-publish-format-file-entry (fmt file project-plist) (format-spec fmt - `((?t . ,(org-publish-find-title file)) + `((?t . ,(org-publish-find-title file t)) (?d . ,(format-time-string sitemap-date-format (org-publish-find-date file))) (?a . ,(or (plist-get project-plist :author) user-full-name))))) -(defun org-publish-find-title (file) +(defun org-publish-find-title (file &optional reset) "Find the title of FILE in project." (or - (org-publish-cache-get-file-property file :title nil t) + (and (not reset) (org-publish-cache-get-file-property file :title nil t)) (let* ((visiting (find-buffer-visiting file)) (buffer (or visiting (find-file-noselect file))) title) @@ -1149,7 +1149,7 @@ Returns value on success, else nil." (puthash key value org-publish-cache)) (defun org-publish-cache-ctime-of-src (filename) - "Get the files ctime as integer." + "Get the FILENAME ctime as an integer." (let ((src-attr (file-attributes (if (stringp (file-symlink-p filename)) (file-symlink-p filename) filename)))) @@ -1157,8 +1157,6 @@ Returns value on success, else nil." (lsh (car (nth 5 src-attr)) 16) (cadr (nth 5 src-attr))))) - - (provide 'org-publish) ;; arch-tag: 72807f3c-8af0-4a6b-8dca-c3376eb25adb -- 2.11.4.GIT