[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: naming and/or directly addressing particular windows?
From: |
martin rudalics |
Subject: |
Re: naming and/or directly addressing particular windows? |
Date: |
Tue, 04 Dec 2012 10:01:26 +0100 |
> in the 'let' expression above, how would I replace \\*foo\\* and *foo*
> with a regular expression that will match, say,
>
> (concat (buffer-name) "-" [:digit:])
Try ".+-[0-9]$" instead of "\\*foo\\*" and "foo-1" instead of "*foo*".
Note that if the purpose of your functions is to display buffers always
approximately at the same location within an Emacs frame, then side
windows (see the function `display-buffer-in-side-window' and the
variables `window-sides-vertical' and `window-sides-slots') might be
more appropriate.
In your case there would be a centered "main window", the "guide window"
at the left and the "metadata window" at the bottom of the frame.
In any case be always aware of two issues:
(1) A user may delete any window at any time (with a few restrictions).
So be prepared that you may have to re-create your windows and give
them a name for showing the buffer of your choice.
(2) Emacs and other applications might reuse or split a window at any
time, for example, to display information like a warning or a
backtrace.
You can fix some of these by making windows dedicated and/or fixing
their sizes but doing that is not entirely trivial.
martin