[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: async-shell-command

From: Marcin Borkowski
Subject: Re: async-shell-command
Date: Mon, 18 Apr 2016 21:56:22 +0200
User-agent: mu4e 0.9.13; emacs

On 2016-04-16, at 20:44, John Wiegley <address@hidden> wrote:

>>>>>> Marcin Borkowski <address@hidden> 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.


Marcin Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

reply via email to

[Prev in Thread] Current Thread [Next in Thread]