Discussion:
repeat macro to bell ?
(too old to reply)
iaw4
2013-12-20 00:42:08 UTC
Permalink
dear emacs experts---is there a command that repeats a command or keyboard macro until the bell rings?

for example, I may have one macro that I named to 'search-for-xxx-and-transpose-word'. I now want to write another macro that applies this first macro to all the .tex files in my directory. Easy---do a dired on all .tex files, and create this macro. it should 'e' into the file, go to the beginning, invoke this macro a million times, save the file, quit the file, and go to the next .tex file. all good, except the bell will ring when there are fewer than a million xxx's in my file, and the macro will die.

I really need a replacement for c-u 9999999 c-x e .

easy?

/iaw
Pascal J. Bourguignon
2013-12-20 20:41:07 UTC
Permalink
Post by iaw4
dear emacs experts---is there a command that repeats a command or keyboard macro until the bell rings?
for example, I may have one macro that I named to
search-for-xxx-and-transpose-word'. I now want to write another macro
that applies this first macro to all the .tex files in my directory.
Easy---do a dired on all .tex files, and create this macro. it should
e' into the file, go to the beginning, invoke this macro a million
times, save the file, quit the file, and go to the next .tex file.
all good, except the bell will ring when there are fewer than a
million xxx's in my file, and the macro will die.
I really need a replacement for c-u 9999999 c-x e .
easy?
C-u 0 C-x e
or
C-0 C-x e


Now, if you want a different binding, you can put this in your ~/.emacs:

(global-set-key (kbd "<f8>")
(lambda ()
(interactive)
(kmacro-end-and-call-macro 0)))

and just type F8 (8 ≅ ∞).
--
__Pascal Bourguignon__
http://www.informatimago.com/
Continue reading on narkive:
Loading...