From 87fdf320e91ef0ed5c83f69ff40191d6ba936efc Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 28 Aug 2004 14:00:38 +0000 Subject: (prin1-char): Put `shift' modifier into the basic character, if it has an uppercase form. --- lisp/emacs-lisp/lisp-mode.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') 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-?") -- cgit v1.2.3 From ea2e9f8dc96dc66f57318731bb44aebb8c61271d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 28 Aug 2004 15:32:06 +0000 Subject: Whitespace change. --- lisp/ChangeLog | 12 ++++++++++++ lisp/emacs-lisp/lisp-mode.el | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66ef44650d5..af7cb76df6b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2004-08-28 Richard M. Stallman + + * progmodes/grep.el (grep-default-command): Use find-tag-default. + (grep-tag-default): Function deleted. + + * subr.el (find-tag-default): Moved from etags.el. + + * progmodes/etags.el (find-tag-default): Moved to subr.el. + + * emacs-lisp/lisp-mode.el (prin1-char): Put `shift' modifier + into the basic character if it has an uppercase form. + 2004-08-27 Kenichi Handa * international/utf-8.el (utf-8-post-read-conversion): If the diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index bcc9c2a89a7..d6f601cd121 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -363,7 +363,7 @@ if that value is non-nil." (when (stringp default) (if (string-match ":+" default) (substring default (match-end 0)) - default)))) + default)))) ;; Used in old LispM code. (defalias 'common-lisp-mode 'lisp-mode) -- cgit v1.2.3 From 4f4ce5976e0922de725f83663a7975b387356d86 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 30 Aug 2004 16:05:47 +0000 Subject: (prin1-char): Don't turn S-a into A. Don't return a string that would read as the wrong character code. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/lisp-mode.el | 40 +++++++++++++++++++++++++--------------- 2 files changed, 30 insertions(+), 15 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5168f53d1cb..fab95b30909 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-30 Richard M. Stallman + + * emacs-lisp/lisp-mode.el (prin1-char): Don't turn S-a into A. + Don't return a string that would read as the wrong character code. + 2004-08-29 Kim F. Storm * emulation/cua-base.el (cua-auto-expand-rectangles): Remove diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d6f601cd121..e2aac327ddc 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -460,26 +460,36 @@ If CHAR is not a character, return nil." (and (integerp char) (eventp char) (let ((c (event-basic-type char)) - (mods (event-modifiers char))) + (mods (event-modifiers char)) + string) ;; Prevent ?A from turning into ?\S-a. (if (and (memq 'shift mods) + (zerop (logand char ?\S-\^@)) (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)) ?-)))) - mods "") - (cond - ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) - ((eq c 127) "\\C-?") - (t - (condition-case nil - (string c) - (error nil)))))))) + ;; What string are we considering using? + (condition-case nil + (setq string + (concat + "?" + (mapconcat + (lambda (modif) + (cond ((eq modif 'super) "\\s-") + (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-)))) + mods "") + (cond + ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) + ((eq c 127) "\\C-?") + (t + (string c))))) + (error nil)) + ;; Verify the string reads a CHAR, not to some other character. + ;; If it doesn't, return nil instead. + (and string + (= (car (read-from-string string)) char) + string)))) + (defun eval-last-sexp-1 (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in minibuffer. -- cgit v1.2.3