From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: Executing part of the code instead of another Date: Wed, 7 Oct 2020 09:01:00 +0200 Message-ID: References: <87imbm3llg.fsf@ebih.ebihd> <87blhe3kxg.fsf@ebih.ebihd> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5749"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: moasenwood@zoho.eu Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 07 09:03:13 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQ3Tk-0001Ov-QO for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Oct 2020 09:03:12 +0200 Original-Received: from localhost ([::1]:48948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQ3Tj-0007H9-Lo for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Oct 2020 03:03:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQ3Rj-0007Gt-Fc for help-gnu-emacs@gnu.org; Wed, 07 Oct 2020 03:01:07 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:49733) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQ3Rf-0007E6-0j for help-gnu-emacs@gnu.org; Wed, 07 Oct 2020 03:01:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602054060; bh=7j6sI3Xxu7MomoDqf5Q6nzEuwZB6mRCQZROwyrNA1mE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Lk/X8DuY5WTxkGqq94J7gydGxyJnKGs2DUiRkDuT47pGeuZ2k7MCekr0EGUYsY2sZ bs3zz17oFK7XTJ5BmEWfdJlw76opZBtozYTppdi8/RH2eYIZYnEVlKa0DuODe523RN 0cpS17/yb5thsgL8BPNH2P/sSR4MO+QWdJil9wvo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs01.server.lan [172.19.170.58]) (via HTTP); Wed, 7 Oct 2020 09:01:00 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <87blhe3kxg.fsf@ebih.ebihd> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:Xu638UXPA6h3tpCqTkrcJvAxZEdeMm7l+hv5G0SV7vzxxO6jcBfxzdmGtZdQMt3zyxSYw wplkxntl9yviFakx4Wz/ZdUa6nkJE91tsa5O9O1W6VDsXTZHefgS1+ChDepHLNDGp/sxxOQja4Yg 3bBw4PrF7P+0YqjxCJ/R7eWXRyX65OcvWjkaxYoxjrACflj7Ep8ECzLLkMZiD6bkz+/iZyPahiGc Dy4kKnoX8hHneNf6kt+SGN5Q4coGOQZXRGtYq7dDuerOeYKUZdwRByKrFbLTuKjVE/h3RvfdFR+n rg= X-UI-Out-Filterresults: notjunk:1;V03:K0:mjJLv9dvGXk=:xwhRiK9oe/mnBcFuKUlzyz EHjNFmCufU2x9DcRV98RGTBmH12oyPIG64xgrFkd1xpW+a7I8EjXvi9clS+dHgXqDCl3noocw HmBMwLBT08ncNTvC+XFVzhZlBzMymYS6XewHTlPHxowwbdcgbmlxvEJeVTVqtugPUulERBt+B 8Ncor+E/C+j3uKr8VUrUGjuzvFsAu/iVFVDkxOSD0dArsBo+P0fjErhFSjEbE14Q5mVKcYNsL q86fpvc6TxGkJrUY7vrGqA8G+ubzZA3ve7/xUxp225uj0amkSUSfD0W0bhlWSoxIszLonA+ab X0h2+6+SDbYaoegnxGh+vuTPj0R9/qNwr3gK7SZVdmlQPrzm9hZeGP1BAFuPgwmO5vHifzpBV HgvV756hEBD4FJG1WrgFFmxmk62F/LJVMlINUWux//2hwtaH/ug1m/E2Dy/pfTYTfG5JBE99h Fo5323KsbN0ccspQ5LhIpbYYd2kiwOFm1PaSuBhtTKvGN+23hmj1rT0bLzs3+QqR5JuQ1auhk wdJOFKgz4RhD7VGV788ykN81FZr7Mu3GGPxutkrQLBA1ArUeVJntf8dqQEiG+Guqw882Um1Bj POwKuxBxCr2Q3ibmtlOoOEyfDmkM57kZSOPZq4H224aqZnuDpkcsUqGJxBft2o3T5jAFHNWpA C6MXvinrdytr4nZ13e+d82sBdDeUQVoDQfZlGqjPkUJ5fnXnNY4rnfxnCJ8QDFXgDSsk= Received-SPF: pass client-ip=212.227.17.20; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/07 03:01:01 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124345 Archived-At: What can one use if there is an else branch with multiple commands, as I w= ould 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" > 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 (=3D optn 1) > > > > ( global-unset-key (kbd "C-") ) > > [...] > > ( global-set-key (kbd "C-") > > (lambda () (interactive) (scroll-up 1)) ; Scrolls the page Up > > ) > > ) > > If there is no else branch, use `when' (or `unless'). > > (when (=3D var-a 1) > (do-this) > (and-this) > (and-this-as-well) ) > > -- > underground experts united > http://user.it.uu.se/~embe8573 > https://dataswamp.org/~incal > > >