diff options
| author | Kim F. Storm | 2005-05-02 10:33:33 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-05-02 10:33:33 +0000 |
| commit | 1bf2f306bb6f8585df3566b6632f888b2e95e92f (patch) | |
| tree | 195759f3afa616f4e16d7eb8159b2c34bacae60f | |
| parent | e40527dcb9470cbbe2d68aa046ab957eec8dc5c6 (diff) | |
| download | emacs-1bf2f306bb6f8585df3566b6632f888b2e95e92f.tar.gz emacs-1bf2f306bb6f8585df3566b6632f888b2e95e92f.zip | |
Use executing-kbd-macro-index variable.
| -rw-r--r-- | lisp/kmacro.el | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 20816fc7fea..7224786c50d 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el | |||
| @@ -960,9 +960,9 @@ following additional answers: `insert', `insert-1', `replace', `replace-1', | |||
| 960 | (defun kmacro-step-edit-prompt (macro index) | 960 | (defun kmacro-step-edit-prompt (macro index) |
| 961 | ;; Show step-edit prompt | 961 | ;; Show step-edit prompt |
| 962 | (let ((keys (and (not kmacro-step-edit-appending) | 962 | (let ((keys (and (not kmacro-step-edit-appending) |
| 963 | index (substring macro index executing-macro-index))) | 963 | index (substring macro index executing-kbd-macro-index))) |
| 964 | (future (and (not kmacro-step-edit-appending) | 964 | (future (and (not kmacro-step-edit-appending) |
| 965 | (substring macro executing-macro-index))) | 965 | (substring macro executing-kbd-macro-index))) |
| 966 | (message-log-max nil) | 966 | (message-log-max nil) |
| 967 | (curmsg (current-message))) | 967 | (curmsg (current-message))) |
| 968 | 968 | ||
| @@ -1020,12 +1020,12 @@ following additional answers: `insert', `insert-1', `replace', `replace-1', | |||
| 1020 | (not (eq kmacro-step-edit-action t))) | 1020 | (not (eq kmacro-step-edit-action t))) |
| 1021 | ;; Find the actual end of this key sequence. | 1021 | ;; Find the actual end of this key sequence. |
| 1022 | ;; Must be able to backtrack in case we actually execute it. | 1022 | ;; Must be able to backtrack in case we actually execute it. |
| 1023 | (setq restore-index executing-macro-index) | 1023 | (setq restore-index executing-kbd-macro-index) |
| 1024 | (let (unread-command-events) | 1024 | (let (unread-command-events) |
| 1025 | (quoted-insert 0) | 1025 | (quoted-insert 0) |
| 1026 | (when unread-command-events | 1026 | (when unread-command-events |
| 1027 | (setq executing-macro-index (- executing-macro-index (length unread-command-events)) | 1027 | (setq executing-kbd-macro-index (- executing-kbd-macro-index (length unread-command-events)) |
| 1028 | next-index executing-macro-index))))) | 1028 | next-index executing-kbd-macro-index))))) |
| 1029 | 1029 | ||
| 1030 | ;; Query the user; stop macro exection temporarily | 1030 | ;; Query the user; stop macro exection temporarily |
| 1031 | (let ((macro executing-kbd-macro) | 1031 | (let ((macro executing-kbd-macro) |
| @@ -1045,7 +1045,7 @@ following additional answers: `insert', `insert-1', `replace', `replace-1', | |||
| 1045 | (when unread-command-events | 1045 | (when unread-command-events |
| 1046 | (setq kmacro-step-edit-new-macro | 1046 | (setq kmacro-step-edit-new-macro |
| 1047 | (substring kmacro-step-edit-new-macro 0 (- (length unread-command-events))) | 1047 | (substring kmacro-step-edit-new-macro 0 (- (length unread-command-events))) |
| 1048 | executing-macro-index (- executing-macro-index (length unread-command-events))))) | 1048 | executing-kbd-macro-index (- executing-kbd-macro-index (length unread-command-events))))) |
| 1049 | (setq current-prefix-arg nil | 1049 | (setq current-prefix-arg nil |
| 1050 | prefix-arg nil) | 1050 | prefix-arg nil) |
| 1051 | (setq act 'ignore)) | 1051 | (setq act 'ignore)) |
| @@ -1099,24 +1099,24 @@ following additional answers: `insert', `insert-1', `replace', `replace-1', | |||
| 1099 | (setq act t) | 1099 | (setq act t) |
| 1100 | t) | 1100 | t) |
| 1101 | ((member act '(insert-1 insert)) | 1101 | ((member act '(insert-1 insert)) |
| 1102 | (setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) | 1102 | (setq executing-kbd-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) |
| 1103 | (setq kmacro-step-edit-inserting (if (eq act 'insert-1) 1 t)) | 1103 | (setq kmacro-step-edit-inserting (if (eq act 'insert-1) 1 t)) |
| 1104 | nil) | 1104 | nil) |
| 1105 | ((member act '(replace-1 replace)) | 1105 | ((member act '(replace-1 replace)) |
| 1106 | (setq kmacro-step-edit-inserting (if (eq act 'replace-1) 1 t)) | 1106 | (setq kmacro-step-edit-inserting (if (eq act 'replace-1) 1 t)) |
| 1107 | (setq kmacro-step-edit-prefix-index nil) | 1107 | (setq kmacro-step-edit-prefix-index nil) |
| 1108 | (if (= executing-macro-index (length executing-kbd-macro)) | 1108 | (if (= executing-kbd-macro-index (length executing-kbd-macro)) |
| 1109 | (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) | 1109 | (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) |
| 1110 | kmacro-step-edit-appending t)) | 1110 | kmacro-step-edit-appending t)) |
| 1111 | nil) | 1111 | nil) |
| 1112 | ((eq act 'append) | 1112 | ((eq act 'append) |
| 1113 | (setq kmacro-step-edit-inserting t) | 1113 | (setq kmacro-step-edit-inserting t) |
| 1114 | (if (= executing-macro-index (length executing-kbd-macro)) | 1114 | (if (= executing-kbd-macro-index (length executing-kbd-macro)) |
| 1115 | (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) | 1115 | (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) |
| 1116 | kmacro-step-edit-appending t)) | 1116 | kmacro-step-edit-appending t)) |
| 1117 | t) | 1117 | t) |
| 1118 | ((eq act 'append-end) | 1118 | ((eq act 'append-end) |
| 1119 | (if (= executing-macro-index (length executing-kbd-macro)) | 1119 | (if (= executing-kbd-macro-index (length executing-kbd-macro)) |
| 1120 | (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) | 1120 | (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) |
| 1121 | kmacro-step-edit-inserting t | 1121 | kmacro-step-edit-inserting t |
| 1122 | kmacro-step-edit-appending t) | 1122 | kmacro-step-edit-appending t) |
| @@ -1124,21 +1124,21 @@ following additional answers: `insert', `insert-1', `replace', `replace-1', | |||
| 1124 | (setq act t) | 1124 | (setq act t) |
| 1125 | t) | 1125 | t) |
| 1126 | ((eq act 'help) | 1126 | ((eq act 'help) |
| 1127 | (setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) | 1127 | (setq executing-kbd-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) |
| 1128 | (setq kmacro-step-edit-help (not kmacro-step-edit-help)) | 1128 | (setq kmacro-step-edit-help (not kmacro-step-edit-help)) |
| 1129 | nil) | 1129 | nil) |
| 1130 | (t ;; Ignore unknown responses | 1130 | (t ;; Ignore unknown responses |
| 1131 | (setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) | 1131 | (setq executing-kbd-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) |
| 1132 | nil)) | 1132 | nil)) |
| 1133 | (if (> executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) | 1133 | (if (> executing-kbd-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) |
| 1134 | (setq kmacro-step-edit-new-macro | 1134 | (setq kmacro-step-edit-new-macro |
| 1135 | (vconcat kmacro-step-edit-new-macro | 1135 | (vconcat kmacro-step-edit-new-macro |
| 1136 | (substring executing-kbd-macro | 1136 | (substring executing-kbd-macro |
| 1137 | (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index) | 1137 | (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index) |
| 1138 | (if (eq act t) nil executing-macro-index))) | 1138 | (if (eq act t) nil executing-kbd-macro-index))) |
| 1139 | kmacro-step-edit-prefix-index nil)) | 1139 | kmacro-step-edit-prefix-index nil)) |
| 1140 | (if restore-index | 1140 | (if restore-index |
| 1141 | (setq executing-macro-index restore-index))) | 1141 | (setq executing-kbd-macro-index restore-index))) |
| 1142 | (t | 1142 | (t |
| 1143 | (setq this-command 'ignore))) | 1143 | (setq this-command 'ignore))) |
| 1144 | (setq kmacro-step-edit-key-index next-index))) | 1144 | (setq kmacro-step-edit-key-index next-index))) |
| @@ -1151,7 +1151,7 @@ following additional answers: `insert', `insert-1', `replace', `replace-1', | |||
| 1151 | (executing-kbd-macro nil) | 1151 | (executing-kbd-macro nil) |
| 1152 | (defining-kbd-macro nil) | 1152 | (defining-kbd-macro nil) |
| 1153 | cmd keys next-index) | 1153 | cmd keys next-index) |
| 1154 | (setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index) | 1154 | (setq executing-kbd-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index) |
| 1155 | kmacro-step-edit-prefix-index nil) | 1155 | kmacro-step-edit-prefix-index nil) |
| 1156 | (kmacro-step-edit-prompt macro nil) | 1156 | (kmacro-step-edit-prompt macro nil) |
| 1157 | ;; Now, we have read a key sequence from the macro, but we don't want | 1157 | ;; Now, we have read a key sequence from the macro, but we don't want |
| @@ -1172,8 +1172,8 @@ following additional answers: `insert', `insert-1', `replace', `replace-1', | |||
| 1172 | (setq kmacro-step-edit-inserting nil) | 1172 | (setq kmacro-step-edit-inserting nil) |
| 1173 | (when unread-command-events | 1173 | (when unread-command-events |
| 1174 | (setq keys (substring keys 0 (- (length unread-command-events))) | 1174 | (setq keys (substring keys 0 (- (length unread-command-events))) |
| 1175 | executing-macro-index (- executing-macro-index (length unread-command-events)) | 1175 | executing-kbd-macro-index (- executing-kbd-macro-index (length unread-command-events)) |
| 1176 | next-index executing-macro-index | 1176 | next-index executing-kbd-macro-index |
| 1177 | unread-command-events nil))) | 1177 | unread-command-events nil))) |
| 1178 | (setq cmd 'ignore) | 1178 | (setq cmd 'ignore) |
| 1179 | nil) | 1179 | nil) |
| @@ -1217,7 +1217,7 @@ following additional answers: `insert', `insert-1', `replace', `replace-1', | |||
| 1217 | ((eq kmacro-step-edit-active 'ignore) | 1217 | ((eq kmacro-step-edit-active 'ignore) |
| 1218 | (setq this-command 'ignore)) | 1218 | (setq this-command 'ignore)) |
| 1219 | ((eq kmacro-step-edit-active 'append-end) | 1219 | ((eq kmacro-step-edit-active 'append-end) |
| 1220 | (if (= executing-macro-index (length executing-kbd-macro)) | 1220 | (if (= executing-kbd-macro-index (length executing-kbd-macro)) |
| 1221 | (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) | 1221 | (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) |
| 1222 | kmacro-step-edit-inserting t | 1222 | kmacro-step-edit-inserting t |
| 1223 | kmacro-step-edit-appending t | 1223 | kmacro-step-edit-appending t |
| @@ -1243,8 +1243,8 @@ following additional answers: `insert', `insert-1', `replace', `replace-1', | |||
| 1243 | (when kmacro-step-edit-active | 1243 | (when kmacro-step-edit-active |
| 1244 | (add-hook 'pre-command-hook 'kmacro-step-edit-pre-command nil nil) | 1244 | (add-hook 'pre-command-hook 'kmacro-step-edit-pre-command nil nil) |
| 1245 | (if kmacro-step-edit-key-index | 1245 | (if kmacro-step-edit-key-index |
| 1246 | (setq executing-macro-index kmacro-step-edit-key-index) | 1246 | (setq executing-kbd-macro-index kmacro-step-edit-key-index) |
| 1247 | (setq kmacro-step-edit-key-index executing-macro-index)))) | 1247 | (setq kmacro-step-edit-key-index executing-kbd-macro-index)))) |
| 1248 | 1248 | ||
| 1249 | 1249 | ||
| 1250 | (defun kmacro-step-edit-macro () | 1250 | (defun kmacro-step-edit-macro () |