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: Wed, 31 May 2023 17:21:51 +0300 Message-ID: <83ttvseg3k.fsf@gnu.org> References: <875y8nks9t.fsf@localhost> <86pm6sb5g8.fsf@mail.linkov.net> <87ttvsn77s.fsf@localhost> <83edmwfz6p.fsf@gnu.org> <87r0qwk6bz.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10008"; mail-complaints-to="usenet@ciao.gmane.io" Cc: juri@linkov.net, emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 31 16:22:03 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 1q4MiA-0002Ju-Mg for ged-emacs-devel@m.gmane-mx.org; Wed, 31 May 2023 16:22:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4MhL-0003n5-HA; Wed, 31 May 2023 10:21:11 -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 1q4MhK-0003mj-CV for emacs-devel@gnu.org; Wed, 31 May 2023 10:21:10 -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 1q4MhH-0002H3-IF; Wed, 31 May 2023 10:21:07 -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=W8Heq8P5PAaPaMc6AKK+geQo3HUTQcSPBLn/EZA3UzA=; b=kzerCMV4EF7D usT6H5B1n5NqMhFEOD7Y/VGlwG43ujMnbYE0fzLknIyh+Sa4pecYhHyiCb+lmXqPrQUbE8J6qBEe9 nukhpxWUsJw+Loi5TcY14lDekokVay0VjYYyUdLPPBrKCmgrilYCZXQbVnJqgv9v/L0v2qUnd/LKr 3Jw5YdyKlAL5Pkzme08MBBbjS0a/9MvAX3cTZ4P/N+h8Yn1HHa89AjjHBfBBR2T+swh/1jhKLm8St EOHyGrtRxJv5ofDBFC1Cva/0l7GDloShznH6WaAOEb+8Wz5/YeZuWPPHCi8p1V+g262TqJW0kE8iH 2hYyVLW2U+i4kik2pZuiWQ==; 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 1q4MhG-0006YX-UJ; Wed, 31 May 2023 10:21:07 -0400 In-Reply-To: <87r0qwk6bz.fsf@localhost> (message from Ihor Radchenko on Wed, 31 May 2023 12:56:16 +0000) 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:306448 Archived-At: > From: Ihor Radchenko > Cc: juri@linkov.net, emacs-devel@gnu.org > Date: Wed, 31 May 2023 12:56:16 +0000 > > I expected `isearch-filter-predicate' to be only used by isearch in > isearch-mode. And thus I expected `isearch-mode-end-hook' to be called > later. > > Isn't it a natural expectation? Evidently, that ship sailed a long time ago: "grep isearch-" yields more than 60 hits in replace.el. And then there are many hits in comint.el, dired-aux.el, info.el, and even in simple.el. > > In general, a predicate is not expected to have side effects, it is > > expected to return a boolean value and leave everything else intact. > > > > (I also don't understand what does isearch-range-invisible have to do > > with this.) > > `isearch-range-invisible' can modify `isearch-opened-overlays' and > `isearch-hidden' by side effect. Yes, but why it is relevant to your problem?