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 #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: uzibalqa <uzibalqa <at> proton.me>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: Reading unicode user inputs from minibuffer
Date: Thu, 06 Oct 2022 03:42:14 +0000
I am using "read-char-by-name" to read utf8 hex codes from user for input to  "glasses-separator".
But because "glasses-separator" requires a string I have to do (string (read-char-by-name "hex: ")).
Meaning that users cannot pass "\u2192", but have to use "#x2192".  Yet, using "completing-read",
the list can contain "\u2192", which works fine.  I am also unsure whether there is an inconsistency
with display-fill-column-indicator-character which also takes unicode. 

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

-----------------------------------------------------

(defun camel-glasses (hexcode)

  "Splits CamelCase phrases using separator."

  (interactive (list (completing-read "hexcode: " '("\u27A4" "\u25BA") nil t)))

  (setq glasses-separator hexcode)

  (glasses-set-overlay-properties))

----------------------------------------------

(defun camel-glasses (hexcode)

  "Splits CamelCase phrases using separator."

  (interactive (list (string (read-char-by-name "hex: ")))

  (setq glasses-separator hexcode)

  (glasses-set-overlay-properties))

-------------------------------------












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.