unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Emanuel Berg <incal@dataswamp.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Setting numecir values according to symbol
Date: Sun, 30 Oct 2022 22:12:52 +0000	[thread overview]
Message-ID: <KGSKcNKEV8-pRM30aVt6chtIIJHvbjYfc61cCHNi2ydhgTOO2cut2jfae-gYD1oxVNlQVyuS-xHdtdAA3r44fOR1J8sUnSiraOJoicJzG-g=@protonmail.com> (raw)
In-Reply-To: <87sfj54g8w.fsf@dataswamp.org>


------- Original Message -------
On Sunday, October 30th, 2022 at 1:01 PM, Emanuel Berg <incal@dataswamp.org> wrote:


> Stefan Monnier via Users list for the GNU Emacs text editor wrote:
> 
> > > (defvar mbcomplt 0)
> > > 
> > > (cond
> > > ((eq armg 'auto) (setq mbcomplt 0)
> > > ((eq armg 'icomplt-horz) (setq mbcomplt 1)
> > > ((eq armg 'icomplt-vert) (setq mbcomplt 2)
> > > ((eq armg 'ivy) (setq mbcomplt 3)
> > > ((eq armg 'vertico) (setq mbcomplt 4)
> > > ((eq armg 'helm) (setq mbcomplt 5)))

I did simplify this with the following "cl-case".  Am interested in seeing
how a can implement the equivalent using "pcase".

(setq mbcomplt
  (cl-case armg
    ('auto 0)
    ('icomplt-horz 1)
    ('icomplt-vert 2)
    ('ivy 3)
    ('vertico 4)
    ('helm 5)))

Would this be all, as below?

(setq mbcomplt
  (pcase armg
    ('auto 0)
    ('icomplt-horz 1)
    ('icomplt-vert 2)
    ('ivy 3)
    ('vertico 4)
    ('helm 5)))






  reply	other threads:[~2022-10-30 22:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-30  4:31 Setting numecir values according to symbol Heime
2022-10-30 12:54 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-10-30 13:01   ` Emanuel Berg
2022-10-30 22:12     ` Heime [this message]
2022-10-31 11:25       ` Emanuel Berg

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='KGSKcNKEV8-pRM30aVt6chtIIJHvbjYfc61cCHNi2ydhgTOO2cut2jfae-gYD1oxVNlQVyuS-xHdtdAA3r44fOR1J8sUnSiraOJoicJzG-g=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=incal@dataswamp.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).