all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dr Rainer Woitok <rainer.woitok@gmail.com>
To: Heime <heimeborgia@protonmail.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Setting value 1 when matching two strings
Date: Sun, 16 Oct 2022 18:23:14 +0200	[thread overview]
Message-ID: <25420.12274.577322.322044@tux.local> (raw)
In-Reply-To: Msg <VkLSl576EMPTbdlc1VyxXUUgOqZFZbfB6LaYOvb8WgpKcLH8SelNGdLxpvenv9QaSpJP__3oHDlAU32kDZ2YzXNVrmZwZYgVdx7PmWknFwE=@protonmail.com> of 2022-10-16 15:51:44 +0000 from help-gnu-emacs@gnu.org

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



  reply	other threads:[~2022-10-16 16:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 15:51 Setting value 1 when matching two strings Heime via Users list for the GNU Emacs text editor
2022-10-16 16:23 ` Dr Rainer Woitok [this message]
2022-10-16 16:33   ` Heime
2022-10-16 20:21   ` Heime
2022-10-16 21:23     ` [External] : " Drew Adams
2022-10-16 22:33       ` Heime
2022-10-16 23:16         ` Michael Heerdegen
2022-10-16 23:21           ` Heime
2022-10-16 23:39             ` Michael Heerdegen
2022-10-17  0:17               ` Heime
2022-10-17  0:41                 ` Drew Adams
2022-10-17  0:57                   ` Michael Heerdegen
2022-10-17  1:06                     ` Drew Adams
2022-10-17  0:42                 ` Michael Heerdegen
2022-10-17  1:40                   ` Christopher Dimech
2022-10-17  1:46                     ` Michael Heerdegen
2022-10-17  2:17                   ` Heime
2022-10-17  0:42         ` Drew Adams
2022-10-17  4:31         ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25420.12274.577322.322044@tux.local \
    --to=rainer.woitok@gmail.com \
    --cc=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.