all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Chong Yidong <cyd@gnu.org>
Cc: Romain Francoise <romain@orebokech.com>, 12764@debbugs.gnu.org
Subject: bug#12764: 24.2; `quit-window' wrongly iconifies frame
Date: Tue, 30 Oct 2012 11:27:40 +0100	[thread overview]
Message-ID: <508FAB9C.7020504@gmx.at> (raw)
In-Reply-To: <87pq408wt3.fsf@gnu.org>

 >> There's a regression in Emacs 24 compared to Emacs 23 wrt the behavior
 >> of `quit-window'. In some circumstances, it iconifies frames that were
 >> existing before the current buffer was created, which (AIUI) it's not
 >> supposed to do.
 >>
 >> Recipe starting from `emacs -Q':
 >> - C-x 5 2 to create a new frame
 >> - in the new frame, M-x man RET emacs RET
 >> - C-x 0 to make the man buffer the current buffer

Which means that we now have a single-window frame where that window has
been specially created for showing man.  We could intepret the user's
intentions here also as "show me man in a separate, dedicated frame".

 >> - q
 >>
 >> When you hit `q' the frame gets iconified, even though it was not
 >> created by M-x man.
 >
 > I think the attached patch is required to fix this.  Martin, please
 > review, thanks.

I'm not sure whether the current behavior should be considered incorrect
or a feature.  C-x 5 2 usually shows the same buffer as in the previous
frame's selected window.  Showing it instead of man doesn't strike me as
something very useful.

OTOH if the user has worked on a different buffer in the new frame and
used C-x 0 in order to temporarily show more of the man page, it makes
sense to show that other buffer again.  And if users really wanted to
show man on a separate frame, they could do so immediately.

In any case I'd propose the slightly different patch below.
	
martin


*** lisp/window.el	2012-10-27 08:58:30 +0000
--- lisp/window.el	2012-10-30 09:51:16 +0000
***************
*** 3556,3562 ****
   	 quad entry)
       (cond
        ((and (not prev-buffer)
! 	   (memq (nth 1 quit-restore) '(window frame))
   	   (eq (nth 3 quit-restore) buffer)
   	   ;; Delete WINDOW if possible.
   	   (window--delete window nil (eq bury-or-kill 'kill)))
--- 3556,3567 ----
   	 quad entry)
       (cond
        ((and (not prev-buffer)
! 	   (or (eq (nth 1 quit-restore) 'frame)
! 	       (and (eq (nth 1 quit-restore) 'window)
! 		    ;; If the window has been created on an existing
! 		    ;; frame and winds up as the sole window on that
! 		    ;; frame, do not delete it (Bug#12764).
! 		    (not (eq window (frame-root-window window)))))
   	   (eq (nth 3 quit-restore) buffer)
   	   ;; Delete WINDOW if possible.
   	   (window--delete window nil (eq bury-or-kill 'kill)))






  parent reply	other threads:[~2012-10-30 10:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29 18:12 bug#12764: 24.2; `quit-window' wrongly iconifies frame Romain Francoise
2012-10-30  3:26 ` Chong Yidong
2012-10-30  8:40   ` Romain Francoise
2012-10-30 10:27   ` martin rudalics [this message]
2012-10-31 10:26     ` martin rudalics
2012-11-01  2:16       ` Chong Yidong
2012-11-04 20:48       ` Romain Francoise

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=508FAB9C.7020504@gmx.at \
    --to=rudalics@gmx.at \
    --cc=12764@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    --cc=romain@orebokech.com \
    /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.