emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/subr.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/subr.el
Date: Wed, 16 Oct 2002 02:28:20 -0400

Index: emacs/lisp/subr.el
diff -c emacs/lisp/subr.el:1.326 emacs/lisp/subr.el:1.327
*** emacs/lisp/subr.el:1.326    Sun Sep 29 14:37:43 2002
--- emacs/lisp/subr.el  Thu Oct  3 14:53:43 2002
***************
*** 1062,1079 ****
    :type '(choice (const 8) (const 10) (const 16))
    :group 'editing-basics)
  
- (defconst read-key-auxiliary-map
-   (let ((map (make-sparse-keymap)))
-     (define-key map [t] 'undefined)
-     map))
- 
- (defun read-key (&optional prompt)
-   "Read a key from the keyboard.
- Contrary to `read-event' this will not return a raw event but will
- obey `function-key-map' and `key-translation-map' instead."
-   (let ((overriding-terminal-local-map read-key-auxiliary-map))
-     (aref (read-key-sequence prompt nil t) 0)))
- 
  (defun read-quoted-char (&optional prompt)
    "Like `read-char', but do not allow quitting.
  Also, if the first character read is an octal digit,
--- 1062,1067 ----
***************
*** 1095,1102 ****
  or the octal character code.
  RET terminates the character code and is discarded;
  any other non-digit terminates the character code and is then used as 
input."))
!       (setq char (read-key (and prompt (format "%s-" prompt))))
        (if inhibit-quit (setq quit-flag nil)))
        (cond ((null char))
            ((not (integerp char))
             (setq unread-command-events (listify-key-sequence 
(this-single-command-raw-keys))
--- 1083,1099 ----
  or the octal character code.
  RET terminates the character code and is discarded;
  any other non-digit terminates the character code and is then used as 
input."))
!       (setq char (read-event (and prompt (format "%s-" prompt)) t))
        (if inhibit-quit (setq quit-flag nil)))
+       ;; Translate TAB key into control-I ASCII character, and so on.
+       ;; Note: `read-char' does it using the `ascii-character' property.
+       ;; We could try and use read-key-sequence instead, but then C-q ESC
+       ;; or C-q C-x might not return immediately since ESC or C-x might be
+       ;; bound to some prefix in function-key-map or key-translation-map.
+       (and char
+          (let ((translated (lookup-key function-key-map (vector char))))
+            (if (arrayp translated)
+                (setq char (aref translated 0)))))
        (cond ((null char))
            ((not (integerp char))
             (setq unread-command-events (listify-key-sequence 
(this-single-command-raw-keys))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]