unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Ludwig, Mark" <ludwig.mark@siemens.com>
To: "Buchs, Kevin" <buchs.kevin@mayo.edu>,
	"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: RE: Avoiding/removing the Async Shell Command buffer
Date: Wed, 28 Sep 2011 10:25:46 +0000	[thread overview]
Message-ID: <BC5672F8AD4C054BAF167C9801500D1A510C54C0@USSLMMBX003.net.plm.eds.com> (raw)
In-Reply-To: <F326B9A37B353A449FC7A09B36835F82D3CD7B@MACE.sppdg.ad>

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  




  reply	other threads:[~2011-09-28 10:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 16:19 Avoiding/removing the Async Shell Command buffer Buchs, Kevin
2011-09-28 10:25 ` Ludwig, Mark [this message]
2011-09-28 15:19   ` Buchs, Kevin

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=BC5672F8AD4C054BAF167C9801500D1A510C54C0@USSLMMBX003.net.plm.eds.com \
    --to=ludwig.mark@siemens.com \
    --cc=buchs.kevin@mayo.edu \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).