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#7533: 24.0.50; `dired-mark-pop-up': delete frame afterwards if `pop-up-frames' Date: Thu, 5 Apr 2012 13:23:46 -0700 Message-ID: <6119F1CF7E7141E28FA3CDF62C165B19@us.oracle.com> References: <90E09641E9264B37932D2315E5E7E2EA@us.oracle.com><4CF7EDED.5090500@gmx.at><44FB8E26FD824BB18AE8A367F560C091@us.oracle.com><4CF8A7B2.5080306@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: dough.gmane.org 1333657492 16054 80.91.229.3 (5 Apr 2012 20:24:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Apr 2012 20:24:52 +0000 (UTC) Cc: 7533@debbugs.gnu.org To: "'Stefan Monnier'" , "'martin rudalics'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 05 22:24:50 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 1SFtEe-0002aX-25 for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Apr 2012 22:24:48 +0200 Original-Received: from localhost ([::1]:47697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFtEb-0002si-6m for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Apr 2012 16:24:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFtEQ-0002sQ-6B for bug-gnu-emacs@gnu.org; Thu, 05 Apr 2012 16:24:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFtEK-0008GX-N3 for bug-gnu-emacs@gnu.org; Thu, 05 Apr 2012 16:24:31 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFtEK-0008GB-If for bug-gnu-emacs@gnu.org; Thu, 05 Apr 2012 16:24:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SFtEs-0002uE-H0 for bug-gnu-emacs@gnu.org; Thu, 05 Apr 2012 16:25:02 -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: Thu, 05 Apr 2012 20:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7533 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7533-submit@debbugs.gnu.org id=B7533.133365747311135 (code B ref 7533); Thu, 05 Apr 2012 20:25:02 +0000 Original-Received: (at 7533) by debbugs.gnu.org; 5 Apr 2012 20:24:33 +0000 Original-Received: from localhost ([127.0.0.1]:41794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SFtEP-0002tX-1k for submit@debbugs.gnu.org; Thu, 05 Apr 2012 16:24:33 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:20584) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SFtEI-0002tL-SN for 7533@debbugs.gnu.org; Thu, 05 Apr 2012 16:24:31 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q35KNomx007253 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 5 Apr 2012 20:23:51 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q35KNn34006097 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Apr 2012 20:23:49 GMT Original-Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q35KNmko008283; Thu, 5 Apr 2012 15:23:49 -0500 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 05 Apr 2012 13:23:48 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcuTKIM9NH7qQWvFQN22AddijPhIpmAP3c6A X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090205.4F7DFF57.0060,ss=1,re=0.000,fgs=0 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:58535 Archived-At: > From: Stefan Monnier Sent: Friday, December 03, 2010 12:27 PM > > Here I have two things: A window parameter that tells for > > each window whether the current buffer is the first buffer > > shown in it and a separate global variable which gives some > > rudimentary information about what the last `display-buffer' > > invocation did to find a suitable window. > > Indeed. We currently have display-buffer-mark-dedicated which goes in > this direction, but uses dedicatedness, which is not always > desired, apparently. > > I think that adding a "buffer for which this window was > created" window parameter and always set it in display-buffer > (regardless of display-buffer-mark-dedicated) should allow > correct handling of such situations. This regression is still not fixed. There was a lot of dancing around and singing about new ways of handling buffer display and windows (vs old-fashioned `pop-up-frames' etc.). But the new ways were added to Emacs and this regression still remains. emacs -Q (setq special-display-regexps '("[ ]?[*][^*]+[*]")) (setq pop-up-frame t) C-x d whatever-dir Mark 4 files for deletion. Hit `x'. Answer `yes'. The *Deletions* frame remains displayed. At the beginning of this thread I offered some code that at least handles this case fine, AFAICT. Actually, I forgot a prog1. Here it is again... The only difference from what is in Emacs is the last two lines, which delete the frame when done. That's all I'm asking for: please delete the frame that you pop up. (defun dired-mark-pop-up (bufname op-symbol files function &rest args) "..." (or bufname (setq bufname " *Marked Files*")) (if (or (eq dired-no-confirm t) (memq op-symbol dired-no-confirm) ;; If FILES defaulted to the current line's file. (= (length files) 1)) (apply function args) (with-current-buffer (get-buffer-create bufname) (erase-buffer) ;; Handle (t FILE) just like (FILE), here. ;; That value is used (only in some cases), to mean just one ;; file that was marked, rather than the current line file. (dired-format-columns-of-files (if (eq (car files) t) (cdr files) files)) (remove-text-properties (point-min) (point-max) '(mouse-face nil help-echo nil))) (save-window-excursion (dired-pop-to-buffer bufname) (prog1 (apply function args) (if (one-window-p) (delete-frame) (delete-window)))))) Yes, it is no doubt true that `save-window-excursion' is inappropriate when used with code displaying a buffer, as Martin pointed. Yes, there might be other things inappropriate or inelegant here. But it works for the use case of the bug report at least, and Emacs 24 -Q does not work for that case. Again, I do not really care how this bug is fixed. But please fix it.