all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: dmitry@gutov.dev, 71081@debbugs.gnu.org, matt@excalamus.com
Subject: bug#71081: 30.0.50; shell-command-on-region outputs boilerplate text on Windows
Date: Wed, 22 May 2024 17:53:22 +0300	[thread overview]
Message-ID: <86zfsh6gpp.fsf@gnu.org> (raw)
In-Reply-To: <875xv5kjmg.fsf@localhost> (message from Ihor Radchenko on Wed, 22 May 2024 14:26:47 +0000)

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: dmitry@gutov.dev, 71081@debbugs.gnu.org, matt@excalamus.com
> Date: Wed, 22 May 2024 14:26:47 +0000
> 
> Eli Zaretskii <eliz@gnu.org> 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.





  reply	other threads:[~2024-05-22 14:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20 18:34 bug#71081: 30.0.50; shell-command-on-region outputs boilerplate text on Windows Ihor Radchenko
2024-05-20 18:59 ` Eli Zaretskii
2024-05-21 20:18   ` Dmitry Gutov
2024-05-22  2:30     ` Eli Zaretskii
2024-05-22 11:45       ` Ihor Radchenko
2024-05-22 13:33         ` Eli Zaretskii
2024-05-22 14:26           ` Ihor Radchenko
2024-05-22 14:53             ` Eli Zaretskii [this message]
2024-05-23 12:06               ` Ihor Radchenko
2024-05-23 13:37                 ` Eli Zaretskii
2024-05-23 14:00                   ` Ihor Radchenko
2024-05-23 14:14                     ` Eli Zaretskii
2024-05-23 14:36                       ` Ihor Radchenko
2024-05-25 10:03                         ` Eli Zaretskii
2024-05-25 10:03                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86zfsh6gpp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71081@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=matt@excalamus.com \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.