GNU bug report logs - #41440
26.3; 'replace' argument in function 'shell-command-on-region' is assumed to be always t for rectangle selection

Previous Next

Package: emacs;

Reported by: Warren Lynn <wrn.lynn <at> gmail.com>

Date: Thu, 21 May 2020 18:54:02 UTC

Severity: normal

Found in version 26.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41440 in the body.
You can then email your comments to 41440 AT debbugs.gnu.org in the normal way.

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#41440; Package emacs. (Thu, 21 May 2020 18:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Warren Lynn <wrn.lynn <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 21 May 2020 18:54:02 GMT) Full text and rfc822 format available.

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

From: Warren Lynn <wrn.lynn <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; 'replace' argument in function 'shell-command-on-region' is
 assumed to be always t for rectangle selection
Date: Thu, 21 May 2020 14:53:05 -0400
[Message part 1 (text/plain, inline)]
Hi:

I am gladly surprised to find out function
shell-command-on-region
is supposed to work on rectangle selection also (with
'region-noncontiguous-p' set to t), but then disappointed to find out the
feature does not work. It has two problems:

1. As this email title says, argument 'replace' is assumed to be t no
matter what.
2. Even if I really want to replace the original selection with the
shell-command output, it still does not work. An error will be thrown in
function "cua--insert-rectangle" due to some argument type mismatch.

This feature will be very useful to me (and hopefully others too) and I
hope somebody can fix the above.

Thanks a lot.

