[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Window configuration
From: |
Drew Adams |
Subject: |
RE: Window configuration |
Date: |
Thu, 27 May 2010 11:05:07 -0700 |
> > > I swear, if emacs "steals" a window to reuse for something
> > > else again, I'm going to swing an axe at it.
> > >
> > > Is there any way to specify that windows containing buffers
> > > which have a certain mode should *never* be reused or closed
> > > unless specifically by user action (for example visiting a
> > > new file from the window)?
> >
> > Yes, make them dedicated windows.
> > See the Elisp manual, node `Dedicated Windows'.
> > See the Elisp manual, node `Choosing Window'.
> >
> > The easiest way to do this is to use
> > `special-display-regexps', giving it a
> > regexp that matches all buffer names. By default, a
> > "special-display" buffer is shown in a dedicated window.
>
> I forgot to answer your question about making this mode-specific.
> You can do that using `set-window-dedicated-p' on a mode hook.
> Or if all buffers in the mode in question have a certain name
> pattern, then you can use `special-buffer-regexps'.
Or customize the mode-hook variable (e.g. `emacs-lisp-mode-hook') to add a
function like this:
(lambda ()
(make-local-variable 'special-display-regexps)
(add-to-list 'special-display-regexps ".*"))
FWIW, I filed an Emacs bug to improve the doc about this for users:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6280