GNU bug report logs - #58326
Reading unicode user inputs from minibuffer

Previous Next

Package: emacs;

Reported by: uzibalqa <uzibalqa <at> proton.me>

Date: Thu, 6 Oct 2022 03:43:02 UTC

Severity: normal

Tags: notabug

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Robert Pluim <rpluim <at> gmail.com>
To: 58326 <at> debbugs.gnu.org
Cc: uzibalqa <uzibalqa <at> proton.me>
Subject: Re: bug#58326: Reading unicode user inputs from minibuffer
Date: Thu, 06 Oct 2022 10:45:24 +0200
>>>>> On Thu, 06 Oct 2022 03:42:14 +0000, uzibalqa via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> said:

    uzibalqa> I am using "read-char-by-name" to read utf8 hex codes
    uzibalqa> from user for input to "glasses-separator".  But because
    uzibalqa> "glasses-separator" requires a string I have to do
    uzibalqa> (string (read-char-by-name "hex: ")).  Meaning that
    uzibalqa> users cannot pass "\u2192", but have to use "#x2192".
    uzibalqa> Yet, using "completing-read", the list can contain
    uzibalqa> "\u2192", which works fine.  I am also unsure whether
    uzibalqa> there is an inconsistency with
    uzibalqa> display-fill-column-indicator-character which also takes
    uzibalqa> unicode.

    uzibalqa> Could the setting up of "glasses-separator" be
    uzibalqa> simplified?  Could "read-char-by-name" be extended to
    uzibalqa> accept hexcodes like "\u2192", or is there some other
    uzibalqa> function that can handle the different unicode inputs
    uzibalqa> from minibuffer better?

I suggest you read the docstring for `read-char-by-name' more
carefully:

    Accept a name like "CIRCULATION FUNCTION", a hexadecimal
    number like "2A10", or a number in hash notation (e.g.,
    "#x2a10" for hex, "10r10768" for decimal, or "#o25020" for
    octal).  Treat otherwise-ambiguous strings like "BED" (U+1F6CF)
    as names, not numbers.

Robert
-- 




This bug report was last modified 2 years and 306 days ago.

Previous Next


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