GNU bug report logs - #27926
25.2; Let arg REGION-NONCONTIGUOUS-P do more

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 2 Aug 2017 22:42:02 UTC

Severity: wishlist

Tags: moreinfo

Found in version 25.2

Full log


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

From: Po Lu <luangruo <at> yahoo.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Stefan Kangas <stefankangas <at> gmail.com>,
 "27926 <at> debbugs.gnu.org" <27926 <at> debbugs.gnu.org>
Subject: Re: bug#27926: 25.2; Let arg REGION-NONCONTIGUOUS-P do more
Date: Sun, 16 Mar 2025 16:01:18 +0800
Drew Adams <drew.adams <at> oracle.com> writes:

>> Drew Adams <drew.adams <at> oracle.com> writes:
>> 
>> > In `replace.el', some replacment commands now accept optional arg
>> > REGION-NONCONTIGUOUS-P, to allow replacement over the rectangular
>> > region (really, over any list of dotted position pairs (START . END)).
>> >
>> > Currently the arg is just a Boolean.  Please consider changing the
>> > behavior of the commands in this way:
>> >
>> > Let non-nil continue to mean the same thing: respect limits such as
>> > those that are returned by the value of `region-extract-function'.
>> > But allow two particular non-nil values to control that behavior in
>> > different ways, instead of requiring that code use
>> > `region-extract-function':
>> >
>> >   * A function as arg value would mean use what that function returns
>> >     instead of applying the function that is the value of
>> >     `region-extract-function' to `bounds' and using what that returns.
>> >     This can be handy in some contexts, just as binding
>> >     `region-extract-function' can be handy in other contexts.
>> >
>> >   * A non-function (i.e., non-lambda) list as arg value would be
>> >     expected to have the form of a value that `region-extract-function'
>> >     applied to `bounds' returns, and it would be used directly, instead
>> >     of invoking `region-extract-function' to get the list of zone limits.
>> >     This can be handy in still other contexts, where the limits might
>> >     already be available - no need to bind `region-extract-function' to
>> >     a function like (lambda (_ignore) THE-KNOWN-LIMITS).
>> 
>> What is the use case here?  Please show some example code before and after
>> making this change, and explain (as briefly as humanly possibly) what are the
>> benefits of making the above change.
>> 
>> It is hard to consider this in its current form.
>
> Sorry, but I don't think it is. I'd completely forgotten about this
> request, but reading it now I find it 100% clear. Please take the time
> to read it carefully, as I took the time to specify it carefully.
> Thx.

I agree.  It is simply a request that these parameters to replacement
commands should accept alternative means of extracting non-contiguous
regions, whether functions equivalent to `region-extract-function' (but
otherwise than from the said variable), or by accepting the list of a
non-contiguous region's segments directly.




This bug report was last modified 90 days ago.

Previous Next


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