[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r105734: Add defcustom definitions fo
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r105734: Add defcustom definitions for display-buffer vars. |
Date: |
Sun, 11 Sep 2011 16:07:34 -0400 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 105734
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2011-09-11 16:07:34 -0400
message:
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.
modified:
lisp/ChangeLog
lisp/window.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-09-11 19:07:41 +0000
+++ b/lisp/ChangeLog 2011-09-11 20:07:34 +0000
@@ -1,3 +1,10 @@
+2011-09-11 Chong Yidong <address@hidden>
+
+ * 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.
+
2011-09-11 Lars Magne Ingebrigtsen <address@hidden>
* play/doctor.el (make-doctor-variables): Define `doctor-sent'.
=== modified file 'lisp/window.el'
--- a/lisp/window.el 2011-09-11 18:30:07 +0000
+++ b/lisp/window.el 2011-09-11 20:07:34 +0000
@@ -4498,7 +4498,33 @@
buffer))
(current-buffer)))
-(defvar display-buffer-alist nil
+(defconst display-buffer--action-function-custom-type
+ '(choice :tag "Function"
+ (const :tag "--" ignore) ; default for insertion
+ (const display-buffer--maybe-same-window)
+ (const display-buffer-reuse-window)
+ (const display-buffer--special)
+ (const display-buffer--maybe-pop-up-frame-or-window)
+ (const display-buffer-use-some-window)
+ (const display-buffer-same-window)
+ (const display-buffer-pop-up-frame)
+ (const display-buffer-use-some-window)
+ (function :tag "Other function"))
+ "Custom type for `display-buffer' action functions.")
+
+(defconst display-buffer--action-custom-type
+ `(cons :tag "Action"
+ (choice :tag "Action functions"
+ ,display-buffer--action-function-custom-type
+ (repeat
+ :tag "List of functions"
+ ,display-buffer--action-function-custom-type))
+ (alist :tag "Action arguments"
+ :key-type symbol
+ :value-type (sexp :tag "Value")))
+ "Custom type for `display-buffer' actions.")
+
+(defcustom display-buffer-alist nil
"Alist of conditional actions for `display-buffer'.
This is a list of elements (CONDITION . ACTION), where:
@@ -4508,10 +4534,17 @@
ACTION is a cons cell (FUNCTION . ALIST), where FUNCTION is a
function or a list of functions. Each such function should
accept 2 arguments: a buffer to display and an alist of the
- same form as ALIST. See `display-buffer' for details.")
-(put 'display-buffer-alist 'risky-local-variable t)
+ same form as ALIST. See `display-buffer' for details."
+ :type `(alist :key-type
+ (choice :tag "Condition"
+ regexp
+ (function :tag "Matcher function"))
+ :value-type ,display-buffer--action-custom-type)
+ :risky t
+ :version "24.1"
+ :group 'windows)
-(defvar display-buffer-default-action
+(defcustom display-buffer-default-action
'((display-buffer--maybe-same-window
display-buffer-reuse-window
display-buffer--special
@@ -4522,17 +4555,23 @@
"List of default actions 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 of the same form as
-ALIST. See `display-buffer' for details.")
-(put 'display-buffer-default-action 'risky-local-variable t)
+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)
-(defvar display-buffer-overriding-action nil
+(defcustom display-buffer-overriding-action '(nil . nil)
"Overriding action to perform to display a buffer.
-If non-nil, 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 of
-the same form as ALIST. See `display-buffer' for details.")
-(put 'display-buffer-overriding-action 'risky-local-variable t)
+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)
(defun display-buffer-assq-regexp (buffer-name alist)
"Retrieve ALIST entry corresponding to BUFFER-NAME."
@@ -4571,7 +4610,7 @@
FUNCTION is either a function or a list of functions. Each such
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 it is unable to display the buffer.
+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',
- [Emacs-diffs] /srv/bzr/emacs/trunk r105734: Add defcustom definitions for display-buffer vars.,
Chong Yidong <=