From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Douglas Lewan Newsgroups: gmane.emacs.help Subject: Re: Executing part of the code instead of another Date: Sun, 18 Oct 2020 19:02:02 -0400 Message-ID: <1e926862-ee73-17ea-108a-6b9e03e2f672@gmail.com> References: <87imbm3llg.fsf@ebih.ebihd> <87blhe3kxg.fsf@ebih.ebihd> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22099"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 19 01:02:49 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 1kUHhQ-0005dy-Vu for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 01:02:48 +0200 Original-Received: from localhost ([::1]:38282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUHhQ-0005KO-1E for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Oct 2020 19:02:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUHgn-0005Jq-Ty for help-gnu-emacs@gnu.org; Sun, 18 Oct 2020 19:02:09 -0400 Original-Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]:33184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUHgl-0001B6-S1 for help-gnu-emacs@gnu.org; Sun, 18 Oct 2020 19:02:09 -0400 Original-Received: by mail-io1-xd34.google.com with SMTP id r4so10968752ioh.0 for ; Sun, 18 Oct 2020 16:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=5UPyZORxIMqahnnPpjjnAtGYGXp4xosf1kVNBMEPTnk=; b=LiAbv5p3EVJG7yFNE4vq1mnACD5YmEkY9ASBvkMGcPEtRJDYSQpMoaE4cqg1fUQDMR xTCTKppPVPnkmr1QYYRZs4UBlJZINsk3kQKymSmysKTccc6Sf9/stH1LgpVFAKaUa/w0 0ozc9gvBojbwCqCf1SGOLpZlvdQbMhGP9gWwnPBNZMo8uFG1pldZR1Pj/HgO0qvrIRRx EoNGtksZOqk4BevZ9wXb0KUCPCKy+1rbjh2XsGd5oAXC6PQnVX+azhx8ZORMD8REEcNC fIbgcjl2rzEMQ1XibkSeJHZSS+ER2qJOGkuu3xzR1JsBPAwwYKm59EcdkF+mpH9EeaFT rzbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=5UPyZORxIMqahnnPpjjnAtGYGXp4xosf1kVNBMEPTnk=; b=OjhTZ4XGMLnFPWO5PMFSyPb+CyKrfSa/MJgKbiUeLgDoxa7ylk20pCI9WgbffZUtcg F4N9G9MRFAkuU16UEzn3JMSkX4k4A8veMge+W5fAcpcpAYS5lIHuplXf/DziPA32PbmS TsCrLHZxnEEsKKXRkst7MShwT7KWcZJQrcsGI/wo+3SkR1r6PxJA4P85GeBhUkiUKIVB 9eLJlKCs4FlrONbGh7AKHnyZsYIcHr4QUc06bA4886Ohn1potBk4hFRpGY+kcrIy/RgH /xoRjrRzng87ZrKMOZ2y3jc/58UAKDqjqgn8NT0N/5KMXnTKfQ4gCimHpsnDeH5++q0L 1ODQ== X-Gm-Message-State: AOAM530z07ALKp7+o5lOEF2j3XkKCu5grXJExrzOjH79zLEx9A1ZMTF1 dcQ0Dz8yFx4XNPvmh0BAL01FRgqUiA== X-Google-Smtp-Source: ABdhPJyTIZPRZa+QdN7eXyDsnc0+6UfTki+MBW0CRg+sdFpztFi5YRJYzSvFKX1C30qvE5nZFA+DfQ== X-Received: by 2002:a6b:6118:: with SMTP id v24mr8974534iob.61.1603062125384; Sun, 18 Oct 2020 16:02:05 -0700 (PDT) Original-Received: from [192.168.43.104] ([172.58.239.127]) by smtp.gmail.com with ESMTPSA id x13sm5977970ilk.67.2020.10.18.16.02.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2020 16:02:04 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::d34; envelope-from=d.lewan2000@gmail.com; helo=mail-io1-xd34.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:124561 Archived-At: (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" >> 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-") ) >>> [...] >>> ( 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 (= 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)