[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How about making `sleep-for' interactive?
From: |
Søren Pilgård |
Subject: |
Re: How about making `sleep-for' interactive? |
Date: |
Thu, 27 Jun 2019 09:46:41 +0200 |
On Thu, Jun 27, 2019 at 6:47 AM Marcin Borkowski <address@hidden> wrote:
>
> Hi all,
>
> I noticed today that `sleep-for' is not an (interactive) command. IMHO
> it should be - at least I can see a need for it. Here is my use case.
> I recorded a keyboard macro which edits the text in some way. The macro
> begins with isearching for something (which may be outside the part of
> the buffer currently seen) and then changing. Having e.g. a 1-second
> delay between moving to that part and actually changing it would help
> spot mistakes.
>
> Since `sleep-for' is a builtin, I can't prepare a patch (I don't speak
> C very well), but if I get a hint I can try (just to learn something
> new).
>
> WDYT?
>
I can't really see the use.
You could always just do ```M-: (sleep-foor xxx)``` in the macro.
Being time sensitive and waiting for abortion is a bit too dangerous
in my taste, either I am sure and do it everywhere or I want to accept
/ decline in cases like that.
What I usually do in cases like that is to make a macro that moves to
the next occurrence, then does the changes and then moves to just the
beginning of the next occurrence again.
That way I can just call the macro repeatedly and it will move forward
to the next place where a change will happen each time.
If I decide not to apply the macro I will skip forward, either
searching manually for the next occurrence or sometimes just moving
the point forward so the macro will edit the next occurrence instead.