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#11939: 24.1; `save-buffers-kill-emacs'losesminibufferfocuswhenitcalls`list-processes' Date: Sat, 25 Aug 2012 21:11:51 -0700 Message-ID: <6CBC512747C54FC0A9F69E36BC8E384B@us.oracle.com> References: <501D275D.3000701@gmx.at><7E4F337C7F6A4B8281!ABE6C82A8CA70E@us.ora cle.com><501FE2D4.1 050103@gmx.at><559D41024BC44EAC92C09DC14E1B7362@us.oracle.com><5022103E.6060502@gmx.at><72C02B3C324744308FB2DF605F46CCA3@us.oracle.com> <502378A8.90!10707@gmx.at> <5026266! 6.2060809@gmx.at> <502!785DF.1040200@gmx.at> <5028! A8FD.60705@gmx .at> < EE0A8E04D35647FE8CAAC52A84777A82@us.oracle.com> <502! A160E.5040601@gmx.at> <4AF3BD064346446AB0F2AEAB5DDCB9DA@us.oracle.com>! <502B7AC2.70004@gmx. at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1345954344 7817 80.91.229.3 (26 Aug 2012 04:12:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Aug 2012 04:12:24 +0000 (UTC) Cc: 11939@debbugs.gnu.org To: "'martin rudalics'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 26 06:12:24 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T5UD1-0002Lm-RE for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Aug 2012 06:12:24 +0200 Original-Received: from localhost ([::1]:36593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5UCz-0004H1-PG for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Aug 2012 00:12:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5UCw-0004Gk-Ru for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2012 00:12:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T5UCv-0008Tg-DH for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2012 00:12:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5UCv-0008Tc-9D for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2012 00:12:17 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T5UDd-0006gG-Jv for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2012 00:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Aug 2012 04:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11939 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11939-submit@debbugs.gnu.org id=B11939.134595437225667 (code B ref 11939); Sun, 26 Aug 2012 04:13:01 +0000 Original-Received: (at 11939) by debbugs.gnu.org; 26 Aug 2012 04:12:52 +0000 Original-Received: from localhost ([127.0.0.1]:49207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T5UDU-0006fv-9g for submit@debbugs.gnu.org; Sun, 26 Aug 2012 00:12:52 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:32949) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T5UDR-0006fm-2v for 11939@debbugs.gnu.org; Sun, 26 Aug 2012 00:12:50 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q7Q4C1i9009392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 26 Aug 2012 04:12:02 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q7Q4C1BK021305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 26 Aug 2012 04:12:01 GMT Original-Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q7Q4C10U030830; Sat, 25 Aug 2012 23:12:01 -0500 Original-Received: from dradamslap1 (/10.159.173.52) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 25 Aug 2012 21:12:00 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <502B7AC2.70004@gmx.at> thread-index: Ac160UW37ckkAMgES7m0LHnOIA3/FwIbYklg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:63495 Archived-At: FYI - I had updated my version of `special-display-popup-frame' to fit the latest Emacs 24 definition of it. (All my version tries to do differently is fit the popped up frame to its buffer, nothing more.) It turns out that in making that update I dropped this sexp from my original definition of the function - the sexp is not in the vanilla Emacs definition: (set-window-buffer window buffer) I have now added that back, because the code does not work without it. The problem was that the frame popped up did not show the BUFFER. It showed another buffer. I mention this in case it might also be needed for the vanilla code (?), or in case it might point to a bug somewhere. You understand these things better than I, Martin. Perhaps you will understand just what is going on. Below is the full definition I am using, which works fine now, (just as before Emacs 24). You don't care about the code that fits the frame, but I show the full definition, just in case it helps you understand better why I might need to explicitly `set-window-buffer' and the vanilla code apparently does not need to do that (?). If you learn something from this, or if you can tell me what I'm not understanding, please let me know. Thx. (defun special-display-popup-frame (buffer &optional args) "Pop up a frame displaying BUFFER. Return its window. If BUFFER is already displayed in a visible or iconified frame then raise that frame. Otherwise, display BUFFER in a new frame. Optional argument ARGS is a list specifying additional information. If ARGS is an alist, use it as a list of frame parameters. If these parameters contain (same-window . t) then display BUFFER in the selected window. If they contain (same-frame . t) then display BUFFER in a window of the selected frame. If ARGS is a list whose car is a symbol then use (car ARGS) as a function to do the work: display the buffer and raise its frame. Pass it BUFFER as first argument, and (cdr ARGS) as the rest of the arguments." (if (and args (symbolp (car args))) (apply (car args) buffer (cdr args)) (let ((window (get-buffer-window buffer 0))) (or ;; If we have a window already, make it visible. (and window (let ((frame (window-frame window))) (make-frame-visible frame) (raise-frame frame) (when (fboundp 'display-buffer-record-window) ; Emacs 24+ (display-buffer-record-window 'reuse window buffer)) (when (fboundp 'fit-frame) (fit-frame frame)) window)) ; Return the window. ;; Reuse the selected window if the caller requested it. (and (cdr (assq 'same-window args)) (condition-case nil ; Try Emacs 24 `switch-to-buffer' first. (progn (switch-to-buffer buffer nil t) (selected-window)) (error ; Try again, with old `switch-to-buffer'. (condition-case nil (progn (switch-to-buffer buffer) (selected-window)) (error nil))))) ;; Stay on the same frame if requested. (and (or (cdr (assq 'same-frame args)) (cdr (assq 'same-window args))) (let ((pop-up-windows t) (pop-up-frames nil) (special-display-buffer-names ()) (special-display-regexps ())) (display-buffer buffer))) ;; If no window yet, make one in a new frame. ;; `make-frame' creates the frame before the buffer is shown in it, ;; so do not call `fit-frame' until we can select the buffer's window. (let* ((make-frame-functions (delq 'fit-frame after-make-frame-functions)) (frame (with-current-buffer buffer (make-frame (append args special-display-frame-alist)))) (window (frame-selected-window frame))) ;; *** IS THIS NOT NEEDED ALSO FOR VANILLA EMACS? WHY NOT? *** (set-window-buffer window buffer) (set-window-dedicated-p window t) (when (fboundp 'display-buffer-record-window) ; Emacs 24+ (display-buffer-record-window 'frame window buffer)) ;; Now call `fit-frame', with WINDOW selected. (with-selected-window window (fit-frame)) window))))) ; Return the window.