From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: bug in calendar-exit (calendar-hide-window) Date: Fri, 22 Jun 2012 12:22:16 +0200 Message-ID: <4FE44758.10607@gmx.at> References: <87zk7wwc6c.fsf@hecubus.retroj.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010706020402040707060809" X-Trace: dough.gmane.org 1340360553 19600 80.91.229.3 (22 Jun 2012 10:22:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 22 Jun 2012 10:22:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: John J Foerch Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 22 12:22:32 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Si10S-0003ZT-Vt for ged-emacs-devel@m.gmane.org; Fri, 22 Jun 2012 12:22:25 +0200 Original-Received: from localhost ([::1]:52047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si10S-0001uL-Ud for ged-emacs-devel@m.gmane.org; Fri, 22 Jun 2012 06:22:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si10N-0001t7-Fj for emacs-devel@gnu.org; Fri, 22 Jun 2012 06:22:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Si10H-0008KV-5m for emacs-devel@gnu.org; Fri, 22 Jun 2012 06:22:19 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:43363) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Si10G-0008JW-SF for emacs-devel@gnu.org; Fri, 22 Jun 2012 06:22:13 -0400 Original-Received: (qmail invoked by alias); 22 Jun 2012 10:22:11 -0000 Original-Received: from 62-47-46-16.adsl.highway.telekom.at (EHLO [62.47.46.16]) [62.47.46.16] by mail.gmx.net (mp016) with SMTP; 22 Jun 2012 12:22:11 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19Sr/9xjolSG7AM5/STcW1/VsaPCa3azqjTnJLf9V s6th+vfSz2Plzv In-Reply-To: <87zk7wwc6c.fsf@hecubus.retroj.net> X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151081 Archived-At: This is a multi-part message in MIME format. --------------010706020402040707060809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I suppose > (setq pop-up-windows nil > pop-up-frames t > special-display-buffer-names '(("*Calendar*" (same-frame . t))) > display-buffer-mark-dedicated 'weak) > > Under this configuration, pop-up-frames are used, with windows dedicated > to their buffers, but the calendar is opened in the current frame, not a > new frame. Calendar-hide-window seems to assume that whenever dedicated > windows are being used, it is okay to delete or iconify a frame: > > (cond > ... > ((and (display-multi-frame-p) (window-dedicated-p window)) > (if calendar-remove-frame-by-deleting > (delete-frame (window-frame window)) > (iconify-frame (window-frame window)))) > ... > ) > > M-x version: > > GNU Emacs 23.4.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) > of 2012-04-07 on trouble, modified by Debian > > Any thoughts for a solution? The corresponding code has changed on trunk but the bug is still present. Note that you now have to (setq calendar-setup t) in order to reproduce it. I'd propose the attached patch which still has the deficiency that KILL is not respected when the buffer appears on a separate frame. This is, however, a general problem shared, for example, by `debug' which kills the *Backtrace* buffer when it appears on the same frame and retains it when on another. martin --------------010706020402040707060809 Content-Type: text/plain; name="calendar.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="calendar.diff" *** lisp/calendar/calendar.el 2012-06-06 18:46:34 +0000 --- lisp/calendar/calendar.el 2012-06-22 09:53:14 +0000 *************** *** 1818,1827 **** (dolist (w (window-list-1 nil nil t)) (if (and (memq (window-buffer w) calendar-buffers) (window-dedicated-p w)) ! (if calendar-remove-frame-by-deleting ! (delete-frame (window-frame w)) ! (iconify-frame (window-frame w))) ! (quit-window kill w))) (dolist (b calendar-buffers) (quit-windows-on b kill)))))) --- 1818,1828 ---- (dolist (w (window-list-1 nil nil t)) (if (and (memq (window-buffer w) calendar-buffers) (window-dedicated-p w)) ! (if (eq (window-deletable-p w) 'frame) ! (if calendar-remove-frame-by-deleting ! (delete-frame (window-frame w)) ! (iconify-frame (window-frame w))) ! (quit-window kill w)))) (dolist (b calendar-buffers) (quit-windows-on b kill)))))) --------------010706020402040707060809--