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

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

bug#51089: 28.0.60; Using read-symbol-shorthands (("-" . "foo-")) should


From: João Távora
Subject: bug#51089: 28.0.60; Using read-symbol-shorthands (("-" . "foo-")) shouldn't shadow the '-' symbol
Date: Mon, 11 Oct 2021 01:18:43 +0100

On Sat, Oct 9, 2021 at 12:53 PM Eli Zaretskii <eliz@gnu.org> wrote:

> You mean iterate the string being analysed by bytes, and use strchr() on
> byte_i and a constant you'll provide me?  And if we reach a byte that's
> part of a multibyte one, we bail, knowing that it's not all ASCII
> punctuation...  Is that the idea?  Should work, yes.

Yes.  But I think we could use strcspn for an easier, one-line, test
of the same.

I tried to use strcspn() to discover if a C string is entirely comprised
of punctuation (as is required by your idea), but couldn't. That function
deals with prefixes, it's not a "every()" kind of operation.  If you're
seeing something clever to do with it, please tell me, because I'm not.

João


reply via email to

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