summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2004-08-28 14:00:38 +0000
committerRichard M. Stallman <rms@gnu.org>2004-08-28 14:00:38 +0000
commit87fdf320e91ef0ed5c83f69ff40191d6ba936efc (patch)
tree8c12d7594969da4623ba6a8952dc7c59829d65ef /lisp/emacs-lisp
parent1b6d517f29bb81996bc6c2ee1a3deb6355959371 (diff)
downloademacs-87fdf320e91ef0ed5c83f69ff40191d6ba936efc.tar.gz
emacs-87fdf320e91ef0ed5c83f69ff40191d6ba936efc.tar.bz2
emacs-87fdf320e91ef0ed5c83f69ff40191d6ba936efc.zip
(prin1-char): Put `shift' modifier into the basic character,
if it has an uppercase form.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index df05555ae7b..bcc9c2a89a7 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -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))
(concat
"?"
(mapconcat
(lambda (modif)
(cond ((eq modif 'super) "\\s-")
(t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-))))
- (event-modifiers char) "")
+ mods "")
(cond
((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))
((eq c 127) "\\C-?")