unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Programatically suppress "Async Shell command" buffer
@ 2009-07-06 13:43 gearheart
  2009-07-07  9:32 ` Peter Dyballa
  2009-07-10 11:02 ` Johan Bockgård
  0 siblings, 2 replies; 9+ messages in thread
From: gearheart @ 2009-07-06 13:43 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi

When async shell-command is run, i get empty buffer that takes like half of
the screen. I know that if command is ran with C-u M-! than buffer is not
shown. I want to bind a calling of specific shell command to some key combo.

C-u is universal-argument, so i wrote a function like

(universal-argument)
(shell-command "something&")

but that still shows empty buffer. So how to write this correctly?

Thank you.
-- 
View this message in context: http://www.nabble.com/Programatically-suppress-%22Async-Shell-command%22-buffer-tp24355670p24355670.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Programatically suppress "Async Shell command" buffer
  2009-07-06 13:43 Programatically suppress "Async Shell command" buffer gearheart
@ 2009-07-07  9:32 ` Peter Dyballa
  2009-07-07 18:00   ` gearheart
       [not found]   ` <mailman.2021.1247001256.2239.help-gnu-emacs@gnu.org>
  2009-07-10 11:02 ` Johan Bockgård
  1 sibling, 2 replies; 9+ messages in thread
From: Peter Dyballa @ 2009-07-07  9:32 UTC (permalink / raw)
  To: gearheart; +Cc: Help-gnu-emacs


Am 06.07.2009 um 15:43 schrieb gearheart:

> When async shell-command is run, i get empty buffer that takes like  
> half of
> the screen.


Half of the frame in which shell-command was run is standard  
behaviour (could be an option exists to set size as for example for  
the *compilation* buffer, compilation-window-height). If your shell  
command does return nothing or white space, then the temporary *Shell  
Command Output* buffer will look empty (in the fringe you can have  
exact indicators). If your shell command, say, a simple ls, should  
return readable output and you get an empty *Shell Command Output*  
buffer, then something is faulty. Then try the same by launching GNU  
Emacs as 'emacs -Q' without any customisation.

--
Greetings

   Pete

People say that if you play Microsoft CD's backwards, you hear  
satanic things, but that's nothing, because if you play them  
forwards, they install MS Windows.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Programatically suppress "Async Shell command" buffer
  2009-07-07  9:32 ` Peter Dyballa
@ 2009-07-07 18:00   ` gearheart
       [not found]   ` <mailman.2021.1247001256.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 9+ messages in thread
From: gearheart @ 2009-07-07 18:00 UTC (permalink / raw)
  To: Help-gnu-emacs




Peter Dyballa wrote:
> 
> 
> Am 06.07.2009 um 15:43 schrieb gearheart:
> 
>> When async shell-command is run, i get empty buffer that takes like  
>> half of
>> the screen.
> 
> 
> Half of the frame in which shell-command was run is standard  
> behaviour (could be an option exists to set size as for example for  
> the *compilation* buffer, compilation-window-height). If your shell  
> command does return nothing or white space, then the temporary *Shell  
> Command Output* buffer will look empty (in the fringe you can have  
> exact indicators). If your shell command, say, a simple ls, should  
> return readable output and you get an empty *Shell Command Output*  
> buffer, then something is faulty. Then try the same by launching GNU  
> Emacs as 'emacs -Q' without any customisation.
> 
> 

oops, my bad.
to call async shell command without a buffer you need to run:
(shell-command "something&" (universal-argument))
-- 
View this message in context: http://www.nabble.com/Programatically-suppress-%22Async-Shell-command%22-buffer-tp24355670p24378496.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Programatically suppress "Async Shell command" buffer
       [not found]   ` <mailman.2021.1247001256.2239.help-gnu-emacs@gnu.org>
