help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: frames dedicated to buffers, or, always see specific buffers in a sp


From: João Távora
Subject: Re: frames dedicated to buffers, or, always see specific buffers in a specific frame
Date: Fri, 12 Apr 2013 14:13:01 +0100

just a small update, this is the code I'm currently working with on
emacs 24.1.1 on windows:

(setq display-buffer-alist
      `((joaot/browse-buffer-p . (joaot/browse-buffer-in-special-frame . nil))))

(defvar joaot/browse-frame)
(setq joaot/browse-frame (new-frame))
(defun joaot/browse-buffer-p (buffer action)
  (declare (ignore action))
  (let ((buffer (and buffer
                     (get-buffer buffer))))
    (and (frame-live-p joaot/browse-frame)
         buffer
         (string-match "^\\*Help\\*$" (buffer-name buffer)) ;; or some
other predicate
         )))

(defun joaot/browse-buffer-in-special-frame (buffer alist)
  (set-window-buffer (frame-selected-window joaot/browse-frame) buffer))

(defadvice switch-to-buffer (around joaot/browse-buffer-maybe activate)
  (if (joaot/browse-buffer-p buffer-or-name nil)
      (let ((display-buffer-alist `(("" .
(joaot/browse-buffer-in-special-frame . nil)))))
        (display-buffer buffer-or-name))
    ad-do-it))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]