summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-02-16 11:39:13 +0100
committerBastien Guerry <bzg@altern.org>2011-02-16 11:39:13 +0100
commit4b8d74150f33043c62a3467379a87364e087205c (patch)
tree67d5ec957e8d84ee5e036809e91a93f2d2a690d3
parentd03d3575cb644734e35f039e9ceacd9bda9a6059 (diff)
downloadorg-mode-4b8d74150f33043c62a3467379a87364e087205c.tar.gz
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.
-rw-r--r--lisp/org-publish.el10
1 files changed, 4 insertions, 6 deletions
diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index 3a29d06..208d9a9 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