aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2002-09-10 22:08:45 +0000
committerKim F. Storm2002-09-10 22:08:45 +0000
commit1c59ca7881d615e701dc74a233bb5e88160846c6 (patch)
tree2859c949e7abac04de52fb9ff7c704c546ac3fe1
parentd2211627e7e9e1f09cf96172d5e60df605da2b91 (diff)
downloademacs-1c59ca7881d615e701dc74a233bb5e88160846c6.tar.gz
emacs-1c59ca7881d615e701dc74a233bb5e88160846c6.zip
(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.
-rw-r--r--lisp/kmacro.el33
1 files changed, 23 insertions, 10 deletions
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 71d49815954..5b2edb8c766 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -592,11 +592,11 @@ others, use M-x name-last-kbd-macro."
592 kmacro-call-repeat-key))) 592 kmacro-call-repeat-key)))
593 (setq repeat-key-str (format-kbd-macro (vector repeat-key) nil)) 593 (setq repeat-key-str (format-kbd-macro (vector repeat-key) nil))
594 (while repeat-key 594 (while repeat-key
595 (message "Repeat macro %swith `%s'..." 595 (message "(Type %s to repeat macro%s)"
596 repeat-key-str
596 (if (and kmacro-call-repeat-with-arg 597 (if (and kmacro-call-repeat-with-arg
597 arg (> arg 1)) 598 arg (> arg 1))
598 (format "%d times " arg) "") 599 (format " %d times" arg) ""))
599 repeat-key-str)
600 (if (equal repeat-key (read-event)) 600 (if (equal repeat-key (read-event))
601 (progn 601 (progn
602 (clear-this-command-keys t) 602 (clear-this-command-keys t)
@@ -752,9 +752,8 @@ If kbd macro currently being defined end it before activating it."
752(defvar kmacro-step-edit-map (make-sparse-keymap) 752(defvar kmacro-step-edit-map (make-sparse-keymap)
753 "Keymap that defines the responses to questions in `kmacro-step-edit-macro'. 753 "Keymap that defines the responses to questions in `kmacro-step-edit-macro'.
754This keymap is an extension to the `query-replace-map', allowing the 754This keymap is an extension to the `query-replace-map', allowing the
755following additional answers: `insert-1', `insert', `append-1', 755following additional answers: `insert', `insert-1', `replace', `replace-1',
756`append', `replace-1', `replace', `act-repeat', `skip-rest', 756`append', `append-end', `act-repeat', `skip-end', `skip-keep'.")
757`skip-keep'.")
758 757
759;; query-replace-map answers include: `act', `skip', `act-and-show', 758;; query-replace-map answers include: `act', `skip', `act-and-show',
760;; `exit', `act-and-exit', `edit', `delete-and-edit', `recenter', 759;; `exit', `act-and-exit', `edit', `delete-and-edit', `recenter',
@@ -775,7 +774,7 @@ following additional answers: `insert-1', `insert', `append-1',
775(define-key kmacro-step-edit-map "r" 'replace) 774(define-key kmacro-step-edit-map "r" 'replace)
776(define-key kmacro-step-edit-map "R" 'replace-1) 775(define-key kmacro-step-edit-map "R" 'replace-1)
777(define-key kmacro-step-edit-map "a" 'append) 776(define-key kmacro-step-edit-map "a" 'append)
778(define-key kmacro-step-edit-map "A" 'append-1) 777(define-key kmacro-step-edit-map "A" 'append-end)
779 778
780(defvar kmacro-step-edit-prefix-commands 779(defvar kmacro-step-edit-prefix-commands
781 '(universal-argument universal-argument-more universal-argument-minus 780 '(universal-argument universal-argument-more universal-argument-minus
@@ -828,7 +827,7 @@ following additional answers: `insert-1', `insert', `append-1',
828 (propertize 827 (propertize
829 (format "Type key sequence%s to insert and execute%s: " 828 (format "Type key sequence%s to insert and execute%s: "
830 (if (numberp kmacro-step-edit-inserting) "" "s") 829 (if (numberp kmacro-step-edit-inserting) "" "s")
831 (if (numberp kmacro-step-edit-inserting) "" "[end with C-j]")) 830 (if (numberp kmacro-step-edit-inserting) "" " (end with C-j)"))
832 'face 'bold)))))) 831 'face 'bold))))))
833 832
834(defun kmacro-step-edit-query () 833(defun kmacro-step-edit-query ()
@@ -932,12 +931,20 @@ following additional answers: `insert-1', `insert', `append-1',
932 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) 931 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
933 kmacro-step-edit-appending t)) 932 kmacro-step-edit-appending t))
934 nil) 933 nil)
935 ((member act '(append-1 append)) 934 ((eq act 'append)
936 (setq kmacro-step-edit-inserting (if (eq act 'append-1) 1 t)) 935 (setq kmacro-step-edit-inserting t)
937 (if (= executing-macro-index (length executing-kbd-macro)) 936 (if (= executing-macro-index (length executing-kbd-macro))
938 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil]) 937 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
939 kmacro-step-edit-appending t)) 938 kmacro-step-edit-appending t))
940 t) 939 t)
940 ((eq act 'append-end)
941 (if (= executing-macro-index (length executing-kbd-macro))
942 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
943 kmacro-step-edit-inserting t
944 kmacro-step-edit-appending t)
945 (setq kmacro-step-edit-active 'append-end))
946 (setq act t)
947 t)
941 ((eq act 'help) 948 ((eq act 'help)
942 (setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index)) 949 (setq executing-macro-index (or kmacro-step-edit-prefix-index kmacro-step-edit-key-index))
943 (setq kmacro-step-edit-help (not kmacro-step-edit-help)) 950 (setq kmacro-step-edit-help (not kmacro-step-edit-help))
@@ -1031,6 +1038,12 @@ following additional answers: `insert-1', `insert', `append-1',
1031 (cond 1038 (cond
1032 ((eq kmacro-step-edit-active 'ignore) 1039 ((eq kmacro-step-edit-active 'ignore)
1033 (setq this-command 'ignore)) 1040 (setq this-command 'ignore))
1041 ((eq kmacro-step-edit-active 'append-end)
1042 (if (= executing-macro-index (length executing-kbd-macro))
1043 (setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
1044 kmacro-step-edit-inserting t
1045 kmacro-step-edit-appending t
1046 kmacro-step-edit-active t)))
1034 ((/= kmacro-step-edit-num-input-keys num-input-keys) 1047 ((/= kmacro-step-edit-num-input-keys num-input-keys)
1035 (if kmacro-step-edit-inserting 1048 (if kmacro-step-edit-inserting
1036 (kmacro-step-edit-insert) 1049 (kmacro-step-edit-insert)