459 |
If CHAR is not a character, return nil." |
If CHAR is not a character, return nil." |
460 |
(and (integerp char) |
(and (integerp char) |
461 |
(eventp char) |
(eventp char) |
462 |
(let ((c (event-basic-type char))) |
(let ((c (event-basic-type char)) |
463 |
|
(mods (event-modifiers char))) |
464 |
|
;; Prevent ?A from turning into ?\S-a. |
465 |
|
(if (and (memq 'shift mods) |
466 |
|
(not (let ((case-fold-search nil)) |
467 |
|
(char-equal c (upcase c))))) |
468 |
|
(setq c (upcase c) mods nil)) |
469 |
(concat |
(concat |
470 |
"?" |
"?" |
471 |
(mapconcat |
(mapconcat |
472 |
(lambda (modif) |
(lambda (modif) |
473 |
(cond ((eq modif 'super) "\\s-") |
(cond ((eq modif 'super) "\\s-") |
474 |
(t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-)))) |
(t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-)))) |
475 |
(event-modifiers char) "") |
mods "") |
476 |
(cond |
(cond |
477 |
((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) |
((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) |
478 |
((eq c 127) "\\C-?") |
((eq c 127) "\\C-?") |