From: Chong Yidong Date: Thu, 15 Sep 2011 15:12:15 +0000 (-0400) Subject: Make the user customizable display-buffer variable empty by default. X-Git-Tag: emacs-pretest-24.0.90~104^2~35 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cbb0f9ab982ecff4b587eed18be29f7d1f726d85;p=emacs.git 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 91ffbcff96b..57c623df56a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2011-09-15 Chong Yidong + + * 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. + 2011-09-15 Chong Yidong * emacs-lisp/package.el (package-alist): Fix risky-local-variable 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." :value-type (sexp :tag "Value"))) "Custom type for `display-buffer' actions.") +(defvar display-buffer-overriding-action '(nil . nil) + "Overriding action to perform to display a buffer. +It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a +function or a list of functions. Each function should accept 2 +arguments: a buffer to display and an alist similar to ALIST. +See `display-buffer' for details.") +(put 'display-buffer-overriding-action 'risky-local-variable t) + (defcustom display-buffer-alist nil "Alist of conditional actions for `display-buffer'. This is a list of elements (CONDITION . ACTION), where: @@ -4485,15 +4493,8 @@ This is a list of elements (CONDITION . ACTION), where: :version "24.1" :group 'windows) -(defcustom display-buffer-default-action - '((display-buffer--maybe-same-window - display-buffer-reuse-window - display-buffer--special - display-buffer--maybe-pop-up-frame-or-window - display-buffer-use-some-window - ;; If all else fails, pop up a new frame. - display-buffer-pop-up-frame)) - "List of default actions for `display-buffer'. +(defcustom display-buffer-base-action '(nil . nil) + "User-specified default action for `display-buffer'. It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a function or a list of functions. Each function should accept 2 arguments: a buffer to display and an alist similar to ALIST. @@ -4503,16 +4504,19 @@ See `display-buffer' for details." :version "24.1" :group 'windows) -(defcustom display-buffer-overriding-action '(nil . nil) - "Overriding action to perform to display a buffer. -It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a -function or a list of functions. Each function should accept 2 -arguments: a buffer to display and an alist similar to ALIST. -See `display-buffer' for details." - :type display-buffer--action-custom-type - :risky t - :version "24.1" - :group 'windows) +(defconst display-buffer-fallback-action + '((display-buffer--maybe-same-window + display-buffer-reuse-window + display-buffer--special + display-buffer--maybe-pop-up-frame-or-window + display-buffer-use-some-window + ;; If all else fails, pop up a new frame. + display-buffer-pop-up-frame)) + "Default fallback action for `display-buffer'. +This is the action used by `display-buffer' if no other actions +specified, e.g. by the user options `display-buffer-alist' or +`display-buffer-base-action'. See `display-buffer'.") +(put 'display-buffer-fallback-action 'risky-local-variable t) (defun display-buffer-assq-regexp (buffer-name alist) "Retrieve ALIST entry corresponding to BUFFER-NAME." @@ -4553,12 +4557,13 @@ function is called with 2 arguments: the buffer to display and an alist. It should either display the buffer and return the window, or return nil if unable to display the buffer. -`display-buffer' builds a function list and an alist from -`display-buffer-overriding-action', `display-buffer-alist', -ACTION, and `display-buffer-default-action' (in that order). -Then it calls each function in the combined function list in -turn, passing the buffer as the first argument and the combined -alist as the second argument, until a function returns non-nil. +The `display-buffer' function builds a function list and an alist +from `display-buffer-overriding-action', `display-buffer-alist', +the ACTION argument, `display-buffer-base-action', and +`display-buffer-fallback-action' (in that order). Then it calls +each function in the combined function list in turn, passing the +buffer as the first argument and the combined alist as the second +argument, until one of the functions returns non-nil. Available action functions include: `display-buffer-same-window' @@ -4608,7 +4613,8 @@ search for a window that is already displaying the buffer. See ;; Construct action function list and action alist. (actions (list display-buffer-overriding-action user-action action extra-action - display-buffer-default-action)) + display-buffer-base-action + display-buffer-fallback-action)) (functions (apply 'append (mapcar (lambda (x) (setq x (car x))