changeset 56825:dcd7b1b4690d

(prin1-char): Put `shift' modifier into the basic character, if it has an uppercase form.
author Richard M. Stallman <rms@gnu.org>
date Sat, 28 Aug 2004 14:00:38 +0000
parents 35774f24f0ab
children c5624ad1554b
files lisp/emacs-lisp/lisp-mode.el
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mode.el	Sat Aug 28 07:45:42 2004 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Sat Aug 28 14:00:38 2004 +0000
@@ -459,14 +459,20 @@
 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-?")