Commit 8989a920 authored by Glenn Morris's avatar Glenn Morris

Replace last-command-char with last-command-event.

parent a4d9b7bc
......@@ -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:
......
......@@ -3392,13 +3392,13 @@ this-command accordingly.
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)
......
......@@ -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))))
......
......@@ -290,7 +290,7 @@ See `PC-complete' for details.
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)
......
......@@ -2344,10 +2344,10 @@ If this is a session registry buffer then just bury it."
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)
......
......@@ -1012,7 +1012,7 @@ of the current buffer."
(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 @@ the one half of the height of window-A."
(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 @@ the width of the A/B/C windows."
;; 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 @@ With a prefix argument, synchronize all files around the current point position
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 @@ ARG is a prefix argument. If nil, copy the current difference region."
"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 @@ a regular expression typed in by the user."
(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 @@ a regular expression typed in by the user."
(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 @@ Without an argument, it saves customized diff argument, if available
(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))
......
......@@ -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.
......
......@@ -835,7 +835,7 @@ Interactively, with a numeric argument, insert this character that many times.
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.
......
;;; 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 @@ REGEXP if non-nil says use the regexp search ring."
;; ;; 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 @@ Isearch mode."
(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
......
;;; 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 @@ Its purpose is to pass different call arguments to
(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 @@ Its purpose is to pass different call arguments to
(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)
......
......@@ -1196,7 +1196,7 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
(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)))
......
......@@ -905,7 +905,7 @@ the completions buffer."
(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))
......
......@@ -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 @@ recently executed command not bound to an input event\"."
(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 @@ recently executed command not bound to an input event\"."
(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)))))
......
......@@ -463,8 +463,8 @@ than the value of `fill-column' and ARG is nil."
(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 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]."
"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)
......
......@@ -470,7 +470,7 @@ This allows for context-sensitive checking whether pairing is appropriate.")
(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 @@ symmetrical ones, and the same character twice for the others."
(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))))
......
......@@ -225,7 +225,7 @@ performance."
;; 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)))
......
......@@ -402,7 +402,7 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'."
(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)
......
;;; 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 @@ Like original function but it skips read-only words."
(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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment