unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: /srv/bzr/emacs/trunk r107697: calendar/calendar.el (calendar-exit): Use `quit-windows-on' instead of
       [not found] <E1SDGAB-00054K-Oq@vcs.savannah.gnu.org>
@ 2012-03-29 17:50 ` Glenn Morris
  2012-03-29 18:10   ` Sam Steingold
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2012-03-29 17:50 UTC (permalink / raw)
  To: Sam Steingold; +Cc: emacs-devel


Hi,

> revno: 107697
> committer: Sam Steingold <sds@gnu.org>
> branch nick: trunk
> timestamp: Thu 2012-03-29 10:00:00 -0400
> message:
>   calendar/calendar.el (calendar-exit): Use `quit-windows-on' instead of
>   the broken adhockery which does not prevent calendar buffers from
>   being displayed at random after exit.
>   (calendar-window-list, calendar-hide-window): Remove the broken adhockery.

This is an unexpected change at this stage in the release process. [1]
Could you explain exactly what it is for? My immediate inclination is to
leave it for after 24.1. (I don't disagree about there being a lot of
adhockery, but it is long-standing.)

[1] http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00318.html

> modified:
>   lisp/ChangeLog
>   lisp/calendar/calendar.el
> === modified file 'lisp/ChangeLog'
> --- a/lisp/ChangeLog	2012-03-28 19:30:12 +0000
> +++ b/lisp/ChangeLog	2012-03-29 14:00:00 +0000
> @@ -1,3 +1,11 @@
> +2012-03-28  Sam Steingold  <sds@gnu.org>
> +
> +	* calendar/calendar.el (calendar-exit): Use `quit-windows-on'
> +	instead of the broken adhockery which does not prevent calendar
> +	buffers from being displayed at random after exit.
> +	(calendar-window-list, calendar-hide-window): Remove the broken
> +	adhockery.
> +
>  2012-03-28  Glenn Morris  <rgm@gnu.org>
>  
>  	* replace.el (query-replace-map): Doc fix.
>
> === modified file 'lisp/calendar/calendar.el'
> --- a/lisp/calendar/calendar.el	2012-03-16 01:10:46 +0000
> +++ b/lisp/calendar/calendar.el	2012-03-29 14:00:00 +0000
> @@ -1793,19 +1793,6 @@
>                           ?\s (- calendar-right-margin (1- start))))))
>          (force-mode-line-update))))
>  
> -(defun calendar-window-list ()
> -  "List of all calendar-related windows."
> -  (let ((calendar-buffers (calendar-buffer-list))
> -        list)
> -    ;; Using 0 rather than t for last argument - see bug#2199.
> -    ;; This is only used with calendar-hide-window, which ignores
> -    ;; iconified frames anyway, so could use 'visible rather than 0.
> -    (walk-windows (lambda (w)
> -                    (if (memq (window-buffer w) calendar-buffers)
> -                        (push w list)))
> -                  nil 0)
> -    list))
> -
>  (defun calendar-buffer-list ()
>    "List of all calendar-related buffers (as buffers, not strings)."
>    (let (buffs)
> @@ -1817,41 +1804,29 @@
>             (push b buffs)))
>      buffs))
>  
> -(defun calendar-exit ()
> +(defun calendar-exit (&optional kill)
>    "Get out of the calendar window and hide it and related buffers."
> -  (interactive)
> -  (let ((diary-buffer (get-file-buffer diary-file)))
> -    (if (or (not diary-buffer)
> -            (not (buffer-modified-p diary-buffer))
> -            (yes-or-no-p
> -             "Diary modified; do you really want to exit the calendar? "))
> -        ;; Need to do this multiple times because one time can replace some
> -        ;; calendar-related buffers with other calendar-related buffers.
> -        (mapc (lambda (x)
> -                (mapc 'calendar-hide-window (calendar-window-list)))
> -              (calendar-window-list)))))
> +  (interactive "P")
> +  (let ((diary-buffer (get-file-buffer diary-file))
> +        (calendar-buffers (calendar-buffer-list)))
> +    (when (or (not diary-buffer)
> +              (not (buffer-modified-p diary-buffer))
> +              (yes-or-no-p
> +               "Diary modified; do you really want to exit the calendar? "))
> +      (if (and calendar-setup (display-multi-frame-p))
> +          ;; FIXME: replace this cruft with the `quit-restore' window property
> +          (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))))))
>  
>  (define-obsolete-function-alias 'exit-calendar 'calendar-exit "23.1")
>  
> -(defun calendar-hide-window (window)
> -  "Hide WINDOW if it is calendar-related."
> -  (let ((buffer (if (window-live-p window) (window-buffer window))))
> -    (if (memq buffer (calendar-buffer-list))
> -        (cond
> -         ((and (display-multi-frame-p)
> -               (eq 'icon (cdr (assoc 'visibility
> -                                     (frame-parameters
> -                                      (window-frame window))))))
> -          nil)
> -         ((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))))
> -         ((not (and (select-window window) (one-window-p window)))
> -          (delete-window window))
> -         (t (set-buffer buffer)
> -            (bury-buffer))))))
> -
>  (defun calendar-current-date (&optional offset)
>    "Return the current date in a list (month day year).
>  Optional integer OFFSET is a number of days from the current date."



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

* Re: /srv/bzr/emacs/trunk r107697: calendar/calendar.el (calendar-exit): Use `quit-windows-on' instead of
  2012-03-29 17:50 ` /srv/bzr/emacs/trunk r107697: calendar/calendar.el (calendar-exit): Use `quit-windows-on' instead of Glenn Morris
@ 2012-03-29 18:10   ` Sam Steingold
  2012-03-30  4:03     ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Steingold @ 2012-03-29 18:10 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

Hi,

> * Glenn Morris <etz@tah.bet> [2012-03-29 13:50:07 -0400]:
>> revno: 107697
>> committer: Sam Steingold <sds@gnu.org>
>> branch nick: trunk
>> timestamp: Thu 2012-03-29 10:00:00 -0400
>> message:
>>   calendar/calendar.el (calendar-exit): Use `quit-windows-on' instead of
>>   the broken adhockery which does not prevent calendar buffers from
>>   being displayed at random after exit.
>>   (calendar-window-list, calendar-hide-window): Remove the broken adhockery.
>
> This is an unexpected change at this stage in the release process. [1]
> Could you explain exactly what it is for? My immediate inclination is to
> leave it for after 24.1. (I don't disagree about there being a lot of
> adhockery, but it is long-standing.)

After "q" in the calendar buffer the calendar windows disappear, but the
buffers reappear as `other-buffer's of other windows, and thus will
pop-up as next-buffer and prev-buffer.
This is not a regression per se, rather an old bug,
and I have been testing this fix for 2 months.

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000
http://www.childpsy.net/ http://ffii.org http://camera.org
http://americancensorship.org http://dhimmi.com http://palestinefacts.org
Never argue with an idiot: he has more experience with idiotic arguments.



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

* Re: /srv/bzr/emacs/trunk r107697: calendar/calendar.el (calendar-exit): Use `quit-windows-on' instead of
  2012-03-29 18:10   ` Sam Steingold
@ 2012-03-30  4:03     ` Glenn Morris
  0 siblings, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2012-03-30  4:03 UTC (permalink / raw)
  To: sds; +Cc: emacs-devel

Sam Steingold wrote:

> After "q" in the calendar buffer the calendar windows disappear, but the
> buffers reappear as `other-buffer's of other windows, and thus will
> pop-up as next-buffer and prev-buffer.
> This is not a regression per se, rather an old bug,
> and I have been testing this fix for 2 months.

The previous code is definitely not great, but I'd rather not change
this so close to a release. So, I hope you don't mind, but I'll put the
previous version back, and open a bug report to remind us to improve
this after 24.1.



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

end of thread, other threads:[~2012-03-30  4:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E1SDGAB-00054K-Oq@vcs.savannah.gnu.org>
2012-03-29 17:50 ` /srv/bzr/emacs/trunk r107697: calendar/calendar.el (calendar-exit): Use `quit-windows-on' instead of Glenn Morris
2012-03-29 18:10   ` Sam Steingold
2012-03-30  4:03     ` Glenn Morris

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