unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Reuben Thomas <rrt@sc3d.org>
Cc: 18133@debbugs.gnu.org
Subject: bug#18133: Suppressing asynchronous command output
Date: Sat, 31 Dec 2016 00:56:06 +0200	[thread overview]
Message-ID: <87mvfdowg5.fsf@mail.linkov.net> (raw)
In-Reply-To: <CAOnWdojxeyvRVCtLMptPi-MEdUYzPi0cfFSXyas8ONVT35D3YQ@mail.gmail.com> (Reuben Thomas's message of "Fri, 30 Dec 2016 18:28:46 +0000")

> "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’.





  parent reply	other threads:[~2016-12-30 22:56 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 18:47 bug#18133: Suppressing asynchronous command output Reuben Thomas
2014-07-29 23:47 ` Juri Linkov
2014-07-30  9:16   ` Reuben Thomas
2014-07-30  9:48     ` Reuben Thomas
2014-07-30 16:35       ` Juri Linkov
2016-12-19 15:48 ` Reuben Thomas
2016-12-21 17:55   ` Eli Zaretskii
2016-12-21 22:44     ` Reuben Thomas
2016-12-22 16:28       ` Eli Zaretskii
2016-12-22 17:53         ` martin rudalics
2016-12-22 18:32           ` Eli Zaretskii
2016-12-22 19:42           ` Reuben Thomas
2016-12-22 20:15             ` martin rudalics
2016-12-22 20:26               ` Reuben Thomas
2016-12-23 18:59                 ` martin rudalics
2016-12-23 19:10                   ` Reuben Thomas
2016-12-23 19:55                     ` martin rudalics
2016-12-23 21:07                       ` Reuben Thomas
2016-12-24  9:16                         ` martin rudalics
2016-12-24 11:11                           ` Reuben Thomas
2016-12-24 12:06                             ` Eli Zaretskii
2016-12-24 13:54                               ` martin rudalics
2016-12-24 14:45                                 ` Reuben Thomas
2016-12-24 16:32                                   ` martin rudalics
2016-12-24 16:03                                 ` Eli Zaretskii
2016-12-24 16:33                                   ` martin rudalics
2016-12-24 16:56                                     ` Eli Zaretskii
2016-12-24 18:14                                       ` martin rudalics
2016-12-25  2:23                                         ` Reuben Thomas
2016-12-26 23:43                                         ` Reuben Thomas
2016-12-27  7:29                                           ` martin rudalics
2016-12-26 23:27                         ` Juri Linkov
2016-12-27  1:09                           ` Reuben Thomas
2016-12-27  1:20                             ` Reuben Thomas
2016-12-27  6:23                               ` Eli Zaretskii
2016-12-27  9:01                                 ` Reuben Thomas
2016-12-27  9:28                                   ` Eli Zaretskii
2016-12-27 22:21                                     ` Reuben Thomas
2016-12-28 16:01                                       ` Eli Zaretskii
2016-12-28 20:58                                         ` Reuben Thomas
2016-12-29 15:50                                           ` Eli Zaretskii
2016-12-29 23:08                                           ` Juri Linkov
2016-12-30 18:28                                             ` Reuben Thomas
2016-12-30 20:50                                               ` Eli Zaretskii
2016-12-30 22:33                                                 ` Reuben Thomas
2016-12-30 22:56                                               ` Juri Linkov [this message]
2016-12-31  0:19                                                 ` Reuben Thomas
2016-12-31  8:41                                                   ` Eli Zaretskii
2017-06-28 21:45                                                     ` Reuben Thomas
2017-06-28 21:53                                                       ` Reuben Thomas
2017-06-28 22:05                                                         ` Reuben Thomas
2017-08-07 12:31                                                           ` Reuben Thomas
2017-08-07 16:25                                                             ` Eli Zaretskii
2020-09-18 13:40                                                               ` Lars Ingebrigtsen
2020-09-18 13:51                                                                 ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-18 14:04                                                                   ` Lars Ingebrigtsen

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=87mvfdowg5.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=18133@debbugs.gnu.org \
    --cc=rrt@sc3d.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).