[Top][All Lists]

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

Re: Escaping quotes in docstrings, Was: A simple solution to "Upcoming l

From: Paul Eggert
Subject: Re: Escaping quotes in docstrings, Was: A simple solution to "Upcoming loss of usability ..."
Date: Wed, 01 Jul 2015 23:57:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Dmitry Gutov wrote:

It's the same if you copy some syntax-highlighted text (say, from src/doc.c) to
/tmp/foo and save it. Kill the buffer, reopen - the highlighting is gone! :)
That may seem counter-intuitive, but it's something Emacs users are generally
familiar with.

I've seen highlighting vanish, but I've never seen the characters change. Anyway....

How about the following idea instead.  Instead of displaying grave
accent and apostrophe specially, have with-help-window transliterate
these characters in place before displaying itself as usual.

That should work, too. In help-mode-finish, before help-make-xrefs.

OK, let's shoot for that instead.

For us to go there, could you please make substitute-command-keys add the
`escaped' property to the escaped characters in its output? And push it to

OK, I'll look into that.

+               (unless (get-text-property mbeg 'help-value)

Supposed the matched string is partly help-value, and partly not.  E.g.,
mbeg has help-value but mbeg+1 does not but mbeg+2 does.  Shouldn't this
test that all the matched characters are not help-value characters?

Why? I'm assuming the value is separated from the other contents by whitespace
or newlines.

I don't think that's a safe assumption. It's common for quoted help-values to be jammed into the middle of other text.

+                                 (buffer-substring-no-properties
+                                  mend (1+ mend)))

This may go haywire if it returns "\t", because a TAB is special to
compose-region.  Also, what if the buffer has some properties other than
help-value that should be preserved?

Err, I don't think the current code deletes any existing properties, it only
changes how the buffer looks.

But buffer-substring-no-properties has no properties in the result, right? So effectively they're removed. And what about the TAB?

reply via email to

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