@ 2009-07-10  2:17     ` dnquark
  2009-07-10  3:30       ` dnquark
  2009-07-10 10:43       ` Peter Dyballa
  0 siblings, 2 replies; 9+ messages in thread
From: dnquark @ 2009-07-10  2:17 UTC (permalink / raw)
  To: help-gnu-emacs

I was just trying to figure out how to get this to work; this helped
but there still is a problem: once the async shell command terminates,
whatever output it produces (I think it's on stderr) which would
normally go to the dedicated output buffer gets inserted into my
current buffer.  How do I suppress all output from the command?..

On Jul 7, 2:00 pm, gearheart <yoyav...@gmail.com> wrote:
> Peter Dyballa wrote:
>
> > Am 06.07.2009 um 15:43 schrieb gearheart:
>
> >> When asyncshell-commandis run, i get empty buffer that takes like  
> >> half of
> >> the screen.
>
> > Half of the frame in whichshell-commandwas run is standard  
> > behaviour (could be an option exists to set size as for example for  
> > the *compilation* buffer, compilation-window-height). If yourshell 
> >commanddoes return nothing or white space, then the temporary *Shell 
> >CommandOutput* buffer will look empty (in the fringe you can have  
> > exact indicators). If yourshellcommand, say, a simple ls, should  
> > return readableoutputand you get an empty *ShellCommandOutput*  
> > buffer, then something is faulty. Then try the same by launching GNU  
> > Emacs as 'emacs -Q' without any customisation.
>
> oops, my bad.
> to call asyncshellcommandwithout a buffer you need to run:
> (shell-command"something&" (universal-argument))
> --
> View this message in context:http://www.nabble.com/Programatically-suppress-%22Async-Shell-command...
> Sent from the Emacs - Help mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Programatically suppress "Async Shell command" buffer
  2009-07-10  2:17     ` dnquark
@ 2009-07-10  3:30       ` dnquark
  2009-07-10 10:48         ` Peter Dyballa
  2009-07-10 10:43       ` Peter Dyballa
  1 sibling, 1 reply; 9+ messages in thread
From: dnquark @ 2009-07-10  3:30 UTC (permalink / raw)
  To: help-gnu-emacs

To add: I can redirect the command output to /dev/dull, but the
problem is that I cannot run the command in a dired buffer since it is
read-only.  Is there a way to specify that the command produces no
output so that it could be possible to run in a read-only buffer,e.g.
dired?

On Jul 9, 10:17 pm, dnquark <dnqu...@gmail.com> wrote:
> I was just trying to figure out how to get this to work; this helped
> but there still is a problem: once the asyncshellcommand terminates,
> whatever output it produces (I think it's on stderr) which would
> normally go to the dedicated output buffer gets inserted into my
> current buffer.  How do I suppress all output from the command?..
>
> On Jul 7, 2:00 pm, gearheart <yoyav...@gmail.com> wrote:
>
> > Peter Dyballa wrote:
>
> > > Am 06.07.2009 um 15:43 schrieb gearheart:
>
> > >> When asyncshell-commandis run, i get empty buffer that takes like  
> > >> half of
> > >> the screen.
>
> > > Half of the frame in whichshell-commandwas run is standard  
> > > behaviour (could be an option exists to set size as for example for  
> > > the *compilation* buffer, compilation-window-height). If yourshell 
> > >commanddoes return nothing or white space, then the temporary *Shell 
> > >CommandOutput* buffer will look empty (in the fringe you can have  
> > > exact indicators). If yourshellcommand, say, a simple ls, should  
> > > return readableoutputand you get an empty *ShellCommandOutput*  
> > > buffer, then something is faulty. Then try the same by launching GNU  
> > > Emacs as 'emacs -Q' without any customisation.
>
> > oops, my bad.
> > to call asyncshellcommandwithout a buffer you need to run:
> > (shell-command"something&" (universal-argument))
> > --
> > View this message in context:http://www.nabble.com/Programatically-suppress-%22Async-Shell-command...
> > Sent from the Emacs - Help mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Programatically suppress "Async Shell command" buffer
  2009-07-10  2:17     ` dnquark
  2009-07-10  3:30       ` dnquark
@ 2009-07-10 10:43       ` Peter Dyballa
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2009-07-10 10:43 UTC (permalink / raw)
  To: dnquark; +Cc: help-gnu-emacs


Am 10.07.2009 um 04:17 schrieb dnquark:

> How do I suppress all output from the command?


Most shell interpreters allow to redirect stderr (and stdin and  
stdout) to files (or pipes). Just the read the documentation of your  
shell interpreter.

GNU Emacs offers (the variable) shell-command-default-error-buffer –  
if you are looking for this and not the shell interpreter docs.

--
Greetings

   Pete

Wasting time is an important part of living.







