help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Emacs Book Vs Emacs Manuals


From: Emanuel Berg
Subject: Re: Emacs Book Vs Emacs Manuals
Date: Sat, 27 Jun 2015 19:42:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Rusi <rustompmody@gmail.com> writes:

>> %% (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

Elisp is by definition better because everything you
can do with keyboard macros, you can do with Elisp -
but not even remotely so the other way around.

When you have done something with Elisp, you can save
that for future use. What it is is clearly defined and
easy to read and edit. Not only that, if it is
modular, as it should, you can use it for other,
unexpected things in the future.

In the past, people wrote extremely long programs that
were macro-ish with a lot of repetition and patterns
in the code, and if you did that all day I suppose
a macro to do the same thing over and over would come
in handy.

I don't know why people wrote code like that then,
probably it was their programming languages that
weren't as powerful as Lisp. With all with have with
Lisp there isn't any reason to do that. Instead of
having page up, page down with

    SOME_VARIABLE_1 = 1
    SOME_VARIABLE_2 = 2
    ...
    SOME_FUNCTION_1 = f1
    SOME_FUNCTION_2 = f2

and then use macros to keep track of it all should you
want to change it you put all that in data structures
and have a function do the mapping. Whenever you want
to change something, you'd change the function, not
use macros to change the code.

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

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