Browse Source

Backport commit eba66c1ea from Emacs

* lisp/ox-publish.el (org-publish-sitemap):
Simplify and remove assumptions about timestamp format.

Don’t assume that current-time and plain encode-time return
timestamps in (HI LO US PS) format.

Remove some timestamp format assumptions
eba66c1eafeef6512259c9b46face2b03c7433b8
Paul Eggert
Fri Feb 22 13:31:01 2019 -0800
Paul Eggert 6 năm trước cách đây
mục cha
commit
1b15d5ef8e
1 tập tin đã thay đổi với 4 bổ sung6 xóa
  1. 4 6
      lisp/ox-publish.el

+ 4 - 6
lisp/ox-publish.el

@@ -793,13 +793,11 @@ Default for SITEMAP-FILENAME is `sitemap.org'."
 			   (not (string-lessp B A))))))
 		((or `anti-chronologically `chronologically)
 		 (let* ((adate (org-publish-find-date a project))
-			(bdate (org-publish-find-date b project))
-			(A (+ (ash (car adate) 16) (cadr adate)))
-			(B (+ (ash (car bdate) 16) (cadr bdate))))
+			(bdate (org-publish-find-date b project)))
 		   (setq retval
-			 (if (eq sort-files 'chronologically)
-			     (<= A B)
-			   (>= A B)))))
+			 (not (if (eq sort-files 'chronologically)
+				  (time-less-p bdate adate)
+				(time-less-p adate bdate))))))
 		(`nil nil)
 		(_ (user-error "Invalid sort value %s" sort-files)))
 	      ;; Directory-wise wins: