From f71db4e509c132b917fb5bcf37084f4e5a8504ca Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 28 Sep 2012 17:07:22 +0200 Subject: [PATCH 1/2] org-publish.el (org-publish-cache-ctime-of-src): Fix reference to relative symlinks * org-publish.el (org-publish-cache-ctime-of-src): Delete the base-dir argument and use (file-name-directory file) to get the file's directory. (org-publish-update-timestamp) (org-publish-cache-file-needs-publishing): Call `org-publish-cache-ctime-of-src' with only one argument. Thanks to T.F. Torrey who suggested a fix for this. --- lisp/org-publish.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/org-publish.el b/lisp/org-publish.el index ed2db3a0b..947d52b92 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -338,7 +338,7 @@ function can still decide about that independently." "Update publishing timestamp for file FILENAME. If there is no timestamp, create one." (let ((key (org-publish-timestamp-filename filename pub-dir pub-func)) - (stamp (org-publish-cache-ctime-of-src filename base-dir))) + (stamp (org-publish-cache-ctime-of-src filename))) (org-publish-cache-set key stamp))) (defun org-publish-remove-all-timestamps () @@ -1122,12 +1122,12 @@ so that the file including them will be republished as well." (while (re-search-forward "^#\\+include:[ \t]+\"\\([^\t\n\r\"]*\\)\"[ \t]*.*$" nil t) (let* ((included-file (expand-file-name (match-string 1)))) (add-to-list 'included-files-ctime - (org-publish-cache-ctime-of-src included-file base-dir) t)))) + (org-publish-cache-ctime-of-src included-file) t)))) ;; FIXME don't kill current buffer (unless visiting (kill-buffer buf))) (if (null pstamp) t - (let ((ctime (org-publish-cache-ctime-of-src filename base-dir))) + (let ((ctime (org-publish-cache-ctime-of-src filename))) (or (< pstamp ctime) (when included-files-ctime (not (null (delq nil (mapcar (lambda(ct) (< ctime ct)) @@ -1182,10 +1182,11 @@ Returns value on success, else nil." (error "`org-publish-cache-set' called, but no cache present")) (puthash key value org-publish-cache)) -(defun org-publish-cache-ctime-of-src (f base-dir) - "Get the FILENAME ctime as an integer." +(defun org-publish-cache-ctime-of-src (file) + "Get the ctime of filename F as an integer." (let ((attr (file-attributes - (expand-file-name (or (file-symlink-p f) f) base-dir)))) + (expand-file-name (or (file-symlink-p file) file) + (file-name-directory file))))) (+ (lsh (car (nth 5 attr)) 16) (cadr (nth 5 attr))))) From 79d3c289dab4c8d76da10f3ee33f21ecec1e7e08 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 28 Sep 2012 17:08:37 +0200 Subject: [PATCH 2/2] org-e-html.el (org-e-html-final-function): Turn on `html-mode', not `nxml-mode' * org-e-html.el (org-e-html-final-function): Turn on `html-mode', not `nxml-mode'. --- contrib/lisp/org-e-html.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/lisp/org-e-html.el b/contrib/lisp/org-e-html.el index c3d1bf263..f0ba5f981 100644 --- a/contrib/lisp/org-e-html.el +++ b/contrib/lisp/org-e-html.el @@ -2915,7 +2915,7 @@ contextual information." (defun org-e-html-final-function (contents backend info) (if (not org-e-html-pretty-output) contents (with-temp-buffer - (nxml-mode) + (html-mode) (insert contents) (indent-region (point-min) (point-max)) (buffer-substring-no-properties (point-min) (point-max)))))