@end deffn
Precisely how @code{display-buffer} finds or creates a window depends on
-the @var{specifiers} argument and the two variables described next.
+the @var{specifiers} argument and the three variables described next.
@defopt display-buffer-names
The value of this option is a list associating buffer names with buffer
required for proper functioning of the command
@code{quit-restore-window}, see below.
+ It's in general a bad idea to call @code{display-buffer} within the
+body of this function since this might lead to infinite recursion. If
+you do need to call @code{display-buffer} from it, consider setting the
+option @code{display-buffer-function} described below.
+
The remaining buffer display specifiers are cons cells or lists whose
@sc{car} is one of the symbols listed next.
of 24 lines, a width of 80 columns, and a non-@code{nil} unsplittable
property. On text-only displays, @code{display-buffer} will not try to
show the buffer on another frame.
+@end defopt
+
+@defopt display-buffer-function
+This variable is the most flexible way to customize the behavior of
+@code{display-buffer}. If it is non-@code{nil}, it should be a function
+that @code{display-buffer} calls to do the work. The function must
+accept two arguments, the buffer to display and a list of buffer display
+specifiers.
+
+ It should choose or create a window, display the specified buffer in
+it, and then return the window. It is also responsible for giving the
+variable @code{display-buffer-window} a meaningful value, see below for
+an explanation. Moreover, the function should set up the
+@code{quit-restore} window parameter which is required for proper
+functioning of the command @code{quit-restore-window}, see below.
+
+ The function specified here is free to ignore any specifiers passed to
+it as second argument. If you intend to call @code{display-buffer}
+within the body of that function, it's a good idea to bind
+@code{display-buffer-function} to @code{nil} around each such call to
+avoid running into an infinite recursion.
@end defopt
In order to understand how @code{display-buffer} combines the values
of @code{display-buffer-names} and @code{display-buffer-regexps} with
-the @var{specifiers} argument consider the following settings. Suppose
-the value of @code{display-buffer-names} has been specified as
+the @var{specifiers} argument consider the following settings (in our
+examples we generally assume that @code{display-buffer-function}
+is @code{nil}). Suppose the value of @code{display-buffer-names} has
+been specified as
@example
((("*text*")
@code{even-window-sizes} specifier to a non-@code{nil} value.
@end itemize
-The following two functions are simple variations of
-@code{display-buffer}.
+The following functions are simple variations of @code{display-buffer}.
@defun display-buffer-same-window &optional buffer-or-name
This function is like @code{display-buffer} but preferably displays the
selected window, usually because it is dedicated to some other buffer.
@end defun
+@defun display-buffer-same-frame &optional buffer-or-name
+This function is like @code{display-buffer} but tries to avoid using
+another frame.
+@end defun
+
@defun display-buffer-other-window &optional buffer-or-name
This function is like @code{display-buffer} but tries to avoid using the
-selected window. The selected window will be used if and only if there
-is no other choice.
+selected window.
+@end defun
+
+@defun display-buffer-other-window-same-frame &optional buffer-or-name
+This function is like @code{display-buffer-other-window} but tries to
+avoid using another frame.
@end defun
The following variable conveys some information about the last
@kbd{C-x b}. It returns the buffer that it switched to.
@end deffn
-The next two functions are similar to @code{switch-to-buffer}, except
-for the described features.
+The next functions are similar to @code{switch-to-buffer}, except for
+the described features.
@deffn Command switch-to-buffer-other-window buffer-or-name &optional norecord
This command makes the buffer specified by @var{buffer-or-name} current
-and displays it in a window not currently selected, by using the
+and tries to display it in a window not currently selected, by using the
function @code{pop-to-buffer} (see below). It returns the buffer
switched to.
meaning as for @code{switch-to-buffer}.
@end deffn
-@deffn Command switch-to-buffer-other-frame buffer-or-name &optional norecord
-This command switches to buffer @var{buffer-or-name} in another frame.
-It returns the buffer switched to.
+@deffn Command switch-to-buffer-same-frame buffer-or-name &optional norecord
+This command is like @code{switch-to-buffer-other-window} but does not
+necessarily avoid the selected window. It does, however, try to use or
+make a window on the selected frame.
+@end deffn
-The arguments @var{buffer-or-name} and @var{norecord} have the same
-meaning as for @code{switch-to-buffer}.
+@deffn Command switch-to-buffer-other-window-same-frame buffer-or-name &optional norecord
+This command is like @code{switch-to-buffer-other-window} but tries to
+use or make a window on the selected frame.
+@end deffn
+
+@deffn Command switch-to-buffer-other-frame buffer-or-name &optional norecord
+This command is like @code{switch-to-buffer-other-window} but tries to
+display the buffer on another frame.
@end deffn
@deffn Command pop-to-buffer buffer-or-name &optional specifiers norecord
@code{switch-to-buffer}.
@end deffn
-The following three commands are similar to @code{pop-to-buffer} but
-for the mentioned differences.
+The following commands are similar to @code{pop-to-buffer} but for the
+mentioned differences.
@deffn Command pop-to-buffer-same-window &optional buffer-or-name norecord
-This command tries to display the buffer specified by
-@var{buffer-or-name} in the selected window. Another window will be
-used only if the buffer can't be shown in the selected window, usually
-because it is dedicated to another buffer.
+This command is like @code{pop-to-buffer} but tries to display the
+buffer in the selected window. Another window will be used only if the
+buffer can't be shown in the selected window, usually because the window
+is dedicated to another buffer.
+@end deffn
- The optional arguments @var{buffer-or-name} and @var{norecord} are as
-for @code{pop-to-buffer}.
+@deffn Command pop-to-buffer-same-frame &optional buffer-or-name norecord
+This command is like @code{pop-to-buffer} but tries to make or use a
+window on the selected frame.
@end deffn
@deffn Command pop-to-buffer-other-window &optional buffer-or-name norecord
-This command displays the buffer specified by @var{buffer-or-name} in
-any but the selected window and selects that window. The selected
-window will be used if and only if there is no other choice. Windows on
-the selected frame are preferred to windows on other frames. It returns
-the buffer specified by @var{buffer-or-name} or @code{nil} if displaying
-the buffer failed.
-
- The optional arguments @var{buffer-or-name} and @var{norecord} are as
-for @code{pop-to-buffer}.
+This command is like @code{pop-to-buffer} but tries to avoid the
+selected window. Windows on the selected frame are preferred to windows
+on other frames.
@end deffn
-@deffn Command pop-to-buffer-other-frame &optional buffer-or-name norecord
-This command displays the buffer specified by @var{buffer-or-name}
-preferably on another frame. It selects the window used for displaying
-the buffer and returns the buffer specified by @var{buffer-or-name} or
-@code{nil} if displaying the buffer failed.
+@deffn Command pop-to-buffer-other-window-same-frame &optional buffer-or-name norecord
+This command is like @code{pop-to-buffer-other-window} but tries to make
+or use a window on the selected frame.
+@end deffn
- The optional arguments @var{buffer-or-name} and @var{norecord} are as
-for @code{pop-to-buffer}.
+@deffn Command pop-to-buffer-other-frame &optional buffer-or-name norecord
+This command is like @code{pop-to-buffer} but preferably displays the
+buffer on another frame.
@end deffn
@node Dedicated Windows
These are the specifiers applied when `display-buffer' is called
with the second argument equal t.")
+(defconst display-buffer-same-frame-specifiers
+ '(same-frame (reuse-buffer-window . nil))
+ "Specifiers for displaying a buffer in a window on the selected frame.")
+
+(defconst display-buffer-other-window-same-frame-specifiers
+ '(same-frame (reuse-buffer-window . nil) (not-this-window . t))
+ "Specifiers for displaying a buffer in another window on the selected frame.")
+
(defconst display-buffer-other-frame-specifiers
'(other-frame (reuse-buffer-window . visible)
(not-this-window . t) (not-this-frame . t))
The optional third argument IGNORE is ignored.
-The method to display a buffer is derived by combining the values
-of `display-buffer-names', `display-buffer-regexps', and
+The method to display the buffer is derived by combining the
+values of `display-buffer-names', `display-buffer-regexps', and
SPECIFIERS. Highest priority is given to overriding elements of
`display-buffer-names' followed by overriding elements of
`display-buffer-regexps'. Next come the elements specified by
`display-buffer-names' and the non-overriding elements of
`display-buffer-regexps'.
-The result must be a list of valid buffer display specifiers.
-`display-buffer' scans this list from front to back until it
-finds a location specifier and attempts to use that specifier in
-order to produce a suitable window. For this purpose, all
-non-symbolic specifiers following the location specifier in the
-list are considered additional specifiers. If an attempt fails
-to produce a window, `display-buffer' continues with the next
-location specifier on the list. Additional specifiers preceding
-the currently chosen location specifier in the list are ignored."
+The result must be a list of valid buffer display specifiers. If
+`display-buffer-function' is non-nil, call it with the buffer and
+this list as arguments. Otherwise, `display-buffer' scans this
+list from front to back until it finds a location specifier and
+attempts to use that specifier in order to produce a suitable
+window. For this purpose, all non-symbolic specifiers following
+the location specifier in the list are considered additional
+specifiers. If an attempt fails to produce a window,
+`display-buffer' continues with the next location specifier on
+the list. Additional specifiers preceding the currently chosen
+location specifier in the list are ignored."
(interactive "BDisplay buffer:\nP")
(let* ((buffer (normalize-buffer-to-display buffer-or-name))
(buffer-name (buffer-name buffer))
reuse-buffer-window reuse-other-window)
;; Reset this.
(setq display-buffer-window nil)
- ;; Retrieve the next location specifier while there a specifiers left
- ;; and we don't have a valid window.
- (while (and specifiers (or (not window) (not (window-live-p window))))
- (setq location (car specifiers))
- (setq specifiers (cdr specifiers))
- (when (symbolp location)
- (setq window
- (or (and (eq location 'same-window)
- (or (not (window-dedicated-p))
- (eq (window-buffer) buffer))
- (let ((selected-window
- ;; If the selected window is a minibuffer
- ;; window, use the selected window of the
- ;; last nonminibuffer frame instead.
- (if (window-minibuffer-p)
- (frame-selected-window
- (last-nonminibuffer-frame))
- (selected-window))))
- (display-buffer-in-window
- buffer selected-window specifiers)))
- (and (memq location '(same-frame other-frame))
- (not (eq (setq reuse-buffer-window
- (cdr (assq
- 'reuse-buffer-window specifiers)))
- 'never))
- ;; Try to reuse a window showing BUFFER. If
- ;; reuse-buffer-window was set, it will specify
- ;; the frames to consider, otherwise look at the
- ;; selected frame's windows only.
- (display-buffer-in-lru-buffer-window
- buffer reuse-buffer-window specifiers))
- (and (eq location 'same-frame)
- (not (frame-parameter frame 'unsplittable))
- (cdr (assq 'new-window specifiers))
- ;; Try making a new window.
- (display-buffer-in-new-window buffer specifiers))
- (and (eq location 'other-frame)
- ;; Try making a new frame.
- (display-buffer-in-new-frame buffer specifiers))
- (and (eq location 'same-frame)
- (not (eq (setq reuse-other-window
- (cdr (assq 'reuse-other-window specifiers)))
- 'never))
- ;; Try to reuse a window not showing BUFFER. If
- ;; reuse-buffer-window was set, it will specify
- ;; the frames to consider, otherwise look at the
- ;; selected frame's windows only.
- (display-buffer-in-lru-window
- buffer reuse-other-window specifiers))
- (and (not (memq location display-buffer-locations))
- (functionp location)
- ;; Separate function.
- (funcall location buffer specifiers))))))
-
- ;; If we don't have a window yet, try a fallback method. Note: All
- ;; specifiers have been used up by now.
- (or (and (window-live-p window) window)
- ;; Try reusing any window showing BUFFER on a visible or
- ;; iconfied frame.
- (display-buffer-in-lru-buffer-window buffer 0)
- ;; Try reusing a window on the selected frame.
- (display-buffer-in-lru-window buffer nil)
- ;; Try reusing a window on a visible frame.
- (display-buffer-in-lru-window buffer 'visible)
- ;; Try reusing a window on a visible or iconified frame.
- (display-buffer-in-lru-window buffer 0)
- ;; Try reusing any window showing BUFFER on any frame.
- (display-buffer-in-lru-buffer-window buffer t)
- ;; Try reusing a window on any frame.
- (display-buffer-in-lru-window buffer t)
- ;; Try making a new window.
- (display-buffer-in-new-window buffer nil)
- ;; Try making a new frame
- (display-buffer-in-new-frame buffer nil)
- ;; Use the selected window and let errors show trough.
- (display-buffer-in-window buffer (selected-window) nil))))
+ (if display-buffer-function
+ ;; Let `display-buffer-function' do the job handing it the list
+ ;; of our specifiers.
+ (funcall display-buffer-function buffer specifiers)
+ ;; Retrieve the next location specifier while there a specifiers
+ ;; left and we don't have a valid window.
+ (while (and specifiers (or (not window) (not (window-live-p window))))
+ (setq location (car specifiers))
+ (setq specifiers (cdr specifiers))
+ (when (symbolp location)
+ (setq window
+ (or (and (eq location 'same-window)
+ (or (not (window-dedicated-p))
+ (eq (window-buffer) buffer))
+ (let ((selected-window
+ ;; If the selected window is a minibuffer
+ ;; window, use the selected window of the
+ ;; last nonminibuffer frame instead.
+ (if (window-minibuffer-p)
+ (frame-selected-window
+ (last-nonminibuffer-frame))
+ (selected-window))))
+ (display-buffer-in-window
+ buffer selected-window specifiers)))
+ (and (memq location '(same-frame other-frame))
+ (not (eq (setq reuse-buffer-window
+ (cdr
+ (assq 'reuse-buffer-window specifiers)))
+ 'never))
+ ;; Try to reuse a window showing BUFFER. If
+ ;; reuse-buffer-window was set, it will specify
+ ;; the frames to consider, otherwise look at the
+ ;; selected frame's windows only.
+ (display-buffer-in-lru-buffer-window
+ buffer reuse-buffer-window specifiers))
+ (and (eq location 'same-frame)
+ (not (frame-parameter frame 'unsplittable))
+ (cdr (assq 'new-window specifiers))
+ ;; Try making a new window.
+ (display-buffer-in-new-window buffer specifiers))
+ (and (eq location 'other-frame)
+ ;; Try making a new frame.
+ (display-buffer-in-new-frame buffer specifiers))
+ (and (eq location 'same-frame)
+ (not (eq (setq reuse-other-window
+ (cdr
+ (assq 'reuse-other-window specifiers)))
+ 'never))
+ ;; Try to reuse a window not showing BUFFER. If
+ ;; reuse-buffer-window was set, it will specify
+ ;; the frames to consider, otherwise look at the
+ ;; selected frame's windows only.
+ (display-buffer-in-lru-window
+ buffer reuse-other-window specifiers))
+ (and (not (memq location display-buffer-locations))
+ (functionp location)
+ ;; Separate function.
+ (funcall location buffer specifiers))))))
+
+ ;; If we don't have a window yet, try a fallback method. Note: All
+ ;; specifiers have been used up by now.
+ (or (and (window-live-p window) window)
+ ;; Try reusing any window showing BUFFER on a visible or
+ ;; iconfied frame.
+ (display-buffer-in-lru-buffer-window buffer 0)
+ ;; Try reusing a window on the selected frame.
+ (display-buffer-in-lru-window buffer nil)
+ ;; Try reusing a window on a visible frame.
+ (display-buffer-in-lru-window buffer 'visible)
+ ;; Try reusing a window on a visible or iconified frame.
+ (display-buffer-in-lru-window buffer 0)
+ ;; Try reusing any window showing BUFFER on any frame.
+ (display-buffer-in-lru-buffer-window buffer t)
+ ;; Try reusing a window on any frame.
+ (display-buffer-in-lru-window buffer t)
+ ;; Try making a new window.
+ (display-buffer-in-new-window buffer nil)
+ ;; Try making a new frame
+ (display-buffer-in-new-frame buffer nil)
+ ;; Use the selected window and let errors show trough.
+ (display-buffer-in-window buffer (selected-window) nil)))))
(defun display-buffer-same-window (&optional buffer-or-name)
"Display buffer specified by BUFFER-OR-NAME in the selected window.
Another window will be used only if the buffer can't be shown in
-the selected window, usualy because it is dedicated to another
+the selected window, usually because it is dedicated to another
buffer.
Optional argument BUFFER-OR-NAME may be a buffer, a string \(a
window unless a new frame is created."
(display-buffer buffer-or-name 'same-window))
+(defun display-buffer-same-frame (&optional buffer-or-name)
+ "Display buffer specified by BUFFER-OR-NAME in a window on the same frame.
+Another frame will be used only if there is no other choice.
+
+Optional argument BUFFER-OR-NAME may be a buffer, a string \(a
+buffer name), or nil. If BUFFER-OR-NAME is a string not naming
+an existent buffer, create a buffer with that name. If
+BUFFER-OR-NAME is nil or omitted, display the current buffer.
+
+Return the window chosen to display BUFFER-OR-NAME or
+nil if no such window is found. Do not change the selected
+window unless a new frame is created."
+ (display-buffer
+ buffer-or-name display-buffer-same-frame-specifiers))
+
(defun display-buffer-other-window (&optional buffer-or-name)
"Display buffer specified by BUFFER-OR-NAME in another window.
-The selected window will be used if and only if there is no other
+The selected window will be used only if there is no other
choice. Windows on the selected frame are preferred to windows
on other frames.
(display-buffer
buffer-or-name display-buffer-other-window-specifiers))
+(defun display-buffer-other-window-same-frame (&optional buffer-or-name)
+ "Display buffer specified by BUFFER-OR-NAME in another window on the same frame.
+The selected window or another frame will be used only if there
+is no other choice.
+
+Optional argument BUFFER-OR-NAME may be a buffer, a string \(a
+buffer name), or nil. If BUFFER-OR-NAME is a string not naming
+an existent buffer, create a buffer with that name. If
+BUFFER-OR-NAME is nil or omitted, display the current buffer.
+
+Return the window chosen to display BUFFER-OR-NAME or
+nil if no such window is found. Do not change the selected
+window unless a new frame is created."
+ (display-buffer
+ buffer-or-name display-buffer-other-window-same-frame-specifiers))
+
(defun pop-to-buffer (&optional buffer-or-name specifiers norecord)
"Display buffer specified by BUFFER-OR-NAME and select the window used.
Optional argument BUFFER-OR-NAME may be a buffer, a string \(a
(interactive "BPop to buffer in selected window:\nP")
(pop-to-buffer buffer-or-name 'same-window norecord))
+(defun pop-to-buffer-same-frame (&optional buffer-or-name norecord)
+ "Pop to buffer specified by BUFFER-OR-NAME in a window on the selected frame.
+Another frame will be used only if there is no other choice.
+Select the window used for displaying the buffer and return the
+buffer specified by BUFFER-OR-NAME or nil if displaying the
+buffer failed.
+
+Optional arguments BUFFER-OR-NAME and NORECORD are as for
+`pop-to-buffer'."
+ (interactive "BPop to buffer in another window:\nP")
+ (pop-to-buffer
+ buffer-or-name display-buffer-same-frame-specifiers norecord))
+
(defun pop-to-buffer-other-window (&optional buffer-or-name norecord)
"Pop to buffer specified by BUFFER-OR-NAME in another window.
-The selected window will be used if and only if there is no other
+The selected window will be used only if there is no other
choice. Windows on the selected frame are preferred to windows
on other frames. Select the window used for displaying the
buffer and return the buffer specified by BUFFER-OR-NAME or nil
(pop-to-buffer
buffer-or-name display-buffer-other-window-specifiers norecord))
+(defun pop-to-buffer-other-window-same-frame (&optional buffer-or-name norecord)
+ "Pop to buffer specified by BUFFER-OR-NAME in another window on the selected frame.
+The selected window or another frame will be used only if there
+is no other choice. Select the window used for displaying the
+buffer and return the buffer specified by BUFFER-OR-NAME or nil
+if displaying the buffer failed.
+
+Optional arguments BUFFER-OR-NAME and NORECORD are as for
+`pop-to-buffer'."
+ (interactive "BPop to buffer in another window:\nP")
+ (pop-to-buffer
+ buffer-or-name display-buffer-other-window-same-frame-specifiers norecord))
+
(defun pop-to-buffer-other-frame (&optional buffer-or-name norecord)
"Pop to buffer specified by BUFFER-OR-NAME on another frame.
The selected frame will be used only if there's no other choice.
(select-window (selected-window)))
(set-buffer buffer))))
+(defun switch-to-buffer-same-frame (buffer-or-name &optional norecord)
+ "Switch to buffer BUFFER-OR-NAME in a window on the selected frame.
+Another frame will be used only if there is no other choice.
+
+If called interactively, prompt for the buffer name using the
+minibuffer. The variable `confirm-nonexistent-file-or-buffer'
+determines whether to request confirmation before creating a new
+buffer.
+
+When called from Lisp, BUFFER-OR-NAME may be a buffer, a string
+\(a buffer name), or nil. If BUFFER-OR-NAME is a string that
+does not identify an existing buffer, create a buffer with that
+name. If BUFFER-OR-NAME is nil, switch to the buffer returned by
+`other-buffer'.
+
+Optional argument NORECORD non-nil means do not put the buffer
+specified by BUFFER-OR-NAME at the front of the buffer list and
+do not make the window displaying it the most recently selected
+one. Return the buffer switched to.
+
+This uses the function `display-buffer' as a subroutine; see the
+documentations of `display-buffer', `display-buffer-names' and
+`display-buffer-regexps' for additional information.
+
+This function is intended for interactive use. Lisp functions
+should call `pop-to-buffer-other-window' instead."
+ (interactive
+ (list (read-buffer-to-switch "Switch to buffer in other window: ")))
+ (let ((buffer (normalize-buffer-to-switch-to buffer-or-name)))
+ (pop-to-buffer
+ buffer display-buffer-same-frame-specifiers norecord)))
+
(defun switch-to-buffer-other-window (buffer-or-name &optional norecord)
"Switch to buffer BUFFER-OR-NAME in another window.
-The selected window will be used if and only if there is no other
+The selected window will be used only if there is no other
choice. Windows on the selected frame are preferred to windows
on other frames.
(pop-to-buffer
buffer display-buffer-other-window-specifiers norecord)))
+(defun switch-to-buffer-other-window-same-frame (buffer-or-name &optional norecord)
+ "Switch to buffer BUFFER-OR-NAME in another window on the selected frame.
+The selected window or another frame will be used only if there
+is no other choice.
+
+If called interactively, prompt for the buffer name using the
+minibuffer. The variable `confirm-nonexistent-file-or-buffer'
+determines whether to request confirmation before creating a new
+buffer.
+
+When called from Lisp, BUFFER-OR-NAME may be a buffer, a string
+\(a buffer name), or nil. If BUFFER-OR-NAME is a string that
+does not identify an existing buffer, create a buffer with that
+name. If BUFFER-OR-NAME is nil, switch to the buffer returned by
+`other-buffer'.
+
+Optional argument NORECORD non-nil means do not put the buffer
+specified by BUFFER-OR-NAME at the front of the buffer list and
+do not make the window displaying it the most recently selected
+one. Return the buffer switched to.
+
+This uses the function `display-buffer' as a subroutine; see the
+documentations of `display-buffer', `display-buffer-names' and
+`display-buffer-regexps' for additional information.
+
+This function is intended for interactive use. Lisp functions
+should call `pop-to-buffer-other-window' instead."
+ (interactive
+ (list (read-buffer-to-switch "Switch to buffer in other window: ")))
+ (let ((buffer (normalize-buffer-to-switch-to buffer-or-name)))
+ (pop-to-buffer
+ buffer display-buffer-other-window-same-frame-specifiers norecord)))
+
(defun switch-to-buffer-other-frame (buffer-or-name &optional norecord)
"Switch to buffer BUFFER-OR-NAME on another frame.
If called interactively, prompt for the buffer name using the
(let ((buffer (normalize-buffer-to-switch-to buffer-or-name)))
(pop-to-buffer buffer display-buffer-other-frame-specifiers norecord)))
-;;; Obsolete definitions of `display-buffer' below.
(defcustom display-buffer-function nil
"If non-nil, function to call to display a buffer.
`display-buffer' calls this function with two arguments, the
-buffer to display and a flag which if non-nil means that the
-selected window is not acceptable for displaying the buffer. It
-should choose or create a window, display the specified buffer in
-it, and return the window.
-
-Commands such as `switch-to-buffer-other-window' and
-`find-file-other-window' work using this function."
+buffer to display and a list of buffer display specifiers, see
+`display-buffer-names'.
+
+The function is supposed to choose or create a window, display
+the specified buffer in it, and return the window. It is also
+responsible for giving the variable `display-buffer-window' and
+the `quit-restore' parameter of the window used a meaningful
+value.
+
+The function specified here overrides all specifiers of the
+variables `display-buffer-names' and `display-buffer-regexps' and
+any specifiers passed to `display-buffer'.
+
+If you call `display-buffer' within the body of the function,
+bind the value of `display-buffer-function' to nil around that
+call to avoid that the function recursively calls itself."
:type '(choice
(const nil)
- (function :tag "function"))
+ (function :tag "Function"))
:group 'display-buffer)
-(make-obsolete-variable
- 'display-buffer-function
- "use `display-buffer-names' or `display-buffer-regexps' instead."
- "24.1")
+;;; Obsolete definitions of `display-buffer' below.
(defcustom special-display-buffer-names nil
"List of names of buffers that should be displayed specially.
Displaying a buffer with `display-buffer' or `pop-to-buffer', if