diff options
author | Karl Heuer <kwzh@gnu.org> | 1995-02-08 03:51:58 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1995-02-08 03:51:58 +0000 |
commit | da16e6483d36a39907417cee18c13d90c2af06e8 (patch) | |
tree | d51bb8cbaa0ee4a2ca7a9052086cc006bd8a48e1 /lisp/subr.el | |
parent | a9b8cb16426a204b87c574b6471305a09c0cf6c5 (diff) | |
download | emacs-da16e6483d36a39907417cee18c13d90c2af06e8.tar.gz emacs-da16e6483d36a39907417cee18c13d90c2af06e8.tar.bz2 emacs-da16e6483d36a39907417cee18c13d90c2af06e8.zip |
(listify-key-sequence-1, event-modifiers): Don't presume internal bit layout
of non-ASCII keys.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index baa91a4f51d..07bbdb45b5e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -311,12 +311,10 @@ The normal global definition of the character C-x indirects to this keymap.") ;;;; 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 @@ and `down'." (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)))) |