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.