help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pcase and minus-sign


From: Michael Heerdegen
Subject: Re: pcase and minus-sign
Date: Wed, 30 Nov 2016 14:31:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> Thanks, that helps. Seems it relates to the following in docstring:
>
> SYMBOL    matches anything and binds it to SYMBOL.

Exactly.


> Now if I use some arbitrary char, like "a",
>
> (defun foo (arg)
>   (interactive "P")
>   (pcase arg
>     (a (message "%s" "ARG was `a'"))
>     (1 (message "%s" "ARG was `1'"))
>     ('- (message "%s" "ARG was minus-sign"))
>     (_ (message "%s" "ARG not minus-sign"))))
>
> It picks that a-branch at any case - as documented but strange.

It's not so strange anymore if you correct the message string ;-)


Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]