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

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

bug#10502: 24.0.92; Please add optional NAMES arg to `read-char-by-name'


From: Drew Adams
Subject: bug#10502: 24.0.92; Please add optional NAMES arg to `read-char-by-name'
Date: Thu, 28 Apr 2016 07:20:07 -0700 (PDT)

> > The use of `(ucs-names)' is hard-coded in `read-char-by-name'.  Please
> > add an optional parameter NAMES that defaults to `(ucs-names)' and use
> > that instead.  That will enable callers to use a different set of
> > candidates, typically a subset of `(ucs-names)'.
> 
> I don't think so.  `read-char-by-name' is just a shim over
> 
> (completing-read
>  prompt
>  (lambda (string pred action)
>    (if (eq action 'metadata)
>        '(metadata
>          (annotation-function . mule--ucs-names-annotation)
>          (category . unicode-name))
>      (complete-with-action action (ucs-names) string pred))))
> 
> and if you want a different completion table, then you should just avoid
> `read-char-by-name' -- it doesn't provide much value.

No.  `read-char-by-name' is useful generally.  It is a general
function for reading a character by its Unicode name.  Nothing
about that means that the full set of Unicode names need
necessarily be the set to choose from.  The function becomes
far more useful if a caller can specify the set of chars to
use as the domain.





reply via email to

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