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

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

bug#58326: Reading unicode user inputs from minibuffer


From: uzibalqa
Subject: bug#58326: 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))

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













reply via email to

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