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 15:09:26 +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="38271"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org, moasenwood@zoho.eu To: Robert Pluim Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 07 15:13:45 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 1kQ9GL-0009sF-Bn for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Oct 2020 15:13:45 +0200 Original-Received: from localhost ([::1]:37044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQ9GK-0008Gj-71 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Oct 2020 09:13:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQ9CL-0006Mk-7A for help-gnu-emacs@gnu.org; Wed, 07 Oct 2020 09:09:38 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:54453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQ9CF-0002Tn-6Z for help-gnu-emacs@gnu.org; Wed, 07 Oct 2020 09:09:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602076167; bh=LkB3s7lmzklM/DTh57fFov1Q0dQjcKahDxcTGWPWmeM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=KwTapW3pz0au8o7hOhHoXGHuYCIEWbr8YOxpmCmLSnywr29zyJW5j4dTxYBMrGTXb VC0vRUHQpy0sUt4kyi8Lyacy2O2A7JjTNYZoMvtOtk87ldpNk8HMCIZTzwXT2cXLhx Hvfc7vbnDckKyCrC818dfJiEJeCN+saQNY0mSmq4= 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 15:09:26 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:/Q7HQk+W/P2VPX6okXrVDFOtC/EB+Pyx/RhBxnLQQhh0kLALRkycPkf2qBuLreUdHyO7r 8wZvLEt9e1TVbPP9760FENnNkSH9Xo+iY9DlM41ujSFn/kVe0ngulJX3nb6SxEHNoU013UJFrpnR S49EZ4TXQukosrxrOcQY5SOR0WM7w16LCadVFi9BcmLUl/HGxUuJCLNyaTisOeutmUfl9D6VmCox CAa1oNb/1hZ8yFaVrU54NSm3i+r6BgIOgqp/IMh4HAdo4woYEN2cnHvDFzqERIBnOL4lPKJSpZWH 8Q= X-UI-Out-Filterresults: notjunk:1;V03:K0:CQSeaK7UlpM=:gxk8G4Kcu0pvFXFKlE0zHB Ec8i1w6g9muiElJLLKlOTP8RwJFbbzxKdv0IvfNE0yogVyuWfjuXRY6kIA/sh3O6DC5bVZXoa 0bgEltavgiSsO6VpD+KSOkwz+aiu/K8qqaox2NvdVWeCWumvxx1kPdEHC32piJudVWBnxNWyi 2NbSZbs+kQ5XOwRSMRls6uKxd5iIeH3iDryfHMWspfJwD0PM1D4K9rUTVZ9GoFw5PzKWLzap9 TGHLCJUK+jLmCzpfrgcQaAIuMG3L9P+dNDYPwqmXIx+C01+87AEFOV2PvQCh4PZq9bbopxpuV MQVu8rLdJdEswv35Zf1VX6kTwpDDf4ceIWRrFgL7VVW36z0rAKTG6FYPMmv58c223PrbRltzh SSJFTKIPd0l16ujmbhm0ACynHzQqwGYB1L3DKYk/NmSUMw0VvczpGr4a4CwnWLVMs3K6KYVWB R0XhmHCIP6zCvs7A7YRqVzb34xPvVxBDCQD3i78L8IYxOVcRDY0ERwSvQWXLvP1Pdo97nVL/7 AiuVR+wkdwyVe8K1lfy0hX3heFKc/rMQtFeS3oaszZOl2Q2vLODjmghOX3PSgLmYUjvsaNt3c jpgVi/KBlN4k6FMPB3jHl4+5wM+h2Fo01o0ZkXaLN2+yv83X7YbGVP/1W6mrivEpE8KVNeKyE l2i3PC5Tf/PR74eUEFfCf6TIyMHtRyOniSXd4OsbCoPwVwxNBdI4T8sWNsAkBfb3VGFY= Received-SPF: pass client-ip=212.227.17.22; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/07 09:09:28 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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:124357 Archived-At: I have tried executing the following condition (if (nb > na)) (setq na 2) (setq nb 5) ( if (> nb na) (message "nb > na [condition true]") (message "condition false") ) I highlighted the region then pressed C-x C-e It returned the first message as expected, but when I tried the next one, I still got the first message. (setq na 2) (setq nb 1) ( if (> nb na) (message "nb > na [condition true]") (message "condition false") ) > Sent: Wednesday, October 07, 2020 at 9:20 AM > From: "Robert Pluim" > To: "Christopher Dimech" > Cc: moasenwood@zoho.eu, help-gnu-emacs@gnu.org > Subject: Re: Executing part of the code instead of another > > >>>>> On Wed, 7 Oct 2020 09:01:00 +0200, Christopher Dimech said: > > Christopher> What can one use if there is an else branch with multip= le commands, as I would > Christopher> like to use it. > > From 'C-h f if' > > if is a special form in `C source code'. > > (if COND THEN ELSE...) > > Probably introduced at or before Emacs version 1.1. > > If COND yields non-nil, do THEN, else do ELSE... > Returns the value of THEN or the value of the last of the ELSE's. > =3D> THEN must be one expression, but ELSE... can be zero or more expre= ssions. > If COND yields nil, and there are no ELSE's, the value is nil. > > > Robert > -- >