aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorPaul Eggert2018-08-21 13:44:03 -0700
committerPaul Eggert2018-08-21 13:44:32 -0700
commitf18af6cd5cb7dbbf7420ec2d3efed4e202c4f0dd (patch)
tree5f42e48e12a0ec77bd5cd5f32255a534635e89bf /doc/lispref
parent81e7eef8224c8a99a207b7a7b9dae1d598392ef7 (diff)
downloademacs-f18af6cd5cb7dbbf7420ec2d3efed4e202c4f0dd.tar.gz
emacs-f18af6cd5cb7dbbf7420ec2d3efed4e202c4f0dd.zip
Audit use of lsh and fix glitches
I audited use of lsh in the Lisp source code, and fixed the glitches that I found. While I was at it, I replaced uses of lsh with ash when either will do. Replacement is OK when either argument is known to be nonnegative, or when only the low-order bits of the result matter, and is a (minor) win since ash is a bit more solid than lsh nowadays, and is a bit faster. * lisp/calc/calc-ext.el (math-check-fixnum): Prefer most-positive-fixnum to (lsh -1 -1). * lisp/vc/vc-hg.el (vc-hg-state-fast): When testing fixnum width, prefer (zerop (ash most-positive-fixnum -32)) to (zerop (lsh -1 32)) (Bug#32485#11). * lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode): Tighten sanity-check for bytecode overflow, by checking that the result of (ash pc -8) is nonnegative. Formerly this check was not needed since lsh was used and the number overflowed differently. * lisp/net/dns.el (dns-write): Fix some obvious sign typos in shift counts. Evidently this part of the code has never been exercised. * lisp/progmodes/hideif.el (hif-shiftleft, hif-shiftright): * lisp/term/common-win.el (x-setup-function-keys): Simplify. * admin/unidata/unidata-gen.el, admin/unidata/uvs.el: * doc/lispref/keymaps.texi, doc/lispref/syntax.texi: * doc/misc/calc.texi, doc/misc/cl.texi, etc/NEWS.19: * lisp/arc-mode.el, lisp/calc/calc-bin.el, lisp/calc/calc-comb.el: * lisp/calc/calc-ext.el, lisp/calc/calc-math.el: * lisp/cedet/semantic/wisent/comp.el, lisp/composite.el: * lisp/disp-table.el, lisp/dos-fns.el, lisp/edmacro.el: * lisp/emacs-lisp/bindat.el, lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el, lisp/emacs-lisp/cl-extra.el: * lisp/erc/erc-dcc.el, lisp/facemenu.el, lisp/gnus/message.el: * lisp/gnus/nndoc.el, lisp/gnus/nnmaildir.el, lisp/image.el: * lisp/international/ccl.el, lisp/international/fontset.el: * lisp/international/mule-cmds.el, lisp/international/mule.el: * lisp/json.el, lisp/mail/binhex.el, lisp/mail/rmail.el: * lisp/mail/uudecode.el, lisp/md4.el, lisp/net/dns.el: * lisp/net/ntlm.el, lisp/net/sasl.el, lisp/net/socks.el: * lisp/net/tramp.el, lisp/obsolete/levents.el: * lisp/obsolete/pgg-parse.el, lisp/org/org.el: * lisp/org/ox-publish.el, lisp/progmodes/cc-defs.el: * lisp/progmodes/ebnf2ps.el, lisp/progmodes/hideif.el: * lisp/ps-bdf.el, lisp/ps-print.el, lisp/simple.el: * lisp/tar-mode.el, lisp/term/common-win.el: * lisp/term/tty-colors.el, lisp/term/xterm.el, lisp/vc/vc-git.el: * lisp/vc/vc-hg.el, lisp/x-dnd.el, test/src/data-tests.el: Prefer ash to lsh when either will do.
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/keymaps.texi2
-rw-r--r--doc/lispref/syntax.texi8
2 files changed, 5 insertions, 5 deletions
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index cc2e11e0b6d..38e89c6cfdd 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -1660,7 +1660,7 @@ to turn the character that follows into a Hyper character:
1660(defun hyperify (prompt) 1660(defun hyperify (prompt)
1661 (let ((e (read-event))) 1661 (let ((e (read-event)))
1662 (vector (if (numberp e) 1662 (vector (if (numberp e)
1663 (logior (lsh 1 24) e) 1663 (logior (ash 1 24) e)
1664 (if (memq 'hyper (event-modifiers e)) 1664 (if (memq 'hyper (event-modifiers e))
1665 e 1665 e
1666 (add-event-modifier "H-" e)))))) 1666 (add-event-modifier "H-" e))))))
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi
index 71c97fdae8c..dcfade3f67d 100644
--- a/doc/lispref/syntax.texi
+++ b/doc/lispref/syntax.texi
@@ -1014,13 +1014,13 @@ corresponds to each syntax flag.
1014@item 1014@item
1015@i{Prefix} @tab @i{Flag} @tab @i{Prefix} @tab @i{Flag} 1015@i{Prefix} @tab @i{Flag} @tab @i{Prefix} @tab @i{Flag}
1016@item 1016@item
1017@samp{1} @tab @code{(lsh 1 16)} @tab @samp{p} @tab @code{(lsh 1 20)} 1017@samp{1} @tab @code{(ash 1 16)} @tab @samp{p} @tab @code{(ash 1 20)}
1018@item 1018@item
1019@samp{2} @tab @code{(lsh 1 17)} @tab @samp{b} @tab @code{(lsh 1 21)} 1019@samp{2} @tab @code{(ash 1 17)} @tab @samp{b} @tab @code{(ash 1 21)}
1020@item 1020@item
1021@samp{3} @tab @code{(lsh 1 18)} @tab @samp{n} @tab @code{(lsh 1 22)} 1021@samp{3} @tab @code{(ash 1 18)} @tab @samp{n} @tab @code{(ash 1 22)}
1022@item 1022@item
1023@samp{4} @tab @code{(lsh 1 19)} @tab @samp{c} @tab @code{(lsh 1 23)} 1023@samp{4} @tab @code{(ash 1 19)} @tab @samp{c} @tab @code{(ash 1 23)}
1024@end multitable 1024@end multitable
1025 1025
1026@defun string-to-syntax desc 1026@defun string-to-syntax desc