unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* live windows
@ 2011-12-28 16:10 Adam
  0 siblings, 0 replies; 2+ messages in thread
From: Adam @ 2011-12-28 16:10 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I stumbled upon an interesting problem today. M-x emacs-version RET is
GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of
2011-12-22

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?

Adam



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

* Re: live windows
@ 2011-12-29  7:00 martin rudalics
  0 siblings, 0 replies; 2+ messages in thread
From: martin rudalics @ 2011-12-29  7:00 UTC (permalink / raw)
  To: adam_w67; +Cc: help-gnu-emacs

 > 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)
     (ding)
     (setq my-suspicious-window (selected-window))))

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



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

end of thread, other threads:[~2011-12-29  7:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-29  7:00 live windows martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2011-12-28 16:10 Adam

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