From d90e2ea0eeccb7422fc7c8ab727a61c49c135e03 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 1 Aug 2011 20:10:58 +0200 Subject: [PATCH] Don't set dedicated status for reused normal windows (Bug#9215). * window.el (display-buffer-in-window): Don't set dedicated status of window here (Bug#9215). (display-buffer-pop-up-window, display-buffer-pop-up-frame) (display-buffer-pop-up-side-window) (display-buffer-in-side-window): Set dedicated status of window here. --- lisp/ChangeLog | 9 +++++++++ lisp/window.el | 24 +++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a3699fc999f..791233439bb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2011-08-01 Martin Rudalics + + * window.el (display-buffer-in-window): Don't set dedicated status + of window here (Bug#9215). + (display-buffer-pop-up-window, display-buffer-pop-up-frame) + (display-buffer-pop-up-side-window) + (display-buffer-in-side-window): Set dedicated status of window + here. + 2011-08-01 Stefan Monnier * emacs-lisp/package.el (package-generate-autoloads): Load autoloads diff --git a/lisp/window.el b/lisp/window.el index 905db8dc9b6..215dbab7849 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4715,15 +4715,12 @@ documentation of `display-buffer-alist' for a description." (setq window (window-normalize-live-window window)) (let* ((old-frame (selected-frame)) (new-frame (window-frame window)) - (dedicate (cdr (assq 'dedicate specifiers))) (no-other-window (cdr (assq 'no-other-window specifiers)))) ;; Show BUFFER in WINDOW. (unless (eq buffer (window-buffer window)) ;; If we show another buffer in WINDOW, undedicate it first. (set-window-dedicated-p window nil)) (set-window-buffer window buffer) - (when dedicate - (set-window-dedicated-p window dedicate)) (when no-other-window (set-window-parameter window 'no-other-window t)) (unless (or (eq old-frame new-frame) @@ -4965,7 +4962,7 @@ Return the new window, nil if it could not be created." (selected-window (selected-window)) root new new-parent) - ;; We are in an atomic window. + ;; We are in an atomic window. (when (and (window-parameter window 'window-atom) (not nest)) ;; Split the root window. (setq window (window-atom-root window))) @@ -5059,6 +5056,10 @@ description." (setq display-buffer-window (cons window 'new-window)) ;; Install BUFFER in the new window. (display-buffer-in-window buffer window specifiers) + (let ((dedicate (cdr (assq 'dedicate specifiers)))) + (when dedicate + ;; Dedicate window to buffer. + (set-window-dedicated-p window dedicate))) ;; Adjust sizes if asked for (for `fit-window-to-buffer' ;; and friends BUFFER must be already shown in the new ;; window). @@ -5094,7 +5095,12 @@ documentation of `display-buffer-alist' for a description." (set-window-parameter window 'quit-restore (list 'new-frame buffer selected-window)) (setq display-buffer-window (cons window 'new-frame)) - (display-buffer-in-window buffer window specifiers)))))) + (display-buffer-in-window buffer window specifiers) + (let ((dedicate (cdr (assq 'dedicate specifiers)))) + (when dedicate + ;; Dedicate window to buffer. + (set-window-dedicated-p window dedicate))) + window))))) (defun display-buffer-pop-up-side-window (buffer side slot &optional specifiers) "Display BUFFER in a new window on SIDE of the selected frame. @@ -5142,6 +5148,10 @@ failed." (setq display-buffer-window (cons window 'new-window)) ;; Install BUFFER in new window. (display-buffer-in-window buffer window specifiers) + (let ((dedicate (cdr (assq 'dedicate specifiers)))) + (when dedicate + ;; Dedicate window to buffer. + (set-window-dedicated-p window dedicate))) ;; Adjust sizes of new window if asked for. (display-buffer-set-height window specifiers) (display-buffer-set-width window specifiers) @@ -5282,6 +5292,10 @@ SPECIFIERS must be a list of buffer display specifiers." (set-window-parameter window 'window-slot slot)) ;; Install BUFFER in the window. (display-buffer-in-window buffer window specifiers) + (let ((dedicate (cdr (assq 'dedicate specifiers)))) + (when dedicate + ;; Dedicate window to buffer. + (set-window-dedicated-p window dedicate))) (when new-window ;; Adjust sizes if asked for (for `fit-window-to-buffer' and ;; friends BUFFER must be already shown in the new window). -- 2.39.2