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: Douglas Lewan
Subject: Re: Executing part of the code instead of another
Date: Sun, 18 Oct 2020 19:02:02 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

(cond) is what comes to my mind for such a thing.

On 10/7/20 3:01 AM, Christopher Dimech wrote:
What can one use if there is an else branch with multiple commands, as I would
like to use it.


Sent: Wednesday, October 07, 2020 at 3:05 AM
From: "Emanuel Berg via Users list for the GNU Emacs text editor" 
<help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Executing part of the code instead of another

Christopher Dimech wrote:

I have been trying to do the following

(setq optn 1)
(if (= optn 1)

    ( global-unset-key (kbd "C-<home>") )
    [...]
    ( global-set-key (kbd "C-<mouse-5>")
       (lambda () (interactive) (scroll-up 1))    ; Scrolls the page Up
    )
)
If there is no else branch, use `when' (or `unless').

(when (= var-a 1)
   (do-this)
   (and-this)
   (and-this-as-well) )

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



--
,Doug
d.lewan2000@gmail.com
(908) 720 7908

You know, it's amazing how much closer to 0 that 8 067 332 is than 15 is. (2020 
Oct 18)




reply via email to

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