GNU bug report logs - #7533
24.0.50; `dired-mark-pop-up': delete frame afterwards if `pop-up-frames'

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Thu, 2 Dec 2010 18:32:01 UTC

Severity: minor

Found in version 24.0.50

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 7533 <at> debbugs.gnu.org, 'Stefan Monnier' <monnier <at> IRO.UMontreal.CA>
Subject: bug#7533: 24.0.50; `dired-mark-pop-up': delete frame afterwards if `pop-up-frames'
Date: Fri, 06 Apr 2012 16:02:42 +0200
[Message part 1 (text/plain, inline)]
> emacs -Q
>
> (setq special-display-regexps '("[ ]?[*][^*]+[*]"))
> (setq pop-up-frame t)

I suppose you mean

(setq pop-up-frames t)

but apparently this variable is no more supported by `display-buffer'
(I'm not sure whether that's by design).

> C-x d whatever-dir
>
> Mark 4 files for deletion.  Hit `x'.  Answer `yes'.
>
> The *Deletions* frame remains displayed.

Would the attached patch fix it?

This is NOT a generic fix - it might fail miserably if the buffer in
question is shown in two windows simultaneously.  Apparently this is no
great issue in the case at hand since `dired-pop-to-buffer' already
calls `get-buffer-window'.  I earlier provided a variable called
`display-buffer-window' for this and related issues but Stefan didn't
like it.

martin
[dired.diff (text/plain, inline)]
bzr diff
=== modified file 'lisp/dired.el'
--- lisp/dired.el	2012-04-01 02:44:24 +0000
+++ lisp/dired.el	2012-04-06 13:35:09 +0000
@@ -2950,8 +2950,7 @@
 		    ;; that's possible.  (Bug#1806)
 		    (split-window-below))
 	       ;; Otherwise, try to split WINDOW sensibly.
-	       (split-window-sensibly window))))
-	pop-up-frames)
+	       (split-window-sensibly window)))))
     (pop-to-buffer (get-buffer-create buf)))
   ;; If dired-shrink-to-fit is t, make its window fit its contents.
   (when dired-shrink-to-fit
@@ -2993,17 +2992,21 @@
 	  ;; 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)
-      (apply function args))))
+    (let ((buffer (get-buffer-create bufname)))
+      (with-current-buffer buffer
+	(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))
+	(dired-pop-to-buffer buffer)
+	(let ((window (get-buffer-window buffer)))
+	  (prog1
+	      (apply function args)
+	    (when (and window (eq (window-buffer window) buffer))
+	      (quit-window nil window))))))))
 
 (defun dired-format-columns-of-files (files)
   (let ((beg (point)))



This bug report was last modified 12 years and 311 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.