changeset 101010:4efc7ca085ce

Replace last-command-char with last-command-event.
author Glenn Morris <rgm@gnu.org>
date Fri, 09 Jan 2009 04:44:15 +0000
parents ad9d2270860e
children 04548ca9af08
files lisp/ChangeLog lisp/allout.el lisp/autoarg.el lisp/complete.el lisp/ediff-mult.el lisp/ediff-util.el lisp/electric.el lisp/hexl.el lisp/isearch.el lisp/isearchb.el lisp/kmacro.el lisp/minibuffer.el lisp/repeat.el lisp/simple.el lisp/skeleton.el lisp/terminal.el lisp/tmm.el lisp/wdired.el
diffstat 18 files changed, 60 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/ChangeLog	Fri Jan 09 04:44:15 2009 +0000
@@ -3,6 +3,10 @@
 	* subr.el (last-input-char, last-command-char):
 	Move here from src/keyboard.c.
 
+	* allout.el, autoarg.el, complete.el, ediff-mult.el, ediff-util.el:
+	* electric.el, hexl.el, isearch.el, isearchb.el, kmacro.el:
+	* minibuffer.el, repeat.el, simple.el, skeleton.el, terminal.el, tmm.el:
+	* wdired.el:
 	* calc/calc-aent.el, calc/calc-ext.el, calc/calc-incom.el:
 	* calc/calc-keypd.el, calc/calc-misc.el, calc/calc-prog.el:
 	* calc/calc-sel.el, calc/calc-store.el, calc/calc-stuff.el:
--- a/lisp/allout.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/allout.el	Fri Jan 09 04:44:15 2009 +0000
@@ -3392,13 +3392,13 @@
 
 Returns the qualifying command, if any, else nil."
   (interactive)
