[Top][All Lists]

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

Re: live windows

From: martin rudalics
Subject: Re: live windows
Date: Thu, 29 Dec 2011 08:00:46 +0100
User-agent: Thunderbird (Windows/20090302)

> I eval
> (defvar a nil)
> (setq a (selected-window))
> in the *scratch*-Buffer.  Then I work a little bit (2 minutes or so)
> without touching the window that displays the *scratch* buffer.  Then I
> eval (window-live-p a) via M-: .  In some cases (I cannot figure out
> what to do exactly), nil is returned, although I did not touch the
> window.
> Whats wrong?

Hard to tell.  Evaluate the below in *scratch* and we'll see whether
you really "did not touch the window" ;-)

Good luck, martin

(defvar my-suspicious-window nil)

(setq my-suspicious-window (selected-window))

(defun is-my-suspicious-window-still-live ()
  (unless (window-live-p my-suspicious-window)
    (message "My suspicious window was killed by `%s'" this-command)
    (setq my-suspicious-window (selected-window))))

(add-hook 'post-command-hook 'is-my-suspicious-window-still-live)

reply via email to

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