aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-09-15 11:12:15 -0400
committerChong Yidong2011-09-15 11:12:15 -0400
commitcbb0f9ab982ecff4b587eed18be29f7d1f726d85 (patch)
tree5a5e25505a9d9aecf3b071ad44ff99768449ffbf
parent39b3d70b17789e237021787ab80ccdd123b97312 (diff)
downloademacs-cbb0f9ab982ecff4b587eed18be29f7d1f726d85.tar.gz
emacs-cbb0f9ab982ecff4b587eed18be29f7d1f726d85.zip
Make the user customizable display-buffer variable empty by default.
* lisp/window.el (display-buffer-base-action): Rename from display-buffer-default-action. Make default value empty. (display-buffer-overriding-action): Convert to defvar. (display-buffer-fallback-action): New var.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/window.el58
2 files changed, 39 insertions, 26 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 91ffbcff96b..57c623df56a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,12 @@
12011-09-15 Chong Yidong <cyd@stupidchicken.com> 12011-09-15 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * window.el (display-buffer-base-action): Rename from
4 display-buffer-default-action. Make default value empty.
5 (display-buffer-overriding-action): Convert to defvar.
6 (display-buffer-fallback-action): New var.
7
82011-09-15 Chong Yidong <cyd@stupidchicken.com>
9
3 * emacs-lisp/package.el (package-alist): Fix risky-local-variable 10 * emacs-lisp/package.el (package-alist): Fix risky-local-variable
4 declaration. 11 declaration.
5 (package--add-to-archive-contents): If there is a duplicate entry 12 (package--add-to-archive-contents): If there is a duplicate entry
diff --git a/lisp/window.el b/lisp/window.el
index 24d95f367e4..c0e8781aab0 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4465,6 +4465,14 @@ BUFFER-OR-NAME and return that buffer."
4465 :value-type (sexp :tag "Value"))) 4465 :value-type (sexp :tag "Value")))
4466 "Custom type for `display-buffer' actions.") 4466 "Custom type for `display-buffer' actions.")
4467 4467
4468(defvar display-buffer-overriding-action '(nil . nil)
4469 "Overriding action to perform to display a buffer.
4470It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a
4471function or a list of functions. Each function should accept 2
4472arguments: a buffer to display and an alist similar to ALIST.
4473See `display-buffer' for details.")
4474(put 'display-buffer-overriding-action 'risky-local-variable t)
4475
4468(defcustom display-buffer-alist nil 4476(defcustom display-buffer-alist nil
4469 "Alist of conditional actions for `display-buffer'. 4477 "Alist of conditional actions for `display-buffer'.
4470This is a list of elements (CONDITION . ACTION), where: 4478This is a list of elements (CONDITION . ACTION), where:
@@ -4485,15 +4493,8 @@ This is a list of elements (CONDITION . ACTION), where:
4485 :version "24.1" 4493 :version "24.1"
4486 :group 'windows) 4494 :group 'windows)
4487 4495
4488(defcustom display-buffer-default-action 4496(defcustom display-buffer-base-action '(nil . nil)
4489 '((display-buffer--maybe-same-window 4497 "User-specified default action for `display-buffer'.
4490 display-buffer-reuse-window
4491 display-buffer--special
4492 display-buffer--maybe-pop-up-frame-or-window
4493 display-buffer-use-some-window
4494 ;; If all else fails, pop up a new frame.
4495 display-buffer-pop-up-frame))
4496 "List of default actions for `display-buffer'.
4497It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a 4498It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a
4498function or a list of functions. Each function should accept 2 4499function or a list of functions. Each function should accept 2
4499arguments: a buffer to display and an alist similar to ALIST. 4500arguments: a buffer to display and an alist similar to ALIST.
@@ -4503,16 +4504,19 @@ See `display-buffer' for details."
4503 :version "24.1" 4504 :version "24.1"
4504 :group 'windows) 4505 :group 'windows)
4505 4506
4506(defcustom display-buffer-overriding-action '(nil . nil) 4507(defconst display-buffer-fallback-action
4507 "Overriding action to perform to display a buffer. 4508 '((display-buffer--maybe-same-window
4508It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a 4509 display-buffer-reuse-window
4509function or a list of functions. Each function should accept 2 4510 display-buffer--special
4510arguments: a buffer to display and an alist similar to ALIST. 4511 display-buffer--maybe-pop-up-frame-or-window
4511See `display-buffer' for details." 4512 display-buffer-use-some-window
4512 :type display-buffer--action-custom-type 4513 ;; If all else fails, pop up a new frame.
4513 :risky t 4514 display-buffer-pop-up-frame))
4514 :version "24.1" 4515 "Default fallback action for `display-buffer'.
4515 :group 'windows) 4516This is the action used by `display-buffer' if no other actions
4517specified, e.g. by the user options `display-buffer-alist' or
4518`display-buffer-base-action'. See `display-buffer'.")
4519(put 'display-buffer-fallback-action 'risky-local-variable t)
4516 4520
4517(defun display-buffer-assq-regexp (buffer-name alist) 4521(defun display-buffer-assq-regexp (buffer-name alist)
4518 "Retrieve ALIST entry corresponding to BUFFER-NAME." 4522 "Retrieve ALIST entry corresponding to BUFFER-NAME."
@@ -4553,12 +4557,13 @@ function is called with 2 arguments: the buffer to display and an
4553alist. It should either display the buffer and return the 4557alist. It should either display the buffer and return the
4554window, or return nil if unable to display the buffer. 4558window, or return nil if unable to display the buffer.
4555 4559
4556`display-buffer' builds a function list and an alist from 4560The `display-buffer' function builds a function list and an alist
4557`display-buffer-overriding-action', `display-buffer-alist', 4561from `display-buffer-overriding-action', `display-buffer-alist',
4558ACTION, and `display-buffer-default-action' (in that order). 4562the ACTION argument, `display-buffer-base-action', and
4559Then it calls each function in the combined function list in 4563`display-buffer-fallback-action' (in that order). Then it calls
4560turn, passing the buffer as the first argument and the combined 4564each function in the combined function list in turn, passing the
4561alist as the second argument, until a function returns non-nil. 4565buffer as the first argument and the combined alist as the second
4566argument, until one of the functions returns non-nil.
4562 4567
4563Available action functions include: 4568Available action functions include:
4564 `display-buffer-same-window' 4569 `display-buffer-same-window'
@@ -4608,7 +4613,8 @@ search for a window that is already displaying the buffer. See
4608 ;; Construct action function list and action alist. 4613 ;; Construct action function list and action alist.
4609 (actions (list display-buffer-overriding-action 4614 (actions (list display-buffer-overriding-action
4610 user-action action extra-action 4615 user-action action extra-action
4611 display-buffer-default-action)) 4616 display-buffer-base-action
4617 display-buffer-fallback-action))
4612 (functions (apply 'append 4618 (functions (apply 'append
4613 (mapcar (lambda (x) 4619 (mapcar (lambda (x)
4614 (setq x (car x)) 4620 (setq x (car x))