GNU bug report logs -
#18326
24.4.50; allow-no-window for async-shell-command in temp buffer
Previous Next
Reported by: Joe Corneli <holtzermann17 <at> gmail.com>
Date: Sun, 24 Aug 2014 18:39:02 UTC
Severity: minor
Found in version 24.4.50
Fixed in version 25.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 18326 <at> debbugs.gnu.org (full text, mbox):
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.
This bug report was last modified 10 years and 232 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.