emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r107186: In server-unselect-displ


From: Stefan Monnier
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r107186: In server-unselect-display make sure that buffer is live before killing it
Date: Wed, 08 Feb 2012 14:32:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

>   In server-unselect-display make sure that buffer is live before killing it

Is it just for "defensive coding" reasons, or are there actual cases
where this buffer could be dead?

>      (let ((buffer (frame-parameter frame 'server-dummy-buffer)))
> -      (if (and (one-window-p 'nomini frame)
> -            (eq (window-buffer (frame-first-window frame)) buffer))
> -       ;; The temp frame still only shows one buffer, and that is the
> -       ;; internal temp buffer.
> -       (delete-frame frame)
> -     (set-frame-parameter frame 'visibility t)
> -     (set-frame-parameter frame 'server-dummy-buffer nil))
> -      (kill-buffer buffer))))
> +      (when (buffer-live-p buffer)
> +     (if (and (one-window-p 'nomini frame)
> +              (eq (window-buffer (frame-first-window frame)) buffer))
> +         ;; The temp frame still only shows one buffer, and that is the
> +         ;; internal temp buffer.
> +         (delete-frame frame)
> +       (set-frame-parameter frame 'visibility t)
> +       (set-frame-parameter frame 'server-dummy-buffer nil))
> +     (kill-buffer buffer)))))
 
Why should the frame not be deleted when the buffer is dead?
Shouldn't the "(when (buffer-live-p buffer)" test only protect the call
to kill-buffer?


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]