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 03:05:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

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




reply via email to

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