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

To reply to this bug, email your comments to 27926 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#27926; Package emacs. (Wed, 02 Aug 2017 22:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 02 Aug 2017 22:42:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.2; Let arg REGION-NONCONTIGUOUS-P do more
Date: Wed, 2 Aug 2017 15:41:01 -0700 (PDT)
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).


In GNU Emacs 25.2.1 (x86_64-w64-mingw32)
 of 2017-04-24 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --without-dbus --without-compress-install 'CFLAGS=-O2
 -static -g3''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27926; Package emacs. (Sat, 15 Mar 2025 12:17:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 27926 <at> debbugs.gnu.org
Subject: Re: bug#27926: 25.2; Let arg REGION-NONCONTIGUOUS-P do more
Date: Sat, 15 Mar 2025 05:16:08 -0700
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.

Thanks.




Added tag(s) moreinfo. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 15 Mar 2025 12:17:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27926; Package emacs. (Sat, 15 Mar 2025 16:59:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: "27926 <at> debbugs.gnu.org" <27926 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#27926: 25.2; Let arg REGION-NONCONTIGUOUS-P
 do more
Date: Sat, 15 Mar 2025 16:58:52 +0000
> 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.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27926; Package emacs. (Sun, 16 Mar 2025 08:02:04 GMT) Full text and rfc822 format available.

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 89 days ago.

Previous Next


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