bug-texinfo
[Top][All Lists]
Advanced

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

Re: address@hidden: Bug#122600: info: Hitting enter on second line of li


From: Eli Zaretskii
Subject: Re: address@hidden: Bug#122600: info: Hitting enter on second line of link does nothing]
Date: Thu, 3 Jan 2002 13:19:35 +0200 (IST)

> From: "Anthony DeRobertis" <address@hidden>
> Date: Sat, 08 Dec 2001 22:42:52 GMT
> 
> Eli Zaretskii writes: 
> 
> >
> > What would you suggest that it does?  Goes backwards searching for
> > the beginning of a cross-reference?  How much should it search? 1
> > line? 2 lines? 10?
> 
> I see your point. Most of the times I've wanted it to work on a different 
> are due to line wrapping. I'd see no reason to look beyond the previous 
> line; any link longer than two lines has much bigger issues (like its 
> bigness ;-) 
> 
> Actually, in practice, I don't think I've ever seen a link run onto a third 
> line. So, I think practice would agree with only checking the previous line.

Thanks for the feedback  Please try this patch:


2002-01-03  Eli Zaretskii  <address@hidden>

        * info/session.c (info_menu_or_ref_item): If we didn't find a
        cross-reference on this line, try the one before.

--- info/session.c~0    Sat Nov 17 01:36:32 2001
+++ info/session.c      Thu Jan  3 11:41:26 2002
@@ -2069,7 +2069,19 @@ info_menu_or_ref_item (window, count, ke
               refs = manpage_xrefs_in_binding (window->node, &binding);
             else
 #endif /* HANDLE_MAN_PAGES */
-            refs = info_xrefs (&binding);
+           {
+             refs = info_xrefs (&binding);
+             if (!refs && point_line > 0)
+               {
+                 /* People get annoyed that Info cannot find an xref
+                    which starts on a previous line and ends on this
+                    one.  So if we fail to find a reference on this
+                    line, let's try the one before.  */
+                 binding.start =
+                   window->line_starts[point_line - 1] - binding.buffer;
+                 refs = info_xrefs (&binding);
+               }
+           }
           }
 
         if (refs)



reply via email to

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