diff options
| author | Michael Kifer | 1999-11-25 05:20:59 +0000 |
|---|---|---|
| committer | Michael Kifer | 1999-11-25 05:20:59 +0000 |
| commit | 7d3f9fd8e89e9901a7879c9cb8c46c439e67db4c (patch) | |
| tree | 2b3ee1fe9721d4e4def0e3be7a922e3ba4ebbbee | |
| parent | 22d92d6b53541889e9bf6459eab091064e7040d9 (diff) | |
| download | emacs-7d3f9fd8e89e9901a7879c9cb8c46c439e67db4c.tar.gz emacs-7d3f9fd8e89e9901a7879c9cb8c46c439e67db4c.zip | |
* viper*el: replaced old-style backquotes.
* ediff*el: replaced old-style backquotes.
* ediff-merge
(ediff-looks-like-combined-merge,ediff-get-combined-region):
changed to support the new format for ediff-combination-pattern.
* ediff-diff (ediff-set-fine-overlays-in-one-buffer):
changed to support the new format for ediff-combination-pattern.
| -rw-r--r-- | lisp/ChangeLog | 13 | ||||
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 187 |
2 files changed, 111 insertions, 89 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e0496b05c33..a22ce4b2dbe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 1999-11-24 Michael Kifer <kifer@cs.sunysb.edu> | ||
| 2 | |||
| 3 | * viper*el: replaced old-style backquotes. | ||
| 4 | |||
| 5 | * ediff*el: replaced old-style backquotes. | ||
| 6 | |||
| 7 | * ediff-merge | ||
| 8 | (ediff-looks-like-combined-merge,ediff-get-combined-region): | ||
| 9 | changed to support the new format for ediff-combination-pattern. | ||
| 10 | |||
| 11 | * ediff-diff (ediff-set-fine-overlays-in-one-buffer): | ||
| 12 | changed to support the new format for ediff-combination-pattern. | ||
| 13 | |||
| 1 | 1999-11-24 Dave Love <fx@gnu.org> | 14 | 1999-11-24 Dave Love <fx@gnu.org> |
| 2 | 15 | ||
| 3 | * custom.el (custom-declare-group): Purecopy DOC. | 16 | * custom.el (custom-declare-group): Purecopy DOC. |
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 9c4bbde61ef..78ed5e5d53c 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -404,8 +404,7 @@ | |||
| 404 | (defun viper-normalize-minor-mode-map-alist () | 404 | (defun viper-normalize-minor-mode-map-alist () |
| 405 | (setq minor-mode-map-alist | 405 | (setq minor-mode-map-alist |
| 406 | (viper-append-filter-alist | 406 | (viper-append-filter-alist |
| 407 | (list | 407 | (list (cons 'viper-vi-intercept-minor-mode viper-vi-intercept-map) |
| 408 | (cons 'viper-vi-intercept-minor-mode viper-vi-intercept-map) | ||
| 409 | (cons 'viper-vi-minibuffer-minor-mode viper-minibuffer-map) | 408 | (cons 'viper-vi-minibuffer-minor-mode viper-minibuffer-map) |
| 410 | (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map) | 409 | (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map) |
| 411 | (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map) | 410 | (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map) |
| @@ -457,8 +456,6 @@ | |||
| 457 | minor-mode-map-alist))) | 456 | minor-mode-map-alist))) |
| 458 | 457 | ||
| 459 | 458 | ||
| 460 | |||
| 461 | |||
| 462 | 459 | ||
| 463 | ;; Viper mode-changing commands and utilities | 460 | ;; Viper mode-changing commands and utilities |
| 464 | 461 | ||
| @@ -1021,8 +1018,8 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1021 | `(key-binding (char-to-string ,event-char)))) | 1018 | `(key-binding (char-to-string ,event-char)))) |
| 1022 | (funcall func prefix-arg) | 1019 | (funcall func prefix-arg) |
| 1023 | (setq prefix-arg nil)) | 1020 | (setq prefix-arg nil)) |
| 1024 | ;; some other command -- let emacs do it in its own way | 1021 | ;; some other command -- let emacs do it in its own way |
| 1025 | (viper-set-unread-command-events event-char)) | 1022 | (viper-set-unread-command-events event-char)) |
| 1026 | )) | 1023 | )) |
| 1027 | 1024 | ||
| 1028 | 1025 | ||
| @@ -1044,86 +1041,86 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1044 | (if (memq char '(?# ?\")) (error "")) | 1041 | (if (memq char '(?# ?\")) (error "")) |
| 1045 | (setq com (cons char com)) | 1042 | (setq com (cons char com)) |
| 1046 | (setq cont nil)) | 1043 | (setq cont nil)) |
| 1047 | ;; If com is nil we set com as char, and read more. Again, if char is | 1044 | ;; If com is nil we set com as char, and read more. Again, if char is |
| 1048 | ;; ", we read the name of register and store it in viper-use-register. | 1045 | ;; ", we read the name of register and store it in viper-use-register. |
| 1049 | ;; if char is !, =, or #, a complete com is formed so we exit the while | 1046 | ;; if char is !, =, or #, a complete com is formed so we exit the while |
| 1050 | ;; loop. | 1047 | ;; loop. |
| 1051 | (cond ((memq char '(?! ?=)) | 1048 | (cond ((memq char '(?! ?=)) |
| 1052 | (setq com char) | 1049 | (setq com char) |
| 1053 | (setq char (read-char)) | 1050 | (setq char (read-char)) |
| 1054 | (setq cont nil)) | 1051 | (setq cont nil)) |
| 1055 | ((= char ?#) | 1052 | ((= char ?#) |
| 1056 | ;; read a char and encode it as com | 1053 | ;; read a char and encode it as com |
| 1057 | (setq com (+ 128 (read-char))) | 1054 | (setq com (+ 128 (read-char))) |
| 1058 | (setq char (read-char))) | 1055 | (setq char (read-char))) |
| 1059 | ((= char ?\") | 1056 | ((= char ?\") |
| 1060 | (let ((reg (read-char))) | 1057 | (let ((reg (read-char))) |
| 1061 | (if (viper-valid-register reg) | 1058 | (if (viper-valid-register reg) |
| 1062 | (setq viper-use-register reg) | 1059 | (setq viper-use-register reg) |
| 1063 | (error "")) | 1060 | (error "")) |
| 1064 | (setq char (read-char)))) | 1061 | (setq char (read-char)))) |
| 1065 | (t | 1062 | (t |
| 1066 | (setq com char) | 1063 | (setq com char) |
| 1067 | (setq char (read-char)))))) | 1064 | (setq char (read-char)))))) |
| 1068 | 1065 | ||
| 1069 | (if (atom com) | 1066 | (if (atom com) |
| 1070 | ;; `com' is a single char, so we construct the command argument | 1067 | ;; `com' is a single char, so we construct the command argument |
| 1071 | ;; and if `char' is `?', we describe the arg; otherwise | 1068 | ;; and if `char' is `?', we describe the arg; otherwise |
| 1072 | ;; we prepare the command that will be executed at the end. | 1069 | ;; we prepare the command that will be executed at the end. |
| 1073 | (progn | 1070 | (progn |
| 1074 | (setq cmd-info (cons value com)) | 1071 | (setq cmd-info (cons value com)) |
| 1075 | (while (= char ?U) | 1072 | (while (= char ?U) |
| 1076 | (viper-describe-arg cmd-info) | 1073 | (viper-describe-arg cmd-info) |
| 1077 | (setq char (read-char))) | 1074 | (setq char (read-char))) |
| 1078 | ;; `char' is a movement cmd, a digit arg cmd, or a register cmd---so we | 1075 | ;; `char' is a movement cmd, a digit arg cmd, or a register cmd---so we |
| 1079 | ;; execute it at the very end | 1076 | ;; execute it at the very end |
| 1080 | (or (viper-movement-command-p char) | 1077 | (or (viper-movement-command-p char) |
| 1081 | (viper-digit-command-p char) | 1078 | (viper-digit-command-p char) |
| 1082 | (viper-regsuffix-command-p char) | 1079 | (viper-regsuffix-command-p char) |
| 1083 | (= char ?!) ; bang command | 1080 | (= char ?!) ; bang command |
| 1084 | (error "")) | 1081 | (error "")) |
| 1085 | (setq cmd-to-exec-at-end | 1082 | (setq cmd-to-exec-at-end |
| 1086 | (viper-exec-form-in-vi | 1083 | (viper-exec-form-in-vi |
| 1087 | `(key-binding (char-to-string ,char))))) | 1084 | `(key-binding (char-to-string ,char))))) |
| 1088 | 1085 | ||
| 1089 | ;; as com is non-nil, this means that we have a command to execute | 1086 | ;; as com is non-nil, this means that we have a command to execute |
| 1090 | (if (memq (car com) '(?r ?R)) | 1087 | (if (memq (car com) '(?r ?R)) |
| 1091 | ;; execute apropriate region command. | 1088 | ;; execute apropriate region command. |
| 1092 | (let ((char (car com)) (com (cdr com))) | 1089 | (let ((char (car com)) (com (cdr com))) |
| 1093 | (setq prefix-arg (cons value com)) | 1090 | (setq prefix-arg (cons value com)) |
| 1094 | (if (= char ?r) (viper-region prefix-arg) | 1091 | (if (= char ?r) (viper-region prefix-arg) |
| 1095 | (viper-Region prefix-arg)) | 1092 | (viper-Region prefix-arg)) |
| 1096 | ;; reset prefix-arg | 1093 | ;; reset prefix-arg |
| 1097 | (setq prefix-arg nil)) | 1094 | (setq prefix-arg nil)) |
| 1098 | ;; otherwise, reset prefix arg and call appropriate command | 1095 | ;; otherwise, reset prefix arg and call appropriate command |
| 1099 | (setq value (if (null value) 1 value)) | 1096 | (setq value (if (null value) 1 value)) |
| 1100 | (setq prefix-arg nil) | 1097 | (setq prefix-arg nil) |
| 1101 | (cond | 1098 | (cond |
| 1102 | ;; If we change ?C to ?c here, then cc will enter replacement mode | 1099 | ;; If we change ?C to ?c here, then cc will enter replacement mode |
| 1103 | ;; rather than deleting lines. However, it will affect 1 less line than | 1100 | ;; rather than deleting lines. However, it will affect 1 less line than |
| 1104 | ;; normal. We decided to not use replacement mode here and follow Vi, | 1101 | ;; normal. We decided to not use replacement mode here and follow Vi, |
| 1105 | ;; since replacement mode on n full lines can be achieved with nC. | 1102 | ;; since replacement mode on n full lines can be achieved with nC. |
| 1106 | ((equal com '(?c . ?c)) (viper-line (cons value ?C))) | 1103 | ((equal com '(?c . ?c)) (viper-line (cons value ?C))) |
| 1107 | ((equal com '(?d . ?d)) (viper-line (cons value ?D))) | 1104 | ((equal com '(?d . ?d)) (viper-line (cons value ?D))) |
| 1108 | ((equal com '(?d . ?y)) (viper-yank-defun)) | 1105 | ((equal com '(?d . ?y)) (viper-yank-defun)) |
| 1109 | ((equal com '(?y . ?y)) (viper-line (cons value ?Y))) | 1106 | ((equal com '(?y . ?y)) (viper-line (cons value ?Y))) |
| 1110 | ((equal com '(?< . ?<)) (viper-line (cons value ?<))) | 1107 | ((equal com '(?< . ?<)) (viper-line (cons value ?<))) |
| 1111 | ((equal com '(?> . ?>)) (viper-line (cons value ?>))) | 1108 | ((equal com '(?> . ?>)) (viper-line (cons value ?>))) |
| 1112 | ((equal com '(?! . ?!)) (viper-line (cons value ?!))) | 1109 | ((equal com '(?! . ?!)) (viper-line (cons value ?!))) |
| 1113 | ((equal com '(?= . ?=)) (viper-line (cons value ?=))) | 1110 | ((equal com '(?= . ?=)) (viper-line (cons value ?=))) |
| 1114 | (t (error ""))))) | 1111 | (t (error ""))))) |
| 1115 | 1112 | ||
| 1116 | (if cmd-to-exec-at-end | 1113 | (if cmd-to-exec-at-end |
| 1117 | (progn | 1114 | (progn |
| 1118 | (setq last-command-char char) | 1115 | (setq last-command-char char) |
| 1119 | (setq last-command-event | 1116 | (setq last-command-event |
| 1120 | (viper-copy-event | 1117 | (viper-copy-event |
| 1121 | (if viper-xemacs-p (character-to-event char) char))) | 1118 | (if viper-xemacs-p (character-to-event char) char))) |
| 1122 | (condition-case nil | 1119 | (condition-case nil |
| 1123 | (funcall cmd-to-exec-at-end cmd-info) | 1120 | (funcall cmd-to-exec-at-end cmd-info) |
| 1124 | (error | 1121 | (error |
| 1125 | (error ""))))) | 1122 | (error ""))))) |
| 1126 | )) | 1123 | )) |
| 1127 | 1124 | ||
| 1128 | (defun viper-describe-arg (arg) | 1125 | (defun viper-describe-arg (arg) |
| 1129 | (let (val com) | 1126 | (let (val com) |
| @@ -1660,6 +1657,7 @@ invokes the command before that, etc." | |||
| 1660 | (viper-push-onto-ring viper-d-com 'viper-command-ring))) | 1657 | (viper-push-onto-ring viper-d-com 'viper-command-ring))) |
| 1661 | (setq viper-this-command-keys nil)) | 1658 | (setq viper-this-command-keys nil)) |
| 1662 | 1659 | ||
| 1660 | |||
| 1663 | (defun viper-prev-destructive-command (next) | 1661 | (defun viper-prev-destructive-command (next) |
| 1664 | "Find previous destructive command in the history of destructive commands. | 1662 | "Find previous destructive command in the history of destructive commands. |
| 1665 | With prefix argument, find next destructive command." | 1663 | With prefix argument, find next destructive command." |
| @@ -1679,11 +1677,13 @@ With prefix argument, find next destructive command." | |||
| 1679 | (setq viper-d-com cmd)) | 1677 | (setq viper-d-com cmd)) |
| 1680 | (viper-display-current-destructive-command))) | 1678 | (viper-display-current-destructive-command))) |
| 1681 | 1679 | ||
| 1680 | |||
| 1682 | (defun viper-next-destructive-command () | 1681 | (defun viper-next-destructive-command () |
| 1683 | "Find next destructive command in the history of destructive commands." | 1682 | "Find next destructive command in the history of destructive commands." |
| 1684 | (interactive) | 1683 | (interactive) |
| 1685 | (viper-prev-destructive-command 'next)) | 1684 | (viper-prev-destructive-command 'next)) |
| 1686 | 1685 | ||
| 1686 | |||
| 1687 | (defun viper-insert-prev-from-insertion-ring (arg) | 1687 | (defun viper-insert-prev-from-insertion-ring (arg) |
| 1688 | "Cycle through insertion ring in the direction of older insertions. | 1688 | "Cycle through insertion ring in the direction of older insertions. |
| 1689 | Undoes previous insertion and inserts new. | 1689 | Undoes previous insertion and inserts new. |
| @@ -1723,6 +1723,7 @@ Undo previous insertion and inserts new." | |||
| 1723 | (interactive) | 1723 | (interactive) |
| 1724 | (viper-insert-prev-from-insertion-ring 'next)) | 1724 | (viper-insert-prev-from-insertion-ring 'next)) |
| 1725 | 1725 | ||
| 1726 | |||
| 1726 | 1727 | ||
| 1727 | ;; some region utilities | 1728 | ;; some region utilities |
| 1728 | 1729 | ||
| @@ -1838,6 +1839,7 @@ Undo previous insertion and inserts new." | |||
| 1838 | (funcall hook) | 1839 | (funcall hook) |
| 1839 | )) | 1840 | )) |
| 1840 | 1841 | ||
| 1842 | |||
| 1841 | ;; Interpret last event in the local map first; if fails, use exit-minibuffer. | 1843 | ;; Interpret last event in the local map first; if fails, use exit-minibuffer. |
| 1842 | ;; Run viper-minibuffer-exit-hook before exiting. | 1844 | ;; Run viper-minibuffer-exit-hook before exiting. |
| 1843 | (defun viper-exit-minibuffer () | 1845 | (defun viper-exit-minibuffer () |
| @@ -2518,6 +2520,7 @@ On reaching end of line, stop and signal error." | |||
| 2518 | (forward-char val) | 2520 | (forward-char val) |
| 2519 | (if com (viper-execute-com 'viper-forward-char val com))))) | 2521 | (if com (viper-execute-com 'viper-forward-char val com))))) |
| 2520 | 2522 | ||
| 2523 | |||
| 2521 | (defun viper-backward-char (arg) | 2524 | (defun viper-backward-char (arg) |
| 2522 | "Move point left ARG characters (right if ARG negative). | 2525 | "Move point left ARG characters (right if ARG negative). |
| 2523 | On reaching beginning of line, stop and signal error." | 2526 | On reaching beginning of line, stop and signal error." |
| @@ -2533,6 +2536,7 @@ On reaching beginning of line, stop and signal error." | |||
| 2533 | (backward-char val) | 2536 | (backward-char val) |
| 2534 | (if com (viper-execute-com 'viper-backward-char val com))))) | 2537 | (if com (viper-execute-com 'viper-backward-char val com))))) |
| 2535 | 2538 | ||
| 2539 | |||
| 2536 | ;; Like forward-char, but doesn't move at end of buffer. | 2540 | ;; Like forward-char, but doesn't move at end of buffer. |
| 2537 | ;; Returns distance traveled | 2541 | ;; Returns distance traveled |
| 2538 | ;; (positive or 0, if arg positive; negative if arg negative). | 2542 | ;; (positive or 0, if arg positive; negative if arg negative). |
| @@ -2546,6 +2550,7 @@ On reaching beginning of line, stop and signal error." | |||
| 2546 | (- (viper-chars-in-region pt (point))) | 2550 | (- (viper-chars-in-region pt (point))) |
| 2547 | (viper-chars-in-region pt (point))))) | 2551 | (viper-chars-in-region pt (point))))) |
| 2548 | 2552 | ||
| 2553 | |||
| 2549 | ;; Like backward-char, but doesn't move at beg of buffer. | 2554 | ;; Like backward-char, but doesn't move at beg of buffer. |
| 2550 | ;; Returns distance traveled | 2555 | ;; Returns distance traveled |
| 2551 | ;; (negative or 0, if arg positive; positive if arg negative). | 2556 | ;; (negative or 0, if arg positive; positive if arg negative). |
| @@ -2594,6 +2599,7 @@ On reaching beginning of line, stop and signal error." | |||
| 2594 | (viper-skip-all-separators-backward 'within-line) | 2599 | (viper-skip-all-separators-backward 'within-line) |
| 2595 | (or (bobp) (forward-char))))) | 2600 | (or (bobp) (forward-char))))) |
| 2596 | 2601 | ||
| 2602 | |||
| 2597 | (defun viper-forward-word-kernel (val) | 2603 | (defun viper-forward-word-kernel (val) |
| 2598 | (while (> val 0) | 2604 | (while (> val 0) |
| 2599 | (cond ((viper-looking-at-alpha) | 2605 | (cond ((viper-looking-at-alpha) |
| @@ -2877,6 +2883,7 @@ On reaching beginning of line, stop and signal error." | |||
| 2877 | (back-to-indentation) | 2883 | (back-to-indentation) |
| 2878 | (if com (viper-execute-com 'viper-next-line-at-bol val com)))) | 2884 | (if com (viper-execute-com 'viper-next-line-at-bol val com)))) |
| 2879 | 2885 | ||
| 2886 | |||
| 2880 | (defun viper-previous-line (arg) | 2887 | (defun viper-previous-line (arg) |
| 2881 | "Go to previous line." | 2888 | "Go to previous line." |
| 2882 | (interactive "P") | 2889 | (interactive "P") |
| @@ -3985,6 +3992,7 @@ Null string will repeat previous search." | |||
| 3985 | (ding)) | 3992 | (ding)) |
| 3986 | (delete-backward-char val t))) | 3993 | (delete-backward-char val t))) |
| 3987 | 3994 | ||
| 3995 | |||
| 3988 | (defun viper-del-backward-char-in-insert () | 3996 | (defun viper-del-backward-char-in-insert () |
| 3989 | "Delete 1 char backwards while in insert mode." | 3997 | "Delete 1 char backwards while in insert mode." |
| 3990 | (interactive) | 3998 | (interactive) |
| @@ -3992,6 +4000,7 @@ Null string will repeat previous search." | |||
| 3992 | (beep 1) | 4000 | (beep 1) |
| 3993 | (delete-backward-char 1 t))) | 4001 | (delete-backward-char 1 t))) |
| 3994 | 4002 | ||
| 4003 | |||
| 3995 | (defun viper-del-backward-char-in-replace () | 4004 | (defun viper-del-backward-char-in-replace () |
| 3996 | "Delete one character in replace mode. | 4005 | "Delete one character in replace mode. |
| 3997 | If `viper-delete-backwards-in-replace' is t, then DEL key actually deletes | 4006 | If `viper-delete-backwards-in-replace' is t, then DEL key actually deletes |
| @@ -4559,6 +4568,7 @@ sensitive for VI-style look-and-feel." | |||
| 4559 | (and (> viper-expert-level 0) (> 5 viper-expert-level))) | 4568 | (and (> viper-expert-level 0) (> 5 viper-expert-level))) |
| 4560 | (viper-set-hooks))) | 4569 | (viper-set-hooks))) |
| 4561 | 4570 | ||
| 4571 | |||
| 4562 | ;; Ask user expert level. | 4572 | ;; Ask user expert level. |
| 4563 | (defun viper-ask-level (dont-change-unless) | 4573 | (defun viper-ask-level (dont-change-unless) |
| 4564 | (let ((ask-buffer " *viper-ask-level*") | 4574 | (let ((ask-buffer " *viper-ask-level*") |
| @@ -4797,7 +4807,6 @@ Mail anyway (y or n)? ") | |||
| 4797 | 4807 | ||
| 4798 | 4808 | ||
| 4799 | 4809 | ||
| 4800 | |||
| 4801 | ;; Smoothes out the difference between Emacs' unread-command-events | 4810 | ;; Smoothes out the difference between Emacs' unread-command-events |
| 4802 | ;; and XEmacs unread-command-event. Arg is a character, an event, a list of | 4811 | ;; and XEmacs unread-command-event. Arg is a character, an event, a list of |
| 4803 | ;; events or a sequence of keys. | 4812 | ;; events or a sequence of keys. |
| @@ -4844,7 +4853,7 @@ Mail anyway (y or n)? ") | |||
| 4844 | "viper-eventify-list-xemacs: can't convert to event, %S" | 4853 | "viper-eventify-list-xemacs: can't convert to event, %S" |
| 4845 | elt)))) | 4854 | elt)))) |
| 4846 | lis)) | 4855 | lis)) |
| 4847 | 4856 | ||
| 4848 | 4857 | ||
| 4849 | 4858 | ||
| 4850 | ;;; viper-cmd.el ends here | 4859 | ;;; viper-cmd.el ends here |