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 02:55:11 +0200 Message-ID: References: <87imbm3llg.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="31912"; 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 02:57:14 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 1kPxla-0008BR-8k for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Oct 2020 02:57:14 +0200 Original-Received: from localhost ([::1]:56544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPxlZ-0002Cm-1P for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 06 Oct 2020 20:57:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPxji-00028m-LH for help-gnu-emacs@gnu.org; Tue, 06 Oct 2020 20:55:20 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:43763) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPxje-0000CY-HR for help-gnu-emacs@gnu.org; Tue, 06 Oct 2020 20:55:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602032111; bh=zp5L6A+OPbddRbYWeDzTxO4JcrZ7F3odCem5zynI+MA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=L3FhKYVDsY+1BkZ3crxHT2ahEswyTWY834zChMt/CbdrlRq0CJg52YIsQVO4yP43o iJpWC2u6hRPuEadHqD8cFbJuC09rtleqVRGDIt41YCMfgaG/1JKaAXVigJHW+5y22L 0TFOfM31tNbrFpdidroYX/q/C3/eztTevP73ESto= 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 02:55:11 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <87imbm3llg.fsf@ebih.ebihd> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:BST47j0dklzd2iiYgAa4S2aEDIohQqj8hoxiTxWI7pqHs7vo8CMUhd6aDbfusv/C59zmD mYgdjk7AJJyWc8WENvjDOS/6hl0iSDHmOLM06o+XJbfE6O+Wru0gpjJkV56GAorUU0mP1l2MAh/N +AgzUp7eTsnNPnMs/Ncxd1izuWeTHcoCjjxjDrMv6WCZY38K2Uol/mT3mZXsUJT6E1bE6tj7II/l ovflrGdWvMHAhc3IWz+PvZY7caPMEj4Lc80jmUcSTTYK17AhIVK9GK9rQuvh4/z8MNJgGqp72VGR xw= X-UI-Out-Filterresults: notjunk:1;V03:K0:IYfIw2Me59U=:VV8VUKKdq1wsABzmYmA/WC PyzoJ6IGCtbbp2uLRmv8YAzclTgBrNiQsAR9Y5svQIBXVgvNcxRVjHpgIisRZoHllCV1RWWmt lT3N/D+6ZieA/WWXxafXrhPUtyrA1+Q/WGU3wPpkYDNBvuhUj3fCiAHIM9cforC9idmlYRzar Y5j0AGaKh7G61MA2kdPRZARdy797Pdt6x9gMdjQdt42NlZlp7H32xwfrrVzoDk8we2NsaSYX9 3+eC4Ipt1YeD8I/63myJMWgCCPazc0a2ZyJ9gPtfXukLjATrmBPQN1jujPMq3y2Jf2Jmm6Y0u pUdA+SxTTUmMvAGdsyYdOpgl8vdI6LnNQtk8cbNcymSdGWqoSfCwxaWRbVVMC8JoyoImppQVm rTsO822c1lcwLnPQSW74+3Dp7+pgvv+S0Sh/gXmI5ff9WO7RP4gm5Uqewr/xIpzIhm+FxdQjQ kLVAPhXCw8sI1W0u7Y/fQ+ouWTe64g7ToqX1JGJD6W+MLr/2m828Di/B3VGGAwXKK1z+CYCFH 9imcN9n4GuklP26VnlLAiYWgxp0ymPDsOM7Q7QKhMuZsrKRqgyI6fFUh5jcD8Th4fZ0HBxvwX KdvbXM5svfm6eQEVqwoNRcA3ZyusEbxHo6jTVTwft+c46myRweVKqpuRZsXdLTWD9viFwJnUG OxGiLuFUElHpHSN2JOC+WCOokpqE630Fg5LWreld4ckEpOT5OjvlB7oa2jZ32W27jgiI= Received-SPF: pass client-ip=212.227.15.15; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/06 20:55:12 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:124343 Archived-At: I have been trying to do the following (setq optn 1) (if (=3D optn 1) ( global-unset-key (kbd "C-") ) ( global-unset-key (kbd "C-") ) ( global-unset-key (kbd "C-") ) ( global-unset-key (kbd "C-") ) ( global-set-key (kbd "C-") (lambda () (interactive) (scroll-down 1)) ; Scrolls the page Down ) ( global-set-key (kbd "C-") (lambda () (interactive) (scroll-up 1)) ; Scrolls the page Up ) ( global-set-key (kbd "C-") (lambda () (interactive) (scroll-down 1)) ; Scrolls the page Down ) ( global-set-key (kbd "C-") (lambda () (interactive) (scroll-up 1)) ; Scrolls the page Up ) ) > Sent: Wednesday, October 07, 2020 at 2:50 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 would like to have some numeric if condition so > > I can set some keybindings when variable a has > > value 1, but if variable a is 2, I want to set > > a different set of keybindings. How can I do it? > > It is probably better to base this on the many > different Emacs _modes_, but to answer your question: > > (if (=3D var-a 1) > (do-something) > (do-something-else) ) > > -- > underground experts united > http://user.it.uu.se/~embe8573 > https://dataswamp.org/~incal > > >