From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71081: 30.0.50; shell-command-on-region outputs boilerplate text on Windows Date: Wed, 22 May 2024 17:53:22 +0300 Message-ID: <86zfsh6gpp.fsf@gnu.org> References: <875xv8qqlv.fsf@localhost> <86y1848g3a.fsf@gnu.org> <863fc61b-5ad5-47e5-9f95-96cdcfcfd016@gutov.dev> <8634qa8tp0.fsf@gnu.org> <87le42jcj0.fsf@localhost> <86a5ki6kf1.fsf@gnu.org> <875xv5kjmg.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17125"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 71081@debbugs.gnu.org, matt@excalamus.com To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 22 16:54:10 2024 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 1s9nM1-0004DU-Sb for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 May 2024 16:54:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9nLs-00052d-3q; Wed, 22 May 2024 10:54:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9nLp-000521-Qm for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 10:53:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s9nLp-0007SZ-Ho for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 10:53:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s9nLv-0003tR-AT for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 10:54:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2024 14:54:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71081 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 71081-submit@debbugs.gnu.org id=B71081.171638962014927 (code B ref 71081); Wed, 22 May 2024 14:54:03 +0000 Original-Received: (at 71081) by debbugs.gnu.org; 22 May 2024 14:53:40 +0000 Original-Received: from localhost ([127.0.0.1]:56402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9nLY-0003sh-5p for submit@debbugs.gnu.org; Wed, 22 May 2024 10:53:40 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9nLW-0003sb-2q for 71081@debbugs.gnu.org; Wed, 22 May 2024 10:53:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9nLK-0007Ox-Px; Wed, 22 May 2024 10:53:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=DW7dRTA/LcxmcQpESeWfJTZBNaCPoi8C6kmG8+stXhI=; b=Hn+z6nLHqWID v7qsGzVapHaxjbkwebQ1ft1hit/6mGDrhbCxAJ32fBLr0CTdsA5rnFfKPUqgZ1eUUpcLY1YZ/YyOo zkvfFAwhUi1q3JGMW/MO/Y0TXx3bWes5F9mGVADqqzjAbIS8Lhug5ZjWWKiEPAi/W18eP5fWkRHPm ZlYDff6d19TzkZQCBtlILg8UkgMQWJLMdAw/t0t4VKYZfBF23of2oSp8IRWtWyrxatfmERTd+1tY/ dCAT2i7CHEEwQMj76hXOKP+9MJArz+72H/2ubGWWz7zUBqNeg4HcHDHsXBJJoXuMRP6dgY78p7PQ6 kzv4noC/wGXYnVBQdqQdbA==; In-Reply-To: <875xv5kjmg.fsf@localhost> (message from Ihor Radchenko on Wed, 22 May 2024 14:26:47 +0000) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285635 Archived-At: > From: Ihor Radchenko > Cc: dmitry@gutov.dev, 71081@debbugs.gnu.org, matt@excalamus.com > Date: Wed, 22 May 2024 14:26:47 +0000 > > Eli Zaretskii writes: > > > The easiest way of solving this conundrum is to create a temporary > > batch file, insert all the commands into it, with the first line being > > > > @echo off > > > > and then submit the name of that batch file to the Windows shell as > > the sole command-line argument after shell-command-switch. So my > > recommendation is to do just that, on Windows. > > May it be something you also want to do for `shell-command-on-region'? No, because in general the region is some text we want to give a program as input. The usual "program" in these cases is not the shell, but some program that gets the text and processes it in some way. So in most "usual" uses of shell-command-on-region, going through a batch file is an unnecessary overhead. > At the end, the current Emacs behaviour is unexpected from the user > perspective Only if the user is not aware of cmd.exe's different (some say idiosyncratic) behavior wrt commands you pipe into its stdin, and wrt command lines that include newlines. If the user _is_ aware of that, the behavior is very expected. > even though it is a result of the cmd.exe behaviour. If there is a > workable workaround, `shell-command-on-region' and Org mode may as > well use it; preferably implemented on Emacs side to not duplicate > the code. I use Emacs for 30 years, and it's the first time I hear about such a strange use of shell-command-on-region. When I will have finished wondering whatever gave Org developers this crazy idea, my next question would be whether indeed this strange way of using shell-command-on-region is a reason good enough for coding something in core. I tend to think no. I think if Org needs that, Org should solve it for itself. It isn't very hard, is it? When we hear about enough clients for this strange feature, we might consider providing a general solution.