diff options
| author | Chong Yidong | 2011-09-15 11:12:15 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-09-15 11:12:15 -0400 |
| commit | cbb0f9ab982ecff4b587eed18be29f7d1f726d85 (patch) | |
| tree | 5a5e25505a9d9aecf3b071ad44ff99768449ffbf | |
| parent | 39b3d70b17789e237021787ab80ccdd123b97312 (diff) | |
| download | emacs-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/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/window.el | 58 |
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 @@ | |||
| 1 | 2011-09-15 Chong Yidong <cyd@stupidchicken.com> | 1 | 2011-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 | |||
| 8 | 2011-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. | ||
| 4470 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a | ||
| 4471 | function or a list of functions. Each function should accept 2 | ||
| 4472 | arguments: a buffer to display and an alist similar to ALIST. | ||
| 4473 | See `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'. |
| 4470 | This is a list of elements (CONDITION . ACTION), where: | 4478 | This 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'. | ||
| 4497 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a | 4498 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a |
| 4498 | function or a list of functions. Each function should accept 2 | 4499 | function or a list of functions. Each function should accept 2 |
| 4499 | arguments: a buffer to display and an alist similar to ALIST. | 4500 | arguments: 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 |
| 4508 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a | 4509 | display-buffer-reuse-window |
| 4509 | function or a list of functions. Each function should accept 2 | 4510 | display-buffer--special |
| 4510 | arguments: a buffer to display and an alist similar to ALIST. | 4511 | display-buffer--maybe-pop-up-frame-or-window |
| 4511 | See `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) | 4516 | This is the action used by `display-buffer' if no other actions |
| 4517 | specified, 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 | |||
| 4553 | alist. It should either display the buffer and return the | 4557 | alist. It should either display the buffer and return the |
| 4554 | window, or return nil if unable to display the buffer. | 4558 | window, or return nil if unable to display the buffer. |
| 4555 | 4559 | ||
| 4556 | `display-buffer' builds a function list and an alist from | 4560 | The `display-buffer' function builds a function list and an alist |
| 4557 | `display-buffer-overriding-action', `display-buffer-alist', | 4561 | from `display-buffer-overriding-action', `display-buffer-alist', |
| 4558 | ACTION, and `display-buffer-default-action' (in that order). | 4562 | the ACTION argument, `display-buffer-base-action', and |
| 4559 | Then it calls each function in the combined function list in | 4563 | `display-buffer-fallback-action' (in that order). Then it calls |
| 4560 | turn, passing the buffer as the first argument and the combined | 4564 | each function in the combined function list in turn, passing the |
| 4561 | alist as the second argument, until a function returns non-nil. | 4565 | buffer as the first argument and the combined alist as the second |
| 4566 | argument, until one of the functions returns non-nil. | ||
| 4562 | 4567 | ||
| 4563 | Available action functions include: | 4568 | Available 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)) |