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


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 18133 <at> debbugs.gnu.org
Subject: bug#18133: Suppressing asynchronous command output
Date: Sat, 24 Dec 2016 10:16:34 +0100
> Here is the implementation I currently use (from Juri Linkov, message #8,
> second block of code):
>
> (advice-add 'comint-output-filter :after
>              "Stop Async Shell Command output from appearing until there is
> output."
>              (lambda (process string)
>                (when (and (string-match-p "\\*Async Shell Command\\*"
>                                           (buffer-name (process-buffer
> process))))
>                  (display-buffer (process-buffer process)))))
>
> I think this does what you say: whenever some output arrives, the buffer
> pops up. It does not involve changing the behaviour of display-buffer.
>
> All my patch does is move the advice into a function suitable for
> comint-output-filter-functions.

To turn this into a minor mode I would do two things:

(1) Add an entry to ‘display-buffer-overriding-action’ so that the
    buffer is not displayed right away.

(2) Get rid of the advice, maybe by doing the display at the end of
    ‘comint-output-filter-functions’.

> But I'm still confused by how you
>> >want to add something to ‘display-buffer-alist’ and at the same time to
>> >not change the behavior of ‘display-buffer’;-)
> ​
> I suggested adding an option to display-buffer-alist's defcustom
> specification, something like:
>
>                  :options (((regexp "\\*Async Shell Command\\*") (function
> display-buffer-no-window)))
>
> By default, this is not selected, so it does not change the default
> behaviour.

Please don't do such things.  Within a couple of months we would be back
where we were before the introduction of ‘display-buffer-alist’.

> I currently simply add an item to display-buffer-alist:
>
> (add-to-list 'display-buffer-alist '("\\*Async Shell Command\\*"
>                                       display-buffer-no-window))

If you now try to customize ‘display-buffer-alist’, you'll be told that
this option has been "CHANGED outside Customize".  You can avoid that by
doing

(customize-save-variable
 'display-buffer-alist
 (add-to-list
  'display-buffer-alist '("\\*Async Shell Command\\*"
			  display-buffer-no-window)))

instead.

martin





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.