[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs Book Vs Emacs Manuals
From: |
Marcin Borkowski |
Subject: |
Re: Emacs Book Vs Emacs Manuals |
Date: |
Sat, 27 Jun 2015 10:25:38 +0200 |
On 2015-06-27, at 07:02, Bob Proulx <bob@proulx.com> wrote:
> Rusi wrote:
>> Emanuel Berg wrote:
>> > %% (replace-regexp "^\\(.*&.*&\\).*&\\(.*\\)" "\\1\\2")
>>
>> 51 chars (ignoring that things like ^& are shift chords)
>>
>> F3
>> C-s & RET C-SPC C-s C-s RET C-w C-a C-n
>> F4
>>
>> 16 keystrokes counting each chord as 1 1/2 keys
>
> I don't think keyboard golf is the best justification for something.
> It helps. But for me keyboard macros are simply more interactive.
> They are a way to quickly multiply one keystroke into many.
>
> But the above does make me realize that I often use keyboard macros
> when the "shape" of the text is a factor in the editing of it. Such
> as when I need to make edits around something both above and below
> it. I might need to move a chunk of text up or down or otherwise
> mutate it in unusual ways while editing. During the keyboard macro I
> can search for something, then search for something different, perhaps
> several times to land on the right starting point. Then I can move up
> or down spatially to be where I want to be. That is much harder to do
> with regular expression. I grew up with regular expressions and use
> them all of the time. But I use different tools at different times.
Exactly.
Macros are especially nice in that they mimic the way you edit text.
You can do that in Elisp, too, or sometimes regexen, but Elisp requires
a lot of typing and regexen require a lot of thinking; both are energy-
and time-consuming. OTOH, there are cases when macros won't do
(conditional expressions, loops – they are doable in macros – see Calc
manual – but much less intuitive, at least for me).
> Here is a contrived example. Split the buffer into two windows.
Nice!
> Regular expressions are awesome. But keyboard macros are awesome too.
Yes.
> Bob
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
- Re: Emacs Book Vs Emacs Manuals, (continued)
- Re: Emacs Book Vs Emacs Manuals, Emanuel Berg, 2015/06/26
- Re: Emacs Book Vs Emacs Manuals, MBR, 2015/06/27
- Re: Emacs Book Vs Emacs Manuals, Emanuel Berg, 2015/06/27
- Message not available
- Re: Emacs Book Vs Emacs Manuals, Rusi, 2015/06/27
- Re: Emacs Book Vs Emacs Manuals, Marcin Borkowski, 2015/06/28
- Re: Emacs Book Vs Emacs Manuals, Emanuel Berg, 2015/06/28
- Re: Emacs Book Vs Emacs Manuals, Marcin Borkowski, 2015/06/28
- Re: Emacs Book Vs Emacs Manuals, Emanuel Berg, 2015/06/28
- Message not available
- Re: Emacs Book Vs Emacs Manuals, Rusi, 2015/06/26
- Re: Emacs Book Vs Emacs Manuals, Bob Proulx, 2015/06/27
- Re: Emacs Book Vs Emacs Manuals,
Marcin Borkowski <=
- Re: Emacs Book Vs Emacs Manuals, Robert Thorpe, 2015/06/27
- Message not available
- Re: Emacs Book Vs Emacs Manuals, Rusi, 2015/06/27
- Re: Emacs Book Vs Emacs Manuals, Emanuel Berg, 2015/06/27
- Re: Emacs Book Vs Emacs Manuals, Emanuel Berg, 2015/06/27
- Re: Emacs Book Vs Emacs Manuals, Filipp Gunbin, 2015/06/29
- Re: Emacs Book Vs Emacs Manuals, Emanuel Berg, 2015/06/29
- Re: Emacs Book Vs Emacs Manuals, Vaidheeswaran C, 2015/06/30
- Re: Emacs Book Vs Emacs Manuals, Emanuel Berg, 2015/06/30
- Message not available
- Re: Emacs Book Vs Emacs Manuals, Dan Espen, 2015/06/30
- Re: Emacs Book Vs Emacs Manuals, Marcin Borkowski, 2015/06/30