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

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

Re: Executing part of the code instead of another


From: Leo Butler
Subject: Re: Executing part of the code instead of another
Date: Thu, 08 Oct 2020 12:43:48 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Christopher Dimech <dimech@gmx.com> writes:

> Thank you so very much Tomas. Ok. Got It.
>
>
>> Sent: Wednesday, October 07, 2020 at 4:01 PM
>> From: tomas@tuxteam.de
>> To: "Christopher Dimech" <dimech@gmx.com>
>> Cc: moasenwood@zoho.eu, help-gnu-emacs@gnu.org
>> Subject: Re: Executing part of the code instead of another
>>
>> On Wed, Oct 07, 2020 at 03:48:51PM +0200, Christopher Dimech wrote:
>> > It would be better if you explain to me this progn stuff
>> >
>> > Have tried an example like this
>> >
>> > (setq na 8)
>> > (setq nb 13)
>> > ( if (> nb na)
>> >     progn (
>> >       (message "nb > na condition [condition is true]")
>> >       (message "nb > na condition [condition is true]")
>> >     )
>>
>> No. Written in Lisp, it's
>>
>>   (progn
>>     (thing 1)
>>     (thing 2)
>>     ...)
>>

Note that Emacs has its own repl, too.

M-x ielm RET

Take a while to learn how to think in lisp. The constructs you are using
are C-like and very primitive (non-expressive, if you prefer) compared
to what you can do in lisp.

Specifically, it seems like what you are trying to do is usually
accomplished with minor-modes in elisp.

Leo



reply via email to

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