From: Heime <heimeborgia@protonmail.com>
To: Dr Rainer Woitok <rainer.woitok@gmail.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 16:33:34 +0000 [thread overview]
Message-ID: <ZE3eidNGGWDsdk0dXbS2K0u3k8hNSYIfV6O3N4hE3_icxtlfjPjk8j11X9Kg0GltxQi0ntJpm5WeMEj-UQwwLVK_b-rwpXBn3ag7CVJWPCY=@protonmail.com> (raw)
In-Reply-To: <25420.12274.577322.322044@tux.local>
------- Original Message -------
On Sunday, October 16th, 2022 at 4:23 PM, Dr Rainer Woitok <rainer.woitok@gmail.com> wrote:
> 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
Am actually using "completing-read". Thusly, to follow your strategy I have to convert to symbols
after using "completing-read". What conversion approach would you have in mind?
(interactive
(list
(let ( (cseq '("vert" "partial-disab" "disable" "horz")) )
(completing-read "icomplt: " cseq nil t "horz"))))
next prev parent reply other threads:[~2022-10-16 16:33 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
2022-10-16 16:33 ` Heime [this message]
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='ZE3eidNGGWDsdk0dXbS2K0u3k8hNSYIfV6O3N4hE3_icxtlfjPjk8j11X9Kg0GltxQi0ntJpm5WeMEj-UQwwLVK_b-rwpXBn3ag7CVJWPCY=@protonmail.com' \
--to=heimeborgia@protonmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=rainer.woitok@gmail.com \
/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.