[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: info jumps to wrong reference
From: |
Eli Zaretskii |
Subject: |
Re: info jumps to wrong reference |
Date: |
Mon, 04 Dec 2006 22:58:38 +0200 |
> From: Bruno Haible <address@hidden>
> Date: Mon, 4 Dec 2006 16:38:45 +0100
>
> Here is a case where 'info' displays the wrong page when the user clicks on
> a line containing a reference (hyperlink).
I'm assuming you mean press RET or f, since the stand-alone Info
doesn't support mouse.
> In
>
> address@hidden'
> Indicate the name of a command. *Note address@hidden': command.
>
> put the cursor on the beginning of the line containing the note and press
> Return. You get to the page with title
> 9.1.9 address@hidden'{FILE-NAME}
It's a ``feature''.
> It worked in info-4.0, info-4.2, info-4.3, info-4.5, and is broken in
> info-4.6, info-4.7, info-4.8. The NEWS file mentions this:
>
> * info:
> . RET now goes to the nearest xref (rather like Emacs Info),
> instead of the next xref starting on the current line.
I'm the guilty^H^H^H^H^H^Hresponsible party for this change...
> I don't understand two things about this:
> - When in Emacs 22 info mode, I put the cursor at the beginning of the
> line containing the note and press Return, it doesn't jump; instead it
> shows a message in the status line:
> Point neither on reference nor in menu item description
This is an issue for the Emacs's Info reader, so I suggest to take it
up with address@hidden
In general, the Emacs and the stand-alone Info are two different
programs written in two different languages and using very different
approaches to parsing Info files (Emacs uses regexps, the stand-alone
reader uses plain text search). They are also maintained by two
different groups of people (I don't count, since I haven't worked on
Texinfo for several years now). So it shouldn't surprise you that
they behave differently in borderline situations.
> - What is the distance (metric) that 'info' considers? Between the
> @file reference and the point there are two lines (including a blank
> line - paragraph separator, no?), whereas the between the @command
> reference there are 7 words but no linebreak.
It counts characters, not lines. @file is closer to the beginning of
the line than @command by about 10 characters.
Please note that such a usage is (or should be) quite rare; normally,
you are supposed to either TAB to the cross-reference before you press
RET, or type `f', which gives you an opportunity to see the automatic
suggestion and correct it if necessary (completion is available to
make this more convenient).
> info should IMO consider the number of linebreaks and/or the number of
> blank lines when measuring the distance between the cursor point and two
> references.
In my experience, this will also cause breakage, just in different
cases. You are welcome to submit a patch, but just counting lines is
not enough; maybe some hybrid metrics that takes both lines and
characters into account will do. For example, count lines if the two
references are in different lines, but count characters if they are on
the same line. I'm not sure how easy is it to implement this, though:
it's been a while since I last hacked Info.