Mercurial > emacs
changeset 10693:0875851842f0
(listify-key-sequence-1, event-modifiers): Don't presume internal bit layout
of non-ASCII keys.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 08 Feb 1995 03:51:58 +0000 |
parents | 58ab3325da3b |
children | 75792481da0c |
files | lisp/subr.el |
diffstat | 1 files changed, 10 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/subr.el Wed Feb 08 03:50:54 1995 +0000 +++ b/lisp/subr.el Wed Feb 08 03:51:58 1995 +0000 @@ -311,12 +311,10 @@ ;;;; Event manipulation functions. -;; This code exists specifically to make sure that the -;; resulting number does not appear in the .elc file. -;; The number is negative on most machines, but not on all! -(defconst listify-key-sequence-1 - (lsh 1 7)) -(setq listify-key-sequence-1 (logior (lsh 1 27) listify-key-sequence-1)) +;; The call to `read' is to ensure that the value is computed at load time +;; and not compiled into the .elc file. The value is negative on most +;; machines, but not on all! +(defconst listify-key-sequence-1 (logior 128 (read "?\\M-\\^@"))) (defun listify-key-sequence (key) "Convert a key sequence to a list of events." @@ -348,19 +346,19 @@ (if (symbolp type) (cdr (get type 'event-symbol-elements)) (let ((list nil)) - (or (zerop (logand type (lsh 1 23))) + (or (zerop (logand type ?\M-\^@)) (setq list (cons 'meta list))) - (or (and (zerop (logand type (lsh 1 22))) + (or (and (zerop (logand type ?\C-\^@)) (>= (logand type 127) 32)) (setq list (cons 'control list))) - (or (and (zerop (logand type (lsh 1 21))) + (or (and (zerop (logand type ?\S-\^@)) (= (logand type 255) (downcase (logand type 255)))) (setq list (cons 'shift list))) - (or (zerop (logand type (lsh 1 20))) + (or (zerop (logand type ?\H-\^@)) (setq list (cons 'hyper list))) - (or (zerop (logand type (lsh 1 19))) + (or (zerop (logand type ?\s-\^@)) (setq list (cons 'super list))) - (or (zerop (logand type (lsh 1 18))) + (or (zerop (logand type ?\A-\^@)) (setq list (cons 'alt list))) list))))