From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#20092: 24.4.91; False matches with incremental search in Info Date: Thu, 12 Mar 2015 21:45:33 +0200 Organization: LINKOV.NET Message-ID: <878uf2dmow.fsf@mail.linkov.net> References: <87egov3udi.fsf@moondust.localdomain> <87zj7ix55f.fsf@moondust.localdomain> <87bnjy9tn2.fsf@moondust.localdomain> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426189637 25866 80.91.229.3 (12 Mar 2015 19:47:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Mar 2015 19:47:17 +0000 (UTC) Cc: 20092@debbugs.gnu.org, "N. Jackson" To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 12 20:47:10 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YW94X-0006cm-OU for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Mar 2015 20:47:09 +0100 Original-Received: from localhost ([::1]:33689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW94X-0000R2-4b for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Mar 2015 15:47:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW94T-0000Qi-8y for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 15:47:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YW94Q-0004Ib-En for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 15:47:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW94Q-0004IT-Br for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 15:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YW94Q-0002Dj-5u for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 15:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Mar 2015 19:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20092 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20092-submit@debbugs.gnu.org id=B20092.14261896078515 (code B ref 20092); Thu, 12 Mar 2015 19:47:02 +0000 Original-Received: (at 20092) by debbugs.gnu.org; 12 Mar 2015 19:46:47 +0000 Original-Received: from localhost ([127.0.0.1]:44269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YW94A-0002DH-VN for submit@debbugs.gnu.org; Thu, 12 Mar 2015 15:46:47 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.222.226]:41043 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YW949-0002D9-3I for 20092@debbugs.gnu.org; Thu, 12 Mar 2015 15:46:45 -0400 Original-Received: from localhost.linkov.net (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 0AE453032165BB; Thu, 12 Mar 2015 12:46:42 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Thu, 12 Mar 2015 15:16:30 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100419 Archived-At: >> 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'.