From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.ciao.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34150: 26.1; Document filtering with `isearch-filter-predicate' in Elisp manual Date: Mon, 21 Jan 2019 18:21:22 +0200 Message-ID: <83o98a9e2l.fsf@gnu.org> References: <8c207ca2-39ae-4ec1-acbd-358165964319@default> Injection-Info: ciao.gmane.org; posting-host="ciao.gmane.org:195.159.176.228"; logging-data="67275"; mail-complaints-to="usenet@ciao.gmane.org" Cc: 34150-done@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 21 17:23:03 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glcLm-000HPr-Fs for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Jan 2019 17:23:02 +0100 Original-Received: from localhost ([127.0.0.1]:55864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glcLk-0005Cp-S8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Jan 2019 11:23:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glcKp-0004hi-SP for bug-gnu-emacs@gnu.org; Mon, 21 Jan 2019 11:22:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glcKo-00072q-VO for bug-gnu-emacs@gnu.org; Mon, 21 Jan 2019 11:22:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41090) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1glcKo-00072W-Su for bug-gnu-emacs@gnu.org; Mon, 21 Jan 2019 11:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1glcKo-0001Ze-M3 for bug-gnu-emacs@gnu.org; Mon, 21 Jan 2019 11:22:02 -0500 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Jan 2019 16:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 34150 X-GNU-PR-Package: emacs Mail-Followup-To: 34150@debbugs.gnu.org, eliz@gnu.org, drew.adams@oracle.com Original-Received: via spool by 34150-done@debbugs.gnu.org id=D34150.15480877046022 (code D ref 34150); Mon, 21 Jan 2019 16:22:02 +0000 Original-Received: (at 34150-done) by debbugs.gnu.org; 21 Jan 2019 16:21:44 +0000 Original-Received: from localhost ([127.0.0.1]:40370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glcKW-0001Z4-Ig for submit@debbugs.gnu.org; Mon, 21 Jan 2019 11:21:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glcKU-0001Yp-KF for 34150-done@debbugs.gnu.org; Mon, 21 Jan 2019 11:21:43 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glcKP-0006eS-1m; Mon, 21 Jan 2019 11:21:37 -0500 Original-Received: from [176.228.60.248] (port=1401 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1glcKO-0007pz-M4; Mon, 21 Jan 2019 11:21:37 -0500 In-reply-to: <8c207ca2-39ae-4ec1-acbd-358165964319@default> (message from Drew Adams on Sun, 20 Jan 2019 16:17:41 -0800 (PST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:154643 Archived-At: > Date: Sun, 20 Jan 2019 16:17:41 -0800 (PST) > From: Drew Adams > > See https://emacs.stackexchange.com/q/47302/105, as one possible > motivaton. > > The only doc I can find about making Isearch and `perform-replace' (all > of its uses) ignore/exclude certain matches is the doc string of > variable `isearch-filter-predicate'. I don't see why the doc string shouldn't be enough. This is a quite obscure feature, so I don't think it warrants to be described in the manual. > And that doc string isn't very precise about the args of the predicate. > It says only: "The function has two arguments: the positions of start > and end of text matched by the search." > > It would help to add that these positions are `(match-beginning 0)' and > `(match-end 0)', respectively, and to say that the match start position > is the first of the two args. To me, "the positions of start and end of the matched text" says precisely that. I don't see what can references to match-beginning and match-end add; if anything, they might confuse, because at least some readers will be sent down the rabbit hole to the descriptions of those two, something that IMO is entirely unnecessary for writing a filter. > It would also be good to state whether predefined search functions such > as `re-search-forward' respect it. (I imagine that they do not, but I > haven't checked, and there's no doc about this AFAIK.) You could guess > no, based on the `isearch' part of the variable name. But if you guess > like that then you likely won't also guess that the variable applies to > `perform-replace' - it's not just about Isearch. I modified the doc string to mention Isearch and replace commands. > One thing that it would also be good to make extra clear is that > filtering takes place _after_ input matching; it is not part of > matching. How can it be part of matching, if the filter needs to be passed the limits of the matched text?