From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: 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 Organization: LINKOV.NET Message-ID: <871rmqz96a.fsf@mail.linkov.net> References: <83d06v13h2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="3759"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 41440@debbugs.gnu.org, Warren Lynn To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 08 02:37:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ji5mn-0000sU-Or for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Jun 2020 02:37:09 +0200 Original-Received: from localhost ([::1]:39414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ji5mm-0000Yf-8u for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Jun 2020 20:37:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ji5mg-0000YI-Ch for bug-gnu-emacs@gnu.org; Sun, 07 Jun 2020 20:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ji5mg-0004OP-3m for bug-gnu-emacs@gnu.org; Sun, 07 Jun 2020 20:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ji5mg-00042B-1L for bug-gnu-emacs@gnu.org; Sun, 07 Jun 2020 20:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Jun 2020 00:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41440 X-GNU-PR-Package: emacs Original-Received: via spool by 41440-submit@debbugs.gnu.org id=B41440.159157659315454 (code B ref 41440); Mon, 08 Jun 2020 00:37:01 +0000 Original-Received: (at 41440) by debbugs.gnu.org; 8 Jun 2020 00:36:33 +0000 Original-Received: from localhost ([127.0.0.1]:55310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ji5mD-00041C-Kc for submit@debbugs.gnu.org; Sun, 07 Jun 2020 20:36:33 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:45411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ji5mC-00040v-EH for 41440@debbugs.gnu.org; Sun, 07 Jun 2020 20:36:32 -0400 X-Originating-IP: 91.129.108.6 Original-Received: from mail.gandi.net (m91-129-108-6.cust.tele2.ee [91.129.108.6]) (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 6658DFF803; Mon, 8 Jun 2020 00:36:24 +0000 (UTC) In-Reply-To: <83d06v13h2.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 May 2020 11:04:57 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181724 Archived-At: >> From: Warren Lynn >> 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"))