Node:Creating a new ECB-layout, Previous:Fixing window sizes, Up:The ECB-layout
If you want to create your own ECB-layout then you can do this very
easy "by example" with the command
This command creates a new empty frame and offers a small set of keys
to create the new layout by splitting windows.
ecb-create-new-layout and this couple of keys are your guide
during the layout-creation-process1.
ecb-create-new-layout you will be asked which
type of layout you want to create: "left", "right", "top" or
"left-right". Here you specify where the ECB-tree-windows/buffers
should be located in the ECB-frame:
Depending on the type you choose the window is splitted by the values
of the options
ecb-windows-width (types "left", "right" and
ecb-windows-height (type "top").
Afterwards you will see a frame like follows (here the layout-type is
----------------------------------------------------------------- |<point> | | | | | ECB-layout creation mode | | | | ======================== | | | | | | | | <This is a durable help-screen> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------------------------------------------- | | ,--- `---| Splitted by the value of
The big window (here the middle window) will be the edit-window of the new layout and can not be selected, deleted or splitted during the creation process. It displays the help-screen for the layout-creation mode. Here all the available commands are displayed.
The small window(s) (here the left and right windows) can be splitted by you wherever you want (C-s). The left one contains the point. You must give every ECB-tree-window you create a type (C-t) which can be either
This can be either "directories", "sources", "methods", "history" or "speedbar".
In this case you insert "other" after hitting C-t and you will
then be asked for the name of the user-defined type. You can insert
any arbitrary type name X. But to get this layout working you have to
define a function with name
ecb-set-X-buffer whereas X is the
name of the user-defined type you have specified during
ecb-set-X-buffer has first to switch to the
buffer you want to display in this window and then making this window
dedicated. You have to use the macro
in such a function!
Here is an example: Suppose you have inserted as type name "example"
then you have to define and load a function
ecb-set-example-buffer which could be defined like follows:
(defun ecb-set-example-buffer () (ecb-with-dedicated-window " *ECB example-buffer*" 'ecb-set-example-buffer (switch-to-buffer (get-buffer-create " *ECB example-buffer*"))))
If you forget to define such a function for the user-defined type then
nevertheless ECB will draw this layout but it will use the
If you are satisfied with your new layout just hit C-q. You will
be asked for a new layout-name (TAB-completion is offered to get a
list of all names already in use) and after inserting a new(!) name
the new layout is saved in the file defined by the option
ecb-create-layout-file. The new layout is now available via the
There is no need for you to load the file
ecb-create-layout-file manually into your Emacs because it's
automatically loaded by ECB!
Please note: During the layout-creation process only the commands displayed in the help-screen are available. ALL other commands are temporally disabled (even the mouse-commands).
For programming new layouts with emacs-lisp see The layout-engine.
With the command
ecb-delete-new-layout you can delete
previously created layouts (TAB-completion is offered for all names of
user created layouts).
During the creation process you will be asked in the minibuffer for several options; here you can use TAB-completion and an ``empty'' RET chooses always the first option!