Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!think!bloom-beacon!mit-eddie!rutgers!mcnc!xanth!kyle From: kyle@xanth.UUCP (Kyle Jones) Newsgroups: comp.emacs Subject: Re: How many windows? Message-ID: <3281@xanth.UUCP> Date: Tue, 10-Nov-87 01:17:08 EST Article-I.D.: xanth.3281 Posted: Tue Nov 10 01:17:08 1987 Date-Received: Thu, 12-Nov-87 06:45:16 EST References: <231@usl-pc.UUCP> Lines: 26 Summary: use (one-window-p) In article <231@usl-pc.UUCP>, jpdres10@usl-pc.UUCP (Green Eric Lee) writes: > Is there any way to find out how many windows are on the screen in a > Elisp program (GNU Emacs version 18.??). Yes, you could iterate through all the windows with (select-window (next-window)) and count them, but that's too much work for what you're trying to do... > I have a program that I want to automatically split the screen > into two windows, ONLY two windows, that is, if we already have two > windows on the screen, we DON'T want to split into THREE windows. Use (one-window-p): one-window-p: Returns non-nil if there is only one window. Optional arg NOMINI non-nil means don't count the minibuffer even if it is active. So if (one-window-p) returns non-nil, split the window, otherwise don't. You also might want to look at the documentation for the `pop-up-windows' and `split-height-threshold' variables. kyle jones old dominion university, norfolk, va usa