aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1995-02-08 03:51:58 +0000
committerKarl Heuer1995-02-08 03:51:58 +0000
commitda16e6483d36a39907417cee18c13d90c2af06e8 (patch)
treed51bb8cbaa0ee4a2ca7a9052086cc006bd8a48e1
parenta9b8cb16426a204b87c574b6471305a09c0cf6c5 (diff)
downloademacs-da16e6483d36a39907417cee18c13d90c2af06e8.tar.gz
emacs-da16e6483d36a39907417cee18c13d90c2af06e8.zip
(listify-key-sequence-1, event-modifiers): Don't presume internal bit layout
of non-ASCII keys.
-rw-r--r--lisp/subr.el22
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.")
311 311
312;;;; Event manipulation functions. 312;;;; Event manipulation functions.
313 313
314;; This code exists specifically to make sure that the 314;; The call to `read' is to ensure that the value is computed at load time
315;; resulting number does not appear in the .elc file. 315;; and not compiled into the .elc file. The value is negative on most
316;; The number is negative on most machines, but not on all! 316;; machines, but not on all!
317(defconst listify-key-sequence-1 317(defconst listify-key-sequence-1 (logior 128 (read "?\\M-\\^@")))
318 (lsh 1 7))
319(setq listify-key-sequence-1 (logior (lsh 1 27) listify-key-sequence-1))
320 318
321(defun listify-key-sequence (key) 319(defun listify-key-sequence (key)
322 "Convert a key sequence to a list of events." 320 "Convert a key sequence to a list of events."
@@ -348,19 +346,19 @@ and `down'."
348 (if (symbolp type) 346 (if (symbolp type)
349 (cdr (get type 'event-symbol-elements)) 347 (cdr (get type 'event-symbol-elements))
350 (let ((list nil)) 348 (let ((list nil))
351 (or (zerop (logand type (lsh 1 23))) 349 (or (zerop (logand type ?\M-\^@))
352 (setq list (cons 'meta list))) 350 (setq list (cons 'meta list)))
353 (or (and (zerop (logand type (lsh 1 22))) 351 (or (and (zerop (logand type ?\C-\^@))
354 (>= (logand type 127) 32)) 352 (>= (logand type 127) 32))
355 (setq list (cons 'control list))) 353 (setq list (cons 'control list)))
356 (or (and (zerop (logand type (lsh 1 21))) 354 (or (and (zerop (logand type ?\S-\^@))
357 (= (logand type 255) (downcase (logand type 255)))) 355 (= (logand type 255) (downcase (logand type 255))))
358 (setq list (cons 'shift list))) 356 (setq list (cons 'shift list)))
359 (or (zerop (logand type (lsh 1 20))) 357 (or (zerop (logand type ?\H-\^@))
360 (setq list (cons 'hyper list))) 358 (setq list (cons 'hyper list)))
361 (or (zerop (logand type (lsh 1 19))) 359 (or (zerop (logand type ?\s-\^@))
362 (setq list (cons 'super list))) 360 (setq list (cons 'super list)))
363 (or (zerop (logand type (lsh 1 18))) 361 (or (zerop (logand type ?\A-\^@))
364 (setq list (cons 'alt list))) 362 (setq list (cons 'alt list)))
365 list)))) 363 list))))
366 364