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: Tue, 4 Sep 2007 11:51:48 -0700

>     I think a better approach is to use a markup language in doc strings,
>     be it XHTML or even TexinfoML.  Then using a style sheet it can be
>     formatted nicely in the Help buffer.  Example of a doc string:
>
>     (defun foo ()
>       "To create a file, just <emph>visit it</emph> with <kbd>C-x
>        C-f</kbd>. See also <xref>find-file-literally</xref>."
>     )
>
> I don't want to go down that route.  It is a lot of complexity, and an
> invitation to keep adding more.

So, coming back to the original topic (;-)), before the fork toward markup:

It makes sense to let programmers apply text properties to doc strings. What
is lacking is an easy way to do that. For functions, there is currently no
way. For variables, there is a way, but it could be made less cumbersome.

Before tackling the problem of finding an easy way to apply text properties,
however, we need to accept Johan's proposed (trivial) fix to
`describe-variable', so that variable doc strings with properties will in
fact be displayed. (Nothing is needed for functions, apparently.)

So, there were two proposals in my mail:

1. Let's accept Johan's fix for `describe-variable'.

2. Let's discuss ways to address the limitation that there is currently "no
clean and easy way to put text properties on a doc string".

#1 does not require #2, so let's take care of #1 first. Johan's fix is a
one-liner.

Wrt #2, I proposed an approach that (a) would allow propertizing doc strings
for functions also and (b) would make propertizing doc strings more
user-friendly for both functions and variables. The idea is to let literal
doc strings contain special syntax to eval parts and replace them with their
values.

I proposed "mumble \\(...) titi". Juri proposed "mumble \\,... titi"
instead, for consistency with query-replace. I have no problem with either
syntax, and perhaps someone has another suggestion.

I also proposed a shortcut for face application, which I expect will be a
common use case for this feature: "mumble \\#highlight toto# titi" instead
of "mumble \\,(propertize "toto" 'face 'highlight) titi" (using Juri's
syntax). And I suggested that a similar shortcut might be added for image
insertion.

Other suggestions for #2 are welcome. But let's at least first agree on #1.








reply via email to

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