diff options
Diffstat (limited to 'lisp/window.el')
-rw-r--r-- | lisp/window.el | 78 |
1 files changed, 28 insertions, 50 deletions
diff --git a/lisp/window.el b/lisp/window.el index 9ff55dc9807..67a4a4bbf2f 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6622,24 +6622,6 @@ fourth element is BUFFER." window 'quit-restore (list 'tab 'tab (selected-window) buffer))))) -(defcustom display-buffer-function nil - "If non-nil, function to call to handle `display-buffer'. -It will receive two args, the buffer and a flag which if non-nil -means that the currently selected window is not acceptable. It -should choose or create a window, display the specified buffer in -it, and return the window. - -The specified function should call `display-buffer-record-window' -with corresponding arguments to set up the quit-restore parameter -of the window used." - :type '(choice - (const nil) - (function :tag "function")) - :group 'windows) - -(make-obsolete-variable 'display-buffer-function - 'display-buffer-alist "24.3") - (defcustom pop-up-frame-alist nil "Alist of parameters for automatically generated new frames. If non-nil, the value you specify here is used by the default @@ -7745,38 +7727,34 @@ specified by the ACTION argument." ;; Handle the old form of the first argument. (inhibit-same-window (and action (not (listp action))))) (unless (listp action) (setq action nil)) - (if display-buffer-function - ;; If `display-buffer-function' is defined, let it do the job. - (funcall display-buffer-function buffer inhibit-same-window) - ;; Otherwise, use the defined actions. - (let* ((user-action - (display-buffer-assq-regexp - buffer display-buffer-alist action)) - (special-action (display-buffer--special-action buffer)) - ;; Extra actions from the arguments to this function: - (extra-action - (cons nil (append (if inhibit-same-window - '((inhibit-same-window . t))) - (if frame - `((reusable-frames . ,frame)))))) - ;; Construct action function list and action alist. - (actions (list display-buffer-overriding-action - user-action special-action action extra-action - display-buffer-base-action - display-buffer-fallback-action)) - (functions (apply 'append - (mapcar (lambda (x) - (setq x (car x)) - (if (functionp x) (list x) x)) - actions))) - (alist (apply 'append (mapcar 'cdr actions))) - window) - (unless (buffer-live-p buffer) - (error "Invalid buffer")) - (while (and functions (not window)) - (setq window (funcall (car functions) buffer alist) - functions (cdr functions))) - (and (windowp window) window))))) + (let* ((user-action + (display-buffer-assq-regexp + buffer display-buffer-alist action)) + (special-action (display-buffer--special-action buffer)) + ;; Extra actions from the arguments to this function: + (extra-action + (cons nil (append (if inhibit-same-window + '((inhibit-same-window . t))) + (if frame + `((reusable-frames . ,frame)))))) + ;; Construct action function list and action alist. + (actions (list display-buffer-overriding-action + user-action special-action action extra-action + display-buffer-base-action + display-buffer-fallback-action)) + (functions (apply 'append + (mapcar (lambda (x) + (setq x (car x)) + (if (functionp x) (list x) x)) + actions))) + (alist (apply 'append (mapcar 'cdr actions))) + window) + (unless (buffer-live-p buffer) + (error "Invalid buffer")) + (while (and functions (not window)) + (setq window (funcall (car functions) buffer alist) + functions (cdr functions))) + (and (windowp window) window)))) (defun display-buffer-other-frame (buffer) "Display buffer BUFFER preferably in another frame. |