Commit 87fdf320 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(prin1-char): Put `shift' modifier into the basic character,

if it has an uppercase form.
parent 1b6d517f
......@@ -459,14 +459,20 @@ alternative printed representations that can be displayed."
If CHAR is not a character, return nil."
(and (integerp char)
(eventp char)
(let ((c (event-basic-type char)))
(let ((c (event-basic-type char))
(mods (event-modifiers char)))
;; Prevent ?A from turning into ?\S-a.
(if (and (memq 'shift mods)
(not (let ((case-fold-search nil))
(char-equal c (upcase c)))))
(setq c (upcase c) mods nil))
(lambda (modif)
(cond ((eq modif 'super) "\\s-")
(t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-))))
(event-modifiers char) "")
mods "")
((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))
((eq c 127) "\\C-?")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment