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: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/subr.el
Date: Sun, 23 Jun 2002 18:13:15 -0400

Index: emacs/lisp/subr.el
diff -c emacs/lisp/subr.el:1.309 emacs/lisp/subr.el:1.310
*** emacs/lisp/subr.el:1.309    Fri Jun 14 02:15:00 2002
--- emacs/lisp/subr.el  Sun Jun 23 18:13:15 2002
***************
*** 608,614 ****
  The return value is of the form
     (WINDOW BUFFER-POSITION (X . Y) TIMESTAMP)
  The `posn-' functions access elements of such lists."
!   (nth 1 event))
  
  (defsubst event-end (event)
    "Return the ending location of EVENT.  EVENT should be a click or drag 
event.
--- 608,615 ----
  The return value is of the form
     (WINDOW BUFFER-POSITION (X . Y) TIMESTAMP)
  The `posn-' functions access elements of such lists."
!   (if (consp event) (nth 1 event)
!     (list (selected-window) (point) '(0 . 0) 0)))
  
  (defsubst event-end (event)
    "Return the ending location of EVENT.  EVENT should be a click or drag 
event.
***************
*** 616,627 ****
  The return value is of the form
     (WINDOW BUFFER-POSITION (X . Y) TIMESTAMP)
  The `posn-' functions access elements of such lists."
!   (nth (if (consp (nth 2 event)) 2 1) event))
  
  (defsubst event-click-count (event)
    "Return the multi-click count of EVENT, a click or drag event.
  The return value is a positive integer."
!   (if (integerp (nth 2 event)) (nth 2 event) 1))
  
  (defsubst posn-window (position)
    "Return the window in POSITION.
--- 617,629 ----
  The return value is of the form
     (WINDOW BUFFER-POSITION (X . Y) TIMESTAMP)
  The `posn-' functions access elements of such lists."
!   (if (consp event) (nth (if (consp (nth 2 event)) 2 1) event)
!     (list (selected-window) (point) '(0 . 0) 0)))
  
  (defsubst event-click-count (event)
    "Return the multi-click count of EVENT, a click or drag event.
  The return value is a positive integer."
!   (if (and (consp event) (integerp (nth 2 event))) (nth 2 event) 1))
  
  (defsubst posn-window (position)
    "Return the window in POSITION.
***************
*** 1033,1038 ****
--- 1035,1047 ----
    :type '(choice (const 8) (const 10) (const 16))
    :group 'editing-basics)
  
+ (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 (make-sparse-keymap)))
+     (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,
***************
*** 1054,1069 ****
  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.
-       (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 (list char)
                   done t))
            ((/= (logand char ?\M-\^@) 0)
             ;; Turn a meta-character into a character with the 0200 bit set.
--- 1063,1073 ----
  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 (this-single-command-raw-keys)
                   done t))
            ((/= (logand char ?\M-\^@) 0)
             ;; Turn a meta-character into a character with the 0200 bit set.
***************
*** 1080,1086 ****
            ((and (not first) (eq char ?\C-m))
             (setq done t))
            ((not first)
!            (setq unread-command-events (list char)
                   done t))
            (t (setq code char
                     done t)))
--- 1084,1090 ----
            ((and (not first) (eq char ?\C-m))
             (setq done t))
            ((not first)
!            (setq unread-command-events (this-single-command-raw-keys)
                   done t))
            (t (setq code char
                     done t)))
***************
*** 1952,1958 ****
  (defun make-temp-file (prefix &optional dir-flag suffix)
    "Create a temporary file.
  The returned file name (created by appending some random characters at the end
! of PREFIX, and expanding against `temporary-file-directory' if necessary,
  is guaranteed to point to a newly created empty file.
  You can then use `write-region' to write new data into the file.
  
--- 1956,1962 ----
  (defun make-temp-file (prefix &optional dir-flag suffix)
    "Create a temporary file.
  The returned file name (created by appending some random characters at the end
! of PREFIX, and expanding against `temporary-file-directory' if necessary),
  is guaranteed to point to a newly created empty file.
  You can then use `write-region' to write new data into the file.
  



reply via email to

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