From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#64178: replace-regexp ignoring value of org-search-invisible Date: Fri, 23 Jun 2023 10:46:09 +0000 Message-ID: <87fs6imp72.fsf@localhost> References: <87v8fiseja.fsf@localhost> <87mt0usaah.fsf@localhost> <875y7hhmoo.fsf@localhost> <87v8fhf747.fsf@localhost> <86ttv00z7c.fsf@mail.linkov.net> <87ttv0c4zx.fsf@localhost> <86h6qzxx2e.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27489"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bobf32@gmail.com, 64178@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 23 12:42:16 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qCeF6-0006w6-7e for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jun 2023 12:42:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCeEu-0006Ut-CW; Fri, 23 Jun 2023 06:42: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 1qCeEs-0006UW-Uq for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 06:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCeEs-0000Hb-Kc for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 06:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qCeEs-000857-Bx for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 06:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Jun 2023 10:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64178 X-GNU-PR-Package: emacs Original-Received: via spool by 64178-submit@debbugs.gnu.org id=B64178.168751688731020 (code B ref 64178); Fri, 23 Jun 2023 10:42:02 +0000 Original-Received: (at 64178) by debbugs.gnu.org; 23 Jun 2023 10:41:27 +0000 Original-Received: from localhost ([127.0.0.1]:37741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCeEJ-00084G-Et for submit@debbugs.gnu.org; Fri, 23 Jun 2023 06:41:27 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:36779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCeEG-00083z-Dx for 64178@debbugs.gnu.org; Fri, 23 Jun 2023 06:41:25 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 10EEF240104 for <64178@debbugs.gnu.org>; Fri, 23 Jun 2023 12:41:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1687516878; bh=N48si6bLg1Go52SmxDQ9wFP/xZwEH8FltcDRwzpRsr4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=KIeU/SukPMbw1xQIw9CgsprK0y3qBDadA7Wo9rghSxcyjnzz2l814g1ibiX9Za1Lu arNqOCbmLvpq4BueLz5ZCHdztjO7EBzaS2s29L50T3gjIPyDreFTNKBxjdKsZND1TG potylEGLx/8NqtisWMZGasG0k30SrdqGdKANe6a5Hg1v6s5XrupC3xx3W3Qtmkq8NV O5lAiCEeKyjOTyAxER/dHjJMHnc918KYOqu9+x5EJ6lZx9EY9O8HzX0AZro7yBhcHn 3wjBwr82phdwyUKpcj1zJSi6GOo5HRpIDr4hvCbyMcXSGysG7WHWpwYCyTTIct1FH+ 1mcIRpfcTRoKQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QnYgd1MJ5z6tw4; Fri, 23 Jun 2023 12:41:17 +0200 (CEST) In-Reply-To: <86h6qzxx2e.fsf@mail.linkov.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263943 Archived-At: Juri Linkov writes: >> It is natural to expect that zero-width matches are considered invisible >> when the surrounding text is invisible. >> >> Also, is this documented anywhere? > > This corner case doesn't seem to be documented. Probably not for > emacs-29, but something like this would require more testing: > > ... > (defun isearch-range-invisible (beg end) > "Return t if all the text from BEG to END is invisible." > - (when (/= beg end) > + (when t `when' becomes redundant here. The rest of the patch looks reasonable. The patch makes sense in general, although the patch will not solve the particular scenario we have here. In my reproducer, we have (defun test()\n\t"This is test")\n\n Note how the first newline after test() is hidden. With the patch, Emacs will perform replacement at the final "\n" only, while users will expect that "$" belongs to the previous visible line. Similarly, "^"/"\<" are expected to match the next visible line/symbol. While I do understand that the way Emacs will treat the above is logical (albeit not intuitive), but may it be possible to make interactive isearch use closer to what users expect? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at