diff options
| author | Chong Yidong | 2011-09-11 16:07:34 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-09-11 16:07:34 -0400 |
| commit | fa5660f92cdd8d2fd775ef0b3bc48a31a96500f5 (patch) | |
| tree | f0aa5699cdba3ba59f2df6a52739e92639a54bac | |
| parent | 73d56dbd6a5b85403c83c256a2991b77de97790c (diff) | |
| download | emacs-fa5660f92cdd8d2fd775ef0b3bc48a31a96500f5.tar.gz emacs-fa5660f92cdd8d2fd775ef0b3bc48a31a96500f5.zip | |
Add defcustom definitions for display-buffer vars.
* lisp/window.el (display-buffer--action-function-custom-type)
(display-buffer--action-custom-type): New vars.
(display-buffer-alist, display-buffer-default-action)
(display-buffer-overriding-action): Add defcustom types.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/window.el | 67 |
2 files changed, 60 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 35f9548baef..c2afcc5cc11 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-09-11 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * window.el (display-buffer--action-function-custom-type) | ||
| 4 | (display-buffer--action-custom-type): New vars. | ||
| 5 | (display-buffer-alist, display-buffer-default-action) | ||
| 6 | (display-buffer-overriding-action): Add defcustom types. | ||
| 7 | |||
| 1 | 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org> | 8 | 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 9 | ||
| 3 | * play/doctor.el (make-doctor-variables): Define `doctor-sent'. | 10 | * play/doctor.el (make-doctor-variables): Define `doctor-sent'. |
diff --git a/lisp/window.el b/lisp/window.el index a0e4136c0bd..e60cc4768b7 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -4498,7 +4498,33 @@ BUFFER-OR-NAME and return that buffer." | |||
| 4498 | buffer)) | 4498 | buffer)) |
| 4499 | (current-buffer))) | 4499 | (current-buffer))) |
| 4500 | 4500 | ||
| 4501 | (defvar display-buffer-alist nil | 4501 | (defconst display-buffer--action-function-custom-type |
| 4502 | '(choice :tag "Function" | ||
| 4503 | (const :tag "--" ignore) ; default for insertion | ||
| 4504 | (const display-buffer--maybe-same-window) | ||
| 4505 | (const display-buffer-reuse-window) | ||
| 4506 | (const display-buffer--special) | ||
| 4507 | (const display-buffer--maybe-pop-up-frame-or-window) | ||
| 4508 | (const display-buffer-use-some-window) | ||
| 4509 | (const display-buffer-same-window) | ||
| 4510 | (const display-buffer-pop-up-frame) | ||
| 4511 | (const display-buffer-use-some-window) | ||
| 4512 | (function :tag "Other function")) | ||
| 4513 | "Custom type for `display-buffer' action functions.") | ||
| 4514 | |||
| 4515 | (defconst display-buffer--action-custom-type | ||
| 4516 | `(cons :tag "Action" | ||
| 4517 | (choice :tag "Action functions" | ||
| 4518 | ,display-buffer--action-function-custom-type | ||
| 4519 | (repeat | ||
| 4520 | :tag "List of functions" | ||
| 4521 | ,display-buffer--action-function-custom-type)) | ||
| 4522 | (alist :tag "Action arguments" | ||
| 4523 | :key-type symbol | ||
| 4524 | :value-type (sexp :tag "Value"))) | ||
| 4525 | "Custom type for `display-buffer' actions.") | ||
| 4526 | |||
| 4527 | (defcustom display-buffer-alist nil | ||
| 4502 | "Alist of conditional actions for `display-buffer'. | 4528 | "Alist of conditional actions for `display-buffer'. |
| 4503 | This is a list of elements (CONDITION . ACTION), where: | 4529 | This is a list of elements (CONDITION . ACTION), where: |
| 4504 | 4530 | ||
| @@ -4508,10 +4534,17 @@ This is a list of elements (CONDITION . ACTION), where: | |||
| 4508 | ACTION is a cons cell (FUNCTION . ALIST), where FUNCTION is a | 4534 | ACTION is a cons cell (FUNCTION . ALIST), where FUNCTION is a |
| 4509 | function or a list of functions. Each such function should | 4535 | function or a list of functions. Each such function should |
| 4510 | accept 2 arguments: a buffer to display and an alist of the | 4536 | accept 2 arguments: a buffer to display and an alist of the |
| 4511 | same form as ALIST. See `display-buffer' for details.") | 4537 | same form as ALIST. See `display-buffer' for details." |
| 4512 | (put 'display-buffer-alist 'risky-local-variable t) | 4538 | :type `(alist :key-type |
| 4539 | (choice :tag "Condition" | ||
| 4540 | regexp | ||
| 4541 | (function :tag "Matcher function")) | ||
| 4542 | :value-type ,display-buffer--action-custom-type) | ||
| 4543 | :risky t | ||
| 4544 | :version "24.1" | ||
| 4545 | :group 'windows) | ||
| 4513 | 4546 | ||
| 4514 | (defvar display-buffer-default-action | 4547 | (defcustom display-buffer-default-action |
| 4515 | '((display-buffer--maybe-same-window | 4548 | '((display-buffer--maybe-same-window |
| 4516 | display-buffer-reuse-window | 4549 | display-buffer-reuse-window |
| 4517 | display-buffer--special | 4550 | display-buffer--special |
| @@ -4522,17 +4555,23 @@ This is a list of elements (CONDITION . ACTION), where: | |||
| 4522 | "List of default actions for `display-buffer'. | 4555 | "List of default actions for `display-buffer'. |
| 4523 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a | 4556 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a |
| 4524 | function or a list of functions. Each function should accept 2 | 4557 | function or a list of functions. Each function should accept 2 |
| 4525 | arguments: a buffer to display and an alist of the same form as | 4558 | arguments: a buffer to display and an alist similar to ALIST. |
| 4526 | ALIST. See `display-buffer' for details.") | 4559 | See `display-buffer' for details." |
| 4527 | (put 'display-buffer-default-action 'risky-local-variable t) | 4560 | :type display-buffer--action-custom-type |
| 4561 | :risky t | ||
| 4562 | :version "24.1" | ||
| 4563 | :group 'windows) | ||
| 4528 | 4564 | ||
| 4529 | (defvar display-buffer-overriding-action nil | 4565 | (defcustom display-buffer-overriding-action '(nil . nil) |
| 4530 | "Overriding action to perform to display a buffer. | 4566 | "Overriding action to perform to display a buffer. |
| 4531 | If non-nil, it should be a cons cell (FUNCTION . ALIST), where | 4567 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a |
| 4532 | FUNCTION is a function or a list of functions. Each function | 4568 | function or a list of functions. Each function should accept 2 |
| 4533 | should accept 2 arguments: a buffer to display and an alist of | 4569 | arguments: a buffer to display and an alist similar to ALIST. |
| 4534 | the same form as ALIST. See `display-buffer' for details.") | 4570 | See `display-buffer' for details." |
| 4535 | (put 'display-buffer-overriding-action 'risky-local-variable t) | 4571 | :type display-buffer--action-custom-type |
| 4572 | :risky t | ||
| 4573 | :version "24.1" | ||
| 4574 | :group 'windows) | ||
| 4536 | 4575 | ||
| 4537 | (defun display-buffer-assq-regexp (buffer-name alist) | 4576 | (defun display-buffer-assq-regexp (buffer-name alist) |
| 4538 | "Retrieve ALIST entry corresponding to BUFFER-NAME." | 4577 | "Retrieve ALIST entry corresponding to BUFFER-NAME." |
| @@ -4571,7 +4610,7 @@ Optional argument ACTION should have the form (FUNCTION . ALIST). | |||
| 4571 | FUNCTION is either a function or a list of functions. Each such | 4610 | FUNCTION is either a function or a list of functions. Each such |
| 4572 | function is called with 2 arguments: the buffer to display and an | 4611 | function is called with 2 arguments: the buffer to display and an |
| 4573 | alist. It should either display the buffer and return the | 4612 | alist. It should either display the buffer and return the |
| 4574 | window, or return nil if it is unable to display the buffer. | 4613 | window, or return nil if unable to display the buffer. |
| 4575 | 4614 | ||
| 4576 | `display-buffer' builds a function list and an alist from | 4615 | `display-buffer' builds a function list and an alist from |
| 4577 | `display-buffer-overriding-action', `display-buffer-alist', | 4616 | `display-buffer-overriding-action', `display-buffer-alist', |