Warren
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41440; Package emacs. (Sat, 23 May 2020 07:26:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Warren Lynn <wrn.lynn <at> gmail.com>
Cc: 41440 <at> debbugs.gnu.org
Subject: Re: bug#41440: 26.3;
 'replace' argument in function 'shell-command-on-region' is assumed
 to be always t for rectangle selection
Date: Sat, 23 May 2020 10:25:25 +0300
> From: Warren Lynn <wrn.lynn <at> gmail.com>
> Date: Thu, 21 May 2020 14:53:05 -0400
> 
> I am gladly surprised to find out function
> shell-command-on-region
> is supposed to work on rectangle selection also (with 'region-noncontiguous-p' set to t), but then
> disappointed to find out the feature does not work. It has two problems:
> 
> 1. As this email title says, argument 'replace' is assumed to be t no matter what.
> 2. Even if I really want to replace the original selection with the shell-command output, it still does not work.
> An error will be thrown in function "cua--insert-rectangle" due to some argument type mismatch.
> 
> This feature will be very useful to me (and hopefully others too) and I hope somebody can fix the above.

Please tell the details: how you marked the rectangle, how you invoked
shell-command-on-region, and what did you see as result.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41440; Package emacs. (Sat, 23 May 2020 08:05:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Warren Lynn <wrn.lynn <at> gmail.com>, Juri Linkov <juri <at> linkov.net>
Cc: 41440 <at> debbugs.gnu.org
Subject: Re: bug#41440: 26.3;
 'replace' argument in function 'shell-command-on-region' is assumed
 to be always t for rectangle selection
Date: Sat, 23 May 2020 11:04:57 +0300
> From: Warren Lynn <wrn.lynn <at> gmail.com>
> Date: Thu, 21 May 2020 14:53:05 -0400
> 
> I am gladly surprised to find out function
> shell-command-on-region
> is supposed to work on rectangle selection also (with 'region-noncontiguous-p' set to t), but then
> disappointed to find out the feature does not work. It has two problems:
> 
> 1. As this email title says, argument 'replace' is assumed to be t no matter what.
> 2. Even if I really want to replace the original selection with the shell-command output, it still does not work.
> An error will be thrown in function "cua--insert-rectangle" due to some argument type mismatch.
> 
> This feature will be very useful to me (and hopefully others too) and I hope somebody can fix the above.

Juri, could you please look into this?  In addition to the problem
described in the bug report, the 'region-noncontiguous-p' argument is
not mentioned in the doc string and not in the manual.  I'd like to
fix that for Emacs 27, please.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41440; Package emacs. (Sat, 23 May 2020 22:57:03 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41440 <at> debbugs.gnu.org, Warren Lynn <wrn.lynn <at> gmail.com>
Subject: Re: bug#41440: 26.3; 'replace' argument in function
 'shell-command-on-region' is assumed to be always t for rectangle
 selection
Date: Sun, 24 May 2020 01:53:33 +0300
>> I am gladly surprised to find out function
>> shell-command-on-region
>> is supposed to work on rectangle selection also (with 'region-noncontiguous-p' set to t), but then
>> disappointed to find out the feature does not work. It has two problems:
>> 
>> 1. As this email title says, argument 'replace' is assumed to be t no matter what.
>> 2. Even if I really want to replace the original selection with the shell-command output, it still does not work.
>> An error will be thrown in function "cua--insert-rectangle" due to some argument type mismatch.
>> 
>> This feature will be very useful to me (and hopefully others too) and I hope somebody can fix the above.
>
> Juri, could you please look into this?  In addition to the problem
> described in the bug report, the 'region-noncontiguous-p' argument is
> not mentioned in the doc string and not in the manual.  I'd like to
> fix that for Emacs 27, please.

This is not a bug, it was implemented so in Emacs 25.
Or you'd like to fix only documentation for Emacs 27?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41440; Package emacs. (Mon, 08 Jun 2020 00:37:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41440 <at> debbugs.gnu.org, Warren Lynn <wrn.lynn <at> gmail.com>
Subject: Re: bug#41440: 26.3; 'replace' argument in function
 'shell-command-on-region' is assumed to be always t for rectangle
 selection
Date: Mon, 08 Jun 2020 03:35:25 +0300
>> From: Warren Lynn <wrn.lynn <at> gmail.com>
>> Date: Thu, 21 May 2020 14:53:05 -0400
>> 
>> I am gladly surprised to find out function
>> shell-command-on-region
>> is supposed to work on rectangle selection also (with 'region-noncontiguous-p' set to t), but then
>> disappointed to find out the feature does not work. It has two problems:
>> 
>> 1. As this email title says, argument 'replace' is assumed to be t no matter what.
>> 2. Even if I really want to replace the original selection with the
>> shell-command output, it still does not work.
>> An error will be thrown in function "cua--insert-rectangle" due to some argument type mismatch.
>> 
>> This feature will be very useful to me (and hopefully others too) and I hope somebody can fix the above.
>
> Juri, could you please look into this?  In addition to the problem
> described in the bug report, the 'region-noncontiguous-p' argument is
> not mentioned in the doc string and not in the manual.  I'd like to
> fix that for Emacs 27, please.

Here is the docstring fix for Emacs 27:

diff --git a/lisp/simple.el b/lisp/simple.el
index 6e69f86739..69c9b68427 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3952,7 +3952,12 @@ shell-command-on-region
 
 Optional seventh arg DISPLAY-ERROR-BUFFER, if non-nil, means to
 display the error buffer if there were any errors.  When called
-interactively, this is t."
+interactively, this is t.
+
+Non-nil REGION-NONCONTIGUOUS-P means that the region is composed of
+noncontiguous pieces.  The most common example of this is a
+rectangular region, where the pieces are separated by newline
+characters."
   (interactive (let (string)
 		 (unless (mark)
 		   (user-error "The mark is not set now, so there is no region"))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41440; Package emacs. (Mon, 08 Jun 2020 14:40:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 41440 <at> debbugs.gnu.org, wrn.lynn <at> gmail.com
Subject: Re: bug#41440: 26.3; 'replace' argument in function
 'shell-command-on-region' is assumed to be always t for rectangle
 selection
Date: Mon, 08 Jun 2020 17:39:36 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: Warren Lynn <wrn.lynn <at> gmail.com>,  41440 <at> debbugs.gnu.org
> Date: Mon, 08 Jun 2020 03:35:25 +0300
> 
> > Juri, could you please look into this?  In addition to the problem
> > described in the bug report, the 'region-noncontiguous-p' argument is
> > not mentioned in the doc string and not in the manual.  I'd like to
> > fix that for Emacs 27, please.
> 
> Here is the docstring fix for Emacs 27:

LGTM, thanks.

Are you also looking into the rest of the bug report?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41440; Package emacs. (Mon, 08 Jun 2020 23:39:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41440 <at> debbugs.gnu.org, wrn.lynn <at> gmail.com
Subject: Re: bug#41440: 26.3; 'replace' argument in function
 'shell-command-on-region' is assumed to be always t for rectangle
 selection
Date: Tue, 09 Jun 2020 02:35:53 +0300
>> > Juri, could you please look into this?  In addition to the problem
>> > described in the bug report, the 'region-noncontiguous-p' argument is
>> > not mentioned in the doc string and not in the manual.  I'd like to
>> > fix that for Emacs 27, please.
>> 
>> Here is the docstring fix for Emacs 27:
>
> LGTM, thanks.

Pushed docstring fix to emacs-27.

> Are you also looking into the rest of the bug report?

The first part of the original report asks for a new feature,
now I implemented it in master in commit 3b93549597.

The second part reports a bug, but I can't reproduce it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41440; Package emacs. (Tue, 09 Jun 2020 14:27:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 41440 <at> debbugs.gnu.org, wrn.lynn <at> gmail.com
Subject: Re: bug#41440: 26.3; 'replace' argument in function
 'shell-command-on-region' is assumed to be always t for rectangle
 selection
Date: Tue, 09 Jun 2020 17:26:25 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: wrn.lynn <at> gmail.com,  41440 <at> debbugs.gnu.org
> Date: Tue, 09 Jun 2020 02:35:53 +0300
> 
> Pushed docstring fix to emacs-27.
> 
> > Are you also looking into the rest of the bug report?
> 
> The first part of the original report asks for a new feature,
> now I implemented it in master in commit 3b93549597.
> 
> The second part reports a bug, but I can't reproduce it.

OK, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41440; Package emacs. (Tue, 09 Jun 2020 23:06:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41440 <at> debbugs.gnu.org, wrn.lynn <at> gmail.com
Subject: Re: bug#41440: 26.3; 'replace' argument in function
 'shell-command-on-region' is assumed to be always t for rectangle
 selection
Date: Wed, 10 Jun 2020 02:03:49 +0300
>> Pushed docstring fix to emacs-27.
>> 
>> > Are you also looking into the rest of the bug report?
>> 
>> The first part of the original report asks for a new feature,
>> now I implemented it in master in commit 3b93549597.
>> 
>> The second part reports a bug, but I can't reproduce it.
>
> OK, thanks.

Actually, I found where the bug was, and pushed the fix to emacs-27
in the commit 22f4fba8a9.

Now we have to wait when Warren will have time to confirm
if everything is alright.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41440; Package emacs. (Mon, 24 Aug 2020 00:38:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Juri Linkov <juri <at> linkov.net>
Cc: 41440 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, wrn.lynn <at> gmail.com
Subject: Re: bug#41440: 26.3; 'replace' argument in function
 'shell-command-on-region' is assumed to be always t for rectangle selection
Date: Sun, 23 Aug 2020 20:36:58 -0400
Juri Linkov <juri <at> linkov.net> writes:

>>> Pushed docstring fix to emacs-27.
>>>
>>> > Are you also looking into the rest of the bug report?
>>>
>>> The first part of the original report asks for a new feature,
>>> now I implemented it in master in commit 3b93549597.
>>>
>>> The second part reports a bug, but I can't reproduce it.
>>
>> OK, thanks.
>
> Actually, I found where the bug was, and pushed the fix to emacs-27
> in the commit 22f4fba8a9.
>
> Now we have to wait when Warren will have time to confirm
> if everything is alright.

Warren, did you have time to test if Juri's fix solved the problem?

If I don't hear back from you within a couple of weeks, I'll just
assume this has been fixed and close this bug.  Thanks.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41440; Package emacs. (Thu, 01 Oct 2020 03:14:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 41440 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, wrn.lynn <at> gmail.com,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#41440: 26.3; 'replace' argument in function
 'shell-command-on-region' is assumed to be always t for rectangle
 selection
Date: Thu, 01 Oct 2020 05:13:39 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

>> Now we have to wait when Warren will have time to confirm
>> if everything is alright.
>
> Warren, did you have time to test if Juri's fix solved the problem?
>
> If I don't hear back from you within a couple of weeks, I'll just
> assume this has been fixed and close this bug.  Thanks.

This was five weeks ago, so I'm now closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 41440 <at> debbugs.gnu.org and Warren Lynn <wrn.lynn <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 01 Oct 2020 03:14:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 29 Oct 2020 11:24:06 GMT) Full text and rfc822 format available.

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

Previous Next


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