all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* dedicated frames
@ 2007-01-03 14:15 rgb
  2007-01-09 14:40 ` Kevin Rodgers
       [not found] ` <mailman.2895.1168353667.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: rgb @ 2007-01-03 14:15 UTC (permalink / raw)


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.

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

* Re: dedicated frames
  2007-01-03 14:15 dedicated frames rgb
@ 2007-01-09 14:40 ` Kevin Rodgers
       [not found] ` <mailman.2895.1168353667.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2007-01-09 14:40 UTC (permalink / raw)


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

I'm not sure how to plug that in to next-buffer -- maybe like this:

(add-to-list 'default-frame-alist
	     '(buffer-predicate . (lambda (buffer)
				    (null
				     (get-buffer-dedicated-window buffer)))))

-- 
Kevin Rodgers
Denver, Colorado, USA

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

* Re: dedicated frames
       [not found] ` <mailman.2895.1168353667.2155.help-gnu-emacs@gnu.org>
@ 2007-01-10 14:42   ` rgb
  0 siblings, 0 replies; 3+ messages in thread
From: rgb @ 2007-01-10 14:42 UTC (permalink / raw)



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.

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

end of thread, other threads:[~2007-01-10 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-03 14:15 dedicated frames rgb
2007-01-09 14:40 ` Kevin Rodgers
     [not found] ` <mailman.2895.1168353667.2155.help-gnu-emacs@gnu.org>
2007-01-10 14:42   ` rgb

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.