aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/arc-mode.el8
-rw-r--r--lisp/calc/calc-bin.el6
-rw-r--r--lisp/calc/calc-comb.el6
-rw-r--r--lisp/calc/calc-ext.el8
-rw-r--r--lisp/calc/calc-math.el2
-rw-r--r--lisp/cedet/semantic/wisent/comp.el10
-rw-r--r--lisp/composite.el6
-rw-r--r--lisp/disp-table.el4
-rw-r--r--lisp/dos-fns.el2
-rw-r--r--lisp/edmacro.el2
-rw-r--r--lisp/emacs-lisp/bindat.el28
-rw-r--r--lisp/emacs-lisp/byte-opt.el4
-rw-r--r--lisp/emacs-lisp/bytecomp.el12
-rw-r--r--lisp/emacs-lisp/cl-extra.el2
-rw-r--r--lisp/erc/erc-dcc.el4
-rw-r--r--lisp/facemenu.el2
-rw-r--r--lisp/gnus/message.el6
-rw-r--r--lisp/gnus/nndoc.el6
-rw-r--r--lisp/gnus/nnmaildir.el2
-rw-r--r--lisp/image.el2
-rw-r--r--lisp/international/ccl.el4
-rw-r--r--lisp/international/fontset.el4
-rw-r--r--lisp/international/mule-cmds.el10
-rw-r--r--lisp/international/mule.el2
-rw-r--r--lisp/json.el2
-rw-r--r--lisp/mail/binhex.el20
-rw-r--r--lisp/mail/rmail.el2
-rw-r--r--lisp/mail/uudecode.el12
-rw-r--r--lisp/md4.el28
-rw-r--r--lisp/net/dns.el24
-rw-r--r--lisp/net/ntlm.el44
-rw-r--r--lisp/net/sasl.el6
-rw-r--r--lisp/net/socks.el4
-rw-r--r--lisp/net/tramp.el14
-rw-r--r--lisp/obsolete/levents.el2
-rw-r--r--lisp/obsolete/pgg-parse.el26
-rw-r--r--lisp/org/org.el2
-rw-r--r--lisp/org/ox-publish.el6
-rw-r--r--lisp/progmodes/cc-defs.el2
-rw-r--r--lisp/progmodes/ebnf2ps.el2
-rw-r--r--lisp/progmodes/hideif.el8
-rw-r--r--lisp/ps-bdf.el4
-rw-r--r--lisp/ps-print.el2
-rw-r--r--lisp/simple.el6
-rw-r--r--lisp/tar-mode.el4
-rw-r--r--lisp/term/common-win.el28
-rw-r--r--lisp/term/tty-colors.el20
-rw-r--r--lisp/term/xterm.el2
-rw-r--r--lisp/vc/vc-git.el4
-rw-r--r--lisp/vc/vc-hg.el2
-rw-r--r--lisp/x-dnd.el12
51 files changed, 213 insertions, 217 deletions
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 4ddb29dcbb5..e45c6004b9a 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -583,7 +583,7 @@ the mode is invalid. If ERROR is nil then nil will be returned."
583 (len (length newmode)) 583 (len (length newmode))
584 (i 1)) 584 (i 1))
585 (while (< i len) 585 (while (< i len)
586 (setq result (+ (lsh result 3) (aref newmode i) (- ?0)) 586 (setq result (+ (ash result 3) (aref newmode i) (- ?0))
587 i (1+ i))) 587 i (1+ i)))
588 (logior (logand oldmode 65024) result))) 588 (logior (logand oldmode 65024) result)))
589 ((string-match "^\\([agou]+\\)\\([---+=]\\)\\([rwxst]+\\)$" newmode) 589 ((string-match "^\\([agou]+\\)\\([---+=]\\)\\([rwxst]+\\)$" newmode)
@@ -1759,7 +1759,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1759 (setq newval (funcall newval (archive-l-e (+ p2 ofs) 2)))) 1759 (setq newval (funcall newval (archive-l-e (+ p2 ofs) 2))))
1760 (goto-char (+ p2 ofs)) 1760 (goto-char (+ p2 ofs))
1761 (delete-char 2) 1761 (delete-char 2)
1762 (insert-unibyte (logand newval 255) (lsh newval -8)) 1762 (insert-unibyte (logand newval 255) (ash newval -8))
1763 (goto-char (1+ p)) 1763 (goto-char (1+ p))
1764 (delete-char 1) 1764 (delete-char 1)
1765 (insert-unibyte (archive-lzh-resum (1+ p) hsize))) 1765 (insert-unibyte (archive-lzh-resum (1+ p) hsize)))
@@ -1949,11 +1949,11 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
1949 (cond ((memq creator '(2 3)) ; Unix 1949 (cond ((memq creator '(2 3)) ; Unix
1950 (goto-char (+ p 40)) 1950 (goto-char (+ p 40))
1951 (delete-char 2) 1951 (delete-char 2)
1952 (insert-unibyte (logand newval 255) (lsh newval -8))) 1952 (insert-unibyte (logand newval 255) (ash newval -8)))
1953 ((memq creator '(0 5 6 7 10 11 15)) ; Dos etc. 1953 ((memq creator '(0 5 6 7 10 11 15)) ; Dos etc.
1954 (goto-char (+ p 38)) 1954 (goto-char (+ p 38))
1955 (insert-unibyte (logior (logand (byte-after (point)) 254) 1955 (insert-unibyte (logior (logand (byte-after (point)) 254)
1956 (logand (logxor 1 (lsh newval -7)) 1))) 1956 (logand (logxor 1 (ash newval -7)) 1)))
1957 (delete-char 1)) 1957 (delete-char 1))
1958 (t (message "Don't know how to change mode for this member")))) 1958 (t (message "Don't know how to change mode for this member"))))
1959 )))) 1959 ))))
diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el
index c05a71a2d7f..a61cecf357c 100644
--- a/lisp/calc/calc-bin.el
+++ b/lisp/calc/calc-bin.el
@@ -420,7 +420,7 @@ the size of a Calc bignum digit.")
420 (let ((q (math-div-bignum-digit a math-bignum-digit-power-of-two))) 420 (let ((q (math-div-bignum-digit a math-bignum-digit-power-of-two)))
421 (if (<= w math-bignum-logb-digit-size) 421 (if (<= w math-bignum-logb-digit-size)
422 (list (logand (lognot (cdr q)) 422 (list (logand (lognot (cdr q))
423 (1- (lsh 1 w)))) 423 (1- (ash 1 w))))
424 (math-mul-bignum-digit (math-not-bignum (math-norm-bignum (car q)) 424 (math-mul-bignum-digit (math-not-bignum (math-norm-bignum (car q))
425 (- w math-bignum-logb-digit-size)) 425 (- w math-bignum-logb-digit-size))
426 math-bignum-digit-power-of-two 426 math-bignum-digit-power-of-two
@@ -529,7 +529,7 @@ the size of a Calc bignum digit.")
529 ((and (integerp a) (< a math-small-integer-size)) 529 ((and (integerp a) (< a math-small-integer-size))
530 (if (> w (logb math-small-integer-size)) 530 (if (> w (logb math-small-integer-size))
531 a 531 a
532 (logand a (1- (lsh 1 w))))) 532 (logand a (1- (ash 1 w)))))
533 (t 533 (t
534 (math-normalize 534 (math-normalize
535 (cons 'bigpos 535 (cons 'bigpos
@@ -542,7 +542,7 @@ the size of a Calc bignum digit.")
542 (let ((q (math-div-bignum-digit a math-bignum-digit-power-of-two))) 542 (let ((q (math-div-bignum-digit a math-bignum-digit-power-of-two)))
543 (if (<= w math-bignum-logb-digit-size) 543 (if (<= w math-bignum-logb-digit-size)
544 (list (logand (cdr q) 544 (list (logand (cdr q)
545 (1- (lsh 1 w)))) 545 (1- (ash 1 w))))
546 (math-mul-bignum-digit (math-clip-bignum (math-norm-bignum (car q)) 546 (math-mul-bignum-digit (math-clip-bignum (math-norm-bignum (car q))
547 (- w math-bignum-logb-digit-size)) 547 (- w math-bignum-logb-digit-size))
548 math-bignum-digit-power-of-two 548 math-bignum-digit-power-of-two
diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el
index 7c88230f86a..f1d3daeed93 100644
--- a/lisp/calc/calc-comb.el
+++ b/lisp/calc/calc-comb.el
@@ -580,7 +580,7 @@
580 ;; deduce a better value for RAND_MAX. 580 ;; deduce a better value for RAND_MAX.
581 (let ((i 0)) 581 (let ((i 0))
582 (while (< (setq i (1+ i)) 30) 582 (while (< (setq i (1+ i)) 30)
583 (if (> (lsh (math-abs (random)) math-random-shift) 4095) 583 (if (> (ash (math-abs (random)) math-random-shift) 4095)
584 (setq math-random-shift (1- math-random-shift)))))) 584 (setq math-random-shift (1- math-random-shift))))))
585 (setq math-last-RandSeed var-RandSeed 585 (setq math-last-RandSeed var-RandSeed
586 math-gaussian-cache nil)) 586 math-gaussian-cache nil))
@@ -592,11 +592,11 @@
592 (cdr math-random-table)) 592 (cdr math-random-table))
593 math-random-ptr2 (or (cdr math-random-ptr2) 593 math-random-ptr2 (or (cdr math-random-ptr2)
594 (cdr math-random-table))) 594 (cdr math-random-table)))
595 (logand (lsh (setcar math-random-ptr1 595 (logand (ash (setcar math-random-ptr1
596 (logand (- (car math-random-ptr1) 596 (logand (- (car math-random-ptr1)
597 (car math-random-ptr2)) 524287)) 597 (car math-random-ptr2)) 524287))
598 -6) 1023)) 598 -6) 1023))
599 (logand (lsh (random) math-random-shift) 1023))) 599 (logand (ash (random) math-random-shift) 1023)))
600 600
601 601
602;;; Produce a random digit in the range 0..999. 602;;; Produce a random digit in the range 0..999.
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 5feff23f72d..f983ebe414d 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -2294,14 +2294,14 @@ calc-kill calc-kill-region calc-yank))))
2294 (let ((a (math-trunc a))) 2294 (let ((a (math-trunc a)))
2295 (if (integerp a) 2295 (if (integerp a)
2296 a 2296 a
2297 (if (or (Math-lessp (lsh -1 -1) a) 2297 (if (or (Math-lessp most-positive-fixnum a)
2298 (Math-lessp a (- (lsh -1 -1)))) 2298 (Math-lessp a (- most-positive-fixnum)))
2299 (math-reject-arg a 'fixnump) 2299 (math-reject-arg a 'fixnump)
2300 (math-fixnum a))))) 2300 (math-fixnum a)))))
2301 ((and allow-inf (equal a '(var inf var-inf))) 2301 ((and allow-inf (equal a '(var inf var-inf)))
2302 (lsh -1 -1)) 2302 most-positive-fixnum)
2303 ((and allow-inf (equal a '(neg (var inf var-inf)))) 2303 ((and allow-inf (equal a '(neg (var inf var-inf))))
2304 (- (lsh -1 -1))) 2304 (- most-positive-fixnum))
2305 (t (math-reject-arg a 'fixnump)))) 2305 (t (math-reject-arg a 'fixnump))))
2306 2306
2307;;; Verify that A is an integer >= 0 and return A in integer form. [I N; - x] 2307;;; Verify that A is an integer >= 0 and return A in integer form. [I N; - x]
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index 4b8abbf4f85..483907a325d 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -1697,7 +1697,7 @@ If this can't be done, return NIL."
1697 (while (not (Math-lessp x pow)) 1697 (while (not (Math-lessp x pow))
1698 (setq pows (cons pow pows) 1698 (setq pows (cons pow pows)
1699 pow (math-sqr pow))) 1699 pow (math-sqr pow)))
1700 (setq n (lsh 1 (1- (length pows))) 1700 (setq n (ash 1 (1- (length pows)))
1701 sum n 1701 sum n
1702 pow (car pows)) 1702 pow (car pows))
1703 (while (and (setq pows (cdr pows)) 1703 (while (and (setq pows (cdr pows))
diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el
index 837222ad4b1..74ca4f4a437 100644
--- a/lisp/cedet/semantic/wisent/comp.el
+++ b/lisp/cedet/semantic/wisent/comp.el
@@ -142,8 +142,8 @@ If optional LEFT is non-nil insert spaces on left."
142(defconst wisent-BITS-PER-WORD 142(defconst wisent-BITS-PER-WORD
143 (let ((i 1) 143 (let ((i 1)
144 (do-shift (if (boundp 'most-positive-fixnum) 144 (do-shift (if (boundp 'most-positive-fixnum)
145 (lambda (i) (lsh most-positive-fixnum (- i))) 145 (lambda (i) (ash most-positive-fixnum (- i)))
146 (lambda (i) (lsh 1 i))))) 146 (lambda (i) (ash 1 i)))))
147 (while (not (zerop (funcall do-shift i))) 147 (while (not (zerop (funcall do-shift i)))
148 (setq i (1+ i))) 148 (setq i (1+ i)))
149 i)) 149 i))
@@ -156,18 +156,18 @@ If optional LEFT is non-nil insert spaces on left."
156 "X[I/BITS-PER-WORD] |= 1 << (I % BITS-PER-WORD)." 156 "X[I/BITS-PER-WORD] |= 1 << (I % BITS-PER-WORD)."
157 (let ((k (/ i wisent-BITS-PER-WORD))) 157 (let ((k (/ i wisent-BITS-PER-WORD)))
158 (aset x k (logior (aref x k) 158 (aset x k (logior (aref x k)
159 (lsh 1 (% i wisent-BITS-PER-WORD)))))) 159 (ash 1 (% i wisent-BITS-PER-WORD))))))
160 160
161(defsubst wisent-RESETBIT (x i) 161(defsubst wisent-RESETBIT (x i)
162 "X[I/BITS-PER-WORD] &= ~(1 << (I % BITS-PER-WORD))." 162 "X[I/BITS-PER-WORD] &= ~(1 << (I % BITS-PER-WORD))."
163 (let ((k (/ i wisent-BITS-PER-WORD))) 163 (let ((k (/ i wisent-BITS-PER-WORD)))
164 (aset x k (logand (aref x k) 164 (aset x k (logand (aref x k)
165 (lognot (lsh 1 (% i wisent-BITS-PER-WORD))))))) 165 (lognot (ash 1 (% i wisent-BITS-PER-WORD)))))))
166 166
167(defsubst wisent-BITISSET (x i) 167(defsubst wisent-BITISSET (x i)
168 "(X[I/BITS-PER-WORD] & (1 << (I % BITS-PER-WORD))) != 0." 168 "(X[I/BITS-PER-WORD] & (1 << (I % BITS-PER-WORD))) != 0."
169 (not (zerop (logand (aref x (/ i wisent-BITS-PER-WORD)) 169 (not (zerop (logand (aref x (/ i wisent-BITS-PER-WORD))
170 (lsh 1 (% i wisent-BITS-PER-WORD)))))) 170 (ash 1 (% i wisent-BITS-PER-WORD))))))
171 171
172(defsubst wisent-noninteractive () 172(defsubst wisent-noninteractive ()
173 "Return non-nil if running without interactive terminal." 173 "Return non-nil if running without interactive terminal."
diff --git a/lisp/composite.el b/lisp/composite.el
index 7daea54c9e9..3d4805e8fa0 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -119,7 +119,7 @@ RULE is a cons of global and new reference point symbols
119 (setq nref (cdr (assq nref reference-point-alist)))) 119 (setq nref (cdr (assq nref reference-point-alist))))
120 (or (and (>= gref 0) (< gref 12) (>= nref 0) (< nref 12)) 120 (or (and (>= gref 0) (< gref 12) (>= nref 0) (< nref 12))
121 (error "Invalid composition rule: %S" rule)) 121 (error "Invalid composition rule: %S" rule))
122 (logior (lsh xoff 16) (lsh yoff 8) (+ (* gref 12) nref))) 122 (logior (ash xoff 16) (ash yoff 8) (+ (* gref 12) nref)))
123 (error "Invalid composition rule: %S" rule)))) 123 (error "Invalid composition rule: %S" rule))))
124 124
125;; Decode encoded composition rule RULE-CODE. The value is a cons of 125;; Decode encoded composition rule RULE-CODE. The value is a cons of
@@ -130,8 +130,8 @@ RULE is a cons of global and new reference point symbols
130(defun decode-composition-rule (rule-code) 130(defun decode-composition-rule (rule-code)
131 (or (and (natnump rule-code) (< rule-code #x1000000)) 131 (or (and (natnump rule-code) (< rule-code #x1000000))
132 (error "Invalid encoded composition rule: %S" rule-code)) 132 (error "Invalid encoded composition rule: %S" rule-code))
133 (let ((xoff (lsh rule-code -16)) 133 (let ((xoff (ash rule-code -16))
134 (yoff (logand (lsh rule-code -8) #xFF)) 134 (yoff (logand (ash rule-code -8) #xFF))
135 gref nref) 135 gref nref)
136 (setq rule-code (logand rule-code #xFF) 136 (setq rule-code (logand rule-code #xFF)
137 gref (car (rassq (/ rule-code 12) reference-point-alist)) 137 gref (car (rassq (/ rule-code 12) reference-point-alist))
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index 13d73a98d0b..95224f2b2a4 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -226,7 +226,7 @@ X frame."
226 char 226 char
227 (let ((fid (face-id face))) 227 (let ((fid (face-id face)))
228 (if (< fid 64) ; we have 32 - 3(LSB) - 1(SIGN) - 22(CHAR) = 6 bits for face id 228 (if (< fid 64) ; we have 32 - 3(LSB) - 1(SIGN) - 22(CHAR) = 6 bits for face id
229 (logior char (lsh fid 22)) 229 (logior char (ash fid 22))
230 (cons char fid))))) 230 (cons char fid)))))
231 231
232;;;###autoload 232;;;###autoload
@@ -239,7 +239,7 @@ X frame."
239;;;###autoload 239;;;###autoload
240(defun glyph-face (glyph) 240(defun glyph-face (glyph)
241 "Return the face of glyph code GLYPH, or nil if glyph has default face." 241 "Return the face of glyph code GLYPH, or nil if glyph has default face."
242 (let ((face-id (if (consp glyph) (cdr glyph) (lsh glyph -22)))) 242 (let ((face-id (if (consp glyph) (cdr glyph) (ash glyph -22))))
243 (and (> face-id 0) 243 (and (> face-id 0)
244 (catch 'face 244 (catch 'face
245 (dolist (face (face-list)) 245 (dolist (face (face-list))
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el
index ebb8acb8608..aeb8da4d480 100644
--- a/lisp/dos-fns.el
+++ b/lisp/dos-fns.el
@@ -269,7 +269,7 @@ returned unaltered."
269 (car where) 269 (car where)
270 (if (zerop (cdr where)) 270 (if (zerop (cdr where))
271 (logior (logand tem 65280) value) 271 (logior (logand tem 65280) value)
272 (logior (logand tem 255) (lsh value 8)))))) 272 (logior (logand tem 255) (ash value 8))))))
273 ((numberp where) 273 ((numberp where)
274 (aset regs where (logand value 65535)))))) 274 (aset regs where (logand value 65535))))))
275 regs) 275 regs)
diff --git a/lisp/edmacro.el b/lisp/edmacro.el
index 78180627950..c3d9bc5a980 100644
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -547,7 +547,7 @@ doubt, use whitespace."
547 ?\M-\^@ ?\s-\^@ ?\S-\^@) 547 ?\M-\^@ ?\s-\^@ ?\S-\^@)
548 when (/= (logand ch bit) 0) 548 when (/= (logand ch bit) 0)
549 concat (format "%c-" pf)) 549 concat (format "%c-" pf))
550 (let ((ch2 (logand ch (1- (lsh 1 18))))) 550 (let ((ch2 (logand ch (1- (ash 1 18)))))
551 (cond ((<= ch2 32) 551 (cond ((<= ch2 32)
552 (pcase ch2 552 (pcase ch2
553 (0 "NUL") (9 "TAB") (10 "LFD") 553 (0 "NUL") (9 "TAB") (10 "LFD")
diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el
index c1343765901..3124217303f 100644
--- a/lisp/emacs-lisp/bindat.el
+++ b/lisp/emacs-lisp/bindat.el
@@ -205,22 +205,22 @@
205 (setq bindat-idx (1+ bindat-idx)))) 205 (setq bindat-idx (1+ bindat-idx))))
206 206
207(defun bindat--unpack-u16 () 207(defun bindat--unpack-u16 ()
208 (logior (lsh (bindat--unpack-u8) 8) (bindat--unpack-u8))) 208 (logior (ash (bindat--unpack-u8) 8) (bindat--unpack-u8)))
209 209
210(defun bindat--unpack-u24 () 210(defun bindat--unpack-u24 ()
211 (logior (lsh (bindat--unpack-u16) 8) (bindat--unpack-u8))) 211 (logior (ash (bindat--unpack-u16) 8) (bindat--unpack-u8)))
212 212
213(defun bindat--unpack-u32 () 213(defun bindat--unpack-u32 ()
214 (logior (lsh (bindat--unpack-u16) 16) (bindat--unpack-u16))) 214 (logior (ash (bindat--unpack-u16) 16) (bindat--unpack-u16)))
215 215
216(defun bindat--unpack-u16r () 216(defun bindat--unpack-u16r ()
217 (logior (bindat--unpack-u8) (lsh (bindat--unpack-u8) 8))) 217 (logior (bindat--unpack-u8) (ash (bindat--unpack-u8) 8)))
218 218
219(defun bindat--unpack-u24r () 219(defun bindat--unpack-u24r ()
220 (logior (bindat--unpack-u16r) (lsh (bindat--unpack-u8) 16))) 220 (logior (bindat--unpack-u16r) (ash (bindat--unpack-u8) 16)))
221 221
222(defun bindat--unpack-u32r () 222(defun bindat--unpack-u32r ()
223 (logior (bindat--unpack-u16r) (lsh (bindat--unpack-u16r) 16))) 223 (logior (bindat--unpack-u16r) (ash (bindat--unpack-u16r) 16)))
224 224
225(defun bindat--unpack-item (type len &optional vectype) 225(defun bindat--unpack-item (type len &optional vectype)
226 (if (eq type 'ip) 226 (if (eq type 'ip)
@@ -250,7 +250,7 @@
250 (if (/= 0 (logand m j)) 250 (if (/= 0 (logand m j))
251 (setq bits (cons bnum bits))) 251 (setq bits (cons bnum bits)))
252 (setq bnum (1- bnum) 252 (setq bnum (1- bnum)
253 j (lsh j -1))))) 253 j (ash j -1)))))
254 bits)) 254 bits))
255 ((eq type 'str) 255 ((eq type 'str)
256 (let ((s (substring bindat-raw bindat-idx (+ bindat-idx len)))) 256 (let ((s (substring bindat-raw bindat-idx (+ bindat-idx len))))
@@ -459,30 +459,30 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..."
459 (setq bindat-idx (1+ bindat-idx))) 459 (setq bindat-idx (1+ bindat-idx)))
460 460
461(defun bindat--pack-u16 (v) 461(defun bindat--pack-u16 (v)
462 (aset bindat-raw bindat-idx (logand (lsh v -8) 255)) 462 (aset bindat-raw bindat-idx (logand (ash v -8) 255))
463 (aset bindat-raw (1+ bindat-idx) (logand v 255)) 463 (aset bindat-raw (1+ bindat-idx) (logand v 255))
464 (setq bindat-idx (+ bindat-idx 2))) 464 (setq bindat-idx (+ bindat-idx 2)))
465 465
466(defun bindat--pack-u24 (v) 466(defun bindat--pack-u24 (v)
467 (bindat--pack-u8 (lsh v -16)) 467 (bindat--pack-u8 (ash v -16))
468 (bindat--pack-u16 v)) 468 (bindat--pack-u16 v))
469 469
470(defun bindat--pack-u32 (v) 470(defun bindat--pack-u32 (v)
471 (bindat--pack-u16 (lsh v -16)) 471 (bindat--pack-u16 (ash v -16))
472 (bindat--pack-u16 v)) 472 (bindat--pack-u16 v))
473 473
474(defun bindat--pack-u16r (v) 474(defun bindat--pack-u16r (v)
475 (aset bindat-raw (1+ bindat-idx) (logand (lsh v -8) 255)) 475 (aset bindat-raw (1+ bindat-idx) (logand (ash v -8) 255))
476 (aset bindat-raw bindat-idx (logand v 255)) 476 (aset bindat-raw bindat-idx (logand v 255))
477 (setq bindat-idx (+ bindat-idx 2))) 477 (setq bindat-idx (+ bindat-idx 2)))
478 478
479(defun bindat--pack-u24r (v) 479(defun bindat--pack-u24r (v)
480 (bindat--pack-u16r v) 480 (bindat--pack-u16r v)
481 (bindat--pack-u8 (lsh v -16))) 481 (bindat--pack-u8 (ash v -16)))
482 482
483(defun bindat--pack-u32r (v) 483(defun bindat--pack-u32r (v)
484 (bindat--pack-u16r v) 484 (bindat--pack-u16r v)
485 (bindat--pack-u16r (lsh v -16))) 485 (bindat--pack-u16r (ash v -16)))
486 486
487(defun bindat--pack-item (v type len &optional vectype) 487(defun bindat--pack-item (v type len &optional vectype)
488 (if (eq type 'ip) 488 (if (eq type 'ip)
@@ -515,7 +515,7 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..."
515 (if (memq bnum v) 515 (if (memq bnum v)
516 (setq m (logior m j))) 516 (setq m (logior m j)))
517 (setq bnum (1- bnum) 517 (setq bnum (1- bnum)
518 j (lsh j -1)))) 518 j (ash j -1))))
519 (bindat--pack-u8 m)))) 519 (bindat--pack-u8 m))))
520 ((memq type '(str strz)) 520 ((memq type '(str strz))
521 (let ((l (length v)) (i 0)) 521 (let ((l (length v)) (i 0))
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 1920503b8c4..4854808fd02 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1283,7 +1283,7 @@
1283 (setq bytedecomp-ptr (1+ bytedecomp-ptr)) 1283 (setq bytedecomp-ptr (1+ bytedecomp-ptr))
1284 (+ (aref bytes bytedecomp-ptr) 1284 (+ (aref bytes bytedecomp-ptr)
1285 (progn (setq bytedecomp-ptr (1+ bytedecomp-ptr)) 1285 (progn (setq bytedecomp-ptr (1+ bytedecomp-ptr))
1286 (lsh (aref bytes bytedecomp-ptr) 8)))) 1286 (ash (aref bytes bytedecomp-ptr) 8))))
1287 (t tem)))) ;Offset was in opcode. 1287 (t tem)))) ;Offset was in opcode.
1288 ((>= bytedecomp-op byte-constant) 1288 ((>= bytedecomp-op byte-constant)
1289 (prog1 (- bytedecomp-op byte-constant) ;Offset in opcode. 1289 (prog1 (- bytedecomp-op byte-constant) ;Offset in opcode.
@@ -1297,7 +1297,7 @@
1297 (setq bytedecomp-ptr (1+ bytedecomp-ptr)) 1297 (setq bytedecomp-ptr (1+ bytedecomp-ptr))
1298 (+ (aref bytes bytedecomp-ptr) 1298 (+ (aref bytes bytedecomp-ptr)
1299 (progn (setq bytedecomp-ptr (1+ bytedecomp-ptr)) 1299 (progn (setq bytedecomp-ptr (1+ bytedecomp-ptr))
1300 (lsh (aref bytes bytedecomp-ptr) 8)))) 1300 (ash (aref bytes bytedecomp-ptr) 8))))
1301 ((and (>= bytedecomp-op byte-listN) 1301 ((and (>= bytedecomp-op byte-listN)
1302 (<= bytedecomp-op byte-discardN)) 1302 (<= bytedecomp-op byte-discardN))
1303 (setq bytedecomp-ptr (1+ bytedecomp-ptr)) ;Offset in next byte. 1303 (setq bytedecomp-ptr (1+ bytedecomp-ptr)) ;Offset in next byte.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index ee28e61800d..0b8f8824b4c 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -835,7 +835,7 @@ all the arguments.
835(defmacro byte-compile-push-bytecode-const2 (opcode const2 bytes pc) 835(defmacro byte-compile-push-bytecode-const2 (opcode const2 bytes pc)
836 "Push OPCODE and the two-byte constant CONST2 onto BYTES, and add 3 to PC. 836 "Push OPCODE and the two-byte constant CONST2 onto BYTES, and add 3 to PC.
837CONST2 may be evaluated multiple times." 837CONST2 may be evaluated multiple times."
838 `(byte-compile-push-bytecodes ,opcode (logand ,const2 255) (lsh ,const2 -8) 838 `(byte-compile-push-bytecodes ,opcode (logand ,const2 255) (ash ,const2 -8)
839 ,bytes ,pc)) 839 ,bytes ,pc))
840 840
841(defun byte-compile-lapcode (lap) 841(defun byte-compile-lapcode (lap)
@@ -925,9 +925,9 @@ CONST2 may be evaluated multiple times."
925 ;; Splits PC's value into 2 bytes. The jump address is 925 ;; Splits PC's value into 2 bytes. The jump address is
926 ;; "reconstructed" by the `FETCH2' macro in `bytecode.c'. 926 ;; "reconstructed" by the `FETCH2' macro in `bytecode.c'.
927 (setcar (cdr bytes-tail) (logand pc 255)) 927 (setcar (cdr bytes-tail) (logand pc 255))
928 (setcar bytes-tail (lsh pc -8)) 928 (setcar bytes-tail (ash pc -8))
929 ;; FIXME: Replace this by some workaround. 929 ;; FIXME: Replace this by some workaround.
930 (if (> (car bytes-tail) 255) (error "Bytecode overflow"))) 930 (or (<= 0 (car bytes-tail) 255) (error "Bytecode overflow")))
931 931
932 ;; Similarly, replace TAGs in all jump tables with the correct PC index. 932 ;; Similarly, replace TAGs in all jump tables with the correct PC index.
933 (dolist (hash-table byte-compile-jump-tables) 933 (dolist (hash-table byte-compile-jump-tables)
@@ -2793,8 +2793,8 @@ If FORM is a lambda or a macro, byte-compile it as a function."
2793 (if (> mandatory 127) 2793 (if (> mandatory 127)
2794 (byte-compile-report-error "Too many (>127) mandatory arguments") 2794 (byte-compile-report-error "Too many (>127) mandatory arguments")
2795 (logior mandatory 2795 (logior mandatory
2796 (lsh nonrest 8) 2796 (ash nonrest 8)
2797 (lsh rest 7))))) 2797 (ash rest 7)))))
2798 2798
2799 2799
2800(defun byte-compile-lambda (fun &optional add-lambda reserved-csts) 2800(defun byte-compile-lambda (fun &optional add-lambda reserved-csts)
@@ -3258,7 +3258,7 @@ for symbols generated by the byte compiler itself."
3258 (fun (car form)) 3258 (fun (car form))
3259 (fargs (aref fun 0)) 3259 (fargs (aref fun 0))
3260 (start-depth byte-compile-depth) 3260 (start-depth byte-compile-depth)
3261 (fmax2 (if (numberp fargs) (lsh fargs -7))) ;2*max+rest. 3261 (fmax2 (if (numberp fargs) (ash fargs -7))) ;2*max+rest.
3262 ;; (fmin (if (numberp fargs) (logand fargs 127))) 3262 ;; (fmin (if (numberp fargs) (logand fargs 127)))
3263 (alen (length (cdr form))) 3263 (alen (length (cdr form)))
3264 (dynbinds ()) 3264 (dynbinds ())
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 36b65f97b07..bea38a05096 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -472,7 +472,7 @@ Optional second arg STATE is a random-state object."
472 (n (logand 8388607 (aset vec i (- (aref vec i) (aref vec j)))))) 472 (n (logand 8388607 (aset vec i (- (aref vec i) (aref vec j))))))
473 (if (integerp lim) 473 (if (integerp lim)
474 (if (<= lim 512) (% n lim) 474 (if (<= lim 512) (% n lim)
475 (if (> lim 8388607) (setq n (+ (lsh n 9) (cl-random 512 state)))) 475 (if (> lim 8388607) (setq n (+ (ash n 9) (cl-random 512 state))))
476 (let ((mask 1023)) 476 (let ((mask 1023))
477 (while (< mask (1- lim)) (setq mask (1+ (+ mask mask)))) 477 (while (< mask (1- lim)) (setq mask (1+ (+ mask mask))))
478 (if (< (setq n (logand n mask)) lim) n (cl-random lim state)))) 478 (if (< (setq n (logand n mask)) lim) n (cl-random lim state))))
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index fdc209991aa..8bf4c3e1666 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -229,7 +229,7 @@ which is big-endian."
229 "Maximum number of bytes for a fixnum.") 229 "Maximum number of bytes for a fixnum.")
230 230
231(defconst erc-most-positive-int-msb 231(defconst erc-most-positive-int-msb
232 (lsh most-positive-fixnum (- 0 (* 8 (1- erc-most-positive-int-bytes)))) 232 (ash most-positive-fixnum (- 0 (* 8 (1- erc-most-positive-int-bytes))))
233 "Content of the most significant byte of most-positive-fixnum.") 233 "Content of the most significant byte of most-positive-fixnum.")
234 234
235(defun erc-unpack-int (str) 235(defun erc-unpack-int (str)
@@ -251,7 +251,7 @@ which is big-endian."
251 (let ((num 0) 251 (let ((num 0)
252 (count 0)) 252 (count 0))
253 (while (< count len) 253 (while (< count len)
254 (setq num (+ num (lsh (aref str (- len count 1)) (* 8 count)))) 254 (setq num (+ num (ash (aref str (- len count 1)) (* 8 count))))
255 (setq count (1+ count))) 255 (setq count (1+ count)))
256 num))) 256 num)))
257 257
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index a4f675b8c11..7c10d6097c5 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -638,7 +638,7 @@ color. The function should accept a single argument, the color name."
638 (insert " ") 638 (insert " ")
639 (insert (propertize 639 (insert (propertize
640 (apply 'format "#%02x%02x%02x" 640 (apply 'format "#%02x%02x%02x"
641 (mapcar (lambda (c) (lsh c -8)) 641 (mapcar (lambda (c) (ash c -8))
642 color-values)) 642 color-values))
643 'mouse-face 'highlight 643 'mouse-face 'highlight
644 'help-echo 644 'help-echo
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index dde9c28656c..0bd9442afc9 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -5564,7 +5564,7 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
5564 ;; Instead we use this randomly inited counter. 5564 ;; Instead we use this randomly inited counter.
5565 (setq message-unique-id-char 5565 (setq message-unique-id-char
5566 (% (1+ (or message-unique-id-char 5566 (% (1+ (or message-unique-id-char
5567 (logand (random most-positive-fixnum) (1- (lsh 1 20))))) 5567 (logand (random most-positive-fixnum) (1- (ash 1 20)))))
5568 ;; (current-time) returns 16-bit ints, 5568 ;; (current-time) returns 16-bit ints,
5569 ;; and 2^16*25 just fits into 4 digits i base 36. 5569 ;; and 2^16*25 just fits into 4 digits i base 36.
5570 (* 25 25))) 5570 (* 25 25)))
@@ -5579,9 +5579,9 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
5579 user) 5579 user)
5580 (message-number-base36 (user-uid) -1)) 5580 (message-number-base36 (user-uid) -1))
5581 (message-number-base36 (+ (car tm) 5581 (message-number-base36 (+ (car tm)
5582 (lsh (% message-unique-id-char 25) 16)) 4) 5582 (ash (% message-unique-id-char 25) 16)) 4)
5583 (message-number-base36 (+ (nth 1 tm) 5583 (message-number-base36 (+ (nth 1 tm)
5584 (lsh (/ message-unique-id-char 25) 16)) 4) 5584 (ash (/ message-unique-id-char 25) 16)) 4)
5585 ;; Append a given name, because while the generated ID is unique 5585 ;; Append a given name, because while the generated ID is unique
5586 ;; to this newsreader, other newsreaders might otherwise generate 5586 ;; to this newsreader, other newsreaders might otherwise generate
5587 ;; the same ID via another algorithm. 5587 ;; the same ID via another algorithm.
diff --git a/lisp/gnus/nndoc.el b/lisp/gnus/nndoc.el
index 149406a9a21..76e785d2ad6 100644
--- a/lisp/gnus/nndoc.el
+++ b/lisp/gnus/nndoc.el
@@ -769,9 +769,9 @@ from the document.")
769 769
770(defun nndoc-read-little-endian () 770(defun nndoc-read-little-endian ()
771 (+ (prog1 (char-after) (forward-char 1)) 771 (+ (prog1 (char-after) (forward-char 1))
772 (lsh (prog1 (char-after) (forward-char 1)) 8) 772 (ash (prog1 (char-after) (forward-char 1)) 8)
773 (lsh (prog1 (char-after) (forward-char 1)) 16) 773 (ash (prog1 (char-after) (forward-char 1)) 16)
774 (lsh (prog1 (char-after) (forward-char 1)) 24))) 774 (ash (prog1 (char-after) (forward-char 1)) 24)))
775 775
776(defun nndoc-oe-dbx-decode-block () 776(defun nndoc-oe-dbx-decode-block ()
777 (list 777 (list
diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el
index d5cfa27c21a..c8480ddda4c 100644
--- a/lisp/gnus/nnmaildir.el
+++ b/lisp/gnus/nnmaildir.el
@@ -651,7 +651,7 @@ This variable is set by `nnmaildir-request-article'.")
651 (funcall func (cdr entry))))))) 651 (funcall func (cdr entry)))))))
652 652
653(defun nnmaildir--up2-1 (n) 653(defun nnmaildir--up2-1 (n)
654 (if (zerop n) 1 (1- (lsh 1 (1+ (logb n)))))) 654 (if (zerop n) 1 (1- (ash 1 (1+ (logb n))))))
655 655
656(defun nnmaildir--system-name () 656(defun nnmaildir--system-name ()
657 (replace-regexp-in-string 657 (replace-regexp-in-string
diff --git a/lisp/image.el b/lisp/image.el
index 8d12b680ea9..74a23046e94 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -261,7 +261,7 @@ We accept the tag Exif because that is the same format."
261 (setq i (1+ i)) 261 (setq i (1+ i))
262 (when (>= (+ i 2) len) 262 (when (>= (+ i 2) len)
263 (throw 'jfif nil)) 263 (throw 'jfif nil))
264 (let ((nbytes (+ (lsh (aref data (+ i 1)) 8) 264 (let ((nbytes (+ (ash (aref data (+ i 1)) 8)
265 (aref data (+ i 2)))) 265 (aref data (+ i 2))))
266 (code (aref data i))) 266 (code (aref data i)))
267 (when (and (>= code #xe0) (<= code #xef)) 267 (when (and (>= code #xe0) (<= code #xef))
diff --git a/lisp/international/ccl.el b/lisp/international/ccl.el
index 58083f05d92..a80452f742f 100644
--- a/lisp/international/ccl.el
+++ b/lisp/international/ccl.el
@@ -1152,9 +1152,9 @@ is a list of CCL-BLOCKs."
1152 (progn 1152 (progn
1153 (insert (logand code #xFFFFFF)) 1153 (insert (logand code #xFFFFFF))
1154 (setq i (1+ i))) 1154 (setq i (1+ i)))
1155 (insert (format "%c" (lsh code -16))) 1155 (insert (format "%c" (ash code -16)))
1156 (if (< (1+ i) len) 1156 (if (< (1+ i) len)
1157 (insert (format "%c" (logand (lsh code -8) 255)))) 1157 (insert (format "%c" (logand (ash code -8) 255))))
1158 (if (< (+ i 2) len) 1158 (if (< (+ i 2) len)
1159 (insert (format "%c" (logand code 255)))) 1159 (insert (format "%c" (logand code 255))))
1160 (setq i (+ i 3))))) 1160 (setq i (+ i 3)))))
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index 9bd05ceb4a2..529262a1e7d 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -487,7 +487,7 @@
487 (data (list (vconcat (mapcar 'car cjk)))) 487 (data (list (vconcat (mapcar 'car cjk))))
488 (i 0)) 488 (i 0))
489 (dolist (elt cjk) 489 (dolist (elt cjk)
490 (let ((mask (lsh 1 i))) 490 (let ((mask (ash 1 i)))
491 (map-charset-chars 491 (map-charset-chars
492 #'(lambda (range _arg) 492 #'(lambda (range _arg)
493 (let ((from (car range)) (to (cdr range))) 493 (let ((from (car range)) (to (cdr range)))
@@ -867,7 +867,7 @@
867 (spec (cdr target-spec))) 867 (spec (cdr target-spec)))
868 (if (integerp spec) 868 (if (integerp spec)
869 (dotimes (i (length registries)) 869 (dotimes (i (length registries))
870 (if (> (logand spec (lsh 1 i)) 0) 870 (if (> (logand spec (ash 1 i)) 0)
871 (set-fontset-font "fontset-default" target 871 (set-fontset-font "fontset-default" target
872 (cons nil (aref registries i)) 872 (cons nil (aref registries i))
873 nil 'append))) 873 nil 'append)))
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 2bde83f4eab..817a26b1feb 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -451,8 +451,8 @@ non-nil, it is used to sort CODINGS instead."
451 ;; E: 1 if not XXX-with-esc 451 ;; E: 1 if not XXX-with-esc
452 ;; II: if iso-2022 based, 0..3, else 1. 452 ;; II: if iso-2022 based, 0..3, else 1.
453 (logior 453 (logior
454 (lsh (if (eq base most-preferred) 1 0) 7) 454 (ash (if (eq base most-preferred) 1 0) 7)
455 (lsh 455 (ash
456 (let ((mime (coding-system-get base :mime-charset))) 456 (let ((mime (coding-system-get base :mime-charset)))
457 ;; Prefer coding systems corresponding to a 457 ;; Prefer coding systems corresponding to a
458 ;; MIME charset. 458 ;; MIME charset.
@@ -468,9 +468,9 @@ non-nil, it is used to sort CODINGS instead."
468 (t 3)) 468 (t 3))
469 0)) 469 0))
470 5) 470 5)
471 (lsh (if (memq base lang-preferred) 1 0) 4) 471 (ash (if (memq base lang-preferred) 1 0) 4)
472 (lsh (if (memq base from-priority) 1 0) 3) 472 (ash (if (memq base from-priority) 1 0) 3)
473 (lsh (if (string-match-p "-with-esc\\'" 473 (ash (if (string-match-p "-with-esc\\'"
474 (symbol-name base)) 474 (symbol-name base))
475 0 1) 2) 475 0 1) 2)
476 (if (eq (coding-system-type base) 'iso-2022) 476 (if (eq (coding-system-type base) 'iso-2022)
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 0267b154409..a4f344192cd 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -911,7 +911,7 @@ non-ASCII files. This attribute is meaningful only when
911 (i 0)) 911 (i 0))
912 (dolist (elt coding-system-iso-2022-flags) 912 (dolist (elt coding-system-iso-2022-flags)
913 (if (memq elt flags) 913 (if (memq elt flags)
914 (setq bits (logior bits (lsh 1 i)))) 914 (setq bits (logior bits (ash 1 i))))
915 (setq i (1+ i))) 915 (setq i (1+ i)))
916 (setcdr (assq :flags spec-attrs) bits)))) 916 (setcdr (assq :flags spec-attrs) bits))))
917 917
diff --git a/lisp/json.el b/lisp/json.el
index cd95ec28327..112f26944bf 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -370,7 +370,7 @@ representation will be parsed correctly."
370 370
371(defun json--decode-utf-16-surrogates (high low) 371(defun json--decode-utf-16-surrogates (high low)
372 "Return the code point represented by the UTF-16 surrogates HIGH and LOW." 372 "Return the code point represented by the UTF-16 surrogates HIGH and LOW."
373 (+ (lsh (- high #xD800) 10) (- low #xDC00) #x10000)) 373 (+ (ash (- high #xD800) 10) (- low #xDC00) #x10000))
374 374
375(defun json-read-escaped-char () 375(defun json-read-escaped-char ()
376 "Read the JSON string escaped character at point." 376 "Read the JSON string escaped character at point."
diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el
index 299fc0b2341..fa2ea3d8471 100644
--- a/lisp/mail/binhex.el
+++ b/lisp/mail/binhex.el
@@ -136,9 +136,9 @@ input and write the converted data to its standard output."
136(defun binhex-update-crc (crc char &optional count) 136(defun binhex-update-crc (crc char &optional count)
137 (if (null count) (setq count 1)) 137 (if (null count) (setq count 1))
138 (while (> count 0) 138 (while (> count 0)
139 (setq crc (logxor (logand (lsh crc 8) 65280) 139 (setq crc (logxor (logand (ash crc 8) 65280)
140 (aref binhex-crc-table 140 (aref binhex-crc-table
141 (logxor (logand (lsh crc -8) 255) 141 (logxor (logand (ash crc -8) 255)
142 char))) 142 char)))
143 count (1- count))) 143 count (1- count)))
144 crc) 144 crc)
@@ -156,14 +156,14 @@ input and write the converted data to its standard output."
156(defun binhex-string-big-endian (string) 156(defun binhex-string-big-endian (string)
157 (let ((ret 0) (i 0) (len (length string))) 157 (let ((ret 0) (i 0) (len (length string)))
158 (while (< i len) 158 (while (< i len)
159 (setq ret (+ (lsh ret 8) (binhex-char-int (aref string i))) 159 (setq ret (+ (ash ret 8) (binhex-char-int (aref string i)))
160 i (1+ i))) 160 i (1+ i)))
161 ret)) 161 ret))
162 162
163(defun binhex-string-little-endian (string) 163(defun binhex-string-little-endian (string)
164 (let ((ret 0) (i 0) (shift 0) (len (length string))) 164 (let ((ret 0) (i 0) (shift 0) (len (length string)))
165 (while (< i len) 165 (while (< i len)
166 (setq ret (+ ret (lsh (binhex-char-int (aref string i)) shift)) 166 (setq ret (+ ret (ash (binhex-char-int (aref string i)) shift))
167 i (1+ i) 167 i (1+ i)
168 shift (+ shift 8))) 168 shift (+ shift 8)))
169 ret)) 169 ret))
@@ -239,13 +239,13 @@ If HEADER-ONLY is non-nil only decode header and return filename."
239 counter (1+ counter) 239 counter (1+ counter)
240 inputpos (1+ inputpos)) 240 inputpos (1+ inputpos))
241 (cond ((= counter 4) 241 (cond ((= counter 4)
242 (binhex-push-char (lsh bits -16) nil work-buffer) 242 (binhex-push-char (ash bits -16) nil work-buffer)
243 (binhex-push-char (logand (lsh bits -8) 255) nil 243 (binhex-push-char (logand (ash bits -8) 255) nil
244 work-buffer) 244 work-buffer)
245 (binhex-push-char (logand bits 255) nil 245 (binhex-push-char (logand bits 255) nil
246 work-buffer) 246 work-buffer)
247 (setq bits 0 counter 0)) 247 (setq bits 0 counter 0))
248 (t (setq bits (lsh bits 6))))) 248 (t (setq bits (ash bits 6)))))
249 (if (null file-name-length) 249 (if (null file-name-length)
250 (with-current-buffer work-buffer 250 (with-current-buffer work-buffer
251 (setq file-name-length (char-after (point-min)) 251 (setq file-name-length (char-after (point-min))
@@ -261,12 +261,12 @@ If HEADER-ONLY is non-nil only decode header and return filename."
261 (setq tmp (and tmp (not (eq inputpos end))))) 261 (setq tmp (and tmp (not (eq inputpos end)))))
262 (cond 262 (cond
263 ((= counter 3) 263 ((= counter 3)
264 (binhex-push-char (logand (lsh bits -16) 255) nil 264 (binhex-push-char (logand (ash bits -16) 255) nil
265 work-buffer) 265 work-buffer)
266 (binhex-push-char (logand (lsh bits -8) 255) nil 266 (binhex-push-char (logand (ash bits -8) 255) nil
267 work-buffer)) 267 work-buffer))
268 ((= counter 2) 268 ((= counter 2)
269 (binhex-push-char (logand (lsh bits -10) 255) nil 269 (binhex-push-char (logand (ash bits -10) 255) nil
270 work-buffer)))) 270 work-buffer))))
271 (if header-only nil 271 (if header-only nil
272 (binhex-verify-crc work-buffer 272 (binhex-verify-crc work-buffer
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 12a58b293d0..9416d049028 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -4515,7 +4515,7 @@ encoded string (and the same mask) will decode the string."
4515 (if (= curmask 0) 4515 (if (= curmask 0)
4516 (setq curmask mask)) 4516 (setq curmask mask))
4517 (setq charmask (% curmask 256)) 4517 (setq charmask (% curmask 256))
4518 (setq curmask (lsh curmask -8)) 4518 (setq curmask (ash curmask -8))
4519 (aset string-vector i (logxor charmask (aref string-vector i))) 4519 (aset string-vector i (logxor charmask (aref string-vector i)))
4520 (setq i (1+ i))) 4520 (setq i (1+ i)))
4521 (concat string-vector))) 4521 (concat string-vector)))
diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el
index 0cdceca6ff5..b8f74e3a839 100644
--- a/lisp/mail/uudecode.el
+++ b/lisp/mail/uudecode.el
@@ -171,12 +171,12 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
171 (cond ((= counter 4) 171 (cond ((= counter 4)
172 (setq result (cons 172 (setq result (cons
173 (concat 173 (concat
174 (char-to-string (lsh bits -16)) 174 (char-to-string (ash bits -16))
175 (char-to-string (logand (lsh bits -8) 255)) 175 (char-to-string (logand (ash bits -8) 255))
176 (char-to-string (logand bits 255))) 176 (char-to-string (logand bits 255)))
177 result)) 177 result))
178 (setq bits 0 counter 0)) 178 (setq bits 0 counter 0))
179 (t (setq bits (lsh bits 6))))))) 179 (t (setq bits (ash bits 6)))))))
180 (cond 180 (cond
181 (done) 181 (done)
182 ((> 0 remain) 182 ((> 0 remain)
@@ -188,12 +188,12 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
188 ((= counter 3) 188 ((= counter 3)
189 (setq result (cons 189 (setq result (cons
190 (concat 190 (concat
191 (char-to-string (logand (lsh bits -16) 255)) 191 (char-to-string (logand (ash bits -16) 255))
192 (char-to-string (logand (lsh bits -8) 255))) 192 (char-to-string (logand (ash bits -8) 255)))
193 result))) 193 result)))
194 ((= counter 2) 194 ((= counter 2)
195 (setq result (cons 195 (setq result (cons
196 (char-to-string (logand (lsh bits -10) 255)) 196 (char-to-string (logand (ash bits -10) 255))
197 result)))) 197 result))))
198 (skip-chars-forward non-data-chars end)) 198 (skip-chars-forward non-data-chars end))
199 (if file-name 199 (if file-name
diff --git a/lisp/md4.el b/lisp/md4.el
index 09b54fc9a7f..788846ab35a 100644
--- a/lisp/md4.el
+++ b/lisp/md4.el
@@ -91,15 +91,15 @@ strings containing the character 0."
91 (let* 91 (let*
92 ((h1 (+ (car a) (,func (car b) (car c) (car d)) (car xk) (car ac))) 92 ((h1 (+ (car a) (,func (car b) (car c) (car d)) (car xk) (car ac)))
93 (l1 (+ (cdr a) (,func (cdr b) (cdr c) (cdr d)) (cdr xk) (cdr ac))) 93 (l1 (+ (cdr a) (,func (cdr b) (cdr c) (cdr d)) (cdr xk) (cdr ac)))
94 (h2 (logand 65535 (+ h1 (lsh l1 -16)))) 94 (h2 (logand 65535 (+ h1 (ash l1 -16))))
95 (l2 (logand 65535 l1)) 95 (l2 (logand 65535 l1))
96 ;; cyclic shift of 32 bits integer 96 ;; cyclic shift of 32 bits integer
97 (h3 (logand 65535 (if (> s 15) 97 (h3 (logand 65535 (if (> s 15)
98 (+ (lsh h2 (- s 32)) (lsh l2 (- s 16))) 98 (+ (ash h2 (- s 32)) (ash l2 (- s 16)))
99 (+ (lsh h2 s) (lsh l2 (- s 16)))))) 99 (+ (ash h2 s) (ash l2 (- s 16))))))
100 (l3 (logand 65535 (if (> s 15) 100 (l3 (logand 65535 (if (> s 15)
101 (+ (lsh l2 (- s 32)) (lsh h2 (- s 16))) 101 (+ (ash l2 (- s 32)) (ash h2 (- s 16)))
102 (+ (lsh l2 s) (lsh h2 (- s 16))))))) 102 (+ (ash l2 s) (ash h2 (- s 16)))))))
103 (cons h3 l3)))) 103 (cons h3 l3))))
104 104
105(md4-make-step md4-round1 md4-F) 105(md4-make-step md4-round1 md4-F)
@@ -110,7 +110,7 @@ strings containing the character 0."
110 "Return 32-bit sum of 32-bit integers X and Y." 110 "Return 32-bit sum of 32-bit integers X and Y."
111 (let ((h (+ (car x) (car y))) 111 (let ((h (+ (car x) (car y)))
112 (l (+ (cdr x) (cdr y)))) 112 (l (+ (cdr x) (cdr y))))
113 (cons (logand 65535 (+ h (lsh l -16))) (logand 65535 l)))) 113 (cons (logand 65535 (+ h (ash l -16))) (logand 65535 l))))
114 114
115(defsubst md4-and (x y) 115(defsubst md4-and (x y)
116 (cons (logand (car x) (car y)) (logand (cdr x) (cdr y)))) 116 (cons (logand (car x) (car y)) (logand (cdr x) (cdr y))))
@@ -185,8 +185,8 @@ The resulting MD4 value is placed in `md4-buffer'."
185 (let ((int32s (make-vector 16 0)) (i 0) j) 185 (let ((int32s (make-vector 16 0)) (i 0) j)
186 (while (< i 16) 186 (while (< i 16)
187 (setq j (* i 4)) 187 (setq j (* i 4))
188 (aset int32s i (cons (+ (aref seq (+ j 2)) (lsh (aref seq (+ j 3)) 8)) 188 (aset int32s i (cons (+ (aref seq (+ j 2)) (ash (aref seq (+ j 3)) 8))
189 (+ (aref seq j) (lsh (aref seq (1+ j)) 8)))) 189 (+ (aref seq j) (ash (aref seq (1+ j)) 8))))
190 (setq i (1+ i))) 190 (setq i (1+ i)))
191 int32s)) 191 int32s))
192 192
@@ -197,7 +197,7 @@ The resulting MD4 value is placed in `md4-buffer'."
197 "Pack 16 bits integer in 2 bytes string as little endian." 197 "Pack 16 bits integer in 2 bytes string as little endian."
198 (let ((str (make-string 2 0))) 198 (let ((str (make-string 2 0)))
199 (aset str 0 (logand int16 255)) 199 (aset str 0 (logand int16 255))
200 (aset str 1 (lsh int16 -8)) 200 (aset str 1 (ash int16 -8))
201 str)) 201 str))
202 202
203(defun md4-pack-int32 (int32) 203(defun md4-pack-int32 (int32)
@@ -207,20 +207,20 @@ integers (cons high low)."
207 (let ((str (make-string 4 0)) 207 (let ((str (make-string 4 0))
208 (h (car int32)) (l (cdr int32))) 208 (h (car int32)) (l (cdr int32)))
209 (aset str 0 (logand l 255)) 209 (aset str 0 (logand l 255))
210 (aset str 1 (lsh l -8)) 210 (aset str 1 (ash l -8))
211 (aset str 2 (logand h 255)) 211 (aset str 2 (logand h 255))
212 (aset str 3 (lsh h -8)) 212 (aset str 3 (ash h -8))
213 str)) 213 str))
214 214
215(defun md4-unpack-int16 (str) 215(defun md4-unpack-int16 (str)
216 (if (eq 2 (length str)) 216 (if (eq 2 (length str))
217 (+ (lsh (aref str 1) 8) (aref str 0)) 217 (+ (ash (aref str 1) 8) (aref str 0))
218 (error "%s is not 2 bytes long" str))) 218 (error "%s is not 2 bytes long" str)))
219 219
220(defun md4-unpack-int32 (str) 220(defun md4-unpack-int32 (str)
221 (if (eq 4 (length str)) 221 (if (eq 4 (length str))
222 (cons (+ (lsh (aref str 3) 8) (aref str 2)) 222 (cons (+ (ash (aref str 3) 8) (aref str 2))
223 (+ (lsh (aref str 1) 8) (aref str 0))) 223 (+ (ash (aref str 1) 8) (aref str 0)))
224 (error "%s is not 4 bytes long" str))) 224 (error "%s is not 4 bytes long" str)))
225 225
226(provide 'md4) 226(provide 'md4)
diff --git a/lisp/net/dns.el b/lisp/net/dns.el
index 057ae3219ee..b3b430d2ba8 100644
--- a/lisp/net/dns.el
+++ b/lisp/net/dns.el
@@ -117,7 +117,7 @@ updated. Set this variable to t to disable the check.")
117 length) 117 length)
118 (while (not ended) 118 (while (not ended)
119 (setq length (dns-read-bytes 1)) 119 (setq length (dns-read-bytes 1))
120 (if (= 192 (logand length (lsh 3 6))) 120 (if (= 192 (logand length (ash 3 6)))
121 (let ((offset (+ (* (logand 63 length) 256) 121 (let ((offset (+ (* (logand 63 length) 256)
122 (dns-read-bytes 1)))) 122 (dns-read-bytes 1))))
123 (save-excursion 123 (save-excursion
@@ -144,17 +144,17 @@ If TCP-P, the first two bytes of the package with be the length field."
144 (dns-write-bytes (dns-get 'id spec) 2) 144 (dns-write-bytes (dns-get 'id spec) 2)
145 (dns-write-bytes 145 (dns-write-bytes
146 (logior 146 (logior
147 (lsh (if (dns-get 'response-p spec) 1 0) -7) 147 (ash (if (dns-get 'response-p spec) 1 0) 7)
148 (lsh 148 (ash
149 (cond 149 (cond
150 ((eq (dns-get 'opcode spec) 'query) 0) 150 ((eq (dns-get 'opcode spec) 'query) 0)
151 ((eq (dns-get 'opcode spec) 'inverse-query) 1) 151 ((eq (dns-get 'opcode spec) 'inverse-query) 1)
152 ((eq (dns-get 'opcode spec) 'status) 2) 152 ((eq (dns-get 'opcode spec) 'status) 2)
153 (t (error "No such opcode: %s" (dns-get 'opcode spec)))) 153 (t (error "No such opcode: %s" (dns-get 'opcode spec))))
154 -3) 154 3)
155 (lsh (if (dns-get 'authoritative-p spec) 1 0) -2) 155 (ash (if (dns-get 'authoritative-p spec) 1 0) 2)
156 (lsh (if (dns-get 'truncated-p spec) 1 0) -1) 156 (ash (if (dns-get 'truncated-p spec) 1 0) 1)
157 (lsh (if (dns-get 'recursion-desired-p spec) 1 0) 0))) 157 (ash (if (dns-get 'recursion-desired-p spec) 1 0) 0)))
158 (dns-write-bytes 158 (dns-write-bytes
159 (cond 159 (cond
160 ((eq (dns-get 'response-code spec) 'no-error) 0) 160 ((eq (dns-get 'response-code spec) 'no-error) 0)
@@ -198,20 +198,20 @@ If TCP-P, the first two bytes of the package with be the length field."
198 (goto-char (point-min)) 198 (goto-char (point-min))
199 (push (list 'id (dns-read-bytes 2)) spec) 199 (push (list 'id (dns-read-bytes 2)) spec)
200 (let ((byte (dns-read-bytes 1))) 200 (let ((byte (dns-read-bytes 1)))
201 (push (list 'response-p (if (zerop (logand byte (lsh 1 7))) nil t)) 201 (push (list 'response-p (if (zerop (logand byte (ash 1 7))) nil t))
202 spec) 202 spec)
203 (let ((opcode (logand byte (lsh 7 3)))) 203 (let ((opcode (logand byte (ash 7 3))))
204 (push (list 'opcode 204 (push (list 'opcode
205 (cond ((eq opcode 0) 'query) 205 (cond ((eq opcode 0) 'query)
206 ((eq opcode 1) 'inverse-query) 206 ((eq opcode 1) 'inverse-query)
207 ((eq opcode 2) 'status))) 207 ((eq opcode 2) 'status)))
208 spec)) 208 spec))
209 (push (list 'authoritative-p (if (zerop (logand byte (lsh 1 2))) 209 (push (list 'authoritative-p (if (zerop (logand byte (ash 1 2)))
210 nil t)) spec) 210 nil t)) spec)
211 (push (list 'truncated-p (if (zerop (logand byte (lsh 1 2))) nil t)) 211 (push (list 'truncated-p (if (zerop (logand byte (ash 1 2))) nil t))
212 spec) 212 spec)
213 (push (list 'recursion-desired-p 213 (push (list 'recursion-desired-p
214 (if (zerop (logand byte (lsh 1 0))) nil t)) spec)) 214 (if (zerop (logand byte (ash 1 0))) nil t)) spec))
215 (let ((rc (logand (dns-read-bytes 1) 15))) 215 (let ((rc (logand (dns-read-bytes 1) 15)))
216 (push (list 'response-code 216 (push (list 'response-code
217 (cond 217 (cond
diff --git a/lisp/net/ntlm.el b/lisp/net/ntlm.el
index 8366bc14e95..217f0b859f2 100644
--- a/lisp/net/ntlm.el
+++ b/lisp/net/ntlm.el
@@ -411,9 +411,9 @@ a string KEY of length 8. FORW is t or nil."
411 (key2 (ntlm-smb-str-to-key key)) 411 (key2 (ntlm-smb-str-to-key key))
412 (i 0) aa) 412 (i 0) aa)
413 (while (< i 64) 413 (while (< i 64)
414 (unless (zerop (logand (aref in (/ i 8)) (lsh 1 (- 7 (% i 8))))) 414 (unless (zerop (logand (aref in (/ i 8)) (ash 1 (- 7 (% i 8)))))
415 (aset inb i 1)) 415 (aset inb i 1))
416 (unless (zerop (logand (aref key2 (/ i 8)) (lsh 1 (- 7 (% i 8))))) 416 (unless (zerop (logand (aref key2 (/ i 8)) (ash 1 (- 7 (% i 8)))))
417 (aset keyb i 1)) 417 (aset keyb i 1))
418 (setq i (1+ i))) 418 (setq i (1+ i)))
419 (setq outb (ntlm-smb-dohash inb keyb forw)) 419 (setq outb (ntlm-smb-dohash inb keyb forw))
@@ -422,7 +422,7 @@ a string KEY of length 8. FORW is t or nil."
422 (unless (zerop (aref outb i)) 422 (unless (zerop (aref outb i))
423 (setq aa (aref out (/ i 8))) 423 (setq aa (aref out (/ i 8)))
424 (aset out (/ i 8) 424 (aset out (/ i 8)
425 (logior aa (lsh 1 (- 7 (% i 8)))))) 425 (logior aa (ash 1 (- 7 (% i 8))))))
426 (setq i (1+ i))) 426 (setq i (1+ i)))
427 out)) 427 out))
428 428
@@ -430,28 +430,28 @@ a string KEY of length 8. FORW is t or nil."
430 "Return a string of length 8 for the given string STR of length 7." 430 "Return a string of length 8 for the given string STR of length 7."
431 (let ((key (make-string 8 0)) 431 (let ((key (make-string 8 0))
432 (i 7)) 432 (i 7))
433 (aset key 0 (lsh (aref str 0) -1)) 433 (aset key 0 (ash (aref str 0) -1))
434 (aset key 1 (logior 434 (aset key 1 (logior
435 (lsh (logand (aref str 0) 1) 6) 435 (ash (logand (aref str 0) 1) 6)
436 (lsh (aref str 1) -2))) 436 (ash (aref str 1) -2)))
437 (aset key 2 (logior 437 (aset key 2 (logior
438 (lsh (logand (aref str 1) 3) 5) 438 (ash (logand (aref str 1) 3) 5)
439 (lsh (aref str 2) -3))) 439 (ash (aref str 2) -3)))
440 (aset key 3 (logior 440 (aset key 3 (logior
441 (lsh (logand (aref str 2) 7) 4) 441 (ash (logand (aref str 2) 7) 4)
442 (lsh (aref str 3) -4))) 442 (ash (aref str 3) -4)))
443 (aset key 4 (logior 443 (aset key 4 (logior
444 (lsh (logand (aref str 3) 15) 3) 444 (ash (logand (aref str 3) 15) 3)
445 (lsh (aref str 4) -5))) 445 (ash (aref str 4) -5)))
446 (aset key 5 (logior 446 (aset key 5 (logior
447 (lsh (logand (aref str 4) 31) 2) 447 (ash (logand (aref str 4) 31) 2)
448 (lsh (aref str 5) -6))) 448 (ash (aref str 5) -6)))
449 (aset key 6 (logior 449 (aset key 6 (logior
450 (lsh (logand (aref str 5) 63) 1) 450 (ash (logand (aref str 5) 63) 1)
451 (lsh (aref str 6) -7))) 451 (ash (aref str 6) -7)))
452 (aset key 7 (logand (aref str 6) 127)) 452 (aset key 7 (logand (aref str 6) 127))
453 (while (>= i 0) 453 (while (>= i 0)
454 (aset key i (lsh (aref key i) 1)) 454 (aset key i (ash (aref key i) 1))
455 (setq i (1- i))) 455 (setq i (1- i)))
456 key)) 456 key))
457 457
@@ -619,16 +619,16 @@ backward."
619 (setq j 0) 619 (setq j 0)
620 (while (< j 8) 620 (while (< j 8)
621 (setq bj (aref b j)) 621 (setq bj (aref b j))
622 (setq m (logior (lsh (aref bj 0) 1) (aref bj 5))) 622 (setq m (logior (ash (aref bj 0) 1) (aref bj 5)))
623 (setq n (logior (lsh (aref bj 1) 3) 623 (setq n (logior (ash (aref bj 1) 3)
624 (lsh (aref bj 2) 2) 624 (ash (aref bj 2) 2)
625 (lsh (aref bj 3) 1) 625 (ash (aref bj 3) 1)
626 (aref bj 4))) 626 (aref bj 4)))
627 (setq k 0) 627 (setq k 0)
628 (setq sbox-jmn (aref (aref (aref ntlm-smb-sbox j) m) n)) 628 (setq sbox-jmn (aref (aref (aref ntlm-smb-sbox j) m) n))
629 (while (< k 4) 629 (while (< k 4)
630 (aset bj k 630 (aset bj k
631 (if (zerop (logand sbox-jmn (lsh 1 (- 3 k)))) 631 (if (zerop (logand sbox-jmn (ash 1 (- 3 k))))
632 0 1)) 632 0 1))
633 (setq k (1+ k))) 633 (setq k (1+ k)))
634 (setq j (1+ j))) 634 (setq j (1+ j)))
diff --git a/lisp/net/sasl.el b/lisp/net/sasl.el
index b4f0fffc716..ca0b66b2fb6 100644
--- a/lisp/net/sasl.el
+++ b/lisp/net/sasl.el
@@ -183,7 +183,7 @@ It contain at least 64 bits of entropy."
183 ;; Don't use microseconds from (current-time), they may be unsupported. 183 ;; Don't use microseconds from (current-time), they may be unsupported.
184 ;; Instead we use this randomly inited counter. 184 ;; Instead we use this randomly inited counter.
185 (setq sasl-unique-id-char 185 (setq sasl-unique-id-char
186 (% (1+ (or sasl-unique-id-char (logand (random) (1- (lsh 1 20))))) 186 (% (1+ (or sasl-unique-id-char (logand (random) (1- (ash 1 20)))))
187 ;; (current-time) returns 16-bit ints, 187 ;; (current-time) returns 16-bit ints,
188 ;; and 2^16*25 just fits into 4 digits i base 36. 188 ;; and 2^16*25 just fits into 4 digits i base 36.
189 (* 25 25))) 189 (* 25 25)))
@@ -191,10 +191,10 @@ It contain at least 64 bits of entropy."
191 (concat 191 (concat
192 (sasl-unique-id-number-base36 192 (sasl-unique-id-number-base36
193 (+ (car tm) 193 (+ (car tm)
194 (lsh (% sasl-unique-id-char 25) 16)) 4) 194 (ash (% sasl-unique-id-char 25) 16)) 4)
195 (sasl-unique-id-number-base36 195 (sasl-unique-id-number-base36
196 (+ (nth 1 tm) 196 (+ (nth 1 tm)
197 (lsh (/ sasl-unique-id-char 25) 16)) 4)))) 197 (ash (/ sasl-unique-id-char 25) 16)) 4))))
198 198
199(defun sasl-unique-id-number-base36 (num len) 199(defun sasl-unique-id-number-base36 (num len)
200 (if (if (< len 0) 200 (if (if (< len 0)
diff --git a/lisp/net/socks.el b/lisp/net/socks.el
index 4a3b13282cf..5ee6eea933f 100644
--- a/lisp/net/socks.el
+++ b/lisp/net/socks.el
@@ -420,7 +420,7 @@
420 (unibyte-string 420 (unibyte-string
421 version ; version 421 version ; version
422 command ; command 422 command ; command
423 (lsh port -8) ; port, high byte 423 (ash port -8) ; port, high byte
424 (logand port #xff)) ; port, low byte 424 (logand port #xff)) ; port, low byte
425 addr ; address 425 addr ; address
426 (user-full-name) ; username 426 (user-full-name) ; username
@@ -434,7 +434,7 @@
434 atype) ; address type 434 atype) ; address type
435 addr ; address 435 addr ; address
436 (unibyte-string 436 (unibyte-string
437 (lsh port -8) ; port, high byte 437 (ash port -8) ; port, high byte
438 (logand port #xff))))) ; port, low byte 438 (logand port #xff))))) ; port, low byte
439 (t 439 (t
440 (error "Unknown protocol version: %d" version))) 440 (error "Unknown protocol version: %d" version)))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 1af2defd586..8e6c9118509 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4108,13 +4108,13 @@ This is used to map a mode number to a permission string.")
4108(defun tramp-file-mode-from-int (mode) 4108(defun tramp-file-mode-from-int (mode)
4109 "Turn an integer representing a file mode into an ls(1)-like string." 4109 "Turn an integer representing a file mode into an ls(1)-like string."
4110 (let ((type (cdr 4110 (let ((type (cdr
4111 (assoc (logand (lsh mode -12) 15) tramp-file-mode-type-map))) 4111 (assoc (logand (ash mode -12) 15) tramp-file-mode-type-map)))
4112 (user (logand (lsh mode -6) 7)) 4112 (user (logand (ash mode -6) 7))
4113 (group (logand (lsh mode -3) 7)) 4113 (group (logand (ash mode -3) 7))
4114 (other (logand (lsh mode -0) 7)) 4114 (other (logand (ash mode -0) 7))
4115 (suid (> (logand (lsh mode -9) 4) 0)) 4115 (suid (> (logand (ash mode -9) 4) 0))
4116 (sgid (> (logand (lsh mode -9) 2) 0)) 4116 (sgid (> (logand (ash mode -9) 2) 0))
4117 (sticky (> (logand (lsh mode -9) 1) 0))) 4117 (sticky (> (logand (ash mode -9) 1) 0)))
4118 (setq user (tramp-file-mode-permissions user suid "s")) 4118 (setq user (tramp-file-mode-permissions user suid "s"))
4119 (setq group (tramp-file-mode-permissions group sgid "s")) 4119 (setq group (tramp-file-mode-permissions group sgid "s"))
4120 (setq other (tramp-file-mode-permissions other sticky "t")) 4120 (setq other (tramp-file-mode-permissions other sticky "t"))
diff --git a/lisp/obsolete/levents.el b/lisp/obsolete/levents.el
index 7fb3be83ee2..48afe7551de 100644
--- a/lisp/obsolete/levents.el
+++ b/lisp/obsolete/levents.el
@@ -145,7 +145,7 @@ It will be the next event read after all pending events."
145The value is an ASCII printing character (not upper case) or a symbol." 145The value is an ASCII printing character (not upper case) or a symbol."
146 (if (symbolp event) 146 (if (symbolp event)
147 (car (get event 'event-symbol-elements)) 147 (car (get event 'event-symbol-elements))
148 (let ((base (logand event (1- (lsh 1 18))))) 148 (let ((base (logand event (1- (ash 1 18)))))
149 (downcase (if (< base 32) (logior base 64) base))))) 149 (downcase (if (< base 32) (logior base 64) base)))))
150 150
151(defun event-object (event) 151(defun event-object (event)
diff --git a/lisp/obsolete/pgg-parse.el b/lisp/obsolete/pgg-parse.el
index 34ec96ec12c..a7470246492 100644
--- a/lisp/obsolete/pgg-parse.el
+++ b/lisp/obsolete/pgg-parse.el
@@ -116,9 +116,9 @@
116 ) 116 )
117 117
118(defmacro pgg-parse-time-field (bytes) 118(defmacro pgg-parse-time-field (bytes)
119 `(list (logior (lsh (car ,bytes) 8) 119 `(list (logior (ash (car ,bytes) 8)
120 (nth 1 ,bytes)) 120 (nth 1 ,bytes))
121 (logior (lsh (nth 2 ,bytes) 8) 121 (logior (ash (nth 2 ,bytes) 8)
122 (nth 3 ,bytes)) 122 (nth 3 ,bytes))
123 0)) 123 0))
124 124
@@ -184,21 +184,21 @@
184 (ccl-execute-on-string pgg-parse-crc24 h string) 184 (ccl-execute-on-string pgg-parse-crc24 h string)
185 (format "%c%c%c" 185 (format "%c%c%c"
186 (logand (aref h 1) 255) 186 (logand (aref h 1) 255)
187 (logand (lsh (aref h 2) -8) 255) 187 (logand (ash (aref h 2) -8) 255)
188 (logand (aref h 2) 255))))) 188 (logand (aref h 2) 255)))))
189 189
190(defmacro pgg-parse-length-type (c) 190(defmacro pgg-parse-length-type (c)
191 `(cond 191 `(cond
192 ((< ,c 192) (cons ,c 1)) 192 ((< ,c 192) (cons ,c 1))
193 ((< ,c 224) 193 ((< ,c 224)
194 (cons (+ (lsh (- ,c 192) 8) 194 (cons (+ (ash (- ,c 192) 8)
195 (pgg-byte-after (+ 2 (point))) 195 (pgg-byte-after (+ 2 (point)))
196 192) 196 192)
197 2)) 197 2))
198 ((= ,c 255) 198 ((= ,c 255)
199 (cons (cons (logior (lsh (pgg-byte-after (+ 2 (point))) 8) 199 (cons (cons (logior (ash (pgg-byte-after (+ 2 (point))) 8)
200 (pgg-byte-after (+ 3 (point)))) 200 (pgg-byte-after (+ 3 (point))))
201 (logior (lsh (pgg-byte-after (+ 4 (point))) 8) 201 (logior (ash (pgg-byte-after (+ 4 (point))) 8)
202 (pgg-byte-after (+ 5 (point))))) 202 (pgg-byte-after (+ 5 (point)))))
203 5)) 203 5))
204 (t;partial body length 204 (t;partial body length
@@ -210,13 +210,13 @@
210 (if (zerop (logand 64 ptag));Old format 210 (if (zerop (logand 64 ptag));Old format
211 (progn 211 (progn
212 (setq length-type (logand ptag 3) 212 (setq length-type (logand ptag 3)
213 length-type (if (= 3 length-type) 0 (lsh 1 length-type)) 213 length-type (if (= 3 length-type) 0 (ash 1 length-type))
214 content-tag (logand 15 (lsh ptag -2)) 214 content-tag (logand 15 (ash ptag -2))
215 packet-bytes 0 215 packet-bytes 0
216 header-bytes (1+ length-type)) 216 header-bytes (1+ length-type))
217 (dotimes (i length-type) 217 (dotimes (i length-type)
218 (setq packet-bytes 218 (setq packet-bytes
219 (logior (lsh packet-bytes 8) 219 (logior (ash packet-bytes 8)
220 (pgg-byte-after (+ 1 i (point))))))) 220 (pgg-byte-after (+ 1 i (point)))))))
221 (setq content-tag (logand 63 ptag) 221 (setq content-tag (logand 63 ptag)
222 length-type (pgg-parse-length-type 222 length-type (pgg-parse-length-type
@@ -317,10 +317,10 @@
317 (let ((name-bytes (pgg-read-bytes 2)) 317 (let ((name-bytes (pgg-read-bytes 2))
318 (value-bytes (pgg-read-bytes 2))) 318 (value-bytes (pgg-read-bytes 2)))
319 (cons (pgg-read-bytes-string 319 (cons (pgg-read-bytes-string
320 (logior (lsh (car name-bytes) 8) 320 (logior (ash (car name-bytes) 8)
321 (nth 1 name-bytes))) 321 (nth 1 name-bytes)))
322 (pgg-read-bytes-string 322 (pgg-read-bytes-string
323 (logior (lsh (car value-bytes) 8) 323 (logior (ash (car value-bytes) 8)
324 (nth 1 value-bytes))))))) 324 (nth 1 value-bytes)))))))
325 (21 ;preferred hash algorithms 325 (21 ;preferred hash algorithms
326 (cons 'preferred-hash-algorithm 326 (cons 'preferred-hash-algorithm
@@ -380,7 +380,7 @@
380 (pgg-set-alist result 380 (pgg-set-alist result
381 'hash-algorithm (pgg-read-byte)) 381 'hash-algorithm (pgg-read-byte))
382 (when (>= 10000 (setq n (pgg-read-bytes 2) 382 (when (>= 10000 (setq n (pgg-read-bytes 2)
383 n (logior (lsh (car n) 8) 383 n (logior (ash (car n) 8)
384 (nth 1 n)))) 384 (nth 1 n))))
385 (save-restriction 385 (save-restriction
386 (narrow-to-region (point)(+ n (point))) 386 (narrow-to-region (point)(+ n (point)))
@@ -391,7 +391,7 @@
391 #'pgg-parse-signature-subpacket))) 391 #'pgg-parse-signature-subpacket)))
392 (goto-char (point-max)))) 392 (goto-char (point-max))))
393 (when (>= 10000 (setq n (pgg-read-bytes 2) 393 (when (>= 10000 (setq n (pgg-read-bytes 2)
394 n (logior (lsh (car n) 8) 394 n (logior (ash (car n) 8)
395 (nth 1 n)))) 395 (nth 1 n))))
396 (save-restriction 396 (save-restriction
397 (narrow-to-region (point)(+ n (point))) 397 (narrow-to-region (point)(+ n (point)))
diff --git a/lisp/org/org.el b/lisp/org/org.el
index e45bc55b244..21d9cd8785d 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -10058,7 +10058,7 @@ Note: this function also decodes single byte encodings like
10058 (cons 6 128)))) 10058 (cons 6 128))))
10059 (when (>= val 192) (setq eat (car shift-xor))) 10059 (when (>= val 192) (setq eat (car shift-xor)))
10060 (setq val (logxor val (cdr shift-xor))) 10060 (setq val (logxor val (cdr shift-xor)))
10061 (setq sum (+ (lsh sum (car shift-xor)) val)) 10061 (setq sum (+ (ash sum (car shift-xor)) val))
10062 (when (> eat 0) (setq eat (- eat 1))) 10062 (when (> eat 0) (setq eat (- eat 1)))
10063 (cond 10063 (cond
10064 ((= 0 eat) ;multi byte 10064 ((= 0 eat) ;multi byte
diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el
index 8901dba34cf..ba5a0232e42 100644
--- a/lisp/org/ox-publish.el
+++ b/lisp/org/ox-publish.el
@@ -794,8 +794,8 @@ Default for SITEMAP-FILENAME is `sitemap.org'."
794 ((or `anti-chronologically `chronologically) 794 ((or `anti-chronologically `chronologically)
795 (let* ((adate (org-publish-find-date a project)) 795 (let* ((adate (org-publish-find-date a project))
796 (bdate (org-publish-find-date b project)) 796 (bdate (org-publish-find-date b project))
797 (A (+ (lsh (car adate) 16) (cadr adate))) 797 (A (+ (ash (car adate) 16) (cadr adate)))
798 (B (+ (lsh (car bdate) 16) (cadr bdate)))) 798 (B (+ (ash (car bdate) 16) (cadr bdate))))
799 (setq retval 799 (setq retval
800 (if (eq sort-files 'chronologically) 800 (if (eq sort-files 'chronologically)
801 (<= A B) 801 (<= A B)
@@ -1348,7 +1348,7 @@ does not exist."
1348 (expand-file-name (or (file-symlink-p file) file) 1348 (expand-file-name (or (file-symlink-p file) file)
1349 (file-name-directory file))))) 1349 (file-name-directory file)))))
1350 (if (not attr) (error "No such file: \"%s\"" file) 1350 (if (not attr) (error "No such file: \"%s\"" file)
1351 (+ (lsh (car (nth 5 attr)) 16) 1351 (+ (ash (car (nth 5 attr)) 16)
1352 (cadr (nth 5 attr)))))) 1352 (cadr (nth 5 attr))))))
1353 1353
1354 1354
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index 53d665477c1..f41a7cf028c 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1858,7 +1858,7 @@ non-nil, a caret is prepended to invert the set."
1858 (setq entry (get-char-table ?a table))) 1858 (setq entry (get-char-table ?a table)))
1859 ;; incompatible 1859 ;; incompatible
1860 (t (error "CC Mode is incompatible with this version of Emacs"))) 1860 (t (error "CC Mode is incompatible with this version of Emacs")))
1861 (setq list (cons (if (= (logand (lsh entry -16) 255) 255) 1861 (setq list (cons (if (= (logand (ash entry -16) 255) 255)
1862 '8-bit 1862 '8-bit
1863 '1-bit) 1863 '1-bit)
1864 list))) 1864 list)))
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 74ec569214e..e29eb74a05b 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -5130,7 +5130,7 @@ killed after process termination."
5130(defsubst ebnf-font-background (font) (nth 3 font)) 5130(defsubst ebnf-font-background (font) (nth 3 font))
5131(defsubst ebnf-font-list (font) (nthcdr 4 font)) 5131(defsubst ebnf-font-list (font) (nthcdr 4 font))
5132(defsubst ebnf-font-attributes (font) 5132(defsubst ebnf-font-attributes (font)
5133 (lsh (ps-extension-bit (cdr font)) -2)) 5133 (ash (ps-extension-bit (cdr font)) -2))
5134 5134
5135 5135
5136(defconst ebnf-font-name-select 5136(defconst ebnf-font-name-select
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el
index 24ad2ff6c75..62e8c453389 100644
--- a/lisp/progmodes/hideif.el
+++ b/lisp/progmodes/hideif.el
@@ -1039,16 +1039,12 @@ preprocessing token"
1039(defun hif-shiftleft (a b) 1039(defun hif-shiftleft (a b)
1040 (setq a (hif-mathify a)) 1040 (setq a (hif-mathify a))
1041 (setq b (hif-mathify b)) 1041 (setq b (hif-mathify b))
1042 (if (< a 0) 1042 (ash a b))
1043 (ash a b)
1044 (lsh a b)))
1045 1043
1046(defun hif-shiftright (a b) 1044(defun hif-shiftright (a b)
1047 (setq a (hif-mathify a)) 1045 (setq a (hif-mathify a))
1048 (setq b (hif-mathify b)) 1046 (setq b (hif-mathify b))
1049 (if (< a 0) 1047 (ash a (- b)))
1050 (ash a (- b))
1051 (lsh a (- b))))
1052 1048
1053 1049
1054(defalias 'hif-multiply (hif-mathify-binop *)) 1050(defalias 'hif-multiply (hif-mathify-binop *))
diff --git a/lisp/ps-bdf.el b/lisp/ps-bdf.el
index c8f88234a03..301142ed489 100644
--- a/lisp/ps-bdf.el
+++ b/lisp/ps-bdf.el
@@ -145,7 +145,7 @@ See the documentation of the function `bdf-read-font-info' for more detail."
145 (if (or (< code (aref code-range 4)) 145 (if (or (< code (aref code-range 4))
146 (> code (aref code-range 5))) 146 (> code (aref code-range 5)))
147 (setq code (aref code-range 6))) 147 (setq code (aref code-range 6)))
148 (+ (* (- (lsh code -8) (aref code-range 0)) 148 (+ (* (- (ash code -8) (aref code-range 0))
149 (1+ (- (aref code-range 3) (aref code-range 2)))) 149 (1+ (- (aref code-range 3) (aref code-range 2))))
150 (- (logand code 255) (aref code-range 2)))) 150 (- (logand code 255) (aref code-range 2))))
151 151
@@ -262,7 +262,7 @@ CODE, where N and CODE are in the following relation:
262 (setq code (read (current-buffer))) 262 (setq code (read (current-buffer)))
263 (if (< code 0) 263 (if (< code 0)
264 (search-forward "ENDCHAR") 264 (search-forward "ENDCHAR")
265 (setq code0 (lsh code -8) 265 (setq code0 (ash code -8)
266 code1 (logand code 255) 266 code1 (logand code 255)
267 min-code (min min-code code) 267 min-code (min min-code code)
268 max-code (max max-code code) 268 max-code (max max-code code)
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 28f93f4e203..7dd1103c2e3 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -6299,7 +6299,7 @@ If FACE is not a valid face name, use default face."
6299 (ps-font-number 'ps-font-for-text 6299 (ps-font-number 'ps-font-for-text
6300 (or (aref ps-font-type (logand effect 3)) 6300 (or (aref ps-font-type (logand effect 3))
6301 face)) 6301 face))
6302 fg-color bg-color (lsh effect -2))))) 6302 fg-color bg-color (ash effect -2)))))
6303 (goto-char to)) 6303 (goto-char to))
6304 6304
6305 6305
diff --git a/lisp/simple.el b/lisp/simple.el
index 6040d48a991..0ccf2f1d22e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -8348,16 +8348,16 @@ PREFIX is the string that represents this modifier in an event type symbol."
8348 (cond ((eq symbol 'control) 8348 (cond ((eq symbol 'control)
8349 (if (<= 64 (upcase event) 95) 8349 (if (<= 64 (upcase event) 95)
8350 (- (upcase event) 64) 8350 (- (upcase event) 64)
8351 (logior (lsh 1 lshiftby) event))) 8351 (logior (ash 1 lshiftby) event)))
8352 ((eq symbol 'shift) 8352 ((eq symbol 'shift)
8353 ;; FIXME: Should we also apply this "upcase" behavior of shift 8353 ;; FIXME: Should we also apply this "upcase" behavior of shift
8354 ;; to non-ascii letters? 8354 ;; to non-ascii letters?
8355 (if (and (<= (downcase event) ?z) 8355 (if (and (<= (downcase event) ?z)
8356 (>= (downcase event) ?a)) 8356 (>= (downcase event) ?a))
8357 (upcase event) 8357 (upcase event)
8358 (logior (lsh 1 lshiftby) event))) 8358 (logior (ash 1 lshiftby) event)))
8359 (t 8359 (t
8360 (logior (lsh 1 lshiftby) event))) 8360 (logior (ash 1 lshiftby) event)))
8361 (if (memq symbol (event-modifiers event)) 8361 (if (memq symbol (event-modifiers event))
8362 event 8362 event
8363 (let ((event-type (if (symbolp event) event (car event)))) 8363 (let ((event-type (if (symbolp event) event (car event))))
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 9860c8b30cf..19e5159816a 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -1279,8 +1279,8 @@ for this to be permanent."
1279 ;; Format a timestamp as 11 octal digits. Ghod, I hope this works... 1279 ;; Format a timestamp as 11 octal digits. Ghod, I hope this works...
1280 (let ((hibits (car timeval)) (lobits (car (cdr timeval)))) 1280 (let ((hibits (car timeval)) (lobits (car (cdr timeval))))
1281 (format "%05o%01o%05o" 1281 (format "%05o%01o%05o"
1282 (lsh hibits -2) 1282 (ash hibits -2)
1283 (logior (lsh (logand 3 hibits) 1) 1283 (logior (ash (logand 3 hibits) 1)
1284 (if (> (logand lobits 32768) 0) 1 0)) 1284 (if (> (logand lobits 32768) 0) 1 0))
1285 (logand 32767 lobits) 1285 (logand 32767 lobits)
1286 ))) 1286 )))
diff --git a/lisp/term/common-win.el b/lisp/term/common-win.el
index 6ef686a996f..a482067ef39 100644
--- a/lisp/term/common-win.el
+++ b/lisp/term/common-win.el
@@ -59,20 +59,20 @@
59 (setq system-key-alist 59 (setq system-key-alist
60 (list 60 (list
61 ;; These are special "keys" used to pass events from C to lisp. 61 ;; These are special "keys" used to pass events from C to lisp.
62 (cons (logior (lsh 0 16) 1) 'ns-power-off) 62 (cons 1 'ns-power-off)
63 (cons (logior (lsh 0 16) 2) 'ns-open-file) 63 (cons 2 'ns-open-file)
64 (cons (logior (lsh 0 16) 3) 'ns-open-temp-file) 64 (cons 3 'ns-open-temp-file)
65 (cons (logior (lsh 0 16) 4) 'ns-drag-file) 65 (cons 4 'ns-drag-file)
66 (cons (logior (lsh 0 16) 5) 'ns-drag-color) 66 (cons 5 'ns-drag-color)
67 (cons (logior (lsh 0 16) 6) 'ns-drag-text) 67 (cons 6 'ns-drag-text)
68 (cons (logior (lsh 0 16) 7) 'ns-change-font) 68 (cons 7 'ns-change-font)
69 (cons (logior (lsh 0 16) 8) 'ns-open-file-line) 69 (cons 8 'ns-open-file-line)
70;;; (cons (logior (lsh 0 16) 9) 'ns-insert-working-text) 70;;; (cons 9 'ns-insert-working-text)
71;;; (cons (logior (lsh 0 16) 10) 'ns-delete-working-text) 71;;; (cons 10 'ns-delete-working-text)
72 (cons (logior (lsh 0 16) 11) 'ns-spi-service-call) 72 (cons 11 'ns-spi-service-call)
73 (cons (logior (lsh 0 16) 12) 'ns-new-frame) 73 (cons 12 'ns-new-frame)
74 (cons (logior (lsh 0 16) 13) 'ns-toggle-toolbar) 74 (cons 13 'ns-toggle-toolbar)
75 (cons (logior (lsh 0 16) 14) 'ns-show-prefs) 75 (cons 14 'ns-show-prefs)
76 )))) 76 ))))
77 (set-terminal-parameter frame 'x-setup-function-keys t))) 77 (set-terminal-parameter frame 'x-setup-function-keys t)))
78 78
diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el
index a776c830a25..d9b272693b0 100644
--- a/lisp/term/tty-colors.el
+++ b/lisp/term/tty-colors.el
@@ -830,10 +830,10 @@ DISPLAY can be a display name or a frame, and defaults to the
830selected frame's display. 830selected frame's display.
831If DISPLAY is not on a 24-but TTY terminal, return nil." 831If DISPLAY is not on a 24-but TTY terminal, return nil."
832 (when (and rgb (= (display-color-cells display) 16777216)) 832 (when (and rgb (= (display-color-cells display) 16777216))
833 (let ((r (lsh (car rgb) -8)) 833 (let ((r (ash (car rgb) -8))
834 (g (lsh (cadr rgb) -8)) 834 (g (ash (cadr rgb) -8))
835 (b (lsh (nth 2 rgb) -8))) 835 (b (ash (nth 2 rgb) -8)))
836 (logior (lsh r 16) (lsh g 8) b)))) 836 (logior (ash r 16) (ash g 8) b))))
837 837
838(defun tty-color-define (name index &optional rgb frame) 838(defun tty-color-define (name index &optional rgb frame)
839 "Specify a tty color by its NAME, terminal INDEX and RGB values. 839 "Specify a tty color by its NAME, terminal INDEX and RGB values.
@@ -895,9 +895,9 @@ FRAME defaults to the selected frame."
895 ;; never consider it for approximating another color. 895 ;; never consider it for approximating another color.
896 (if try-rgb 896 (if try-rgb
897 (progn 897 (progn
898 (setq try-r (lsh (car try-rgb) -8) 898 (setq try-r (ash (car try-rgb) -8)
899 try-g (lsh (cadr try-rgb) -8) 899 try-g (ash (cadr try-rgb) -8)
900 try-b (lsh (nth 2 try-rgb) -8)) 900 try-b (ash (nth 2 try-rgb) -8))
901 (setq dif-r (- r try-r) 901 (setq dif-r (- r try-r)
902 dif-g (- g try-g) 902 dif-g (- g try-g)
903 dif-b (- b try-b)) 903 dif-b (- b try-b))
@@ -938,13 +938,13 @@ should be the same regardless of what display is being used."
938 (i2 (+ i1 ndig)) 938 (i2 (+ i1 ndig))
939 (i3 (+ i2 ndig))) 939 (i3 (+ i2 ndig)))
940 (list 940 (list
941 (lsh 941 (ash
942 (string-to-number (substring color i1 i2) 16) 942 (string-to-number (substring color i1 i2) 16)
943 (* 4 (- 4 ndig))) 943 (* 4 (- 4 ndig)))
944 (lsh 944 (ash
945 (string-to-number (substring color i2 i3) 16) 945 (string-to-number (substring color i2 i3) 16)
946 (* 4 (- 4 ndig))) 946 (* 4 (- 4 ndig)))
947 (lsh 947 (ash
948 (string-to-number (substring color i3) 16) 948 (string-to-number (substring color i3) 16)
949 (* 4 (- 4 ndig)))))) 949 (* 4 (- 4 ndig))))))
950 ((and (>= len 9) ;; X-style RGB:xx/yy/zz color spec 950 ((and (>= len 9) ;; X-style RGB:xx/yy/zz color spec
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index ce4e18efff8..00747afbdce 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -1009,7 +1009,7 @@ hitting screen's max DCS length."
1009 1009
1010(defun xterm-rgb-convert-to-16bit (prim) 1010(defun xterm-rgb-convert-to-16bit (prim)
1011 "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value." 1011 "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
1012 (logior prim (lsh prim 8))) 1012 (logior prim (ash prim 8)))
1013 1013
1014(defun xterm-register-default-colors (colors) 1014(defun xterm-register-default-colors (colors)
1015 "Register the default set of colors for xterm or compatible emulator. 1015 "Register the default set of colors for xterm or compatible emulator.
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 75f458233ee..96c2f38af42 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -367,8 +367,8 @@ in the order given by 'git status'."
367 367
368(defun vc-git-file-type-as-string (old-perm new-perm) 368(defun vc-git-file-type-as-string (old-perm new-perm)
369 "Return a string describing the file type based on its permissions." 369 "Return a string describing the file type based on its permissions."
370 (let* ((old-type (lsh (or old-perm 0) -9)) 370 (let* ((old-type (ash (or old-perm 0) -9))
371 (new-type (lsh (or new-perm 0) -9)) 371 (new-type (ash (or new-perm 0) -9))
372 (str (pcase new-type 372 (str (pcase new-type
373 (?\100 ;; File. 373 (?\100 ;; File.
374 (pcase old-type 374 (pcase old-type
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 14df9d8b673..da4fc2bdf70 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -1017,7 +1017,7 @@ hg binary."
1017 ;; Dirstate too small to be valid 1017 ;; Dirstate too small to be valid
1018 (< (nth 7 dirstate-attr) 40) 1018 (< (nth 7 dirstate-attr) 40)
1019 ;; We want to store 32-bit unsigned values in fixnums. 1019 ;; We want to store 32-bit unsigned values in fixnums.
1020 (zerop (lsh -1 32)) 1020 (zerop (ash most-positive-fixnum -32))
1021 (progn 1021 (progn
1022 (setf repo-relative-filename 1022 (setf repo-relative-filename
1023 (file-relative-name truename repo)) 1023 (file-relative-name truename repo))
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 5f8578444a0..080cd4d13f3 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -556,18 +556,18 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
556 556
557(defun x-dnd-motif-value-to-list (value size byteorder) 557(defun x-dnd-motif-value-to-list (value size byteorder)
558 (let ((bytes (cond ((eq size 2) 558 (let ((bytes (cond ((eq size 2)
559 (list (logand (lsh value -8) ?\xff) 559 (list (logand (ash value -8) ?\xff)
560 (logand value ?\xff))) 560 (logand value ?\xff)))
561 561
562 ((eq size 4) 562 ((eq size 4)
563 (if (consp value) 563 (if (consp value)
564 (list (logand (lsh (car value) -8) ?\xff) 564 (list (logand (ash (car value) -8) ?\xff)
565 (logand (car value) ?\xff) 565 (logand (car value) ?\xff)
566 (logand (lsh (cdr value) -8) ?\xff) 566 (logand (ash (cdr value) -8) ?\xff)
567 (logand (cdr value) ?\xff)) 567 (logand (cdr value) ?\xff))
568 (list (logand (lsh value -24) ?\xff) 568 (list (logand (ash value -24) ?\xff)
569 (logand (lsh value -16) ?\xff) 569 (logand (ash value -16) ?\xff)
570 (logand (lsh value -8) ?\xff) 570 (logand (ash value -8) ?\xff)
571 (logand value ?\xff))))))) 571 (logand value ?\xff)))))))
572 (if (eq byteorder ?l) 572 (if (eq byteorder ?l)
573 (reverse bytes) 573 (reverse bytes)