all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: John Wiegley <jwiegley@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: async-shell-command
Date: Mon, 18 Apr 2016 21:56:22 +0200	[thread overview]
Message-ID: <87k2jubsih.fsf@mbork.pl> (raw)
In-Reply-To: <m2wpnx706y.fsf@newartisans.com>


On 2016-04-16, at 20:44, John Wiegley <jwiegley@gmail.com> wrote:

>>>>>> Marcin Borkowski <mbork@mbork.pl> writes:
>
>> Of course, this is extremely hackish. I thought that stock Emacs could use
>> the prefix argument to `async-shell-command' for something else than "make
>> this synchronous after all, and put the result at point", which seems odd
>> (and not documented, btw). For instance, C-u M-& might /not/ show the *Async
>> Shell Command* buffer, and when some option is set, this hiding/showing
>> behavior would be reversed (as in my solution). OTOH, maybe the current way
>> of doing things is fine, and just needs mentioning in the docstring?
>
>> Any ideas?  WDYT?
>
> None of the current invocation commands use a prefix argument to control
> display, so this would be a departure from established practice. I think the
> change you've described is better done locally, for those who want such
> behavior.

I expected such an answer, and I pretty much agree.  I just wanted to
ask whether I'm the only one who could find something like that useful
(from some private email exchange I know that not), and whether the UI
I proposed (C-u) makes sense (this is at least debatable).

> Another way of doing this that might be nicer would be to check if the
> shell-command string ends in "&!" instead of "&", and to take that as an
> indication it should be executed both asynchronously and "silently" (without
> display).

That sounds interesting.  What if the command ends with "!" alone?
Should it be synchronous and silent?  (I guess not.)

John, would you like me to explore this idea further and try to come up
with a patch?  Are there any other ideas for the UI?

Also, no matter how we indicate "silent" runs, what do people think
about the idea of an option to /invert/ things, so that running
a command /without/ the "silent" flag makes it silent (IOW, making
`async-shell-command' "silent" by default)?

Also, I'm pretty sure that the current meaning of the prefix argument
for `async-shell-command' /must/ be documented - it is far from obvious,
and can be learned only from careful reading of the code.  I'm going to
prepare such a patch for docs (both the docstring and the manual) first.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



  reply	other threads:[~2016-04-18 19:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-16  7:54 async-shell-command Marcin Borkowski
2016-04-16 20:44 ` async-shell-command John Wiegley
2016-04-18 19:56   ` Marcin Borkowski [this message]
2016-04-18 20:09     ` async-shell-command Drew Adams
2016-04-19  0:47     ` async-shell-command John Wiegley
2016-04-19 20:30       ` async-shell-command Marcin Borkowski

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=87k2jubsih.fsf@mbork.pl \
    --to=mbork@mbork.pl \
    --cc=emacs-devel@gnu.org \
    --cc=jwiegley@gmail.com \
    /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.