From: Joe Corneli <holtzermann17@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 18326@debbugs.gnu.org
Subject: bug#18326: 24.4.50; allow-no-window for async-shell-command in temp buffer
Date: Tue, 26 Aug 2014 23:59:29 +0100 [thread overview]
Message-ID: <CAN+qofmr05fmzOzO2USqOLR2DDMb6ohAChwgtWXF4aMvaW5Ciw@mail.gmail.com> (raw)
In-Reply-To: <jwvvbpglija.fsf-monnier+emacsbugs@gnu.org>
Hi Stefan:
I tried this:
(setq display-buffer-alist
'(("\\*Async Shell Command\\*" . (display-buffer-no-window . nil))))
(defun sudo-shell-command (command)
(interactive "MShell command (root): ")
(with-temp-buffer
(cd "/sudo::/")
(async-shell-command command)))
(sudo-shell-command "touch /dev/null")
The buffer still pops up.
The docs say:
(async-shell-command COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER)
[...]
To run COMMAND without displaying the output
in a window you can configure `display-buffer-alist' to use the action
`display-buffer-no-window' for the buffer `*Async Shell Command*'.
OK, would be be able to tell me how I do that? It seems that I've now
tried two seemingly sensible ways to do this configuration, and the
docs led me to the previous configuration, and not clearly to anything
else.
display-buffer-alist is a variable defined in `window.el'.
[...]
This is a list of elements (CONDITION . ACTION), where:
CONDITION is either a regexp matching buffer names, or a
function that takes two arguments - a buffer name and the
ACTION argument of `display-buffer' - and returns a boolean.
ACTION is a cons cell (FUNCTION . ALIST), where FUNCTION is a
function or a list of functions. Each such function should
accept two arguments: a buffer to display and an alist of the
same form as ALIST. See `display-buffer' for details.
(display-buffer-no-window BUFFER ALIST)
[...]
Display BUFFER in no window.
If ALIST has a non-nil `allow-no-window' entry, then don't display
a window at all.
next prev parent reply other threads:[~2014-08-26 22:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-24 18:34 bug#18326: 24.4.50; allow-no-window for async-shell-command in temp buffer Joe Corneli
2014-08-25 15:03 ` Stefan Monnier
2014-08-26 22:59 ` Joe Corneli [this message]
2014-08-26 23:31 ` Glenn Morris
2014-08-28 6:42 ` Joe Corneli
2014-08-28 15:45 ` Glenn Morris
2014-08-28 19:33 ` Michael Albinus
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=CAN+qofmr05fmzOzO2USqOLR2DDMb6ohAChwgtWXF4aMvaW5Ciw@mail.gmail.com \
--to=holtzermann17@gmail.com \
--cc=18326@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.