Browse Source

org-e-publish: Mirror changes made to org-publish.el

* contrib/lisp/org-e-publish.el (org-e-publish-cache-ctime-of-src):
  Change signature.
(org-e-publish-update-timestamp,
org-e-publish-cache-file-needs-publishing): Apply signature change.

See commit f71db4e509c132b917fb5bcf37084f4e5a8504ca.
Nicolas Goaziou 12 years ago
parent
commit
e5488204f3
1 changed files with 8 additions and 10 deletions
  1. 8 10
      contrib/lisp/org-e-publish.el

+ 8 - 10
contrib/lisp/org-e-publish.el

@@ -350,7 +350,7 @@ still decide about that independently."
   "Update publishing timestamp for file FILENAME.
   "Update publishing timestamp for file FILENAME.
 If there is no timestamp, create one."
 If there is no timestamp, create one."
   (let ((key (org-e-publish-timestamp-filename filename pub-dir pub-func))
   (let ((key (org-e-publish-timestamp-filename filename pub-dir pub-func))
-	(stamp (org-e-publish-cache-ctime-of-src filename base-dir)))
+	(stamp (org-e-publish-cache-ctime-of-src filename)))
     (org-e-publish-cache-set key stamp)))
     (org-e-publish-cache-set key stamp)))
 
 
 (defun org-e-publish-remove-all-timestamps ()
 (defun org-e-publish-remove-all-timestamps ()
@@ -1132,14 +1132,11 @@ the file including them will be republished as well."
 	(while (re-search-forward
 	(while (re-search-forward
 		"^#\\+INCLUDE:[ \t]+\"\\([^\t\n\r\"]*\\)\"[ \t]*.*$" nil t)
 		"^#\\+INCLUDE:[ \t]+\"\\([^\t\n\r\"]*\\)\"[ \t]*.*$" nil t)
 	  (let* ((included-file (expand-file-name (match-string 1))))
 	  (let* ((included-file (expand-file-name (match-string 1))))
-	    (add-to-list
+	    (add-to-list 'included-files-ctime
-	     'included-files-ctime
+			 (org-e-publish-cache-ctime-of-src included-file) t))))
-	     (org-e-publish-cache-ctime-of-src included-file base-dir)
-	     t))))
-      ;; FIXME: don't kill current buffer.
       (unless visiting (kill-buffer buf)))
       (unless visiting (kill-buffer buf)))
     (if (null pstamp) t
     (if (null pstamp) t
-      (let ((ctime (org-e-publish-cache-ctime-of-src filename base-dir)))
+      (let ((ctime (org-e-publish-cache-ctime-of-src filename)))
 	(or (< pstamp ctime)
 	(or (< pstamp ctime)
 	    (when included-files-ctime
 	    (when included-files-ctime
 	      (not (null (delq nil (mapcar (lambda(ct) (< ctime ct))
 	      (not (null (delq nil (mapcar (lambda(ct) (< ctime ct))
@@ -1191,10 +1188,11 @@ Returns value on success, else nil."
     (error "`org-e-publish-cache-set' called, but no cache present"))
     (error "`org-e-publish-cache-set' called, but no cache present"))
   (puthash key value org-e-publish-cache))
   (puthash key value org-e-publish-cache))
 
 
-(defun org-e-publish-cache-ctime-of-src (f base-dir)
+(defun org-e-publish-cache-ctime-of-src (file)
-  "Get the FILENAME ctime as an integer."
+  "Get the ctime of FILE as an integer."
   (let ((attr (file-attributes
   (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)
     (+ (lsh (car (nth 5 attr)) 16)
        (cadr (nth 5 attr)))))
        (cadr (nth 5 attr)))))