From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Leo Liu <sdl.web@gmail.com>, 13594@debbugs.gnu.org
Subject: bug#13594: Planning Emacs-24.4
Date: Thu, 21 Nov 2013 02:30:27 +0200 [thread overview]
Message-ID: <874n76d2qk.fsf@mail.jurta.org> (raw)
In-Reply-To: <jwveh6bn4af.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 19 Nov 2013 22:26:18 -0500")
>> Then it could be defined as:
>> (defun display-buffer-no-window (buffer alist)
>> (when (cdr (assq 'allow-no-window alist))
>> 'fail))
>> And the user customization:
>> (add-to-list 'display-buffer-alist '("\\*compilation\\*"
>> display-buffer-no-window (nil)))
>
> Sounds fine.
This patch adds a new action to window.el and also adds support
for not displaying a window for the buffer `*Async Shell Command*'
of `async-shell-command' that will be possible to customize with
(add-to-list 'display-buffer-alist '("\\*Async Shell Command\\*"
display-buffer-no-window (nil)))
=== modified file 'lisp/window.el'
--- lisp/window.el 2013-11-20 02:44:38 +0000
+++ lisp/window.el 2013-11-21 00:30:00 +0000
@@ -5501,6 +5501,9 @@ (defun display-buffer (buffer-or-name &o
argument - a new window. The function is supposed to adjust
the width of the window; its return value is ignored.
+ `allow-no-window' -- A non-nil value allows the user to override
+ the default action and not display the buffer in a window.
+
The ACTION argument to `display-buffer' can also have a non-nil
and non-list value. This means to display the buffer in a window
other than the selected one, even if it is already displayed in
@@ -5830,6 +5833,16 @@ (defun display-buffer-use-some-window (b
(unless (cdr (assq 'inhibit-switch-frame alist))
(window--maybe-raise-frame (window-frame window)))))))
+(defun 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 makes possible to override the default action
+and avoid displaying the buffer. It is assumed that when the caller
+specifies a non-nil `allow-no-window' then it can handle a nil value
+returned from `display-buffer' in this case."
+ (when (cdr (assq 'allow-no-window alist))
+ 'fail))
+
;;; Display + selection commands:
(defun pop-to-buffer (buffer &optional action norecord)
"Select buffer BUFFER in some window, preferably a different one.
=== modified file 'lisp/simple.el'
--- lisp/simple.el 2013-10-30 02:45:53 +0000
+++ lisp/simple.el 2013-11-21 00:30:04 +0000
@@ -2820,7 +2820,7 @@ (defun shell-command (command &optional
;; which comint sometimes adds for prompts.
(let ((inhibit-read-only t))
(erase-buffer))
- (display-buffer buffer)
+ (display-buffer buffer '(nil (allow-no-window . t)))
(setq default-directory directory)
(setq proc (start-process "Shell" buffer shell-file-name
shell-command-switch command))
next prev parent reply other threads:[~2013-11-21 0:30 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <jwvzjp4nu45.fsf-monnier+emacs@gnu.org>
[not found] ` <m17gc7a9vv.fsf@gmail.com>
2013-11-17 20:53 ` bug#13594: Planning Emacs-24.4 Stefan Monnier
2013-11-18 8:41 ` Leo Liu
2013-11-18 9:53 ` Leo Liu
2013-11-18 10:00 ` Andreas Schwab
2013-11-18 10:17 ` Leo Liu
2013-11-18 10:26 ` Andreas Schwab
2013-11-18 10:35 ` Leo Liu
2013-11-18 10:38 ` Andreas Schwab
2013-11-18 11:09 ` Leo Liu
2013-11-18 11:25 ` Andreas Schwab
2013-11-18 11:59 ` Leo Liu
2013-11-18 10:46 ` martin rudalics
2013-01-31 10:43 ` bug#13594: 24.2.92; [PATCH] compilation-start doesn't consider nil OUTWIN Leo Liu
2013-01-31 12:35 ` Leo Liu
2013-01-31 15:14 ` Stefan Monnier
2013-01-31 15:21 ` Leo Liu
2013-02-05 10:58 ` Leo Liu
2013-02-05 11:57 ` Leo Liu
2013-02-05 23:25 ` Juri Linkov
2013-02-06 1:19 ` Leo Liu
2013-02-06 10:12 ` Juri Linkov
2013-02-06 15:35 ` Stefan Monnier
2013-02-06 23:40 ` Juri Linkov
2013-02-07 13:36 ` Stefan Monnier
2013-02-08 8:10 ` Juri Linkov
2013-02-08 14:36 ` Stefan Monnier
2013-02-09 9:22 ` martin rudalics
2013-02-10 10:01 ` Juri Linkov
2013-02-10 17:32 ` martin rudalics
2013-02-11 9:28 ` Juri Linkov
2013-02-11 17:31 ` martin rudalics
2013-02-11 17:55 ` Leo Liu
2013-02-14 8:22 ` Leo Liu
2013-02-14 14:15 ` Stefan Monnier
2013-03-19 15:39 ` Leo Liu
2013-03-20 3:12 ` Stefan Monnier
2013-03-20 4:37 ` Leo Liu
2013-03-20 12:51 ` Stefan Monnier
2013-11-17 5:18 ` Leo Liu
2013-11-17 9:48 ` martin rudalics
2013-02-08 9:59 ` martin rudalics
2013-11-18 11:16 ` bug#13594: Planning Emacs-24.4 Leo Liu
2013-11-18 13:19 ` martin rudalics
2013-11-18 14:56 ` Leo Liu
2013-11-18 15:20 ` martin rudalics
2013-11-18 15:48 ` Leo Liu
2013-11-19 0:33 ` Stefan Monnier
2013-11-19 0:54 ` Juri Linkov
2013-11-19 3:38 ` Stefan Monnier
2013-11-19 2:42 ` Leo Liu
2013-11-19 7:42 ` martin rudalics
2013-11-20 2:51 ` Leo Liu
2013-11-20 7:33 ` martin rudalics
2013-11-19 0:31 ` Stefan Monnier
2013-11-19 7:42 ` martin rudalics
2013-11-20 0:55 ` Juri Linkov
2013-11-20 3:26 ` Stefan Monnier
2013-11-21 0:30 ` Juri Linkov [this message]
2013-12-02 5:33 ` Leo Liu
2013-12-03 1:19 ` Juri Linkov
2013-12-03 3:23 ` Leo Liu
2013-12-03 7:56 ` martin rudalics
2013-11-20 7:34 ` martin rudalics
2013-11-18 13:55 ` Stefan Monnier
2013-11-18 15:32 ` martin rudalics
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=874n76d2qk.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=13594@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=sdl.web@gmail.com \
/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).