Subject: Re: bug#7533: 24.0.50; `dired-mark-pop-up': delete frame afterwards if `pop-up-frames'

From: martin rudalics <[email-masked]>
Date: Thu, 02 Dec 2010 20:05:17 +0100

> (save-window-excursion
 >   (dired-pop-to-buffer bufname)
 >   (apply function args)
 >   (if (one-window-p) (delete-frame) (delete-window))) ; <===== NEW

This would be funny when `pop-up-frames' is nil and a window gets reused
for showing the *Deletions* buffer.  In particular if that window is the
only window on its frame ;-)

BTW the `save-window-excursion' is completely useless when you pop up a
new frame.

 > The important thing, for me, is that the frame that was created just to
 > show the files that will be deleted (or whatever) goes away.  It should
 > be only a _temporary_ frame because its only raison d'etre is as part of
 > the deletion etc. _dialog_.

Here I have a simple function called `quit-restore-window' which does
exactly that.

 > [Martin will explain that a different test from `one-window-p' is more
 > appropriate. ;-)  IIRC, he generally prefers something like this to
 > (one-window-p win): (eq win (frame-root-window (window-frame win))).]

Because `one-window-p' calls `next-window' which I don't like.  See the
recent discussion about `loop' endlessly cycling over windows.

martin