Pārlūkot izejas kodu

ox-publish: Clean-up `org-publish-find-date'

* lisp/ox-publish.el (org-publish-find-date): Remove useless cond
branch.

:date property is never a single timestamp, so the first branch is
always false.

Reported-by: Rasmus <rasmus@gmx.us>
Nicolas Goaziou 10 gadi atpakaļ
vecāks
revīzija
0ed5d4336b
1 mainītis faili ar 4 papildinājumiem un 6 dzēšanām
  1. 4 6
      lisp/ox-publish.el

+ 4 - 6
lisp/ox-publish.el

@@ -839,17 +839,15 @@ time in `current-time' format."
 	   (date (plist-get
 		  (with-current-buffer file-buf
 		    (if visiting
-			(org-export-with-buffer-copy (org-export-get-environment))
+			(org-export-with-buffer-copy
+			 (org-export-get-environment))
 		      (org-export-get-environment)))
 		  :date)))
       (unless visiting (kill-buffer file-buf))
-      ;; DATE is either a timestamp object or a secondary string.  If it
-      ;; is a timestamp or if the secondary string contains a timestamp,
+      ;; DATE is a secondary string.  If it contains a timestamp,
       ;; convert it to internal format.  Otherwise, use FILE
       ;; modification time.
-      (cond ((eq (org-element-type date) 'timestamp)
-	     (org-time-string-to-time (org-element-interpret-data date)))
-	    ((let ((ts (and (consp date) (assq 'timestamp date))))
+      (cond ((let ((ts (and (consp date) (assq 'timestamp date))))
 	       (and ts
 		    (let ((value (org-element-interpret-data ts)))
 		      (and (org-string-nw-p value)