(prin1-char): Don't turn S-a into A.
Don't return a string that would read as the wrong character code.
This commit is contained in:
parent
85d392cbe0
commit
4f4ce5976e
2 changed files with 30 additions and 15 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-08-30 Richard M. Stallman <rms@gnu.org>
|
||||
|
||||
* 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 <storm@cua.dk>
|
||||
|
||||
* emulation/cua-base.el (cua-auto-expand-rectangles): Remove
|
||||
|
|
|
@ -460,12 +460,17 @@ 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))
|
||||
;; What string are we considering using?
|
||||
(condition-case nil
|
||||
(setq string
|
||||
(concat
|
||||
"?"
|
||||
(mapconcat
|
||||
|
@ -477,9 +482,14 @@ If CHAR is not a character, return nil."
|
|||
((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))
|
||||
((eq c 127) "\\C-?")
|
||||
(t
|
||||
(condition-case nil
|
||||
(string c)
|
||||
(error nil))))))))
|
||||
(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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue