From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#8851: 24.0.50; regression: special-display-frame is no longer dedicated Date: Mon, 13 Jun 2011 11:41:17 -0700 Message-ID: <0C191F638279437BADFCC697A5389F9E@us.oracle.com> References: <853BDEF1AA9646ACB90724066E1A5951@us.oracle.com> <4DF65024.20305@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1307990721 31136 80.91.229.12 (13 Jun 2011 18:45:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Jun 2011 18:45:21 +0000 (UTC) Cc: 8851@debbugs.gnu.org To: "'martin rudalics'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 13 20:45:17 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QWC8T-0007eT-7K for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Jun 2011 20:45:17 +0200 Original-Received: from localhost ([::1]:54747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWC8S-0002vd-Kt for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Jun 2011 14:45:16 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWC5O-0002aw-C6 for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2011 14:42:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWC5M-0006Em-2Z for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2011 14:42:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:32964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWC5L-0006Ec-Qr for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2011 14:42:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QWC5K-0001YO-IB; Mon, 13 Jun 2011 14:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Jun 2011 18:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8851 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8851-submit@debbugs.gnu.org id=B8851.13079905125955 (code B ref 8851); Mon, 13 Jun 2011 18:42:02 +0000 Original-Received: (at 8851) by debbugs.gnu.org; 13 Jun 2011 18:41:52 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QWC59-0001Y0-UT for submit@debbugs.gnu.org; Mon, 13 Jun 2011 14:41:52 -0400 Original-Received: from acsinet12.oracle.com ([141.146.126.234]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QWC56-0001Xl-FD for 8851@debbugs.gnu.org; Mon, 13 Jun 2011 14:41:49 -0400 Original-Received: from rtcsinet22.oracle.com (rtcsinet22.oracle.com [66.248.204.30]) by acsinet12.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p5DIfMgf032550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 Jun 2011 18:41:26 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by rtcsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p5DIfLtO012481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Jun 2011 18:41:22 GMT Original-Received: from abhmt009.oracle.com (abhmt009.oracle.com [141.146.116.18]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p5DIfFOP013947; Mon, 13 Jun 2011 13:41:15 -0500 Original-Received: from dradamslap1 (/130.35.179.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Jun 2011 11:41:15 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4DF65024.20305@gmx.at> Thread-Index: Acwp97GWE73a8FfnT62jTah9FG0ccwAAW3PA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 X-Source-IP: rtcsinet22.oracle.com [66.248.204.30] X-CT-RefId: str=0001.0A090201.4DF659E2.011D:SCFSTAT5015188,ss=1,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 13 Jun 2011 14:42:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:47111 Archived-At: > Does the patch below fix it? Thanks for your quick reply, Martin. No, I'm afraid it doesn't change anything wrt this bug. I didn't download the latest source files to apply your patch, but the build I'm using is supposedly from today. I applied your patch manually to its source code, which means that I eval'ed these two updated definitions (below). That didn't help. (defun display-buffer-in-window (buffer window specifiers) "Display BUFFER in WINDOW and raise its frame if needed. WINDOW must be a live window and defaults to the selected one. Return WINDOW. SPECIFIERS must be a list of buffer display specifiers, see the documentation of `display-buffer-alist' for a description." (setq buffer (normalize-live-buffer buffer)) (setq window (normalize-live-window window)) (let* ((old-frame (selected-frame)) (new-frame (window-frame window)) (dedicated (cdr (assq 'dedicated specifiers))) (no-other-window (cdr (assq 'no-other-window specifiers)))) ;; Show BUFFER in WINDOW. ;;---- (set-window-dedicated-p window nil) (set-window-buffer window buffer) (when dedicated (set-window-dedicated-p window dedicated)) (when no-other-window (set-window-parameter window 'no-other-window t)) (unless (eq old-frame new-frame) (display-buffer-select-window window)) ;; Return window. window)) (defun display-buffer-reuse-window (buffer method &optional specifiers) "Display BUFFER in an existing window. METHOD must be a list in the form of the cdr of a `reuse-window' buffer display specifier, see `display-buffer-alist' for an explanation. The first element must specifiy the window to use, and can be either nil, `same', `other', or a live window. The second element must specify the window's buffer and can be either nil, `same', `other', or a live buffer. The third element is the frame to use - either nil, 0, `visible', `other', t, or a live frame. Optional argument SPECIFIERS must be a list of valid display specifiers. Return the window chosen to display BUFFER, nil if none was found." (let* ((method-window (nth 0 method)) (method-buffer (nth 1 method)) (method-frame (nth 2 method)) (reuse-dedicated (assq 'reuse-window-dedicated specifiers)) windows other-frame dedicated time best-window best-time) (when (eq method-frame 'other) ;; `other' is not handled by `window-list-1'. (setq other-frame t) (setq method-frame t)) (dolist (window (window-list-1 nil 'nomini method-frame)) (let ((window-buffer (window-buffer window))) (when (and (not (window-minibuffer-p window)) ;; Don't reuse a side window. (or (not (eq (window-parameter window 'window-side) 'side)) (eq window-buffer buffer)) (or (not method-window) (and (eq method-window 'same) (eq window (selected-window))) (and (eq method-window 'other) (not (eq window (selected-window)))) ;; Special case for applications that specifiy ;; the window explicitly. (eq method-window window)) (or (not method-buffer) (and (eq method-buffer 'same) (eq window-buffer buffer)) (and (eq method-buffer 'other) (not (eq window-buffer buffer))) ;; Special case for applications that specifiy ;; the window's buffer explicitly. (eq method-buffer window-buffer)) (or (not other-frame) (not (eq (window-frame window) (selected-frame)))) ;; Handle dedicatedness. (or (eq window-buffer buffer) ;; The window does not show the same buffer. (not (setq dedicated (window-dedicated-p window))) ;; If the window is weakly dedicated to its ;; buffer, reuse-dedicated must be non-nil. (and (not (eq dedicated t)) reuse-dedicated) ;; If the window is strongly dedicated to its ;; buffer, reuse-dedicated must be t. (eq reuse-dedicated t))) (setq windows (cons window windows))))) (if (eq method-buffer 'same) ;; When reusing a window on the same buffer use the lru one. (dolist (window windows) (setq time (window-use-time window)) (when (or (not best-window) (< time best-time)) (setq best-window window) (setq best-time time))) ;; Otherwise, sort windows according to their use-time. (setq windows (sort windows #'(lambda (window-1 window-2) (<= (window-use-time window-1) (window-use-time window-2))))) (setq best-window ;; Try to get a full-width window (this is silly and can ;; get us to another frame but let's ignore these issues ;; for the moment). (catch 'found (dolist (window windows) (when (window-full-width-p window) (throw 'found window))) ;; If there's no full-width window return the lru window. (car windows)))) (when best-window (display-buffer-even-window-sizes best-window specifiers) ;; Never change the quit-restore parameter of a window here. (if (eq (window-buffer best-window) buffer) (setq display-buffer-window (cons best-window 'reuse-buffer-window)) (setq display-buffer-window (cons best-window 'reuse-other-window)) (unless (window-parameter best-window 'quit-restore) ;; Don't overwrite an existing quit-restore entry. (set-window-parameter best-window 'quit-restore (list (window-buffer best-window) (window-start best-window) (window-point best-window) buffer (window-total-size best-window) (selected-window))))) ;; Reset dedicated status of best-window here. (set-window-dedicated-p best-window nil) (display-buffer-in-window buffer best-window specifiers))))