From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: dedicated frames Date: 10 Jan 2007 06:42:08 -0800 Organization: http://groups.google.com Message-ID: <1168440128.297662.237650@i56g2000hsf.googlegroups.com> References: <1167833715.051263.12570@a3g2000cwd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1168443642 15520 80.91.229.12 (10 Jan 2007 15:40:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Jan 2007 15:40:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 10 16:40:40 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H4fYv-00077z-Up for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Jan 2007 16:40:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H4fYv-0004QY-IM for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Jan 2007 10:40:25 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!i56g2000hsf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: 168.208.215.220 Original-X-Trace: posting.google.com 1168440130 11373 127.0.0.1 (10 Jan 2007 14:42:10 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 10 Jan 2007 14:42:10 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: i56g2000hsf.googlegroups.com; posting-host=168.208.215.220; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:144607 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:40211 Archived-At: Kevin Rodgers wrote: > rgb wrote: > > Has someone written a version of next-buffer that doesn't > > display buffers that are already displayed in dedicated frames? > > > > It appears to me to be terribly difficult to tell if a given buffer > > happens to be associated with a dedicated window or frame. > > How about: > > (defun get-buffer-dedicated-window (buffer &optional all-frames) > "Return a dedicated window displaying BUFFER, or nil if none. > BUFFER can be a buffer or a buffer name. > ALL-FRAMES determines which frames are considered; see `walk-windows'." > (catch 'window > (mapc (lambda (window) > (when (or (window-dedicated-p window) > (frame-parameter (window-frame window) 'unsplittable)) > (throw 'window window))) > (get-buffer-window-list buffer nil all-frames)) > nil)) You make it look easy. Thanks. Exactly what I needed.