^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Programatically suppress "Async Shell command" buffer
  2009-07-10  3:30       ` dnquark
@ 2009-07-10 10:48         ` Peter Dyballa
  2009-07-10 11:01           ` Leo Alekseyev
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Dyballa @ 2009-07-10 10:48 UTC (permalink / raw)
  To: dnquark; +Cc: help-gnu-emacs


Am 10.07.2009 um 05:30 schrieb dnquark:

> To add: I can redirect the command output to /dev/dull, but the
> problem is that I cannot run the command in a dired buffer since it is
> read-only.  Is there a way to specify that the command produces no
> output so that it could be possible to run in a read-only buffer,e.g.
> dired?


I don't understand what you are trying to express. Can you give a  
detailed example? With actual shell commands? A picture (ASCII) of  
the dired buffer before and afterwards? And another example when you  
launched GNU Emacs with -Q and applied the same example?

--
Greetings

   Pete

You can learn many things from children.  How much patience you have,  
for instance.
				– Franklin P. Jones





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Programatically suppress "Async Shell command" buffer
  2009-07-10 10:48         ` Peter Dyballa
@ 2009-07-10 11:01           ` Leo Alekseyev
  0 siblings, 0 replies; 9+ messages in thread
From: Leo Alekseyev @ 2009-07-10 11:01 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

I already solved the problem by simply turning off the read-only
property of the dired buffer.  I am interested to see if there is a
better fix though:


(defun terminal-here ()
  "Launch external terminal in the current buffer's directory or current dired
directory.  (Works by grabbing the directory name and passing as an argument to
a batch file.  Note the (toggle-read-only) workaround; the command will not run
in dired mode without it."
  (interactive)
  (let ((dir "") (diredp nil))
    (cond
     ((and (local-variable-p 'dired-directory) dired-directory)
      (setq dir dired-directory)
      (setq diredp t)
      (toggle-read-only)
)
     ((stringp (buffer-file-name))
      (setq dir (file-name-directory (buffer-file-name))))
      )
    (shell-command (concat "~/bin/mrxvt_win.bat \""dir"\" 2>/dev/null &")
 (universal-argument))
    (if diredp (toggle-read-only))
))


On Fri, Jul 10, 2009 at 6:48 AM, Peter Dyballa<Peter_Dyballa@web.de> wrote:
>
> Am 10.07.2009 um 05:30 schrieb dnquark:
>
>> To add: I can redirect the command output to /dev/dull, but the
>> problem is that I cannot run the command in a dired buffer since it is
>> read-only.  Is there a way to specify that the command produces no
>> output so that it could be possible to run in a read-only buffer,e.g.
>> dired?
>
>
> I don't understand what you are trying to express. Can you give a detailed
> example? With actual shell commands? A picture (ASCII) of the dired buffer
> before and afterwards? And another example when you launched GNU Emacs with
> -Q and applied the same example?
>
> --
> Greetings
>
>  Pete
>
> You can learn many things from children.  How much patience you have, for
> instance.
>                                – Franklin P. Jones
>
>




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Programatically suppress "Async Shell command" buffer
  2009-07-06 13:43 Programatically suppress "Async Shell command" buffer gearheart
  2009-07-07  9:32 ` Peter Dyballa
@ 2009-07-10 11:02 ` Johan Bockgård
  1 sibling, 0 replies; 9+ messages in thread
From: Johan Bockgård @ 2009-07-10 11:02 UTC (permalink / raw)
  To: help-gnu-emacs

gearheart <yoyavova@gmail.com> writes:

> When async shell-command is run, i get empty buffer that takes like
> half of the screen.

(call-process-shell-command "something" nil 0)





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-07-10 11:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-06 13:43 Programatically suppress "Async Shell command" buffer gearheart
2009-07-07  9:32 ` Peter Dyballa
2009-07-07 18:00   ` gearheart
     [not found]   ` <mailman.2021.1247001256.2239.help-gnu-emacs@gnu.org>
2009-07-10  2:17     ` dnquark
2009-07-10  3:30       ` dnquark
2009-07-10 10:48         ` Peter Dyballa
2009-07-10 11:01           ` Leo Alekseyev
2009-07-10 10:43       ` Peter Dyballa
2009-07-10 11:02 ` Johan Bockgård

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).