aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2004-08-28 14:00:38 +0000
committerRichard M. Stallman2004-08-28 14:00:38 +0000
commit87fdf320e91ef0ed5c83f69ff40191d6ba936efc (patch)
tree8c12d7594969da4623ba6a8952dc7c59829d65ef
parent1b6d517f29bb81996bc6c2ee1a3deb6355959371 (diff)
downloademacs-87fdf320e91ef0ed5c83f69ff40191d6ba936efc.tar.gz
emacs-87fdf320e91ef0ed5c83f69ff40191d6ba936efc.zip
(prin1-char): Put `shift' modifier into the basic character,
if it has an uppercase form.
-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."
459If CHAR is not a character, return nil." 459If CHAR is not a character, return nil."
460 (and (integerp char) 460 (and (integerp char)
461 (eventp char) 461 (eventp char)
462 (let ((c (event-basic-type char))) 462 (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))
463 (concat 469 (concat
464 "?" 470 "?"
465 (mapconcat 471 (mapconcat
466 (lambda (modif) 472 (lambda (modif)
467 (cond ((eq modif 'super) "\\s-") 473 (cond ((eq modif 'super) "\\s-")
468 (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-)))) 474 (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-))))
469 (event-modifiers char) "") 475 mods "")
470 (cond 476 (cond
471 ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) 477 ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))
472 ((eq c 127) "\\C-?") 478 ((eq c 127) "\\C-?")