all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: John J Foerch <jjfoerch@earthlink.net>
Cc: emacs-devel@gnu.org
Subject: Re: bug in calendar-exit (calendar-hide-window)
Date: Fri, 22 Jun 2012 12:22:16 +0200	[thread overview]
Message-ID: <4FE44758.10607@gmx.at> (raw)
In-Reply-To: <87zk7wwc6c.fsf@hecubus.retroj.net>

[-- Attachment #1: Type: text/plain, Size: 1413 bytes --]

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

[-- Attachment #2: calendar.diff --]
[-- Type: text/plain, Size: 1078 bytes --]

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


  reply	other threads:[~2012-06-22 10:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-21 22:08 bug in calendar-exit (calendar-hide-window) John J Foerch
2012-06-22 10:22 ` martin rudalics [this message]
2012-06-25 17:04   ` Glenn Morris
2012-06-26  7:25     ` martin rudalics
2012-06-26 13:02       ` John J Foerch

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=4FE44758.10607@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=jjfoerch@earthlink.net \
    /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.