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

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

Re: search in Info should not find "File", "Node" etc. in header


From: Juri Linkov
Subject: Re: search in Info should not find "File", "Node" etc. in header
Date: Sun, 31 Oct 2004 16:32:01 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

"Drew Adams" <address@hidden> writes:
> It's quite another thing to argue that 1) this bug has always been there (so
> it's OK), 2) this isn't a bug (though it's an annoyance), or 3) fixing this
> bug would mean treating a special implementation case.
>
> Call it an "annoyance" if you like. I call it a bug. The navigational
> keywords have no business being searched.

I would not call it a bug.  However, there is a real bug:
when `Info-use-header-line' is `t', part of the Info header
(prev/up/next links) is moved to the header line.  But Info-search
still searches in the hidden header parts, and when it finds a string
in the hidden part of the header it places the point at the end of the
header even if the found string is not visible there.

Fixing this bug requires adding complex code which takes into
account the value of `Info-use-header-line' and skips some parts
of the header line.  This looks wrong to me.  I think it's better
to skip the whole header line with the following simple change:

Index: lisp/info.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/info.el,v
retrieving revision 1.406
diff -u -r1.406 info.el
--- lisp/info.el        28 Oct 2004 09:01:13 -0000      1.406
+++ lisp/info.el        31 Oct 2004 13:12:10 -0000
@@ -1480,7 +1480,9 @@
                      (or (null found)
                          (if backward
                               (isearch-range-invisible found beg-found)
-                            (isearch-range-invisible beg-found found))))
+                            (isearch-range-invisible beg-found found))
+                          (save-excursion (forward-line -1)
+                                          (looking-at "\^_"))))
            (if (if backward
                     (re-search-backward regexp bound t)
                   (re-search-forward regexp bound t))
@@ -1538,7 +1540,9 @@
                            (or (null found)
                                (if backward
                                     (isearch-range-invisible found beg-found)
-                                  (isearch-range-invisible beg-found found))))
+                                  (isearch-range-invisible beg-found found))
+                                (save-excursion (forward-line -1)
+                                                (looking-at "\^_"))))
                  (if (if backward
                           (re-search-backward regexp nil t)
                         (re-search-forward regexp nil t))

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





reply via email to

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