From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#11378: 24.1.50; Suggestion: Let M-i in isearch cycle `search-invisible' Date: Tue, 29 May 2012 14:22:27 -0400 Message-ID: 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 1338315774 14633 80.91.229.3 (29 May 2012 18:22:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 29 May 2012 18:22:54 +0000 (UTC) Cc: michael_heerdegen@web.de, 11378@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 29 20:22:53 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 1SZR4B-0000Kk-VN for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 May 2012 20:22:48 +0200 Original-Received: from localhost ([::1]:42244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZR4B-0002EN-KJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 May 2012 14:22:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZR44-0002DT-0R for bug-gnu-emacs@gnu.org; Tue, 29 May 2012 14:22:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SZR42-0001Q6-4s for bug-gnu-emacs@gnu.org; Tue, 29 May 2012 14:22:39 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZR42-0001Px-10 for bug-gnu-emacs@gnu.org; Tue, 29 May 2012 14:22:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SZR5N-0005Mo-Tq for bug-gnu-emacs@gnu.org; Tue, 29 May 2012 14:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 May 2012 18:24:01 +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.133831584120623 (code B ref 11378); Tue, 29 May 2012 18:24:01 +0000 Original-Received: (at 11378) by debbugs.gnu.org; 29 May 2012 18:24:01 +0000 Original-Received: from localhost ([127.0.0.1]:48706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SZR5M-0005Ma-Qm for submit@debbugs.gnu.org; Tue, 29 May 2012 14:24:01 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:17572) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SZR5K-0005MK-R3 for 11378@debbugs.gnu.org; Tue, 29 May 2012 14:23:59 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09MCpYd/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCws0EhQYDSSIHAW6CZBEA6MzgViDBQ X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="183811258" Original-Received: from 76-10-150-29.dsl.teksavvy.com (HELO pastel.home) ([76.10.150.29]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 29 May 2012 14:22:28 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 21B3E58F58; Tue, 29 May 2012 14:22:27 -0400 (EDT) In-Reply-To: <874nqzgcuk.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 29 May 2012 19:40:19 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) 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:60474 Archived-At: > This is implemented by the following patch that also simplifies > the filter usage in other packages and adds two useful filters for > comments/strings: Thanks, see comments below. > -(defvar isearch-filter-predicate 'isearch-filter-visible > - "Predicate that filters the search hits that would normally be available. > -Search hits that dissatisfy the predicate are skipped. The function > -has two arguments: the positions of start and end of text matched by > -the search. If this function returns nil, continue searching without > -stopping at this match.") > +(defvar isearch-filter-predicate '(isearch-filter-visible) > + "Predicates that filter the search hits that would normally be available. > +Search hits that dissatisfy the list of predicates are skipped. > +Each function in this list has two arguments: the positions of > +start and end of text matched by the search. > +If `run-hook-with-args-until-failure' returns nil for all predicates, > +continue searching without stopping at this match.") I suggest renaming it to isearch-filter-predicates or isearch-filter-functions. Also the docstring should describe its `isearch-message-prefix' property (BTW, why "prefix"?). > +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. > +(defsubst isearch-filter-predicate-state (frame) > + "Return the filter predicates in FRAME." > + (aref frame 12)) Any taker for (defstruct isearch--state ...)? > + (nth 3 (parse-partial-sexp (point-min) (point)))) [...] > + (nth 4 (parse-partial-sexp (point-min) (point)))) Please use syntax-ppss instead. > @@ -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? Stefan