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' [PATCH] Date: Sat, 26 May 2012 10:55:42 -0700 Message-ID: <7783B19C74CD4DFAA1E6410A507A69C8@us.oracle.com> References: <90E09641E9264B37932D2315E5E7E2EA@us.oracle.com><4CF7EDED.5090500@gmx.at><44FB8E26FD824BB18AE8A367F560C091@us.oracle.com><4CF8A7B2.5080306@gmx.at><6119F1CF7E7141E28FA3CDF62C165B19@us.oracle.com><4F7EF782.6020103@gmx.at><4F7F0386.6030909@gmx.at><7F573FD9970448A282AF763F35489AA3@us.oracle.com><4F7F0FF8.7090401@gmx.at><4F7F203F.90101@gmx.at><19CE4DF0C5AC4DFE86074D71C7FC3985@us.oracle.com> <0F6E005543DB4891A01F42BEA11DE520@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_004C_01CD3B2E.1929B2F0" X-Trace: dough.gmane.org 1338055025 4196 80.91.229.3 (26 May 2012 17:57:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 26 May 2012 17:57:05 +0000 (UTC) Cc: 7533@debbugs.gnu.org To: "'martin rudalics'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 26 19:57:03 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 1SYLEb-0007dg-BP for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 May 2012 19:57:01 +0200 Original-Received: from localhost ([::1]:60210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYLEb-0007RA-0W for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 May 2012 13:57:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYLEY-0007Qc-FH for bug-gnu-emacs@gnu.org; Sat, 26 May 2012 13:56:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SYLEW-0007Bl-HM for bug-gnu-emacs@gnu.org; Sat, 26 May 2012 13:56:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYLEW-00079X-8G for bug-gnu-emacs@gnu.org; Sat, 26 May 2012 13:56:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SYLFa-0002nR-Oh for bug-gnu-emacs@gnu.org; Sat, 26 May 2012 13:58: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: Sat, 26 May 2012 17:58: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.133805504810671 (code B ref 7533); Sat, 26 May 2012 17:58:02 +0000 Original-Received: (at 7533) by debbugs.gnu.org; 26 May 2012 17:57:28 +0000 Original-Received: from localhost ([127.0.0.1]:44439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SYLF1-0002m4-Lf for submit@debbugs.gnu.org; Sat, 26 May 2012 13:57:27 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:29825) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SYLEg-0002ky-QM for 7533@debbugs.gnu.org; Sat, 26 May 2012 13:57:26 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q4QHtpqZ018251 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 26 May 2012 17:55:52 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q4QHtpIw027968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 May 2012 17:55:51 GMT Original-Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q4QHtoGd007692; Sat, 26 May 2012 12:55:50 -0500 Original-Received: from dradamslap1 (/10.159.171.147) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 26 May 2012 10:55:50 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <0F6E005543DB4891A01F42BEA11DE520@us.oracle.com> Thread-Index: Ac0UFj2qaRw7C3nMROWxAJlDHizgWQAAM7FAAlZBkiAHUfEKQAAprUeg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet22.oracle.com [141.146.126.238] 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:60372 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_004C_01CD3B2E.1929B2F0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Martin wrote: > IIUC your patch works regardless of the value of > `frame-auto-hide-function'. The problem of your patch is that in > (if (one-window-p) (delete-frame) (delete-window)) > the window for showing the buffer may have been _reused_ in which case > deleting is certainly the wrong solution. I do not understand how/why that window would or should be reused. Especially between the time it becomes displayed and the end of the calling function. The window is only for the user interaction of confirming (or not) the operation on the marked files. The existing code seems to reflect this aim in that it uses `save-window-excursion'. What is still missing is (a) deletion of the window or frame (if `one-window-p') and (b) burial of the buffer. And this should happen always, regardless of what the user does, including `C-g'. If the buffer is not shown in a separate frame then the `save-window-excursion' alone seems to remove/hide the window - great. And that is why more people are not complaining about this regression, IMO. But if the buffer is shown in a separate frame (e.g. due to `special-buffer-regexps') then `save-window-excursion' is simply not sufficient. The frame remains displayed after the user interaction, regardless of what the user does during the interaction (including `C-g'). Attached is a patch against the latest source code. AFAIK it DTRT. Can anyone point to a reasonable situation where it does not DTRT - IOW, where what it does is inappropriate? If not, can this please be installed for Emacs 24.1, to eliminate this regression? Thx. Here is a change-log entry for the patch: 2012-05-26 Drew Adams * dired.el (dired-mark-pop-up): Delete the marked-files window/frame and bury its buffer. ------=_NextPart_000_004C_01CD3B2E.1929B2F0 Content-Type: application/octet-stream; name="dired-2012-05-26.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="dired-2012-05-26.patch" diff -c dired.el dired-patched-2012-05-26.el=0A= *** dired.el Sat May 26 09:48:52 2012=0A= --- dired-patched-2012-05-26.el Sat May 26 10:43:26 2012=0A= ***************=0A= *** 2988,3009 ****=0A= in the case of one marked file, to distinguish that from using=0A= just the current file."=0A= (or bufname (setq bufname " *Marked Files*"))=0A= ! (if (or (eq dired-no-confirm t)=0A= ! (memq op-symbol dired-no-confirm)=0A= ! ;; If FILES defaulted to the current line's file.=0A= ! (=3D (length files) 1))=0A= ! (apply function args)=0A= ! (with-current-buffer (get-buffer-create bufname)=0A= ! (erase-buffer)=0A= ! ;; Handle (t FILE) just like (FILE), here.=0A= ! ;; That value is used (only in some cases), to mean=0A= ! ;; just one file that was marked, rather than the current line = file.=0A= ! (dired-format-columns-of-files (if (eq (car files) t) (cdr = files) files))=0A= ! (remove-text-properties (point-min) (point-max)=0A= ! '(mouse-face nil help-echo nil)))=0A= ! (save-window-excursion=0A= ! (dired-pop-to-buffer bufname)=0A= ! (apply function args))))=0A= =0A= (defun dired-format-columns-of-files (files)=0A= (let ((beg (point)))=0A= --- 2988,3016 ----=0A= in the case of one marked file, to distinguish that from using=0A= just the current file."=0A= (or bufname (setq bufname " *Marked Files*"))=0A= ! (let (result)=0A= ! (if (or (eq dired-no-confirm t)=0A= ! (memq op-symbol dired-no-confirm)=0A= ! ;; If FILES defaulted to the current line's file.=0A= ! (=3D (length files) 1))=0A= ! (setq result (apply function args))=0A= ! (with-current-buffer (get-buffer-create bufname)=0A= ! (erase-buffer)=0A= ! ;; Handle (t FILE) just like (FILE), here.=0A= ! ;; That value is used (only in some cases), to mean=0A= ! ;; just one file that was marked, rather than the current line = file.=0A= ! (dired-format-columns-of-files (if (eq (car files) t) (cdr = files) files))=0A= ! (remove-text-properties (point-min) (point-max)=0A= ! '(mouse-face nil help-echo nil)))=0A= ! (unwind-protect=0A= ! (save-window-excursion=0A= ! (dired-pop-to-buffer bufname)=0A= ! (setq result (apply function args)))=0A= ! (ignore-errors=0A= ! (select-window (get-buffer-window bufname 0))=0A= ! (if (one-window-p) (delete-frame) (delete-window)))=0A= ! (bury-buffer bufname)))=0A= ! result))=0A= =0A= (defun dired-format-columns-of-files (files)=0A= (let ((beg (point)))=0A= =0A= Diff finished. Sat May 26 10:48:28 2012=0A= ------=_NextPart_000_004C_01CD3B2E.1929B2F0--