all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@IRO.UMontreal.CA>,
	"'martin rudalics'" <rudalics@gmx.at>
Cc: 7533@debbugs.gnu.org
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	[thread overview]
Message-ID: <6119F1CF7E7141E28FA3CDF62C165B19@us.oracle.com> (raw)
In-Reply-To: <jwvr5dyob9x.fsf-monnier+emacs@gnu.org>

> 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.






  reply	other threads:[~2012-04-05 20:23 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02 18:35 bug#7533: 24.0.50; `dired-mark-pop-up': delete frame afterwards if `pop-up-frames' Drew Adams
2010-12-02 19:05 ` martin rudalics
2010-12-02 19:22   ` Drew Adams
2010-12-03  8:17     ` martin rudalics
2010-12-03 16:22       ` Drew Adams
2010-12-03 18:16         ` martin rudalics
2010-12-03 18:33           ` Drew Adams
2010-12-03 18:41             ` martin rudalics
2010-12-04 22:44               ` Chong Yidong
2010-12-16 18:27                 ` Drew Adams
2010-12-17  6:32                   ` martin rudalics
2010-12-17 15:32                     ` Drew Adams
2010-12-17 16:12                       ` martin rudalics
2010-12-17 16:55                         ` Drew Adams
2010-12-17 18:09                           ` martin rudalics
2010-12-17 18:40                             ` Drew Adams
2010-12-21  6:48                           ` Chong Yidong
2010-12-03 20:27       ` Stefan Monnier
2012-04-05 20:23         ` Drew Adams [this message]
2012-04-06 14:02           ` martin rudalics
2012-04-06 14:44             ` Drew Adams
2012-04-06 14:53               ` martin rudalics
2012-04-06 15:34                 ` Drew Adams
2012-04-06 15:47                   ` martin rudalics
2012-04-06 16:10                     ` Drew Adams
2012-04-06 16:56                       ` martin rudalics
2012-04-06 17:08                         ` Drew Adams
2012-04-18 14:32                           ` Drew Adams
2012-05-25 20:52                             ` Drew Adams
2012-05-26 17:55                               ` bug#7533: 24.0.50; `dired-mark-pop-up': delete frame afterwards if `pop-up-frames' [PATCH] Drew Adams
2012-05-27 13:21                                 ` martin rudalics
2012-05-27 14:33                                   ` Drew Adams
2011-01-18 22:14 ` bug#7533: 24.0.50; `dired-mark-pop-up': delete frame afterwards if `pop-up-frames' Drew Adams
2012-09-05 14:30 ` martin rudalics
2012-09-05 14:33   ` Drew Adams
2012-10-03  9:11     ` martin rudalics
2012-10-03 15:52     ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6119F1CF7E7141E28FA3CDF62C165B19@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=7533@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.