aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKim F. Storm <[email protected]>2002-09-10 22:08:45 +0000
committerKim F. Storm <[email protected]>2002-09-10 22:08:45 +0000
commit1c59ca7881d615e701dc74a233bb5e88160846c6 (patch)
tree2859c949e7abac04de52fb9ff7c704c546ac3fe1 /lisp
parentd2211627e7e9e1f09cf96172d5e60df605da2b91 (diff)
(kmacro-call-macro): Rephrase repeat prompt.
(kmacro-step-edit-map): Bind "A" to `append-end'. (kmacro-step-edit-prompt): Fix prompt. (kmacro-step-edit-query): Handle `append-end' response. (kmacro-step-edit-pre-command): Activate `append-end' at end of macro when required.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/kmacro.el33
1 files changed, 23 insertions, 10 deletions
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 71d4981595..5b2edb8c76 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -592,11 +592,11 @@ others, use M-x name-last-kbd-macro."
kmacro-call-repeat-key)))
(setq repeat-key-str (format-kbd-macro (vector repeat-key) nil))
(while repeat-key
- (message "Repeat macro %swith `%s'..."
+ (message "(Type %s to repeat macro%s)"
+ repeat-key-str
(if (and kmacro-call-repeat-with-arg
arg (> arg 1))
- (format "%d times " arg) "")
- repeat-key-str)
+ (format " %d times" arg) ""))
(if (equal repeat-key (read-event))
(progn
(clear-this-command-keys t)
@@ -752,9 +752,8 @@ If kbd macro currently being defined end it before activating it."
(defvar kmacro-step-edit-map (make-sparse-keymap)
"Keymap that defines the responses to questions in `kmacro-step-edit-macro'.
This keymap is an extension to the `query-replace-map', allowing the
-following additional answers: `insert-1', `insert', `append-1',
-`append', `replace-1', `replace', `act-repeat', `skip-rest',
-`skip-keep'.")
+following additional answers: `insert', `insert-1', `replace', `replace-1',
+`append', `append-end', `act-repeat', `skip-end', `skip-keep'.")
;; query-replace-map answers include: `act', `skip', `act-and-show',
;; `exit', `act-and-exit', `edit', `delete-and-edit', `recenter',
@@ -775,7 +774,7 @@ following additional answers: `insert-1', `insert', `append-1',
(define-key kmacro-step-edit-map "r" 'replace)
(define-key kmacro-step-edit-map "R" 'replace-1)
(define-key kmacro-step-edit-map "a" 'append)
-(define-key kmacro-step-edit-map "A" 'append-1)
+(define-key kmacro-step-edit-map "A" 'append-end)
(defvar kmacro-step-edit-prefix-commands
'(universal-argument universal-argument-more universal-argument-minus
@@ -828,7 +827,7 @@ following additional answers: `insert-1', `insert', `append-1',
(propertize
(format "Type key sequence%s to insert and execute%s: "
(if (numberp kmacro-step-edit-inserting) "" "s")
- (if (numberp kmacro-step-edit-inserting) "" "[end with C-j]"))
+ (if (numberp kmacro-step-edit-inserting) "" " (end with C-j)"))
'face 'bold))))))
(defun kmacro-step-edit-query ()
@@ -932,12 +931,20 @@ following additional answers: `insert-1', `insert', `append-1',
(setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
kmacro-step-edit-appending t))
nil)
- ((member act '(append-1 append))
- (setq kmacro-step-edit-inserting (if (eq act 'append-1) 1 t))
+ ((eq act 'append)
+ (setq kmacro-step-edit-inserting t)
(if (= executing-macro-index (length executing-kbd-macro))
(setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
kmacro-step-edit-appending t))
t)
+ ((eq act 'append-end)
+ (if (= executing-macro-index (length executing-kbd-macro))
+ (setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
+ kmacro-step-edit-inserting t
+ kmacro-step-edit-appending t)
+ (setq kmacro-step-edit-active 'append-end))
+ (setq act t)
+ t)
((eq act 'help)
(setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index))
(setq kmacro-step-edit-help (not kmacro-step-edit-help))
@@ -1031,6 +1038,12 @@ following additional answers: `insert-1', `insert', `append-1',
(cond
((eq kmacro-step-edit-active 'ignore)
(setq this-command 'ignore))
+ ((eq kmacro-step-edit-active 'append-end)
+ (if (= executing-macro-index (length executing-kbd-macro))
+ (setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
+ kmacro-step-edit-inserting t
+ kmacro-step-edit-appending t
+ kmacro-step-edit-active t)))
((/= kmacro-step-edit-num-input-keys num-input-keys)
(if kmacro-step-edit-inserting
(kmacro-step-edit-insert)