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#11378: 24.1.50; Suggestion: Let M-i in isearch cycle `search-invisible' Date: Wed, 30 May 2012 03:40:05 +0300 Organization: JURTA Message-ID: <87vcjesccy.fsf@mail.jurta.org> References: <87haw32hly.fsf@web.de> <87397m6oxf.fsf@mail.jurta.org> <87y5pcdzxx.fsf@mail.jurta.org> <874nqzgcuk.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1338341324 6879 80.91.229.3 (30 May 2012 01:28:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 May 2012 01:28:44 +0000 (UTC) Cc: michael_heerdegen@web.de, 11378@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 30 03:28:43 2012 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 1SZXiM-0004eK-Er for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 May 2012 03:28:42 +0200 Original-Received: from localhost ([::1]:34426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZXiM-0000rm-18 for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 May 2012 21:28:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZXiI-0000ix-M8 for bug-gnu-emacs@gnu.org; Tue, 29 May 2012 21:28:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SZXiG-0002ug-PQ for bug-gnu-emacs@gnu.org; Tue, 29 May 2012 21:28:38 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZXiG-0002ub-ML for bug-gnu-emacs@gnu.org; Tue, 29 May 2012 21:28:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SZXje-0006Xf-Ag for bug-gnu-emacs@gnu.org; Tue, 29 May 2012 21:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 May 2012 01:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11378 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11378-submit@debbugs.gnu.org id=B11378.133834136325066 (code B ref 11378); Wed, 30 May 2012 01:30:02 +0000 Original-Received: (at 11378) by debbugs.gnu.org; 30 May 2012 01:29:23 +0000 Original-Received: from localhost ([127.0.0.1]:48995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SZXj1-0006WF-0a for submit@debbugs.gnu.org; Tue, 29 May 2012 21:29:23 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:55576 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SZXiy-0006W2-7Z for 11378@debbugs.gnu.org; Tue, 29 May 2012 21:29:21 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id C9C9F451C96A; Tue, 29 May 2012 18:27:51 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Tue, 29 May 2012 14:22:27 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:60491 Archived-At: > I suggest renaming it to isearch-filter-predicates or > isearch-filter-functions. isearch-filter-functions is more usual name for the hook-like functionality than isearch-filter-predicates. > Also the docstring should describe its > `isearch-message-prefix' property (BTW, why "prefix"?). The prefix is what's displayed before the search string in the message. The suffix is after the search string in square brackets. >> +Type \\[isearch-toggle-filter-strings] to toggle searching inside strings. >> +Type \\[isearch-toggle-filter-comments] to toggle searching inside comments. > > To me, the most useful filter would be "search in comments and strings" > or "search in code only (i.e. exclude comments and strings)", neither of > which is covered by those two toggles. Then the combination of comments and strings could be named "text" with its filter bound to `M-s f t'. And the inverse filter to exclude comments and strings could be bound to `M-s f T'. Also it could be enabled only in prog-mode. >> @@ -2489,13 +2560,11 @@ (defun isearch-search () >> (setq isearch-case-fold-search >> (isearch-no-upper-case-p isearch-string isearch-regexp))) >> (condition-case lossage >> - (let ((inhibit-point-motion-hooks >> - (and (eq isearch-filter-predicate 'isearch-filter-visible) >> - search-invisible)) >> + (let ((inhibit-point-motion-hooks search-invisible) >> (inhibit-quit nil) >> (case-fold-search isearch-case-fold-search) >> (search-spaces-regexp search-whitespace-regexp) > > Why is this correct? I believe that binding `inhibit-point-motion-hooks' to t unconditionally shouldn't cause an unwanted effect because `isearch-done' takes care about moving point outside of intangible text at the end of the search (the source lines that begin with the comment ";; If we ended in the middle of some intangible text, move to the further end of that intangible text.") But currently I know no test case to prove the effect of `inhibit-point-motion-hooks'. BTW, in etc/TODO I noticed this task: *** Outlining **** Support for incremental search automatically making hidden text visible. It seems this is already implemented at least for outline (but needs more testing in org-mode). Anyway I intend to rewrite the filter `isearch-filter-visible' to just check if the text is visible. The code that opens overlays should be moved to the main search loop to work independently from the filter.