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

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

bug#16439: [feature request] Highlighting of strings within Info buffers


From: Drew Adams
Subject: bug#16439: [feature request] Highlighting of strings within Info buffers
Date: Mon, 20 Jan 2014 10:06:13 -0800 (PST)

> The problem is how to highlight strings only in code samples
> because in other places highlighting "..." makes no sense.
> Look for example in the node (info "(emacs) Package Keywords"):
> 
>   Most optional features in Emacs are grouped into "packages".
> 
> Should "packages" be highlighted as a string.  Of course not.
> There is no additional emphasis on quotations in books.


1. That is not "the problem", IMO.  When I proposed this feature,
long ago, the complaints (against even providing it optionally,
via a user option) were that the highlighting is not foolproof,
in that there are some cases where ` or " is not matched (e.g.,
?").

For that, I tested each node of the Emacs and Elisp manuals (at
the time), and I showed that that problem is very rare.  And
making the highlighting optional and togglable, deals quite well
with that rarity - just hit a key in any of the very few nodes
where the highlighting is problematic, to get rid of it.  Or
turn the option off in your init file if you really prefer what
Emacs does now (no such highlighting).


2. Wrt the "problem" you bring up now -

Sorry, I don't agree.  I've used this feature for decades now,
and I can assure you that it is very helpful to have all "..."
highlighted.  Just my opinion, obviously.

It is also possible to separate the control over highlighting of
`...' and "...", e.g., by either having different user options
or giving the option more possible values.  I have not done that
in `info+.el', as I have not see the need for it.  (However, I
do have separate options for `...' and "...", on the one hand,
and <...>, on the other.)


3. More importantly, I'm hoping that Emacs will at some point
(soon) move to supporting different quoting methods for
semantically different constructs, as was discussed in this bug
thread: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16292.

I did not bring this up in that thread, because it had already
been decided what to do in the immediate, but there are some
very different uses of "..." in the Elisp and Emacs manuals.

And here I am with you to some extent: "..." to represent a
string is different in meaning from "..." to represent, say,
the introduction of a glossary term (in-place term definition),
which is yet again different from actual quotation (citation),
such as the FSF's Back-Cover Text.

Strings should be represented using straight " quotes, as
is done currently.  Actual quotations (citations) should be
represented using curly double-quotes.  And glossary terms
should be represented using either curly double-quotes or
another typographical convention (bold or italic is often
used for this, but it could also be a different color or
other convention).

If we do ever represent these different things in different
ways, instead of the single "..." notation, then your
problem will disappear.


4. During the one or two days that curly single-quotes were
actually used in Emacs, during the discussion of bug #16292,
I adjusted `info+.el' to DTRT for that, and it worked very
well.  Unfortunately, the builds for that did not also affect
double-quotes, so there was no test for that.  But taking
care of that in `info+.el' would be trivial also.

I'm not knowledgable about TexInfo etc., but I would guess
that the changes to support different appearances for what
are now handled as "..." would also be straightforward.

That is, I would expect that "..." as strings or as
term definitions might already be handled differently at
the TexInfo level, and are just being mapped to the same
Info representation, "...".  Just a guess.

I see no obstacle to providing helpful highlighting to
Emacs such as is provided by `info+.el', except the will
of Emacs Dev.

FWIW, `info+.el' also highlights <...> (controlled by a
separate user option).  Thus keys represented using this
syntax are highlighted the same as other keys.


5. Note, BTW, that there is no real difference between
"..." and `...' wrt "the problem" you cite.  Look at the
`Top' node of the Emacs manual, for example, and you will
see this:

  This is the `GNU Emacs Manual', updated for

That use of `...' is semantically different from its use in
`forward-char' or `C-x 4 f' or `.emacs'.





reply via email to

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