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: Emanuel Berg
Subject: Re: Executing part of the code instead of another
Date: Wed, 07 Oct 2020 02:50:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Christopher Dimech wrote:

> I would like to have some numeric if condition so
> I can set some keybindings when variable a has
> value 1, but if variable a is 2, I want to set
> a different set of keybindings. How can I do it?

It is probably better to base this on the many
different Emacs _modes_, but to answer your question:

(if (= var-a 1)
    (do-something)
  (do-something-else) )

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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