all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#58326: Reading unicode user inputs from minibuffer
@ 2022-10-06  3:42 uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-10-06  8:45 ` Robert Pluim
  0 siblings, 1 reply; 8+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-06  3:42 UTC (permalink / raw)
  To: 58326


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))

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













^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-10-07  0:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06  3:42 bug#58326: Reading unicode user inputs from minibuffer uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-06  8:45 ` Robert Pluim
2022-10-06 11:51   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-06 12:21     ` Lars Ingebrigtsen
2022-10-06 16:34       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-06 17:21         ` Robert Pluim
2022-10-06 17:52           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-07  0:45             ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.