all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: nljlistbox2@gmail.com (N. Jackson)
To: 20092@debbugs.gnu.org
Subject: bug#20092: 24.4.91; False matches with incremental search in Info
Date: Thu, 12 Mar 2015 00:31:56 -0300	[thread overview]
Message-ID: <87zj7ix55f.fsf@moondust.localdomain> (raw)
In-Reply-To: <87egov3udi.fsf@moondust.localdomain> (N. Jackson's message of "Wed, 11 Mar 2015 21:57:29 -0300")

At 21:57 -0300 on Wednesday 2015-03-11, N. Jackson wrote:

> In the top level node of Emacs Info, incremental search is matching text
> that isn't there.
>
> My search text was "sage". Repeatedly pressing C-s, I get four or five
> correct matches, then I end up in the "GNU C library functions and
> macros" section where I get several false matches with point placed at
> the end of the line. (E.g. On the entry "err: (libc)".)
>
> I'm guessing there is some invisible text there (I don't know how I can
> check; switching to fundamental mode reveals nothing), but probably
> I-search shouldn't be finding it.

Further to my report, I did a bit of poking around.

Setting the variable Info-hide-note-references to nil allows me to see
the invisible text.

An example of an entry that was showing a false match for "sage" was

    * err: (libc)

and setting Info-hide-note-references to nil, this displays as

    * err: (libc)Error Messages.
                          ^^^^
which at least shows what I-search was finding.

For me the value of search-invisible is `open' (which I assume is the
default). The bug does *not* manifest itself when I set search-invisible
to nil.

I found this function in info.el:

#+BEGIN_SRC emacs-lisp
    (defun Info-isearch-filter (beg-found found)
      "Test whether the current search hit is a visible useful text.
    Return non-nil if the text from BEG-FOUND to FOUND is visible
    and is not in the header line or a tag table."
      (save-match-data
	(let ((backward (< found beg-found)))
	  (not
	   (or
	    (and (not search-invisible)
		 (if backward
		     (or (text-property-not-all found beg-found 'invisible nil)
			 (text-property-not-all found beg-found 'display nil))
		   (or (text-property-not-all beg-found found 'invisible nil)
		       (text-property-not-all beg-found found 'display nil))))
	    ;; Skip node header line
	    (and (save-excursion (forward-line -1)
				 (looking-at "\^_"))
		 (forward-line (if backward -1 1)))
	    ;; Skip Tag Table node
	    (save-excursion
	      (and (search-backward "\^_" nil t)
		   (looking-at
		    "\^_\n\\(Tag Table\\|Local Variables\\)"))))))))
#+END_SRC

I don't know elisp, but if this function is relevant here (I have no
idea if it is and I don't even know if runs in this context; I didn't
try running the debugger yet as I don't yet know how) and if it is
intended to make I-search ignore the invisible text, then the

    (not search-invisible)

form looks suspect perhaps?

    (not 'open) => nil
    (not t)  => nil
    (not nil) => t

So here, for search-invisible to be `open' is equivalent to it being t
which would explain the buggy behaviour that I see. Or am I missing
something?

Thanks.






  reply	other threads:[~2015-03-12  3:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12  0:57 bug#20092: 24.4.91; False matches with incremental search in Info N. Jackson
2015-03-12  3:31 ` N. Jackson [this message]
2015-03-12 14:29   ` N. Jackson
2015-03-12 19:16     ` Stefan Monnier
2015-03-12 19:45       ` Juri Linkov
2015-03-13  1:12         ` Stefan Monnier
2020-08-25  9:40         ` Lars Ingebrigtsen
2020-08-25 18:32           ` Juri Linkov
2021-05-10 11:26             ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zj7ix55f.fsf@moondust.localdomain \
    --to=nljlistbox2@gmail.com \
    --cc=20092@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.