-  (let* ((key-string (if (numberp last-command-char)
-                         (char-to-string last-command-char)))
-         (key-num (cond ((numberp last-command-char) last-command-char)
+  (let* ((key-string (if (numberp last-command-event)
+                         (char-to-string last-command-event)))
+         (key-num (cond ((numberp last-command-event) last-command-event)
                         ;; for XEmacs character type:
                         ((and (fboundp 'characterp)
-                              (apply 'characterp (list last-command-char)))
-                         (apply 'char-to-int (list last-command-char)))
+                              (apply 'characterp (list last-command-event)))
+                         (apply 'char-to-int (list last-command-event)))
                         (t 0)))
          mapped-binding)
 
--- a/lisp/autoarg.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/autoarg.el	Fri Jan 09 04:44:15 2009 +0000
@@ -67,7 +67,7 @@
 (defun autoarg-kp-digit-argument (arg)
   "Part of the numeric argument for the next command, like `digit-argument'."
   (interactive "P")
-  (let ((digit (cdr (assq last-command-char autoarg-kp-digits))))
+  (let ((digit (cdr (assq last-command-event autoarg-kp-digits))))
     (cond ((integerp arg)
 	   (setq prefix-arg (+ (* arg 10)
 			       (if (< arg 0) (- digit) digit))))
--- a/lisp/complete.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/complete.el	Fri Jan 09 04:44:15 2009 +0000
@@ -290,7 +290,7 @@
 This can be bound to other keys, like `-' and `.', if you wish."
   (interactive)
   (if (eq (PC-was-meta-key) PC-meta-flag)
-      (if (eq last-command-char ? )
+      (if (eq last-command-event ? )
 	  (minibuffer-complete-word)
 	(self-insert-command 1))
     (self-insert-command 1)
--- a/lisp/ediff-mult.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/ediff-mult.el	Fri Jan 09 04:44:15 2009 +0000
@@ -2344,10 +2344,10 @@
 This is used only for sessions that involve 2 or 3 files at the same time.
 ACTION is an optional argument that can be ?h, ?m, ?=, to mark for hiding, mark
 for operation, or simply indicate which are equal files.  If it is nil, then
-`last-command-char' is used to decide which action to take."
+`last-command-event' is used to decide which action to take."
   (interactive)
   (if (null action)
-      (setq action last-command-char))
+      (setq action last-command-event))
   (let ((list (cdr ediff-meta-list))
 	marked1 marked2 marked3
 	fileinfo1 fileinfo2 fileinfo3 elt)
--- a/lisp/ediff-util.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/ediff-util.el	Fri Jan 09 04:44:15 2009 +0000
@@ -1012,7 +1012,7 @@
   (interactive)
   (ediff-barf-if-not-control-buffer)
   (let ((ctl-buf (if (null buf) (current-buffer)))
-	(buf-type (ediff-char-to-buftype last-command-char)))
+	(buf-type (ediff-char-to-buftype last-command-event)))
     (or buf (ediff-recenter))
     (or buf
 	(setq buf (ediff-get-buffer buf-type)))
@@ -1514,7 +1514,7 @@
       (error ediff-KILLED-VITAL-BUFFER))
 
   (ediff-operate-on-windows
-   (if (memq last-command-char '(?v ?\C-v))
+   (if (memq last-command-event '(?v ?\C-v))
        'scroll-up
      'scroll-down)
    ;; calculate argument to scroll-up/down
@@ -1562,7 +1562,7 @@
    ;; interactively so that they set the window's min_hscroll.
    ;; Otherwise, automatic hscrolling will undo the effect of
    ;; hscrolling.
-   (if (= last-command-char ?<)
+   (if (= last-command-event ?<)
        (lambda (arg)
 	 (let ((prefix-arg arg))
 	   (call-interactively 'scroll-left)))
@@ -1826,7 +1826,7 @@
 in the specified buffer."
   (interactive "P")
   (ediff-barf-if-not-control-buffer)
-  (let* ((buf-type (ediff-char-to-buftype last-command-char))
+  (let* ((buf-type (ediff-char-to-buftype last-command-event))
 	 (buffer (ediff-get-buffer buf-type))
 	 (pt (ediff-with-current-buffer buffer (point)))
 	 (diff-no (ediff-diff-at-point buf-type nil (if arg 'after)))
@@ -2162,13 +2162,13 @@
   "Restore ARGth diff from `ediff-killed-diffs-alist'.
 ARG is a prefix argument.  If ARG is nil, restore the current-difference.
 If the second optional argument, a character, is given, use it to
-determine the target buffer instead of last-command-char"
+determine the target buffer instead of last-command-event"
   (interactive "P")
   (ediff-barf-if-not-control-buffer)
   (if (numberp arg)
       (ediff-jump-to-difference arg))
   (ediff-pop-diff ediff-current-difference
-		  (ediff-char-to-buftype (or key last-command-char)))
+		  (ediff-char-to-buftype (or key last-command-event)))
   ;; recenter with rehighlighting, but no messages
   (let (ediff-verbose-p)
     (ediff-recenter)))
@@ -2192,13 +2192,13 @@
     (cond
      ((or (and (eq ediff-skip-diff-region-function
 		   ediff-focus-on-regexp-matches-function)
-	       (eq last-command-char ?f))
+	       (eq last-command-event ?f))
 	  (and (eq ediff-skip-diff-region-function
 		   ediff-hide-regexp-matches-function)
-	       (eq last-command-char ?h)))
+	       (eq last-command-event ?h)))
       (message "Selective browsing by regexp turned off")
       (setq ediff-skip-diff-region-function 'ediff-show-all-diffs))
-     ((eq last-command-char ?h)
+     ((eq last-command-event ?h)
       (setq ediff-skip-diff-region-function ediff-hide-regexp-matches-function
 	    regexp-A
 	    (read-string
@@ -2236,7 +2236,7 @@
       (or (string= regexp-B "") (setq ediff-regexp-hide-B regexp-B))
       (or (string= regexp-C "") (setq ediff-regexp-hide-C regexp-C)))
 
-     ((eq last-command-char ?f)
+     ((eq last-command-event ?f)
       (setq ediff-skip-diff-region-function
 	    ediff-focus-on-regexp-matches-function
 	    regexp-A
@@ -3302,10 +3302,10 @@
   (ediff-barf-if-not-control-buffer)
   (ediff-compute-custom-diffs-maybe)
   (ediff-with-current-buffer
-      (cond ((memq last-command-char '(?a ?b ?c))
+      (cond ((memq last-command-event '(?a ?b ?c))
 	     (ediff-get-buffer
-	      (ediff-char-to-buftype last-command-char)))
-	    ((eq last-command-char ?d)
+	      (ediff-char-to-buftype last-command-event)))
+	    ((eq last-command-event ?d)
 	     (message "Saving diff output ...")
 	     (sit-for 1) ; let the user see the message
 	     (cond ((and arg (ediff-buffer-live-p ediff-diff-buffer))
--- a/lisp/electric.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/electric.el	Fri Jan 09 04:44:15 2009 +0000
@@ -65,7 +65,7 @@
               (setq prompt-string nil)
             (setq prompt-string "->")))
       (setq cmd (read-key-sequence prompt-string))
-      (setq last-command-char (aref cmd (1- (length cmd)))
+      (setq last-command-event (aref cmd (1- (length cmd)))
 	    this-command (key-binding cmd t)
 	    cmd this-command)
       ;; This makes universal-argument-other-key work.
--- a/lisp/hexl.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/hexl.el	Fri Jan 09 04:44:15 2009 +0000
@@ -835,7 +835,7 @@
 Non-ASCII characters are first encoded with `buffer-file-coding-system',
 and their encoded form is inserted byte by byte."
   (interactive "p")
-  (hexl-insert-multibyte-char last-command-char arg))
+  (hexl-insert-multibyte-char last-command-event arg))
 
 (defun hexl-insert-char (ch num)
   "Insert the character CH NUM times in a hexl buffer.
--- a/lisp/isearch.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/isearch.el	Fri Jan 09 04:44:15 2009 +0000
@@ -1,7 +1,8 @@
 ;;; isearch.el --- incremental search minor mode
 
 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000,
-;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
 ;; Maintainer: FSF
@@ -954,7 +955,7 @@
 ;;   ;; First terminate isearch-mode.
 ;;   (isearch-done)
 ;;   (isearch-clean-overlays)
-;;   (handle-switch-frame (car (cdr last-command-char))))
+;;   (handle-switch-frame (car (cdr last-command-event))))
 
 
 ;; The search status structure and stack.
@@ -1984,7 +1985,7 @@
 (defun isearch-printing-char ()
   "Add this ordinary printing character to the search string and search."
   (interactive)
-  (let ((char last-command-char))
+  (let ((char last-command-event))
     (if (= char ?\S-\ )
 	(setq char ?\s))
     (if current-input-method
--- a/lisp/isearchb.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/isearchb.el	Fri Jan 09 04:44:15 2009 +0000
@@ -1,6 +1,7 @@
 ;;; isearchb --- a marriage between iswitchb and isearch
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Maintainer: FSF
@@ -136,10 +137,10 @@
   (unless iswitchb-text
     (setq iswitchb-text "")
     (iswitchb-make-buflist nil))
-  (if last-command-char
+  (if last-command-event
       (setq iswitchb-rescan t
 	    iswitchb-text (concat iswitchb-text
-				  (char-to-string last-command-char))))
+				  (char-to-string last-command-event))))
   (iswitchb-set-matches)
   (let* ((match (car iswitchb-matches))
 	 (buf (and match (get-buffer match))))
@@ -176,17 +177,17 @@
 	      (substring iswitchb-text 0 (1- (length iswitchb-text))))
 	(if (= 0 (length iswitchb-text))
 	    (isearchb-stop t t)
-	  (setq last-command-char nil)
+	  (setq last-command-event nil)
 	  (setq this-command 'isearchb)))
        ((or (equal keys "\C-i") (equal keys [tab]))
 	(setq this-command 'isearchb-iswitchb))
        ((equal keys "\C-s")
 	(iswitchb-next-match)
-	(setq last-command-char nil)
+	(setq last-command-event nil)
 	(setq this-command 'isearchb))
        ((equal keys "\C-r")
 	(iswitchb-prev-match)
-	(setq last-command-char nil)
+	(setq last-command-event nil)
 	(setq this-command 'isearchb))
        ((equal keys "\C-g")
 	(ding)
--- a/lisp/kmacro.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/kmacro.el	Fri Jan 09 04:44:15 2009 +0000
@@ -1196,7 +1196,7 @@
 	(setq this-command 'ignore)
       (setq this-command cmd)
       (if (memq this-command '(self-insert-command digit-argument))
-	  (setq last-command-char (aref keys (1- (length keys)))))
+	  (setq last-command-event (aref keys (1- (length keys)))))
       (if keys
 	  (setq kmacro-step-edit-new-macro (vconcat kmacro-step-edit-new-macro keys))))
     (setq kmacro-step-edit-key-index next-index)))
--- a/lisp/minibuffer.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/minibuffer.el	Fri Jan 09 04:44:15 2009 +0000
@@ -905,7 +905,7 @@
 (defun self-insert-and-exit ()
   "Terminate minibuffer input."
   (interactive)
-  (if (characterp last-command-char)
+  (if (characterp last-command-event)
       (call-interactively 'self-insert-command)
     (ding))
   (exit-minibuffer))
--- a/lisp/repeat.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/repeat.el	Fri Jan 09 04:44:15 2009 +0000
@@ -100,9 +100,9 @@
   :type '(repeat function))
 
 ;; If the last command was self-insert-command, the char to be inserted was
-;; obtained by that command from last-command-char, which has now been
+;; obtained by that command from last-command-event, which has now been
 ;; clobbered by the command sequence that invoked `repeat'.  We could get it
-;; from (recent-keys) & set last-command-char to that, "unclobbering" it, but
+;; from (recent-keys) & set last-command-event to that, "unclobbering" it, but
 ;; this has the disadvantage that if the user types a sequence of different
 ;; chars then invokes repeat, only the final char will be inserted.  In vi,
 ;; the dot command can reinsert the entire most-recently-inserted sequence.
@@ -247,14 +247,14 @@
     (setq repeat-arg last-prefix-arg))
   ;; Now determine whether to loop on repeated taps of the final character
   ;; of the key sequence that invoked repeat.  The Emacs global
-  ;; last-command-char contains the final character now, but may not still
+  ;; last-command-event contains the final character now, but may not still
   ;; contain it after the previous command is repeated, so the character
   ;; needs to be saved.
   (let ((repeat-repeat-char
          (if (eq repeat-on-final-keystroke t)
-	     last-command-char
+	     last-command-event
            ;; allow only specified final keystrokes
-           (car (memq last-command-char
+           (car (memq last-command-event
                       (listify-key-sequence
                        repeat-on-final-keystroke))))))
     (if (memq last-repeatable-command '(exit-minibuffer
@@ -344,7 +344,7 @@
 (defun repeat-self-insert (string)
   (let ((i 0))
     (while (< i (length string))
-      (let ((last-command-char (aref string i)))
+      (let ((last-command-event (aref string i)))
 	(self-insert-command 1))
       (setq i (1+ i)))))
 
--- a/lisp/simple.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/simple.el	Fri Jan 09 04:44:15 2009 +0000
@@ -463,8 +463,8 @@
 	(beforepos (point)))
     (if flag (backward-char 1))
     ;; Call self-insert so that auto-fill, abbrev expansion etc. happens.
-    ;; Set last-command-char to tell self-insert what to insert.
-    (let ((last-command-char ?\n)
+    ;; Set last-command-event to tell self-insert what to insert.
+    (let ((last-command-event ?\n)
 	  ;; Don't auto-fill if we have a numeric argument.
 	  ;; Also not if flag is true (it would fill wrong line);
 	  ;; there is no need to since we're at BOL.
@@ -2596,9 +2596,9 @@
   "Part of the numeric argument for the next command.
 \\[universal-argument] following digits or minus sign ends the argument."
   (interactive "P")
-  (let* ((char (if (integerp last-command-char)
-		   last-command-char
-		 (get last-command-char 'ascii-character)))
+  (let* ((char (if (integerp last-command-event)
+		   last-command-event
+		 (get last-command-event 'ascii-character)))
 	 (digit (- (logand char ?\177) ?0)))
     (cond ((integerp arg)
 	   (setq prefix-arg (+ (* arg 10)
--- a/lisp/skeleton.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/skeleton.el	Fri Jan 09 04:44:15 2009 +0000
@@ -470,7 +470,7 @@
 
 
 (defvar skeleton-pair-alist ()
-  "An override alist of pairing partners matched against `last-command-char'.
+  "An override alist of pairing partners matched against `last-command-event'.
 Each alist element, which looks like (ELEMENT ...), is passed to
 `skeleton-insert' with no interactor.  Variable `str' does nothing.
 
@@ -504,7 +504,7 @@
 		      (or (eq last-command 'mouse-drag-region)
 			  (and transient-mark-mode mark-active))))
 	   (skeleton-end-hook)
-	   (char last-command-char)
+	   (char last-command-event)
 	   (skeleton (or (assq char skeleton-pair-alist)
 			 (assq char skeleton-pair-default-alist)
 			 `(,char _ ,char))))
--- a/lisp/terminal.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/terminal.el	Fri Jan 09 04:44:15 2009 +0000
@@ -225,7 +225,7 @@
      ;;  you hit esc key...
      ((and (stringp s)
 	   (string= s (make-string 1 terminal-escape-char)))
-      (setq last-command-char terminal-escape-char)
+      (setq last-command-event terminal-escape-char)
       (let ((terminal-escape-char -259))
 	(te-pass-through)))
 
--- a/lisp/tmm.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/tmm.el	Fri Jan 09 04:44:15 2009 +0000
@@ -402,7 +402,7 @@
 (defun tmm-shortcut ()
   "Choose the shortcut that the user typed."
   (interactive)
-  (let ((c last-command-char) s)
+  (let ((c last-command-event) s)
     (if (symbolp tmm-shortcut-style)
         (setq c (funcall tmm-shortcut-style c)))
     (if (memq c tmm-short-cuts)
--- a/lisp/wdired.el	Fri Jan 09 04:36:00 2009 +0000
+++ b/lisp/wdired.el	Fri Jan 09 04:44:15 2009 +0000
@@ -1,6 +1,7 @@
 ;;; wdired.el --- Rename files editing their names in dired buffers
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 ;; Filename: wdired.el
 ;; Author: Juan León Lahoz García <juanleon1@gmail.com>
@@ -741,9 +742,9 @@
 (defun wdired-set-bit ()
   "Set a permission bit character."
   (interactive)
-  (if (wdired-perm-allowed-in-pos last-command-char
+  (if (wdired-perm-allowed-in-pos last-command-event
                                   (- (current-column) wdired-col-perm))
-      (let ((new-bit (char-to-string last-command-char))
+      (let ((new-bit (char-to-string last-command-event))
             (inhibit-read-only t)
 	    (pos-prop (- (point) (- (current-column) wdired-col-perm))))
         (put-text-property 0 1 'keymap wdired-perm-mode-map new-bit)