unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 20092@debbugs.gnu.org, "N. Jackson" <nljlistbox2@gmail.com>
Subject: bug#20092: 24.4.91; False matches with incremental search in Info
Date: Thu, 12 Mar 2015 21:45:33 +0200	[thread overview]
Message-ID: <878uf2dmow.fsf@mail.linkov.net> (raw)
In-Reply-To: <jwvk2ymuj2o.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Thu, 12 Mar 2015 15:16:30 -0400")

>> confusing behaviour that prompted me to report this bug.); and 3) if the
>> value of search-invisible is `open' then the chunk of invisible text is
>> made visible ("opened") temporarilly, and the match shown within it.
>
> That's right.  But currently `open' doesn't actually work for text
> that's hidden via text-properties (as opposed to overlays).  I think
> that's the problem you bumped into.

Since Info doesn't open invisible text, then maybe `Info-mode' should
set the buffer-local value of `search-invisible' to nil?

diff --git a/lisp/info.el b/lisp/info.el
index 0159661..2c73639 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -4305,6 +4305,7 @@ (define-derived-mode Info-mode nil "Info" ;FIXME: Derive from special-mode?
   (setq-local isearch-wrap-function #'Info-isearch-wrap)
   (setq-local isearch-push-state-function #'Info-isearch-push-state)
   (setq-local isearch-filter-predicate #'Info-isearch-filter)
+  (setq-local search-invisible nil)
   (setq-local revert-buffer-function #'Info-revert-buffer-function)
   (setq-local font-lock-defaults '(Info-mode-font-lock-keywords t t))
   (Info-set-mode-line)

> I'm not sure what's the best and/or simplest way to fix it.
> Maybe a first step would be to emit a message explaining that the match
> is inside hidden text (at least so the user gets a clue about what's
> going on).

Like in the message prefix?

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 191ec82..4bc2129 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2526,6 +2526,7 @@ (defun isearch-message-prefix (&optional ellipsis nonincremental)
 		    (multi-isearch-buffer-list "multi-buffer ")
 		    (t ""))
 		   (or isearch-message-prefix-add "")
+		   (if isearch-hidden "hidden " "")
 		   (if nonincremental "search" "I-search")
 		   (if isearch-forward "" " backward")
 		   (if current-input-method

Or maybe better in the message suffix?

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 191ec82..4bc2129 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2544,6 +2545,7 @@ (defun isearch-message-suffix (&optional c-q-hack)
 	  (if isearch-error
 	      (concat " [" isearch-error "]")
 	    "")
+	  (if isearch-hidden " [hidden]" "")
 	  (or isearch-message-suffix-add "")))

>> In any case looking at the code, it does actually toggle
>> (between nil and t), but also changes `open' to nil, and then one can
>> never "toggle" back to `open'.
>
> That's indeed another problem that should be fixed.

I can't reproduce this problem: after `C-s M-s i M-s i'
isearch-invisible is still `open'.





  reply	other threads:[~2015-03-12 19:45 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
2015-03-12 14:29   ` N. Jackson
2015-03-12 19:16     ` Stefan Monnier
2015-03-12 19:45       ` Juri Linkov [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=878uf2dmow.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=20092@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=nljlistbox2@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).