GNU bug report logs - #56374
27.2; Occur with non-contiguous regions

Previous Next

Package: emacs;

Reported by: Magnus Nilsson <magnus.nilsson <at> alumni.chalmers.se>

Date: Sun, 3 Jul 2022 22:39:01 UTC

Severity: normal

Found in version 27.2

Full log


Message #8 received at 56374 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Magnus Nilsson <magnus.nilsson <at> alumni.chalmers.se>
Cc: 56374 <at> debbugs.gnu.org
Subject: Re: bug#56374: 27.2; Occur with non-contiguous regions
Date: Mon, 04 Jul 2022 09:31:17 +0300
> 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?




This bug report was last modified 3 years and 37 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.