unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12764: 24.2; `quit-window' wrongly iconifies frame
@ 2012-10-29 18:12 Romain Francoise
  2012-10-30  3:26 ` Chong Yidong
  0 siblings, 1 reply; 7+ messages in thread
From: Romain Francoise @ 2012-10-29 18:12 UTC (permalink / raw)
  To: 12764

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

When you hit `q' the frame gets iconified, even though it was not
created by M-x man.

Git bisect finds the following commit as the culprit:

| eb54d3ecc6903155955fc07d7f3baaed912c8378 is the first bad commit
| commit eb54d3ecc6903155955fc07d7f3baaed912c8378
| Author: martin rudalics <rudalics@gmx.at>
| Date:   Tue Oct 4 17:28:25 2011 +0200
| 
|     Make frame iconification/deletion optional when burying buffers.
| 
|     * window.el (window--delete): New function.
|     (frame-auto-delete): Resuscitate option.
|     (bury-buffer, replace-buffer-in-windows)
|     (quit-window): Rewrite using window--delete.
|     (display-buffer-pop-up-frame, display-buffer-pop-up-window):
|     Pass display-buffer-mark-dedicated to window--display-buffer-2
|     (Bug#9639).

Adding martin to Cc list.
Thanks,


In GNU Emacs 24.2.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2012-10-29 on silenus
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
Configured using:
 `configure '--with-x-toolkit=lucid' '--without-dbus' '--without-gconf'
 '--without-gsettings' '--without-selinux' '--without-sound'
 '--without-m17n-flt' '--without-gpm' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security'
 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o r SPC e m <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils time-date tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer loaddefs button faces cus-face files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dynamic-setting
font-render-setting x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#12764: 24.2; `quit-window' wrongly iconifies frame
  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
  0 siblings, 2 replies; 7+ messages in thread
From: Chong Yidong @ 2012-10-30  3:26 UTC (permalink / raw)
  To: Martin Rudalics; +Cc: Romain Francoise, 12764

Romain Francoise <romain@orebokech.com> writes:

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

=== modified file 'lisp/window.el'
*** lisp/window.el	2012-10-27 08:58:30 +0000
--- lisp/window.el	2012-10-30 03:23:59 +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,3566 ----
  	 quad entry)
      (cond
       ((and (not prev-buffer)
! 	   (or (eq (nth 1 quit-restore) 'frame)
! 	       ;; If the window had been created on an existing frame,
! 	       ;; do not try to delete the frame.
! 	       (and (eq (nth 1 quit-restore) 'window)
! 		    (not (eq (window-deletable-p window) 'frame))))
  	   (eq (nth 3 quit-restore) buffer)
  	   ;; Delete WINDOW if possible.
  	   (window--delete window nil (eq bury-or-kill 'kill)))






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#12764: 24.2; `quit-window' wrongly iconifies frame
  2012-10-30  3:26 ` Chong Yidong
@ 2012-10-30  8:40   ` Romain Francoise
  2012-10-30 10:27   ` martin rudalics
  1 sibling, 0 replies; 7+ messages in thread
From: Romain Francoise @ 2012-10-30  8:40 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 12764

Chong Yidong <cyd@gnu.org> writes:

> I think the attached patch is required to fix this.

Works for me, thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#12764: 24.2; `quit-window' wrongly iconifies frame
  2012-10-30  3:26 ` Chong Yidong
  2012-10-30  8:40   ` Romain Francoise
@ 2012-10-30 10:27   ` martin rudalics
  2012-10-31 10:26     ` martin rudalics
  1 sibling, 1 reply; 7+ messages in thread
From: martin rudalics @ 2012-10-30 10:27 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Romain Francoise, 12764

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






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#12764: 24.2; `quit-window' wrongly iconifies frame
  2012-10-30 10:27   ` martin rudalics
@ 2012-10-31 10:26     ` martin rudalics
  2012-11-01  2:16       ` Chong Yidong
  2012-11-04 20:48       ` Romain Francoise
  0 siblings, 2 replies; 7+ messages in thread
From: martin rudalics @ 2012-10-31 10:26 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Romain Francoise, 12764

> *** 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)))

Installed now in revision 110748 on trunk.  Please check again.

Thanks, martin






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#12764: 24.2; `quit-window' wrongly iconifies frame
  2012-10-31 10:26     ` martin rudalics
@ 2012-11-01  2:16       ` Chong Yidong
  2012-11-04 20:48       ` Romain Francoise
  1 sibling, 0 replies; 7+ messages in thread
From: Chong Yidong @ 2012-11-01  2:16 UTC (permalink / raw)
  To: martin rudalics; +Cc: Romain Francoise, 12764-done

martin rudalics <rudalics@gmx.at> writes:

> Installed now in revision 110748 on trunk.  Please check again.

Looks and works OK to me.  Thank you.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#12764: 24.2; `quit-window' wrongly iconifies frame
  2012-10-31 10:26     ` martin rudalics
  2012-11-01  2:16       ` Chong Yidong
@ 2012-11-04 20:48       ` Romain Francoise
  1 sibling, 0 replies; 7+ messages in thread
From: Romain Francoise @ 2012-11-04 20:48 UTC (permalink / raw)
  To: martin rudalics; +Cc: Chong Yidong, 12764

Works for me as well, thanks martin!





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-11-04 20:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-10-31 10:26     ` martin rudalics
2012-11-01  2:16       ` Chong Yidong
2012-11-04 20:48       ` Romain Francoise

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).