Browse Source

Backport commit f18af6cd5 from Emacs

* lisp/org.el:
* lisp/ox-publish.el:
Prefer ash to lsh when either will do.

Audit use of lsh and fix glitches
f18af6cd5cb7dbbf7420ec2d3efed4e202c4f0dd
Paul Eggert
Tue Aug 21 13:44:32 2018 -0700
Paul Eggert 1 year ago
parent
commit
28d2c81709
2 changed files with 4 additions and 4 deletions
  1. 1 1
      lisp/org.el
  2. 3 3
      lisp/ox-publish.el

+ 1 - 1
lisp/org.el

@@ -9643,7 +9643,7 @@ Note: this function also decodes single byte encodings like
 		  (cons 6 128))))
 	  (when (>= val 192) (setq eat (car shift-xor)))
 	  (setq val (logxor val (cdr shift-xor)))
-	  (setq sum (+ (lsh sum (car shift-xor)) val))
+	  (setq sum (+ (ash sum (car shift-xor)) val))
 	  (when (> eat 0) (setq eat (- eat 1)))
 	  (cond
 	   ((= 0 eat)			;multi byte

+ 3 - 3
lisp/ox-publish.el

@@ -794,8 +794,8 @@ Default for SITEMAP-FILENAME is `sitemap.org'."
 		((or `anti-chronologically `chronologically)
 		 (let* ((adate (org-publish-find-date a project))
 			(bdate (org-publish-find-date b project))
-			(A (+ (lsh (car adate) 16) (cadr adate)))
-			(B (+ (lsh (car bdate) 16) (cadr bdate))))
+			(A (+ (ash (car adate) 16) (cadr adate)))
+			(B (+ (ash (car bdate) 16) (cadr bdate))))
 		   (setq retval
 			 (if (eq sort-files 'chronologically)
 			     (<= A B)
@@ -1364,7 +1364,7 @@ does not exist."
 	       (expand-file-name (or (file-symlink-p file) file)
 				 (file-name-directory file)))))
     (if (not attr) (error "No such file: \"%s\"" file)
-      (+ (lsh (car (nth 5 attr)) 16)
+      (+ (ash (car (nth 5 attr)) 16)
 	 (cadr (nth 5 attr))))))