GNU bug report logs - #18133
Suppressing asynchronous command output

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Mon, 28 Jul 2014 18:48:02 UTC

Severity: wishlist

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #140 received at 18133 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>,
 18133 <at> debbugs.gnu.org
Subject: Re: bug#18133: Suppressing asynchronous command output
Date: Sat, 31 Dec 2016 00:56:06 +0200
> "The way recommended by Martin" involves a new minor mode,
> async-shell-lazy-pop-up-mode, which I tried to avoid; Eli didn't seem to
> support its addition, either.

No, not a new minor mode, I meant https://debbugs.gnu.org/18133#47
i.e. in ‘shell-command’ instead of

(display-buffer buffer '(nil (allow-no-window . t)))

we could use

(display-buffer buffer '(display-buffer-no-window (allow-no-window . t)))

when this feature is enabled by the new customizable variable
‘async-shell-command-display-buffer’.

> I'm not sure what the variable async-shell-command-display-buffer is
> supposed to contain. (It does not seem to be the name of the buffer to be
> matched.)

We can't hard-code the name of the buffer because ‘shell-command’
uses the arg ‘output-buffer’, and only if it's nil then by default
"*Async Shell Command*".  So ‘async-shell-command-display-buffer’
shouldn't define the name of the buffer.  Instead, it could be
boolean to enable this feature (or a choice of options for more
future related features like in ‘async-shell-command-buffer’).

> I am unclear what goes in the ellipsis after "when" in the sample code
> above; it seems to imply a test for whether the buffer should be displayed,
> but I already handled that in my patch with the preoutput-filter function.

In the ellipsis goes the code that you already wrote for the filter:

(set-process-filter
 proc
 `(lambda (process string)
    (when (and (= 0 (buffer-size (process-buffer process)))
               (eq (buffer-name (process-buffer process))
                  ,(or output-buffer "*Async Shell Command*")))
      (display-buffer (process-buffer process)))))

i.e. it will handle exactly the same buffer that was provided as an arg
‘output-buffer’ to ‘async-shell-command’.




This bug report was last modified 4 years and 248 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.