From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Is it valid to call isearch-filter-predicate outside isearch? Date: Thu, 01 Jun 2023 08:55:35 +0300 Message-ID: <83cz2fenfs.fsf@gnu.org> References: <875y8nks9t.fsf@localhost> <87jzwo1462.fsf@web.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37360"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 01 07:55:38 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q4bHc-0009Tv-7v for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Jun 2023 07:55:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4bH4-0001EE-AY; Thu, 01 Jun 2023 01:55:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4bGt-0001Bw-Ey for emacs-devel@gnu.org; Thu, 01 Jun 2023 01:54:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4bGr-0000yX-Vd; Thu, 01 Jun 2023 01:54:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=v/jcY+dwxtb828Sz7tFQWQf9fJJwqb7vqqMhFfCGI1w=; b=bEwaXMspbgB0 d64sLEVDE3FfTQoA6dFjf/G0LW8nqAjd4pol12S2HsKG3dxsYky+MoifJvMCtoApiM6NzaLmIy8wu gg0ObwoMQdpH4vbp38D5V1lQLXOQG9edQBNsXZ5SxhsiOt3QK01BXDdQCa1ieJ2B3T070grm0zemW lKZsh1yiXxA2OXF+4Q1pDhdAUhybw0oP95VLPANHf/amBqjfTNKZQjuijIe4YUYqLbofu9KzoRyPz fbx56qqtS/+OxC++8XAdJBgkkLe45N/fSTykN2N3m2jlpIwQGeCSJ3sKU5jVyhVBefSbX19ypIF3Q EoW6fRrTOmkGHCKRyjn0Mg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4bGr-0002or-CC; Thu, 01 Jun 2023 01:54:49 -0400 In-Reply-To: <87jzwo1462.fsf@web.de> (message from Michael Heerdegen on Thu, 01 Jun 2023 01:17:57 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306478 Archived-At: > From: Michael Heerdegen > Cc: emacs-devel@gnu.org > Date: Thu, 01 Jun 2023 01:17:57 +0200 > > Ihor Radchenko writes: > > > The documentation for `isearch-filter-visible' sounds like no side > > effects are expected: > > > > Predicate to filter hits of Isearch and replace commands. > > > > Isearch hits that don't satisfy the predicate will be skipped. > > The value should be a function of two arguments; it will be > > called with the positions of the start and the end of the text > > matched by Isearch and replace commands. If this function > > returns nil, Isearch and replace commands will continue searching > > without stopping at resp. replacing this match. > > This function is expected to be careful not to clobber the match data. > > > > Either the docstring is not accurate or the implementation of > > `isearch-range-invisible' is not safe. > > > > Am I missing something? > > No. It has does have side effects that are not documented. The question is: why do we have to document every possible nit of the internals? I still don't think I understand the rationale. People who want to know _everything_ about the code should consult the source code; it's the power of Free Software that they can do it.