diff options
| author | Glenn Morris | 2009-01-09 04:36:00 +0000 |
|---|---|---|
| committer | Glenn Morris | 2009-01-09 04:36:00 +0000 |
| commit | a4d9b7bca3dc69efe89eecbd81ed96859f7cd818 (patch) | |
| tree | a946b8d6c185093144a33d99a33c9fbaed0eb068 | |
| parent | 61a846fbec62231eb19bdd41e08fd89f57787195 (diff) | |
| download | emacs-a4d9b7bca3dc69efe89eecbd81ed96859f7cd818.tar.gz emacs-a4d9b7bca3dc69efe89eecbd81ed96859f7cd818.zip | |
Replace last-command-char with last-command-event.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/emulation/vi.el | 20 | ||||
| -rw-r--r-- | lisp/emulation/vip.el | 4 | ||||
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 18 | ||||
| -rw-r--r-- | lisp/emulation/viper.el | 2 | ||||
| -rw-r--r-- | lisp/mail/mailabbrev.el | 9 |
6 files changed, 28 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a3882d5a07b..cc70c82f9f4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -8,8 +8,10 @@ | |||
| 8 | * calc/calc-sel.el, calc/calc-store.el, calc/calc-stuff.el: | 8 | * calc/calc-sel.el, calc/calc-store.el, calc/calc-stuff.el: |
| 9 | * calc/calc-units.el, calc/calc-yank.el, calc/calc.el: | 9 | * calc/calc-units.el, calc/calc-yank.el, calc/calc.el: |
| 10 | * emacs-lisp/lisp.el, emacs-lisp/re-builder.el: | 10 | * emacs-lisp/lisp.el, emacs-lisp/re-builder.el: |
| 11 | * emulation/vi.el, emulation/vip.el, emulation/viper-cmd.el: | ||
| 11 | * eshell/em-smart.el, eshell/esh-mode.el: | 12 | * eshell/em-smart.el, eshell/esh-mode.el: |
| 12 | * international/mule-cmds.el: | 13 | * international/mule-cmds.el: |
| 14 | * mail/mailabbrev.el: | ||
| 13 | * net/tramp.el: | 15 | * net/tramp.el: |
| 14 | * play/mpuz.el: | 16 | * play/mpuz.el: |
| 15 | * progmodes/ada-mode.el, progmodes/antlr-mode.el, progmodes/cc-align.el: | 17 | * progmodes/ada-mode.el, progmodes/antlr-mode.el, progmodes/cc-align.el: |
diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el index de7bcffdf0e..e9c7f6e8bbd 100644 --- a/lisp/emulation/vi.el +++ b/lisp/emulation/vi.el | |||
| @@ -506,13 +506,13 @@ set sw=n M-x set-variable vi-shift-width n " | |||
| 506 | (defun vi-undefined () | 506 | (defun vi-undefined () |
| 507 | (interactive) | 507 | (interactive) |
| 508 | (message "Command key \"%s\" is undefined in Evi." | 508 | (message "Command key \"%s\" is undefined in Evi." |
| 509 | (single-key-description last-command-char)) | 509 | (single-key-description last-command-event)) |
| 510 | (ding)) | 510 | (ding)) |
| 511 | 511 | ||
| 512 | (defun vi-unimplemented () | 512 | (defun vi-unimplemented () |
| 513 | (interactive) | 513 | (interactive) |
| 514 | (message "Command key \"%s\" is not implemented in Evi." | 514 | (message "Command key \"%s\" is not implemented in Evi." |
| 515 | (single-key-description last-command-char)) | 515 | (single-key-description last-command-event)) |
| 516 | (ding)) | 516 | (ding)) |
| 517 | 517 | ||
| 518 | ;;;;; | 518 | ;;;;; |
| @@ -832,7 +832,7 @@ Possible prefix-arg cases are nil, INTEGER, (nil . CHAR) or (INTEGER . CHAR)." | |||
| 832 | (defun vi-goto-mark (mark-char &optional line-flag) | 832 | (defun vi-goto-mark (mark-char &optional line-flag) |
| 833 | "Go to marked position or line (if line-flag is given). | 833 | "Go to marked position or line (if line-flag is given). |
| 834 | Goto mark '@' means jump into and pop the top mark on the mark ring." | 834 | Goto mark '@' means jump into and pop the top mark on the mark ring." |
| 835 | (cond ((char-equal mark-char last-command-char) ; `` or '' | 835 | (cond ((char-equal mark-char last-command-event) ; `` or '' |
| 836 | (exchange-point-and-mark) (if line-flag (back-to-indentation))) | 836 | (exchange-point-and-mark) (if line-flag (back-to-indentation))) |
| 837 | ((char-equal mark-char ?@) ; jump and pop mark | 837 | ((char-equal mark-char ?@) ; jump and pop mark |
| 838 | (set-mark-command t) (if line-flag (back-to-indentation))) | 838 | (set-mark-command t) (if line-flag (back-to-indentation))) |
| @@ -949,7 +949,7 @@ With argument, do this that many times." | |||
| 949 | "Replace char after point by CHAR. Repeat COUNT times." | 949 | "Replace char after point by CHAR. Repeat COUNT times." |
| 950 | (interactive "p\nc") | 950 | (interactive "p\nc") |
| 951 | (delete-char count nil) ; don't save in kill ring | 951 | (delete-char count nil) ; don't save in kill ring |
| 952 | (setq last-command-char char) | 952 | (setq last-command-event char) |
| 953 | (self-insert-command count) | 953 | (self-insert-command count) |
| 954 | (vi-set-last-change-command 'vi-replace-1-char count char)) | 954 | (vi-set-last-change-command 'vi-replace-1-char count char)) |
| 955 | 955 | ||
| @@ -984,15 +984,15 @@ With argument, do this that many times." | |||
| 984 | the key bindings of the operators being fixed." | 984 | the key bindings of the operators being fixed." |
| 985 | (interactive "P") | 985 | (interactive "P") |
| 986 | (catch 'vi-exit-op | 986 | (catch 'vi-exit-op |
| 987 | (let ((this-op-char last-command-char)) | 987 | (let ((this-op-char last-command-event)) |
| 988 | (setq last-command-char (read-char)) | 988 | (setq last-command-event (read-char)) |
| 989 | (setq this-command (lookup-key vi-com-map (char-to-string last-command-char))) | 989 | (setq this-command (lookup-key vi-com-map (char-to-string last-command-event))) |
| 990 | (if (not (eq this-command 'vi-digit-argument)) | 990 | (if (not (eq this-command 'vi-digit-argument)) |
| 991 | (setq prefix-arg arg) | 991 | (setq prefix-arg arg) |
| 992 | (vi-digit-argument arg) | 992 | (vi-digit-argument arg) |
| 993 | (setq last-command-char (read-char)) | 993 | (setq last-command-event (read-char)) |
| 994 | (setq this-command (lookup-key vi-com-map (char-to-string last-command-char)))) | 994 | (setq this-command (lookup-key vi-com-map (char-to-string last-command-event)))) |
| 995 | (cond ((char-equal this-op-char last-command-char) ; line op | 995 | (cond ((char-equal this-op-char last-command-event) ; line op |
| 996 | (vi-execute-op this-op-char 'next-line | 996 | (vi-execute-op this-op-char 'next-line |
| 997 | (cons (1- (vi-prefix-numeric-value prefix-arg)) | 997 | (cons (1- (vi-prefix-numeric-value prefix-arg)) |
| 998 | (vi-prefix-char-value prefix-arg)))) | 998 | (vi-prefix-char-value prefix-arg)))) |
diff --git a/lisp/emulation/vip.el b/lisp/emulation/vip.el index 0d00b36b7e1..560a7e6e849 100644 --- a/lisp/emulation/vip.el +++ b/lisp/emulation/vip.el | |||
| @@ -606,7 +606,7 @@ obtained so far, and COM is the command part obtained so far." | |||
| 606 | (defun vip-digit-argument (arg) | 606 | (defun vip-digit-argument (arg) |
| 607 | "Begin numeric argument for the next command." | 607 | "Begin numeric argument for the next command." |
| 608 | (interactive "P") | 608 | (interactive "P") |
| 609 | (vip-prefix-arg-value last-command-char nil | 609 | (vip-prefix-arg-value last-command-event nil |
| 610 | (if (consp arg) (cdr arg) nil))) | 610 | (if (consp arg) (cdr arg) nil))) |
| 611 | 611 | ||
| 612 | (defun vip-command-argument (arg) | 612 | (defun vip-command-argument (arg) |
| @@ -614,7 +614,7 @@ obtained so far, and COM is the command part obtained so far." | |||
| 614 | (interactive "P") | 614 | (interactive "P") |
| 615 | (condition-case conditions | 615 | (condition-case conditions |
| 616 | (vip-prefix-arg-com | 616 | (vip-prefix-arg-com |
| 617 | last-command-char | 617 | last-command-event |
| 618 | (cond ((null arg) nil) | 618 | (cond ((null arg) nil) |
| 619 | ((consp arg) (car arg)) | 619 | ((consp arg) (car arg)) |
| 620 | ((numberp arg) arg) | 620 | ((numberp arg) arg) |
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 5040b278728..95f601716fa 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -719,7 +719,7 @@ | |||
| 719 | ARG is used as the prefix value for the executed command. If | 719 | ARG is used as the prefix value for the executed command. If |
| 720 | EVENTS is a list of events, which become the beginning of the command." | 720 | EVENTS is a list of events, which become the beginning of the command." |
| 721 | (interactive "P") | 721 | (interactive "P") |
| 722 | (if (viper= last-command-char ?\\) | 722 | (if (viper= last-command-event ?\\) |
| 723 | (message "Switched to EMACS state for the next command...")) | 723 | (message "Switched to EMACS state for the next command...")) |
| 724 | (viper-escape-to-state arg events 'emacs-state)) | 724 | (viper-escape-to-state arg events 'emacs-state)) |
| 725 | 725 | ||
| @@ -773,8 +773,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to | |||
| 773 | last-command-char (event-to-character last-command-event)) | 773 | last-command-char (event-to-character last-command-event)) |
| 774 | ;; Emacs represents them as sequences (str or vec) | 774 | ;; Emacs represents them as sequences (str or vec) |
| 775 | (setq last-command-event | 775 | (setq last-command-event |
| 776 | (viper-copy-event (viper-seq-last-elt key)) | 776 | (viper-copy-event (viper-seq-last-elt key)))) |
| 777 | last-command-char last-command-event)) | ||
| 778 | 777 | ||
| 779 | (if (commandp com) | 778 | (if (commandp com) |
| 780 | ;; pretend that current state is the state we excaped to | 779 | ;; 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." | |||
| 1170 | ;; then execute it with funcall and clear prefix-arg in order to not | 1169 | ;; then execute it with funcall and clear prefix-arg in order to not |
| 1171 | ;; confuse subsequent commands | 1170 | ;; confuse subsequent commands |
| 1172 | (progn | 1171 | (progn |
| 1173 | ;; last-command-char is the char we want emacs to think was typed | 1172 | ;; last-command-event is the char we want emacs to think was typed |
| 1174 | ;; last. If com is not nil, the viper-digit-argument command was | 1173 | ;; last. If com is not nil, the viper-digit-argument command was |
| 1175 | ;; called from within viper-prefix-arg command, such as `d', `w', | 1174 | ;; called from within viper-prefix-arg command, such as `d', `w', |
| 1176 | ;; etc., i.e., the user typed, say, d2. In this case, `com' would be | 1175 | ;; 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." | |||
| 1178 | ;; viper-escape-to-vi (which is indicated by the fact that the | 1177 | ;; viper-escape-to-vi (which is indicated by the fact that the |
| 1179 | ;; current state is not vi-state), then `event-char' represents the | 1178 | ;; current state is not vi-state), then `event-char' represents the |
| 1180 | ;; vi command to be executed (e.g., `d', `w', etc). Again, | 1179 | ;; vi command to be executed (e.g., `d', `w', etc). Again, |
| 1181 | ;; last-command-char must make emacs believe that this is the command | 1180 | ;; last-command-event must make emacs believe that this is the command |
| 1182 | ;; we typed. | 1181 | ;; we typed. |
| 1183 | (cond ((eq event-char 'return) (setq event-char ?\C-m)) | 1182 | (cond ((eq event-char 'return) (setq event-char ?\C-m)) |
| 1184 | ((eq event-char 'delete) (setq event-char ?\C-?)) | 1183 | ((eq event-char 'delete) (setq event-char ?\C-?)) |
| 1185 | ((eq event-char 'backspace) (setq event-char ?\C-h)) | 1184 | ((eq event-char 'backspace) (setq event-char ?\C-h)) |
| 1186 | ((eq event-char 'space) (setq event-char ?\ ))) | 1185 | ((eq event-char 'space) (setq event-char ?\ ))) |
| 1187 | (setq last-command-char (or com event-char)) | 1186 | (setq last-command-event (or com event-char)) |
| 1188 | (setq func (viper-exec-form-in-vi | 1187 | (setq func (viper-exec-form-in-vi |
| 1189 | `(key-binding (char-to-string ,event-char)))) | 1188 | `(key-binding (char-to-string ,event-char)))) |
| 1190 | (funcall func prefix-arg) | 1189 | (funcall func prefix-arg) |
| @@ -1288,7 +1287,6 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1288 | 1287 | ||
| 1289 | (if cmd-to-exec-at-end | 1288 | (if cmd-to-exec-at-end |
| 1290 | (progn | 1289 | (progn |
| 1291 | (setq last-command-char char) | ||
| 1292 | (setq last-command-event | 1290 | (setq last-command-event |
| 1293 | (viper-copy-event | 1291 | (viper-copy-event |
| 1294 | (if (featurep 'xemacs) (character-to-event char) char))) | 1292 | (if (featurep 'xemacs) (character-to-event char) char))) |
| @@ -1315,7 +1313,7 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1315 | (interactive "P") | 1313 | (interactive "P") |
| 1316 | (viper-leave-region-active) | 1314 | (viper-leave-region-active) |
| 1317 | (viper-prefix-arg-value | 1315 | (viper-prefix-arg-value |
| 1318 | last-command-char (if (consp arg) (cdr arg) nil))) | 1316 | last-command-event (if (consp arg) (cdr arg) nil))) |
| 1319 | 1317 | ||
| 1320 | (defun viper-command-argument (arg) | 1318 | (defun viper-command-argument (arg) |
| 1321 | "Accept a motion command as an argument." | 1319 | "Accept a motion command as an argument." |
| @@ -1323,7 +1321,7 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1323 | (let ((viper-intermediate-command 'viper-command-argument)) | 1321 | (let ((viper-intermediate-command 'viper-command-argument)) |
| 1324 | (condition-case nil | 1322 | (condition-case nil |
| 1325 | (viper-prefix-arg-com | 1323 | (viper-prefix-arg-com |
| 1326 | last-command-char | 1324 | last-command-event |
| 1327 | (cond ((null arg) nil) | 1325 | (cond ((null arg) nil) |
| 1328 | ((consp arg) (car arg)) | 1326 | ((consp arg) (car arg)) |
| 1329 | ((integerp arg) arg) | 1327 | ((integerp arg) arg) |
| @@ -2100,7 +2098,7 @@ Undo previous insertion and inserts new." | |||
| 2100 | "Exit minibuffer Viper way." | 2098 | "Exit minibuffer Viper way." |
| 2101 | (interactive) | 2099 | (interactive) |
| 2102 | (let (command) | 2100 | (let (command) |
| 2103 | (setq command (local-key-binding (char-to-string last-command-char))) | 2101 | (setq command (local-key-binding (char-to-string last-command-event))) |
| 2104 | (run-hooks 'viper-minibuffer-exit-hook) | 2102 | (run-hooks 'viper-minibuffer-exit-hook) |
| 2105 | (if command | 2103 | (if command |
| 2106 | (command-execute command) | 2104 | (command-execute command) |
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index a7fd5fdee35..d2234fb22d9 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -288,7 +288,7 @@ | |||
| 288 | ;; convoluted. Instead of viper-command-argument, keymaps should bind the | 288 | ;; convoluted. Instead of viper-command-argument, keymaps should bind the |
| 289 | ;; actual commands. E.g., "dw" should be bound to a generic command | 289 | ;; actual commands. E.g., "dw" should be bound to a generic command |
| 290 | ;; viper-delete that will delete things based on the value of | 290 | ;; viper-delete that will delete things based on the value of |
| 291 | ;; last-command-char. This would greatly simplify the logic and the code. | 291 | ;; last-command-event. This would greatly simplify the logic and the code. |
| 292 | ;; | 292 | ;; |
| 293 | ;; 2. Somebody should venture to write a customization package a la | 293 | ;; 2. Somebody should venture to write a customization package a la |
| 294 | ;; options.el that would allow the user to change values of variables | 294 | ;; options.el that would allow the user to change values of variables |
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index 85dfa24dc46..7e2d62da05c 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | ;;; mailabbrev.el --- abbrev-expansion of mail aliases | 1 | ;;; mailabbrev.el --- abbrev-expansion of mail aliases |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1996, 1997, 2000, 2001, | 3 | ;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1996, 1997, 2000, 2001, |
| 4 | ;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. | 4 | ;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
| 5 | ;; Free Software Foundation, Inc. | ||
| 5 | 6 | ||
| 6 | ;; Author: Jamie Zawinski <jwz@lucid.com; now jwz@jwz.org> | 7 | ;; Author: Jamie Zawinski <jwz@lucid.com; now jwz@jwz.org> |
| 7 | ;; Maintainer: FSF | 8 | ;; Maintainer: FSF |
| @@ -500,12 +501,12 @@ of a mail alias. The value is set up, buffer-local, when first needed.") | |||
| 500 | ;; when the user types -.) Check the character's syntax in | 501 | ;; when the user types -.) Check the character's syntax in |
| 501 | ;; the usual syntax table. | 502 | ;; the usual syntax table. |
| 502 | 503 | ||
| 503 | (or (and (integerp last-command-char) | 504 | (or (and (integerp last-command-event) |
| 504 | ;; Some commands such as M-> may want to expand first. | 505 | ;; Some commands such as M-> may want to expand first. |
| 505 | (equal this-command 'self-insert-command) | 506 | (equal this-command 'self-insert-command) |
| 506 | (or (eq (char-syntax last-command-char) ?_) | 507 | (or (eq (char-syntax last-command-event) ?_) |
| 507 | ;; Don't expand on @. | 508 | ;; Don't expand on @. |
| 508 | (memq last-command-char '(?@ ?. ?% ?! ?_ ?-)))) | 509 | (memq last-command-event '(?@ ?. ?% ?! ?_ ?-)))) |
| 509 | ;; Use this table so that abbrevs can have hyphens in them. | 510 | ;; Use this table so that abbrevs can have hyphens in them. |
| 510 | (with-syntax-table mail-abbrev-syntax-table | 511 | (with-syntax-table mail-abbrev-syntax-table |
| 511 | (funcall expand)))) | 512 | (funcall expand)))) |