emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] ignoring Info extensions


From: Juri Linkov
Subject: Re: [PATCH] ignoring Info extensions
Date: Fri, 02 Apr 2004 21:19:17 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

address@hidden (Karl Berry) writes:
>     juri> I think `*Note' quoted with a preceding
>     ` or " character should not be considered as a valid reference
>
> I guess I can't think of a reason to write something like address@hidden' or
> "@ref{foo}", and I don't see any cases in reality, so this might be ok,
> but neither am I clear as to why it is necessary.  What does
> fontification have to do with quote chars?  (Sorry, I could not quickly
> make sense of the code.)  Could you explain a little?

There are three cases with quoted `*Note' I was able to find:

./info.info:like a menu item except that it has `*note' instead of `*'.  It
./info-stnd.info:with `*Note', and continue with a label and a target.
./texinfo-1:     or an Info cross-reference saying `*Note NAME: NODE.'.

Currently they are fontified incorrectly: the text between them and
the next reference in the same Info node with them is very distorted.

However, the first two cases will be fixed when the reference regexp
will be changed to \*Note[ \t\n]+ because they have no whitespace
after *Note.  And the third case (in texinfo-1), even though it has
whitespace after *Note, is not a problem at all, because it's just
an example.  Moreover, by coincidence, it refers to the node named
`NODE', and the Texinfo manual has a node with the same name,
so this reference is not broken!

Currently the function `Info-fontify-node' has the code to skip the
reference if the preceding character is ".  The commentary says that
it's a "hack".  I haven't seen Info references with a leading ".
Could someone tell is this code really needed.  Otherwise, it could be
removed.

>     eliz> How about if we instead detect the "*Note:*" case and don't
>     treat it as a reference?  
>
> I believe this amounts to *Note:[^*] (vs. *Note:\s).  I think either one
> is ok, it won't make any difference in practice.  I slightly tend toward
> the latter, because it is clearer to understand "*Note: is always
> followed by whitespace" rather than "*Note: is followed by anything
> except a *" (which, in practice, is always whitespace).

I guess you actually meant *Note[^:*] vs. *Note\s.  Anyway,
restricting the character after *Note to [:*] instead of
whitespace apparently will not solve the problem for all
known references.  Here is the distribution of \*Note[^ \t]+
matches on the biggest Info base I found:

     78 *Note:*
      8 *NOTEBOOK,
      6 *Note:
      4 *NOTE:*
      4 *NOTE*
      3 *Note*:
      2 *note:*
      2 *NOTEBOOK)
      2 *NOTE*:
      1 *note*
      1 *Notes:*
      1 *Note2:
      1 *note'
      1 *Note',

So perhaps whitespace is a better choice.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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