((integerp ch)
(concat
(cl-loop for pf across "ACHMsS"
- for bit in '(?\A-\^@ ?\C-\^@ ?\H-\^@
- ?\M-\^@ ?\s-\^@ ?\S-\^@)
+ for bit in '( ?\A-\0 ?\C-\0 ?\H-\0
+ ?\M-\0 ?\s-\0 ?\S-\0)
when (/= (logand ch bit) 0)
concat (format "%c-" pf))
(let ((ch2 (logand ch (1- (ash 1 18)))))
(setq bits (+ bits
(cdr
(assq (aref word 0)
- '((?A . ?\A-\^@) (?C . ?\C-\^@)
- (?H . ?\H-\^@) (?M . ?\M-\^@)
- (?s . ?\s-\^@) (?S . ?\S-\^@))))))
+ '((?A . ?\A-\0) (?C . ?\C-\0)
+ (?H . ?\H-\0) (?M . ?\M-\0)
+ (?s . ?\s-\0) (?S . ?\S-\0))))))
(setq prefix (+ prefix 2))
(setq word (substring word 2)))
(when (string-match "^\\^.$" word)
- (setq bits (+ bits ?\C-\^@))
+ (setq bits (+ bits ?\C-\0))
(setq prefix (1+ prefix))
(setq word (substring word 1)))
(let ((found (assoc word '(("NUL" . "\0") ("RET" . "\r")
(setq word (vector n))))
(cond ((= bits 0)
(setq key word))
- ((and (= bits ?\M-\^@) (stringp word)
+ ((and (= bits ?\M-\0) (stringp word)
(string-match "^-?[0-9]+$" word))
(setq key (mapcar (lambda (x) (+ x bits))
(append word nil))))
((/= (length word) 1)
(error "%s must prefix a single character, not %s"
(substring orig-word 0 prefix) word))
- ((and (/= (logand bits ?\C-\^@) 0) (stringp word)
+ ((and (/= (logand bits ?\C-\0) 0) (stringp word)
;; We used to accept . and ? here,
;; but . is simply wrong,
;; and C-? is not used (we use DEL instead).
(string-match "[@-_a-z]" word))
- (setq key (list (+ bits (- ?\C-\^@)
+ (setq key (list (+ bits (- ?\C-\0)
(logand (aref word 0) 31)))))
(t
(setq key (list (+ bits (aref word 0)))))))))
;; sure the symbol has already been parsed.
(cdr (internal-event-symbol-parse-modifiers type))
(let ((list nil)
- (char (logand type (lognot (logior ?\M-\^@ ?\C-\^@ ?\S-\^@
- ?\H-\^@ ?\s-\^@ ?\A-\^@)))))
- (if (not (zerop (logand type ?\M-\^@)))
+ (char (logand type (lognot (logior ?\M-\0 ?\C-\0 ?\S-\0
+ ?\H-\0 ?\s-\0 ?\A-\0)))))
+ (if (not (zerop (logand type ?\M-\0)))
(push 'meta list))
- (if (or (not (zerop (logand type ?\C-\^@)))
+ (if (or (not (zerop (logand type ?\C-\0)))
(< char 32))
(push 'control list))
- (if (or (not (zerop (logand type ?\S-\^@)))
+ (if (or (not (zerop (logand type ?\S-\0)))
(/= char (downcase char)))
(push 'shift list))
- (or (zerop (logand type ?\H-\^@))
+ (or (zerop (logand type ?\H-\0))
(push 'hyper list))
- (or (zerop (logand type ?\s-\^@))
+ (or (zerop (logand type ?\s-\0))
(push 'super list))
- (or (zerop (logand type ?\A-\^@))
+ (or (zerop (logand type ?\A-\0))
(push 'alt list))
list))))
(setq event (car event)))
(if (symbolp event)
(car (get event 'event-symbol-elements))
- (let* ((base (logand event (1- ?\A-\^@)))
+ (let* ((base (logand event (1- ?\A-\0)))
(uncontrolled (if (< base 32) (logior base 64) base)))
;; There are some numbers that are invalid characters and
;; cause `downcase' to get an error.
(should (equal (kbd "C-x C-f") "\C-x\C-f"))
(should (equal (kbd "C-M-<down>") [C-M-down]))
(should (equal (kbd "<C-M-down>") [C-M-down]))
- (should (equal (kbd "C-RET") [?\C-\C-m]))
+ (should (equal (kbd "C-RET") [?\C-\r]))
(should (equal (kbd "C-SPC") [?\C- ]))
(should (equal (kbd "C-TAB") [?\C-\t]))
(should (equal (kbd "C-<down>") [C-down]))