From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dr Rainer Woitok Newsgroups: gmane.emacs.help Subject: Re: Setting value 1 when matching two strings Date: Sun, 16 Oct 2022 18:23:14 +0200 Message-ID: <25420.12274.577322.322044@tux.local> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21409"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "help-gnu-emacs@gnu.org" To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 16 18:25:10 2022 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 1ok6Rp-0005On-OT for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 18:25:09 +0200 Original-Received: from localhost ([::1]:49382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ok6Rn-0003KS-RQ for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 12:25:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok6Q4-0002Lc-Mi for help-gnu-emacs@gnu.org; Sun, 16 Oct 2022 12:23:20 -0400 Original-Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:40754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ok6Q3-0002LX-1t for help-gnu-emacs@gnu.org; Sun, 16 Oct 2022 12:23:20 -0400 Original-Received: by mail-ed1-x533.google.com with SMTP id r14so12968275edc.7 for ; Sun, 16 Oct 2022 09:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:subject:cc:to:date:message-id :content-transfer-encoding:mime-version:from:from:to:cc:subject:date :message-id:reply-to; bh=anfefOCZsq14JDY4APdHYzbvLjaMZccPKK56Ve7biPs=; b=EW2KrYjRlAL+hc/2X2spvkmp5h0O+pkOtJrxyEfRcFg2TPlmJn/gJJJXUHc+tDKjfx l1p12AO4QCmGDTePrD6TDPDl2r8fpqZc4NOKRPEVyQrpw7LrDToRqxm2emEeDutoYO24 AVjcLAnaHNVphMARW3JqDd7bl6d/HUQgXc30XFzQ133oXdjHet5FOeeco2PVIWUi6eEg RuqAKfbSfgmBd5RzkINpv79Yl6UZn2y16MOoM1DAXJBeHbCZ9VGQg94e0tHonZCmkc0p ECrbOY8AdYL66aQ6lrRF3d5nYmMagUMHG3Oo63j6NB6r9sBTZEXTOyJ5SGfTnwLFip4T LaHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:subject:cc:to:date:message-id :content-transfer-encoding:mime-version:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=anfefOCZsq14JDY4APdHYzbvLjaMZccPKK56Ve7biPs=; b=jEo2fcSEFxL1i8QTdYumNGK1sptoJ28IzqPVhMLpnjxkGIh0KG4nTihkWlfVmbuF1h KXOEMCkTJqxIOQ9FKPKT1W2nIVe/raBTsxswB+4dBbdrAQpUOOel9GOR+aP5TmoUDIFu vPSHoxR0RbwK8PqEwu2jLTYv3xvGWPy9wGkxto1gRq8TL4PRRB0xUIJ3cvapwr93odBc gvJX0ZxINyIzvk4BgiRtR+nTpFVHzpK/I9HVKcCTV21vTI2fiEXUO1MZ2BJu9xub1ygi 9QX5dKLifr6QS6u5eBe1dPsvpum7yuzOp7WOPXLgRZy8ShoT+fEMJcnt9ZoXsbzASG8t CZyA== X-Gm-Message-State: ACrzQf1j5pA9UEr6kCNA0PgseZ22gmKmXjtDucAesMn56qhzR2DxvtWi enmvTfVOrDrIds/aF+SuZ+k= X-Google-Smtp-Source: AMsMyM5SRkCy7KDN2BT52SiUzEOm/YDtb2e2V+OwvXIBxRv7GCYeXedFkrTGzQQA0xxKG69X5DXxtA== X-Received: by 2002:aa7:cd10:0:b0:45c:2c83:1208 with SMTP id b16-20020aa7cd10000000b0045c2c831208mr6488971edw.81.1665937397064; Sun, 16 Oct 2022 09:23:17 -0700 (PDT) Original-Received: from gmail.com (p200300df071dd6435e6606208f3c3308.dip0.t-ipconnect.de. [2003:df:71d:d643:5e66:620:8f3c:3308]) by smtp.gmail.com with ESMTPSA id h20-20020a0564020e9400b00456d2721d93sm5615404eda.64.2022.10.16.09.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 09:23:16 -0700 (PDT) X-Google-Original-From: Dr Rainer Woitok In-Reply-To: Msg of 2022-10-16 15:51:44 +0000 from help-gnu-emacs@gnu.org X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta34) "kale" XEmacs Lucid (x86_64-pc-linux) Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=rainer.woitok@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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.29 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:139997 Archived-At: Heime, On Sunday, 2022-10-16 15:51:44 +0000, you wrote: > This code sets "isel" to value "1" if "actm" matches "vert". I want to extend this so that value "1" > is also set when "actm" matches "horz". > > (let ( (isel (if (equal "vert" actm) 1 -1)) ) > > Thus when "actm" matches "vert" or "horz", then "isel" has value "1". Otherwise "isel" has value "-1". In case you don't really need "vert" as a string but could as well use the symbol 'vert, you could use "eq" rather than "equal". And if you want two or more alternatives, you could use (member actm '("vert" "horz")) or (memq actm '(vert horz)) Sincerely, Rainer