home *** CD-ROM | disk | FTP | other *** search
- >>>>> On Wed, 12 May 1993 09:06:13 CDT, irvine@lks.csi.com said:
- irvine> x-gateway: rodan.UU.NET from help-lucid-emacs to alt.lucid-emacs.help; Wed, 12 May 1993 10:06:12 EDT
-
- irvine> I need an elisp function that given a buffer returns the screen that it
- irvine> is currently being displayed in, otherwise returns nil. I've dug a
- irvine> little bit in screens.el, and so far I haven't been able to figure it
- irvine> out. Anyone know how to do it off the top of their head? Thanks.
-
- irvine> --
- irvine> Comdisco Systems, Inc Chuck Irvine FAX (913) 841-1345
- irvine> Suite A irvine@lks.csi.com
- irvine> 1310 Wakarusa Dr. (913) 841-1283
- irvine> Lawrence, KS 66049
-
- You can have more than one screen showing the same buffer. How would
- you decide which screen you really want? Should it return a list of screens?
- I guess what you want is the screen of the current window?
-
- If you want to get a list of the screens that has the window that
- displays this buffer, the following lisp programn seems to do it:
-
- (defun find-screen-showing-buffer (buf)
- (let ((cur (selected-window)))
- (let ((w cur)
- win
- result)
- (if (eq (window-buffer w) buf)
- (let ((screen (window-screen w)))
- (or (memq screen result)
- (setq result (cons screen result)))))
- (setq w (next-window w nil t t))
- (while (not (eq w cur))
- (if (eq (window-buffer w) buf)
- (let ((screen (window-screen w)))
- (or (memq screen result)
- (setq result (cons screen result)))))
- (setq w (next-window w nil t t)))
- result)))
-
-
-
-
-
-
- ---- Wilson
-
-