emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speed of keyboard macro execution?


From: Per Starbäck
Subject: Re: Speed of keyboard macro execution?
Date: Sun, 13 Dec 2015 00:20:24 +0100

> Repeating a keyboard macro without intervening other actions means that
> the macro, after achieving its changes, has to progress to the next
> position where executing it makes sense as its last part.  This progress
> will often involve moving to the next line.  The next _visual_ line is
> meaningless for that purpose in almost all situations.  Under manual
> control, you'll just move across some continuation line.  But a repeated
> keyboard macro is not under manual control.
>
> My claim is not about "right" but "useful" behavior.  We've had one
> other person state that he switches off visual-line-mode always since
> keyboard macros would otherwise be useless.  Of course that's one
> possibility, but visual-line-mode is actually useful for _visual_
> navigation.  Which is not what happens during macro execution since the
> computer executes the recorded keys without human intervention.  Which
> makes sense in _similar_ but not identical situations (for identical
> situations, one could just copy and paste the result repeatedly).  And
> non-identical situations will sometimes have lines wrapped visually and
> sometimes not without that being related to the structure of the
> modified text.
>
> I am surprised that I should be the only user of keyboard macros having
> noticed that.

Of course you are not! Your proposed change would make it a easier to
write macros. Now I often resort to work-arounds like C-e C-f and then
more navigation to get to the right place in the new line to be sure
to actually get to the next line in the typical case where you run a
macro on one line at a time.

Since I teach a course for GNU beginners with some Emacs in it, I see
what kind of mistakes beginners make when using macros. There is no
surprise there, I think. They navigate with visual feedback in a way
that works fine for the line they are in, but that doesn't do the
"same" thing on (some) other lines.

First it can be totally obvious like just typing <right> <right>
<right> ... <right> to get to the end of line. Later perhaps using
word navigation in a CSV file where most fields are one word, but
where there are some fields with several words where their macros
won't work.

line-move-visual invites this sort of using visual feedback that only
works for a particular line and can lead to the same kind of
surprises. It has been written here that not changing any settings
when defining macros leads to less surprises. Yes, less surprises
*while defining*, but more surprises when using those macros. And then
it's certainly possible that you don't notice it, because you just ran
your macro on all lines in a buffer without checking every one.

I think one reason not many have written in support for your position
is that some experienced Emacs users turn off visual-line-mode and
think that it's mostly there for less experienced users, so they don't
have any problems. And the less experienced users don't use macros
that much (except when forced to in my course :-) .



reply via email to

[Prev in Thread] Current Thread [Next in Thread]