emacs-devel
[Top][All Lists]
Advanced

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

RE: display-completion-list should not strip text properties


From: Drew Adams
Subject: RE: display-completion-list should not strip text properties
Date: Mon, 22 Jan 2007 21:10:56 -0800

>     Users could then pass propertized strings to, for example,
>     `completing-read' and have them displayed as defined.
>
> Is there a case where this is useful?

I think the page I pointed to suggests a few uses. It's hard to know whether
you didn't follow the URL or you didn't think the suggestions made there
were useful.

Just in case you didn't follow the URL, some possible uses of text
properties in *Completions*:

. 'face' - to make some completion candidates stand out in particular ways

The screenshots show *Completions* with color names and their accompanying
color swatches; that is, the individual completions have, as their
backgrounds, the colors they name. Complete your input to a name or just
click the color you want (WYSIWYG), without paying much attention to the
name.

Or, complete a face name: you see the faces whose names you can choose (like
`list-faces-display', but with completion). WYSIWYG.

. 'help-echo' - for help that is specific to a particular candidate or to a
particular command that completes input

Put your mouse over a candidate function name to see its first doc-string
line (like `apropos' with completion).

. 'keymap' - for individualized mouse or key treatment of candidates (or
even of parts of candidates)

For example, a mouse binding specific to a particular candidate or group of
candidates (e.g. help, preview, or a mouse-3 menu).

. 'display' - to include images in candidates or to add display artifacts

For example, application icons next to file names, to show what program will
apply if a particular file is chosen. Or thumbnails next to image-file
names - choose an image file by completing its name, but also get a preview
of it to help you choose.


More generally, `display-completion-list' is a general function. It should
be just as general as the other completion functions such as
`all-completions'.

Put another way, what is *gained* by stripping text properties from
completions? If something is gained in some cases, then at the very least
stripping should be an option (bind some variable or customize some user
option to impose stripping).

I would prefer to just get rid of stripping altogether, to open new
possibilities. I would rather burden any programs that might need to strip
properties with doing that themselves, before they call
`display-completion-list'.

And I would prefer to have the function coded in Lisp. What is the advantage
of using C here? It just makes user tweaking more difficult, with no benefit
that I can see.









reply via email to

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