GNU bug report logs - #73307
Fix ctype(3) usage

Previous Next

Package: emacs;

Reported by: Thomas Klausner <wiz <at> gatalith.at>

Date: Mon, 16 Sep 2024 21:26:01 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #28 received at 73307 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: luangruo <at> yahoo.com, 73307 <at> debbugs.gnu.org, wiz <at> gatalith.at
Subject: Re: bug#73307: Fix ctype(3) usage
Date: Wed, 18 Sep 2024 08:35:18 -0700
[Message part 1 (text/plain, inline)]
On 2024-09-18 04:45, Eli Zaretskii wrote:
> what's the
> problem with using c_isspace (and what do you mean by "multibyte
> space"

Using c_isspace would be OK, in that it'd handle most practical 
examples. I wrote the fancier version to handle prompts that end in 
non-ASCII spaces, e.g., (yes-or-no-p "Delete all files? ") where the 
last character is actually U+00A0 NO-BREAK_SPACE instead of U+0020 
SPACE, so its UTF-8 encoding is multiple bytes. If it's not important to 
handle such cases we could just use c_isspace.


> You are testing characters for whitespace syntax, which is AFAIU
> subject to buffer-local syntax tables.

Thanks, I didn't think of that. How about the attached patch? It is an 
alternative to just using c_isspace.
[fns.c.diff (text/x-patch, attachment)]

This bug report was last modified 296 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.