mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-04 06:31:13 -08:00
Replace last-command-char with last-command-event.
This commit is contained in:
parent
61a846fbec
commit
a4d9b7bca3
6 changed files with 28 additions and 27 deletions
|
|
@ -8,8 +8,10 @@
|
|||
* calc/calc-sel.el, calc/calc-store.el, calc/calc-stuff.el:
|
||||
* calc/calc-units.el, calc/calc-yank.el, calc/calc.el:
|
||||
* emacs-lisp/lisp.el, emacs-lisp/re-builder.el:
|
||||
* emulation/vi.el, emulation/vip.el, emulation/viper-cmd.el:
|
||||
* eshell/em-smart.el, eshell/esh-mode.el:
|
||||
* international/mule-cmds.el:
|
||||
* mail/mailabbrev.el:
|
||||
* net/tramp.el:
|
||||
* play/mpuz.el:
|
||||
* progmodes/ada-mode.el, progmodes/antlr-mode.el, progmodes/cc-align.el:
|
||||
|
|
|
|||
|
|
@ -506,13 +506,13 @@ set sw=n M-x set-variable vi-shift-width n "
|
|||
(defun vi-undefined ()
|
||||
(interactive)
|
||||
(message "Command key \"%s\" is undefined in Evi."
|
||||
(single-key-description last-command-char))
|
||||
(single-key-description last-command-event))
|
||||
(ding))
|
||||
|
||||
(defun vi-unimplemented ()
|
||||
(interactive)
|
||||
(message "Command key \"%s\" is not implemented in Evi."
|
||||
(single-key-description last-command-char))
|
||||
(single-key-description last-command-event))
|
||||
(ding))
|
||||
|
||||
;;;;;
|
||||
|
|
@ -832,7 +832,7 @@ Possible prefix-arg cases are nil, INTEGER, (nil . CHAR) or (INTEGER . CHAR)."
|
|||
(defun vi-goto-mark (mark-char &optional line-flag)
|
||||
"Go to marked position or line (if line-flag is given).
|
||||
Goto mark '@' means jump into and pop the top mark on the mark ring."
|
||||
(cond ((char-equal mark-char last-command-char) ; `` or ''
|
||||
(cond ((char-equal mark-char last-command-event) ; `` or ''
|
||||
(exchange-point-and-mark) (if line-flag (back-to-indentation)))
|
||||
((char-equal mark-char ?@) ; jump and pop mark
|
||||
(set-mark-command t) (if line-flag (back-to-indentation)))
|
||||
|
|
@ -949,7 +949,7 @@ With argument, do this that many times."
|
|||
"Replace char after point by CHAR. Repeat COUNT times."
|
||||
(interactive "p\nc")
|
||||
(delete-char count nil) ; don't save in kill ring
|
||||
(setq last-command-char char)
|
||||
(setq last-command-event char)
|
||||
(self-insert-command count)
|
||||
(vi-set-last-change-command 'vi-replace-1-char count char))
|
||||
|
||||
|
|
@ -984,15 +984,15 @@ With argument, do this that many times."
|
|||
the key bindings of the operators being fixed."
|
||||
(interactive "P")
|
||||
(catch 'vi-exit-op
|
||||
(let ((this-op-char last-command-char))
|
||||
(setq last-command-char (read-char))
|
||||
(setq this-command (lookup-key vi-com-map (char-to-string last-command-char)))
|
||||
(let ((this-op-char last-command-event))
|
||||
(setq last-command-event (read-char))
|
||||
(setq this-command (lookup-key vi-com-map (char-to-string last-command-event)))
|
||||
(if (not (eq this-command 'vi-digit-argument))
|
||||
(setq prefix-arg arg)
|
||||
(vi-digit-argument arg)
|
||||
(setq last-command-char (read-char))
|
||||
(setq this-command (lookup-key vi-com-map (char-to-string last-command-char))))
|
||||
(cond ((char-equal this-op-char last-command-char) ; line op
|
||||
(setq last-command-event (read-char))
|
||||
(setq this-command (lookup-key vi-com-map (char-to-string last-command-event))))
|
||||
(cond ((char-equal this-op-char last-command-event) ; line op
|
||||
(vi-execute-op this-op-char 'next-line
|
||||
(cons (1- (vi-prefix-numeric-value prefix-arg))
|
||||
(vi-prefix-char-value prefix-arg))))
|
||||
|
|
|
|||
|
|
@ -606,7 +606,7 @@ obtained so far, and COM is the command part obtained so far."
|
|||
(defun vip-digit-argument (arg)
|
||||
"Begin numeric argument for the next command."
|
||||
(interactive "P")
|
||||
(vip-prefix-arg-value last-command-char nil
|
||||
(vip-prefix-arg-value last-command-event nil
|
||||
(if (consp arg) (cdr arg) nil)))
|
||||
|
||||
(defun vip-command-argument (arg)
|
||||
|
|
@ -614,7 +614,7 @@ obtained so far, and COM is the command part obtained so far."
|
|||
(interactive "P")
|
||||
(condition-case conditions
|
||||
(vip-prefix-arg-com
|
||||
last-command-char
|
||||
last-command-event
|
||||
(cond ((null arg) nil)
|
||||
((consp arg) (car arg))
|
||||
((numberp arg) arg)
|
||||
|
|
|
|||
|
|
@ -719,7 +719,7 @@
|
|||
ARG is used as the prefix value for the executed command. If
|
||||
EVENTS is a list of events, which become the beginning of the command."
|
||||
(interactive "P")
|
||||
(if (viper= last-command-char ?\\)
|
||||
(if (viper= last-command-event ?\\)
|
||||
(message "Switched to EMACS state for the next command..."))
|
||||
(viper-escape-to-state arg events 'emacs-state))
|
||||
|
||||
|
|
@ -773,8 +773,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
|
|||
last-command-char (event-to-character last-command-event))
|
||||
;; Emacs represents them as sequences (str or vec)
|
||||
(setq last-command-event
|
||||
(viper-copy-event (viper-seq-last-elt key))
|
||||
last-command-char last-command-event))
|
||||
(viper-copy-event (viper-seq-last-elt key))))
|
||||
|
||||
(if (commandp com)
|
||||
;; pretend that current state is the state we excaped to
|
||||
|
|
@ -1170,7 +1169,7 @@ as a Meta key and any number of multiple escapes is allowed."
|
|||
;; then execute it with funcall and clear prefix-arg in order to not
|
||||
;; confuse subsequent commands
|
||||
(progn
|
||||
;; last-command-char is the char we want emacs to think was typed
|
||||
;; last-command-event is the char we want emacs to think was typed
|
||||
;; last. If com is not nil, the viper-digit-argument command was
|
||||
;; called from within viper-prefix-arg command, such as `d', `w',
|
||||
;; etc., i.e., the user typed, say, d2. In this case, `com' would be
|
||||
|
|
@ -1178,13 +1177,13 @@ as a Meta key and any number of multiple escapes is allowed."
|
|||
;; viper-escape-to-vi (which is indicated by the fact that the
|
||||
;; current state is not vi-state), then `event-char' represents the
|
||||
;; vi command to be executed (e.g., `d', `w', etc). Again,
|
||||
;; last-command-char must make emacs believe that this is the command
|
||||
;; last-command-event must make emacs believe that this is the command
|
||||
;; we typed.
|
||||
(cond ((eq event-char 'return) (setq event-char ?\C-m))
|
||||
((eq event-char 'delete) (setq event-char ?\C-?))
|
||||
((eq event-char 'backspace) (setq event-char ?\C-h))
|
||||
((eq event-char 'space) (setq event-char ?\ )))
|
||||
(setq last-command-char (or com event-char))
|
||||
(setq last-command-event (or com event-char))
|
||||
(setq func (viper-exec-form-in-vi
|
||||
`(key-binding (char-to-string ,event-char))))
|
||||
(funcall func prefix-arg)
|
||||
|
|
@ -1288,7 +1287,6 @@ as a Meta key and any number of multiple escapes is allowed."
|
|||
|
||||
(if cmd-to-exec-at-end
|
||||
(progn
|
||||
(setq last-command-char char)
|
||||
(setq last-command-event
|
||||
(viper-copy-event
|
||||
(if (featurep 'xemacs) (character-to-event char) char)))
|
||||
|
|
@ -1315,7 +1313,7 @@ as a Meta key and any number of multiple escapes is allowed."
|
|||
(interactive "P")
|
||||
(viper-leave-region-active)
|
||||
(viper-prefix-arg-value
|
||||
last-command-char (if (consp arg) (cdr arg) nil)))
|
||||
last-command-event (if (consp arg) (cdr arg) nil)))
|
||||
|
||||
(defun viper-command-argument (arg)
|
||||
"Accept a motion command as an argument."
|
||||
|
|
@ -1323,7 +1321,7 @@ as a Meta key and any number of multiple escapes is allowed."
|
|||
(let ((viper-intermediate-command 'viper-command-argument))
|
||||
(condition-case nil
|
||||
(viper-prefix-arg-com
|
||||
last-command-char
|
||||
last-command-event
|
||||
(cond ((null arg) nil)
|
||||
((consp arg) (car arg))
|
||||
((integerp arg) arg)
|
||||
|
|
@ -2100,7 +2098,7 @@ Undo previous insertion and inserts new."
|
|||
"Exit minibuffer Viper way."
|
||||
(interactive)
|
||||
(let (command)
|
||||
(setq command (local-key-binding (char-to-string last-command-char)))
|
||||
(setq command (local-key-binding (char-to-string last-command-event)))
|
||||
(run-hooks 'viper-minibuffer-exit-hook)
|
||||
(if command
|
||||
(command-execute command)
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@
|
|||
;; convoluted. Instead of viper-command-argument, keymaps should bind the
|
||||
;; actual commands. E.g., "dw" should be bound to a generic command
|
||||
;; viper-delete that will delete things based on the value of
|
||||
;; last-command-char. This would greatly simplify the logic and the code.
|
||||
;; last-command-event. This would greatly simplify the logic and the code.
|
||||
;;
|
||||
;; 2. Somebody should venture to write a customization package a la
|
||||
;; options.el that would allow the user to change values of variables
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
;;; mailabbrev.el --- abbrev-expansion of mail aliases
|
||||
|
||||
;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1996, 1997, 2000, 2001,
|
||||
;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||
;; Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Jamie Zawinski <jwz@lucid.com; now jwz@jwz.org>
|
||||
;; Maintainer: FSF
|
||||
|
|
@ -500,12 +501,12 @@ of a mail alias. The value is set up, buffer-local, when first needed.")
|
|||
;; when the user types -.) Check the character's syntax in
|
||||
;; the usual syntax table.
|
||||
|
||||
(or (and (integerp last-command-char)
|
||||
(or (and (integerp last-command-event)
|
||||
;; Some commands such as M-> may want to expand first.
|
||||
(equal this-command 'self-insert-command)
|
||||
(or (eq (char-syntax last-command-char) ?_)
|
||||
(or (eq (char-syntax last-command-event) ?_)
|
||||
;; Don't expand on @.
|
||||
(memq last-command-char '(?@ ?. ?% ?! ?_ ?-))))
|
||||
(memq last-command-event '(?@ ?. ?% ?! ?_ ?-))))
|
||||
;; Use this table so that abbrevs can have hyphens in them.
|
||||
(with-syntax-table mail-abbrev-syntax-table
|
||||
(funcall expand))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue