From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#56374: 27.2; Occur with non-contiguous regions Date: Mon, 04 Jul 2022 09:31:17 +0300 Organization: LINKOV.NET Message-ID: <86y1x9fky2.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32114"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 56374@debbugs.gnu.org To: Magnus Nilsson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 04 08:36:35 2022 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 1o8FhC-0008Ep-NG for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 08:36:34 +0200 Original-Received: from localhost ([::1]:49052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8FhB-0006AX-8Y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 02:36:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Fgg-00069H-JM for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 02:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8Fgg-0004St-6O for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 02:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o8Fgg-0000i5-3c for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 02:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Jul 2022 06:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56374 X-GNU-PR-Package: emacs Original-Received: via spool by 56374-submit@debbugs.gnu.org id=B56374.16569165342683 (code B ref 56374); Mon, 04 Jul 2022 06:36:02 +0000 Original-Received: (at 56374) by debbugs.gnu.org; 4 Jul 2022 06:35:34 +0000 Original-Received: from localhost ([127.0.0.1]:45958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8Fg8-0000h8-OF for submit@debbugs.gnu.org; Mon, 04 Jul 2022 02:35:34 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:42759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8Fg6-0000gt-Sd for 56374@debbugs.gnu.org; Mon, 04 Jul 2022 02:35:27 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id B09F8E0009; Mon, 4 Jul 2022 06:35:19 +0000 (UTC) In-Reply-To: (Magnus Nilsson's message of "Mon, 4 Jul 2022 00:37:58 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:236033 Archived-At: > In the help text for 'occur' it indicates that it should be able to work > on non-contiguous regions (i.e., a list of cons cells on the form (START > . END)). However, when I tried this in both Emacs 27 and 28, this > doesn't work when I mark a rectangular region. It only catches > occurrances found within the bounds of the first cons cell. Like bug#14013 now has a patch that implements support for any regexp including "^.*$" on a non-contiguous region, occur should be improved to use the same search function. (Also all artificial restrictions on handling only the first cons cell in occur should be lifted.) > My intention was to override (region-bounds) within a let statement to > return a non-contiguous region of interest (in the form of a list of > cons cells) and let 'occur' work on that non-contiguous > region. Unfortunately, this didn't work out as I planned. It would be > neat if this could be fixed for upcoming versions. Do you expect that 'occur' should accept a non-contiguous region in its argument REGION? This is not how perform-replace works. The query-replace commands send the boolean value of '(region-noncontiguous-p)' to perform-replace argument 'region-noncontiguous-p', then perform-replace extracts it with '(funcall region-extract-function 'bounds)'. Do you agree that 'occur' could do the same?