[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (newbie) checking for which buffers are visible to the user
From: |
Tom Tromey |
Subject: |
Re: (newbie) checking for which buffers are visible to the user |
Date: |
Wed, 12 Sep 2007 13:08:47 -0600 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (gnu/linux) |
>>>>> "Stuart" == Stuart McLean <makhector@gmail.com> writes:
Stuart> I have bound f6 to bring up the calendar. Here is what I would like to
Stuart> do. If the calendar is not visible to me, make it visible. However, if
Stuart> I can see it, I would like to bury the calendar buffer. I am not sure
Stuart> the most effective way to check if a buffer is visible to the user
Stuart> (me) and how to write a function that takes advantage of this.
Iterate over the results of get-buffer-window-list and see if any of
the windows' frames are visible.
I think stuff like this may give weird results if you're using
multi-tty. E.g., code like this could say that something is "visible"
but you might be using a terminal frame and not be able to physically
see the X frame where the buffer is displayed. I'm not sure what to
do about this.
Tom