This is ecb.info, produced by makeinfo version 4.2 from ecb.texi. INFO-DIR-SECTION GNU Emacs Lisp START-INFO-DIR-ENTRY * ECB: (ecb). Emacs Code Browser END-INFO-DIR-ENTRY  File: ecb.info, Node: Changing the ECB-layout, Next: Redrawing the ECB-layout, Prev: The ECB-layout, Up: The ECB-layout Changing and customizing the ECB-layout --------------------------------------- ECB offers several predefined layouts with different sets and also different locations of ECB-windows. See below the "ascii-screenshot" of all currently built-in layouts(1). In addition to these predefined layouts you can either interactively create new layouts "by example" (*note Creating a new ECB-layout::) or program new layouts with the macro `ecb-layout-define' (*note The layout-engine::). The former method is the recommended one! There are two ways to interactively change the layout: * Changing permanently: Customize the option `ecb-layout-name' and store it for future Emacs sessions. * Switching between several layouts at runtime: If you want to switch fast between a certain sequence of layouts see the option `ecb-toggle-layout-sequence' and the command `ecb-toggle-layout' (*note Simulating speedbar::). For just selecting another layout during current Emacs-session use the command `ecb-change-layout'. With the option `ecb-show-sources-in-directories-buffer' you can define if sources are displayed in the directory-window of a layout (*note ECB Directories-buffer::). In addition to the general layout you can specify if the layout should contain a persistent compilation-window at the bottom of the frame, see `ecb-compile-window-height' (*note Temp- and compile-buffers::). Maybe you want also change the look&feel of the tree-buffers. Then you can change the general style of the tree-buffers with the option `ecb-tree-buffer-style' and the location of the collapse- and expand-symbols and the indentation of sub-nodes in a tree. See `ecb-tree-indent' and `ecb-tree-expand-symbol-before'. More details about the different tree-buffer-styles are described in *Note Tree-buffer styles::. Here are all currently available layouts (for creating own new layouts see *Note Creating a new ECB-layout::); just customize the option `ecb-layout-name' to the related name: Layout "left1" ------------------------------------------------------- | | | | Directories | | | | | | | | | | | |--------------| | | | | | | Sour | Hist | Edit | | | | | | | | | |--------------| | | | | | Methods | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left2" ------------------------------------------------------- | | | | | | | | | | Directories | | | | | | | | | | | |--------------| Edit | | | | | | | | | | | Sources | | | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left3" ------------------------------------------------------- | | | | Directories | | | | | | | | | | | |--------------| | | | | | Sources | Edit | | | | | | | |--------------| | | | | | Methods | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left4" ------------------------------------------------------- | | | | | | | | | | Directories | | | | | | | | | | | |--------------| Edit | | | | | | | | | | | | | | Sour | Hist | | | | | | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left5" ------------------------------------------------------- | | | | Directories | | | | | | | | | | | |--------------| | | | | | Sources | Edit | | | | | | | |--------------| | | | | | History | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "right1" ------------------------------------------------------- | | | | | Directories | | | | | | | | |--------------| | | | | | | | Edit | Sources | | | | | | | | |--------------| | | | | | Methods | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left6" ------------------------------------------------------- | Sources | | |--------------| | | | | | | | | | | | Methods | Edit | | | | | | | | | | |--------------| | | History | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "top1" ------------------------------------------------------- | | | | | | | | | Directories | Sources | Methods | | | | | | | | | |-----------------------------------------------------| | | | | | | | | | Edit | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left7" ------------------------------------------------------- | | | | Directories | | | | | | | | | | | | | | | | | |--------------| Edit | | | | | History | | | | | |--------------| | | | | | Methods | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left8" ------------------------------------------------------- | | | | Directories | | | | | |--------------| | | | | | Sources | | | | | |--------------| Edit | | | | | Methods | | | | | | | | |--------------| | | History | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "top2" ------------------------------------------------------- | | | | | Methods | | | | | |-----------------------------------------------------| | | | | | | | | | Edit | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left9" ------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | Methods | Edit | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left10" ------------------------------------------------------- | | | | | | | | | | Methods | Edit | | | | | | | | | | | | | | | | |--------------| | | | | | | Sou | Hist | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left11" ------------------------------------------------------- | | | | | | | | | | Methods | Edit | | | | | | | | | | | | | | | | |--------------| | | | | | History | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left12" ------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | History | Edit | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left13" ------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | Directories | Edit | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left14" ------------------------------------------------------- | | | | | | | | | | Directories | Edit | | | | | | | | | | | | | | | | |--------------| | | | | | History | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left15" ------------------------------------------------------- | | | | Directories | | | | | | | | | | | | | | | | | |--------------| Edit | | | | | | | | | | | Methods | | | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "leftright1" ------------------------------------------------------- | | | | | Directories | | Methods | | | | | | | | | | | | | | | | | | | | | |-------------| Edit | | | | | | | Sources | | | | | | | |-------------| | | | | | | | History | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "leftright2" ------------------------------------------------------- | | | | | Directories | | Methods | | | | | | | | | | | | | | | | | | | | | | | Edit | | |-------------| |-------------| | | | | | Sources | | History | | | | | | | | | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "leftright3" ------------------------------------------------------- | | | | | Directories | | Methods | | | | | | | | | | | | | | | | | | | | | | | Edit | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left-dir-plus-speedbar" ------------------------------------------------------- | | | | Directories | | | | | | | | | | | | | | | | | |-------------| | | | | | | | | | | | Speedbar | | | | | | | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left-analyse" ------------------------------------------------------- | | | | Directories | | | | | |--------------| | | | | | Sources | | | | | |--------------| Edit | | | | | Methods | | | | | |--------------| | | | | | Analyse | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- Layout "left-symboldef" ------------------------------------------------------- | | | | Directories | | | | | |--------------| | | | | | Sources | | | | | |--------------| Edit | | | | | Methods | | | | | |--------------| | | | | | Symbol-defs | | | | | ------------------------------------------------------- | | | Compilation | | | ------------------------------------------------------- ---------- Footnotes ---------- (1) The command `ecb-show-layout-help'' shows the outline-picture for all built-in layouts.  File: ecb.info, Node: Redrawing the ECB-layout, Next: Changing window sizes, Prev: Changing the ECB-layout, Up: The ECB-layout Redrawing the ECB-layout ------------------------ If you have unintentionally destroyed the ECB-layout, you can always restore the layout with calling `ecb-redraw-layout'. This is even true, if you get messages like "wrong-type-argument window-live-p #". If the variable `ecb-redraw-layout-quickly' is not nil then the redraw is done by the `ecb-redraw-layout-quickly' function, otherwise by `ecb-redraw-layout-full'. But it's strongly recommended to use the quick redraw only if you have really slow machines where a full redraw takes several seconds because the quick redraw is not really safe and may have some drawbacks! On normal machines the full redraw should be done in << 1s! Please read the documentation of the command `ecb-redraw-layout'! See also the hooks `ecb-redraw-layout-after-hook' and `ecb-redraw-layout-before-hook'!  File: ecb.info, Node: Changing window sizes, Next: Fixing window sizes, Prev: Redrawing the ECB-layout, Up: The ECB-layout Changing the sizes of the special ECB-windows --------------------------------------------- The standard width and height of the special ECB-windows is defined with the options `ecb-windows-width' and `ecb-windows-height'. But changing these options always influences all layouts which is not always desired. ECB offers to re-adjust the width and height of the ECB-windows (e.g. by dragging the windows-borders via the mouse) and then saving exactly these current window-sizes for the current layout so after activating this layout all windows have autom. the stored sizes. This is done via the option `ecb-layout-window-sizes' and the commands `ecb-store-window-sizes', `ecb-restore-window-sizes' and `ecb-restore-default-window-sizes'. Here is an example how to resize and store the sizes of the ECB-windows of layout "left1": 1. Switch to layout "left1" via `ecb-change-layout' (`C-c . lc') 2. Resize the ECB-windows by dragging the window-borders with the mouse 3. Call `ecb-store-window-sizes' After this layout "left1" will be always drawn with the new sizes until you call `ecb-restore-default-window-sizes' during layout "left1" is active. *Please note*: `ecb-store-window-sizes' stores the width and height of the windows per default as fractions of the width (rsp. height) of the ECB-frame, so the stored sizes are always correct regardless of the current frame-size! But if called with a prefix argument then fixed sizes are stored.  File: ecb.info, Node: Fixing window sizes, Next: Creating a new ECB-layout, Prev: Changing window sizes, Up: The ECB-layout Fixing the sizes of the special ECB-windows ------------------------------------------- GNU Emacs 21 introduced a new feature which can fix the sizes of a window displaying a certain buffer even after resizing the frame. This new feature is driven by the new buffer-local variable `window-size-fixed'. ECB offers an option `ecb-fix-window-size' for fixing the sizes of the special ECB-windows/buffers even after frame-resizing. The fix type (valid values are `nil', `t', `width' and `height') can either be set on a layout-basis (means a different value for each layout) or one value can be set for all layouts. In the latter case there is an additional value `auto' which choose autom. the senseful fix-type depending on the current layout-type: For top-layouts the fix-type `height' and for all other layout-types the fix-type `width'. Probably the most senseful value is `auto' for all layouts because it makes less sense to fix the height of the ecb-windows in a left-, right- or leftright-layout. Same for fixing the width in a top-layout. Note: With current Emacs 21.2.X there seems to be no distinction between `width', `height' and `t'. Therefore this option takes no effect (means all ecb-windows have always unfixed sizes) if `ecb-compile-window-height' is not `nil'.  File: ecb.info, Node: Creating a new ECB-layout, Prev: Fixing window sizes, Up: The ECB-layout Interactively creating new layouts ---------------------------------- If you want to create your own ECB-layout then you can do this very easy "by example" with the command `ecb-create-new-layout'. 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-process(1). After calling `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: - left: All ECB-tree-windows are located on the left side - right: All ECB-tree-windows are located on the right side - top: All ECB-tree-windows are located on the top side - left-right: All ECB-tree-windows are located on the left and right side Depending on the type you choose the window is splitted by the values of the options `ecb-windows-width' (types "left", "right" and "left-right") or `ecb-windows-height' (type "top"). Afterwards you will see a frame like follows (here the layout-type is "left-right"): ----------------------------------------------------------------- | | | | | | ECB-layout creation mode | | | | ======================== | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------------------------------------------- | | ,--- `---| Splitted by the value of `ecb-windows-width'. `--- The big window (here the middle window) will be the edit-area 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 * One of the built-in types This can be either "directories", "sources", "methods", "history" or "speedbar". * Any user-defined type: 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 layout-creation. This function `ecb-set-X-buffer' must be defined with the macro `defecb-window-dedicator' and has to switch to the buffer you want to display in this window. This macro automatically ensures that this window is dedicated to that buffer. 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: (defecb-window-dedicator ecb-set-example-buffer " *ECB example-buf*" (switch-to-buffer (get-buffer-create " *ECB example-buf*"))) 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 default-function `ecb-set-default-ecb-buffer' instead. 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 option `ecb-layout-name'. 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 *Note 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). ---------- Footnotes ---------- (1) 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!  File: ecb.info, Node: Hiding the ECB windows, Next: Maximizing the ECB windows, Prev: The ECB-layout, Up: Usage of ECB Hiding/Showing the ECB windows ============================== With `ecb-toggle-ecb-windows', `ecb-hide-ecb-windows' and `ecb-show-ecb-windows' you can hide/show all the ECB windows without changing the activation state of ECB and also without deactivating the advices for `delete-other-windows' and/or `delete-window'. This is most useful if you use a layout like "top2" (*note Tips and tricks::) or if you want to have maximum space for editing and you don't need the browsing windows all the time. The following sequence of hooks is evaluated during showing again the hidden ECB-windows: 1. `ecb-show-ecb-windows-before-hook' 2. `ecb-redraw-layout-before-hook' 3.