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

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

bug#13177: 24.3.50; doc of `read-char-by-name'


From: Juri Linkov
Subject: bug#13177: 24.3.50; doc of `read-char-by-name'
Date: Sat, 15 Dec 2012 13:09:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)

> Dunno just what the intention was for this function.  If it really
> was to return a recognized Unicode character then this is a product
> bug and reading should not end until the user enters matching input
> (or hits `C-g').

As its docstring says, it also accepts a hexadecimal number
of Unicode code whose input can't use completion.

> Anyway, for this bug report and for my part, it would be enough
> to correct the doc to say that if the user enters a name that
> is unknown then nil is returned.

Then this patch would be enough:

=== modified file 'lisp/international/mule-cmds.el'
--- lisp/international/mule-cmds.el     2012-10-11 20:05:47 +0000
+++ lisp/international/mule-cmds.el     2012-12-15 11:09:03 +0000
@@ -2944,7 +2944,10 @@ (defun read-char-by-name (prompt)
 
 This function also accepts a hexadecimal number of Unicode code
 point or a number in hash notation, e.g. #o21430 for octal,
-#x2318 for hex, or #10r8984 for decimal."
+#x2318 for hex, or #10r8984 for decimal.
+
+When input is neither a known Unicode name nor a hex number string,
+return nil."
   (let ((input
          (completing-read
           prompt






reply via email to

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