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.

Full log


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"))





This bug report was last modified 4 years and 312 days ago.

Previous Next


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