summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2011-09-15 11:12:15 -0400
committerChong Yidong <cyd@stupidchicken.com>2011-09-15 11:12:15 -0400
commitcbb0f9ab982ecff4b587eed18be29f7d1f726d85 (patch)
tree5a5e25505a9d9aecf3b071ad44ff99768449ffbf /lisp
parent39b3d70b17789e237021787ab80ccdd123b97312 (diff)
downloademacs-cbb0f9ab982ecff4b587eed18be29f7d1f726d85.tar.gz
emacs-cbb0f9ab982ecff4b587eed18be29f7d1f726d85.tar.bz2
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.
Diffstat (limited to 'lisp')
-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 @@
2011-09-15 Chong Yidong <cyd@stupidchicken.com>
+ * 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 <cyd@stupidchicken.com>
+
* emacs-lisp/package.el (package-alist): Fix risky-local-variable
declaration.
(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."
: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))