ECB History-window - ECB - the Emacs Code Browser
Description: ECB - the Emacs Code Browser

Previous: ECB Methods-window, Up: Basic ECB-windows

#### 4.1.6 The ECB History-window

ECB offers a ECB-windows for displaying a history of currently open or recently closed source-buffers, regardless of the directory the related file belongs to.

Contrary to the ECB-sources-window the ECB-History-window can be flat but needn't. Another difference to the ECB-sources window is that the History displays not filenames but buffer-names for buffers which are either directly related to a file or which are indirect-buffers with a base-buffer which is related to a file. For a description of the indirect-buffer concept see the Emacs manual (see command `clone-indirect-buffer` or `make-indirect-buffer` for XEmacs).

Please note: The History of ECB is not meant to be a full replacement for the Buffers-menu of (X)Emacs! It only displays buffers which are related to a file (either directly or via indirect-buffer). All non-file-related buffers (e.g. *Help*, *grep* etc.) will never be displayed in the ECB-History-window!

##### 4.1.6.1 Usage of the ECB-History-window

- Buffers in the history can be selected by clicking with the primary mouse button (see Using the mouse) or hitting RETURN (see Using the keyboard) on the buffername-node in the ECB-History-window. The buffer of the selected buffer-name will be displayed in an edit-window - which one depends on the setting in `ecb-mouse-click-destination`.

  IMPORTANT: If you use the POWER-click (i.e. hold down the SHIFT-key while clicking with the primary mouse button (see Using the mouse) or RETURN (see Using the keyboard)) on a node in the ECB-History-window then the related buffer will not be displayed in an edit-window but it will be scanned in the background and all its contents (e.g. methods and variables) are listed in the ECB Methods-window (see ECB Methods-window. So you can get an overlook over the buffer-contents without changing the buffer in the edit-window.

- Clicking on a buffername-node with the secondary mouse button or C-RETURN (see Usage of ECB) will open the buffer in another edit window - which one depends on the setting in `ecb-mouse-click-destination`.
- Right clicking on a buffername-node (mouse-button 3) will open a popup menu where different operation on the item under the mouse cursor can be performed. This popup-menu offers operations for version-control, dired, grep, filtering the buffernames and some file-operations like deleting the related file from disk. In addition the ECB-History-window can be maximized or the bucketizing type (s.b. “Bucketizing the history”) can be changed on the fly via popup-menu.

##### 4.1.6.2 Activating/Displaying the ECB-History-window

Either use one of the predefined layouts which contain the ECB-History-window (see Changing the ECB-layout) (e.g. via `C-c . l c`) or create a new ecb-layout via the command `ecb-create-new-layout` and add a buffer of type “history” into this new layout (see Creating a new ECB-layout).

##### 4.1.6.3 Dead buffers in the history

You can customize if ECB should remove the related buffername-node from the history-window after killing a buffer. This is done with the option `ecb-kill-buffer-clears-history`. See the documentation of this option for the possible choices. If you decide that ECB should not remove the related buffername-node then this is named a “dead” buffer in the history-window. It is displayed with a special face (see `ecb-history-dead-buffer-face`), default is a kind of grey.

You can use such a dead-buffer-node in the history as all other buffername-nodes: ECB will reopen the related file in a buffer and perform the action you have choosen (see above section “Usage of the ECB-History-window”).

##### 4.1.6.4 Indirect buffers in the history

You can work with indirect buffers as well with direct buffers. See the (X)Emacs manual for an introduction for indirect buffers (e.g. see the command `clone-indirect-buffer` for GNU Emacs).

Indirect buffers are displayed with the face `ecb-history-indirect-buffer-face`, default is an italic outline.

There is an option `ecb-history-stick-indirect-buffers-to-basebuffer` which allows to customize how ECB displays indirect buffers in the history-window:

If this option is `nil` then indirect-buffers are treated as non-indirect-buffers and sorted into the history-buffer-sequence according to the setting of `ecb-history-sort-method`. Then the history contains something like this:

       <base-buffer BB>
       <indirect-buffer 1 of BB>
       <indirect-buffer 2 of BB>
       <indirect-buffer 3 of BB>

If not nil then indirect-buffers are always sticked to their base-buffer, ie. the base-buffer is displayed as expandable node with all its indirect-buffers as children-nodes, so the history contains something like:

       [-] <base-buffer BB>
        |  <indirect-buffer 1 of BB>
        |  <indirect-buffer 2 of BB>
        `- <indirect-buffer 3 of BB>

Here the buffer with name “<base-buffer BB>” has three indirect-buffers which are display as childrens of their base-buffer.

##### 4.1.6.5 Bucketizing the history

ECB can display the history-contents “flat” or it can display buckets to bucketize the contens according to certain criterias. This is done with the option `ecb-history-make-buckets`. It allows bucketizing according to the directory, the file-extension, the major-mode or a list of regular expression - see the documentation of this option for details.

Here is an example for a history-window bucketized according to the major-mode of the related buffers:

       [-] [c++-mode]
        |  headerfile-1.h
        |  headerfile-2.h
        |  codefile-1.cc
        `- codefile-2.cc
       [-] [emacs-lisp-mode]
        |  elisp-buffer-1.el
        |  elisp-buffer-1.el
        `- elisp-buffer-1.el
       [-] [makefile-mode]
        `- Makefile
       [-] [java-mode]
        |  java-buffer-1.java
        `- java-buffer-2.java

Please note: If `ecb-history-make-buckets` is nil then this is interpreted as an empty list of regular-expressions and the history is display with exactly one bucket. Use the value 'never if you want the? contents of the history-window to be displayed “flat”!

You can change the bucketizing type on the fly via the popup-menu of the history-window.

##### 4.1.6.6 Customizing the ECB-History-window

See ecb-history for a list of all options currently available for customizing this ECB-windows to your needs.