* bug#10502: 24.0.92; Please add optional NAMES arg to `read-char-by-name'
@ 2012-01-14 15:08 Drew Adams
2016-04-28 12:10 ` Lars Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2012-01-14 15:08 UTC (permalink / raw
To: 10502
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)'.
`ucs-names' is gigantic and all-emcompassing. Code that calls
`read-char-by-name' for a particular purpose/context might well deal
with only a subset of that giant set of char names. The names it deals
with should not be hard-coded but should be decidable programmatically.
In GNU Emacs 24.0.92.1 (i386-mingw-nt5.1.2600) of 2012-01-05 on MARVIN
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.6) --no-opt --cflags
-ID:/devel/emacs/libs/libXpm-3.5.8/include
-ID:/devel/emacs/libs/libXpm-3.5.8/src
-ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
-ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
-ID:/devel/emacs/libs/giflib-4.1.4-1/include
-ID:/devel/emacs/libs/jpeg-6b-4/include
-ID:/devel/emacs/libs/tiff-3.8.2-1/include
-ID:/devel/emacs/libs/gnutls-3.0.9/include --ldflags
-LD:/devel/emacs/libs/gnutls-3.0.9/lib'
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#10502: 24.0.92; Please add optional NAMES arg to `read-char-by-name'
2012-01-14 15:08 bug#10502: 24.0.92; Please add optional NAMES arg to `read-char-by-name' Drew Adams
@ 2016-04-28 12:10 ` Lars Ingebrigtsen
2016-04-28 14:20 ` Drew Adams
0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-28 12:10 UTC (permalink / raw
To: Drew Adams; +Cc: 10502
"Drew Adams" <drew.adams@oracle.com> writes:
> 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.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#10502: 24.0.92; Please add optional NAMES arg to `read-char-by-name'
2016-04-28 12:10 ` Lars Ingebrigtsen
@ 2016-04-28 14:20 ` Drew Adams
0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2016-04-28 14:20 UTC (permalink / raw
To: Lars Ingebrigtsen; +Cc: 10502
> > 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-28 14:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-14 15:08 bug#10502: 24.0.92; Please add optional NAMES arg to `read-char-by-name' Drew Adams
2016-04-28 12:10 ` Lars Ingebrigtsen
2016-04-28 14:20 ` Drew Adams
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.