[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Avoiding/removing the Async Shell Command buffer
From: |
Ludwig, Mark |
Subject: |
RE: Avoiding/removing the Async Shell Command buffer |
Date: |
Wed, 28 Sep 2011 10:25:46 +0000 |
>From the doc (C-h f) for kill-buffer:
The functions in `kill-buffer-query-functions' are called with the buffer to be
killed as the current buffer. If any of them returns nil, the buffer is not
killed.
HTH,
Mark
From: help-gnu-emacs-bounces+ludwig.mark=siemens.com@gnu.org
[mailto:help-gnu-emacs-bounces+ludwig.mark=siemens.com@gnu.org] On Behalf Of
Buchs, Kevin
Sent: Tuesday, September 27, 2011 11:19 AM
To: help-gnu-emacs@gnu.org
Subject: Avoiding/removing the Async Shell Command buffer
In gnuemacs 23, I have a shell command I want to run asynchronously but I want
it to not open an output buffer (except perhaps if there is an error - but that
is quite unlikely). Could someone suggest an approach to solving this? Does it
take creation of a custom async-shell-command variant?
I have tried implementing some commands to remove that buffer, but it fails and
prompts me to be sure I want to kill the buffer. Here is what I have tried:
(defun org-doc ()
"Open PDF for Org Mode"
(interactive)
(async-shell-command (concat custom-dir "/org-7.7/doc/org.pdf"))
; like to have it put away the *Async Shell Command* buffer
(let ( (process (get-buffer-process "*Async Shell Command*")) )
(kill-process process))
(kill-buffer "*Async Shell Command*"))
Does anyone see any *mistakes* in that code?
Kevin Buchs | Senior Engineer | Department of Physiology and Biomedical
Engineering - SPPDG
507-538-5459 | buchs.kevin@mayo.edu | http://www.mayo.edu/sppdg
Mayo Clinic | 200 1st St. SW | Rochester, MN 55905