Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
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: Top, Next: Install and first steps, Prev: (dir), Up: (dir) This is the user manual for ECB version 1.96. ECB stands for "Emacs Code Browser" and is a source code browser for (X)Emacs. It is a global minor-mode which displays a couple of windows that can be used to browse directories, files and file-contents like methods and variables. It supports source-code parsing for semantic-supported languages like Java, C, C++, Elisp and Scheme as well as for source-types supported "only" by imenu or etags (e.g. perl, TeX, LaTeX etc.). *Please note*: Experienced ECB users find a complete alphabetical list of all commands and user-options in *Note Interactive ECB commands:: and *Note Customizable options::. The latest version of ECB can always be found at the URL . To send bug reports, or participate in discussions about ECB, use the mailing list via the URL . * Menu: * Install and first steps:: Installing ECB and first steps * Overview:: Introduce basic concepts * Activation and Deactivation:: How to start and end ECB * Usage of ECB:: How to use ECB * Customizing:: How to customize ECB * Submitting problem report:: What to do when problems occur * Upgrading:: Upgrading and downloading packages * Tips and tricks:: Useful hints and tips * Elisp programming:: Entry points for Elisp programmers * Conflicts and bugs:: Known Conflicts with other packages and bugs * FAQ:: Frequently asked questions * Command Index:: Index for interactive commands * Option Index:: Index for user options * Concept Index:: Index for concepts and terms --- The Detailed Node Listing --- Installation and first steps of ECB * Installation:: Installation of ECB * Setting up Emacs:: How to set up Emacs for file parsing with ECB * First steps:: First steps after activating ECB first time Installation of ECB * XEmacs Installation:: Installation of ECB for XEmacs users * GNU Emacs Installation:: Installation of ECB for GNU Emacs users How to set up Emacs for file parsing with ECB * General hints:: General hints for a correct setup * Setting up semantic:: How to setup semantic correctly * Non-semantic files:: Setup for file types not supported by semantic Overview * ECB Directories-buffer:: Contents of the ECB Directories-buffer * ECB Sources-buffer:: Contents of the ECB Sources/history-buffer * ECB Methods-buffer:: Contents of the ECB Methods-buffer Activation and Deactivation * Standard activation:: How to manually (de)activate ECB * Automatic activation:: Automatically (de)activating ECB Usage of ECB * Using the mouse:: Working with the mouse * Using the keyboard:: Working with the keyboard * The edit-window:: How to use the edit-window(s) * Temp- and compile-buffers:: Displaying temp- and compilation-buffers * The Methods buffer:: Using and customizing he Methods-buffer * The ECB-layout:: Changing, customizing, redrawing, creating * Hiding the ECB windows:: Hiding/Showing the ECB-windows * Maximizing the ECB windows:: Maximizing the ECB-windows * Back/forward navigation:: Back- and forward navigation like a browser * ECB-window synchronizing:: Auto./manual synchronizing the ECB-windows * Interactive ECB commands:: All interactive user-commands of ECB Working with the keyboard in the ECB-windows * Navigation/Selection:: Keyboard navigation/selection in a tree-buffer * Incremental search:: Find nodes as fast as possible * Personal keybindings:: Adding personal keybindings to a tree-buffer Using and customizing the ECB-Methods buffer * Visiting tokens:: Possible actions after visiting a token * Expanding:: Explicit and automatic expanding * Customizing the display:: How to customize the Methods-buffer display * Rebuilding the Methods:: When to rebuild the Methods-buffer Changing, customizing, redrawing and creating layouts * Changing the ECB-layout:: How to change and customize the layout * Redrawing the ECB-layout:: How and when redrawing the layout * Changing window sizes:: Changing sizes of the ECB-windows * Fixing window sizes:: Fixing sizes of the ECB-windows * Creating a new ECB-layout:: Interactively creating new layouts Customizing ECB * General aspects:: General aspects for customizing ECB * Most important options:: Which option you must know * Customizable options:: All customizable options of ECB All customizable options of ECB * ecb-general:: General customizing ECB * ecb-directories:: Customizing the ECB-directories * ecb-sources:: Customizing the ECB-sources * ecb-methods:: Customizing the ECB-methods * ecb-history:: Customizing the ECB-history * ecb-layout:: Customizing the ECB-layout * ecb-compilation:: Customizing the compile-window * ecb-create-layout:: Customizing options for creating layouts * ecb-face-options:: Customizing options for faces * ecb-faces:: Customizing the faces * ecb-download:: Customizing how to download ECB * ecb-help:: Customizing the online help of ECB * ecb-eshell:: Customizing the eshell-integration * ecb-non-semantic:: Customizing parsing non-semantic sources * ecb-winman:: Customizing window-manager support Upgrading and downloading packages * Downloading new versions:: How to download newer versions of packages * Auto. option-upgrading:: ECB can auto. upgrade your options Automatic upgrading of options * User interface:: Options and commands you should know * Background information:: Maybe some interesting informations Tips and tricks * Changing faces:: Changing faces in the ECB tree-buffers * Small screens:: Working with small screens * Big screens:: Working with big screens * Simulating speedbar:: Simulating speedbar without an extra frame * Integrating speedbar:: Integrating speedbar in the ECB-frame * Optimize scrolling:: Optimize scrolling in the edit-window * Large directories:: Working with large directories * Using eshell:: Optimal using of eshell in ECB * Grepping directories:: Grepping directories with ECB * Working with JDEE:: Working best with ECB and JDEE * Compile-window on demand:: Displaying the compile-window on demand * Non-semantic sources:: Parsing and displaying non-semantic sources * Hide-show:: Using hide-show from the methods-buffer-menu * Window-managers and ECB:: Support of several Emacs-window-managers Entry points for Elisp programmers * List of variables:: Which variables an Elisp-program can use * List of hooks:: All available hooks * tree-buffer:: Some words to the tree-buffer-library * Adviced functions:: How to deal with the adviced functions * The layout-engine:: Programming new layouts and special windows How to program new layouts and new special windows * Programming a new layout:: How to program a new layout * Programming special windows:: Aspects of programming special windows * Possible layout-outlines:: The wide range of possible layouts * The layout-engine API:: The complete layout-engine API Known conflicts and bugs of ECB * Conflicts:: Known conflicts with other packages * Bugs:: Known bugs  File: ecb.info, Node: Install and first steps, Next: Overview, Prev: Top, Up: Top Installation and first steps of ECB *********************************** This chapter describes how to install ECB and setup (X)Emacs correctly and what are the first steps after activation of ECB. * Menu: * Installation:: Installation of ECB * Setting up Emacs:: How to set up Emacs for file parsing with ECB * First steps:: First steps after activating ECB first time  File: ecb.info, Node: Installation, Next: Setting up Emacs, Prev: Install and first steps, Up: Install and first steps Installation of ECB =================== This section describes how to install ECB. * Menu: * XEmacs Installation:: Installation of ECB for XEmacs users * GNU Emacs Installation:: Installation of ECB for GNU Emacs users  File: ecb.info, Node: XEmacs Installation, Next: GNU Emacs Installation, Prev: Installation, Up: Installation Installation of ECB for XEmacs users ------------------------------------ For XEmacs-users it is strongly recommended to use the package-management-system of XEmacs for first-time downloading/installing ECB or for upgrading to a newer version of ECB. Here is a short guide (for details about the package-manager of XEmacs see the related info-manual): *Caution*: If ECB is already installed and you just want upgrading to a newer version then it is recommended to deactivate ECB before proceeding with the steps below! 1. Choose a download-site This can be done via the menu "Tools -> Packages -> Add Download Site": Choose one of the listed sites. Or you can customize the option `package-get-remote' by hand and save it for future sessions. 2. Activate the packages list This can be done either by the menu "Tools -> Packages -> List and Install" or via the command `pui-list-packages'. After that a special packages-buffer is displayed where you can interactively install or upgrade packages. At the end of this buffer there is a short description how to use this buffer. 3. Install ECB and all required packages Mark the package named "ecb" for install. Do this also for the required packages "semantic", "eieio" and "speedbar". The package "mail-lib" is needed for easy submitting of problem-reports to the ECB-maintainers and the package "c-support" is needed for easy using hideshow within the Methods-buffer of ECB(1). After marking all needed packages for installation hit `x' to install them. If you have already installed ECB and you want just upgrading to the latest available version then proceed as described above - same if you want to upgrade one of the required packages. 4. Start ECB Now you can immediately start ECB via the command `ecb-activate'; there is no need to restart XEmacs! As an alternative you can first read the online-help via `ecb-show-help'. If you do not like the package-manager of XEmacs but you want installing ECB "by hand" direct from the ECB-website then you have to follow the instructions for GNU Emacs, see *Note GNU Emacs Installation::. ---------- Footnotes ---------- (1) All required packages can simply autom. marked by hitting `r' in the packages buffer. But this installs a lot of packages more (e.g. the Newsreader Gnus) which are really not essential for ECB. Therefore it is recommended to mark the required packages by hand.  File: ecb.info, Node: GNU Emacs Installation, Prev: XEmacs Installation, Up: Installation Installation of ECB for GNU Emacs users --------------------------------------- *IMPORTANT*: If you are a XEmacs-user please read *Note XEmacs Installation:: before proceeding with the following instructions! 1. Download and unpack the ECB archive (probably you have already done this :-) 2. Read the file `README' in the ECB-directory and install the required semantic-, eieio- and speedbar-version(1). *Please note*: ECB maybe requires a newer version of these libraries than shipped with (X)Emacs. You have to install exactly a version ECB requires and also to make sure that the correct version is loaded into (X)Emacs! But ECB performs two autom checks: - At load-time: It checks if the packages semantic, eieio and speedbar are at least installed so ECB can be loaded. If not it offers to download and install them. - At start-time: It checks if the correct versions of semantic, eieio and speedbar are installed and gives you proper feedback. *Note Download required packages::. So if you are not sure if you have installed the required packages at all or if you have installed the correct versions of these packages then do not worry about this, just go on with the following installation steps: If ECB is missing something it will give you proper feedback and support not later than at load-time or start-time! 3. Add the new ECB-directory to your `load-path' variable. You *MUST* add the ECB-install-directory to the `load-path' either by changing the `load-path' variable directly in your `.emacs' or `site-lisp/site-start.el' or by working with a file `subdirs.el'(2). *ATTENTION*: ECB is NOT properly installed if it's directory is not added to `load-path' and for example just loaded by (load-file "/path/to/ecb/ecb.el") Do not do this! 4. Load ECB by adding code to your `.emacs': If you want to load the complete ECB at (X)Emacs-loadtime (Advantage: All ECB-options available after loading ECB. Disadvantage: Increasing loadtime(3)): (require 'ecb) If you want to load the ECB first after starting it by `ecb-activate' (Advantage: Fast loading(4). Disadvantage: ECB- and semantic-options first available after starting ECB): (require 'ecb-autoloads) This loads all available autoloads of ECB, e.g. `ecb-activate', `ecb-minor-mode', `ecb-byte-compile' and `ecb-show-help'. 5. Restart (X)Emacs. ECB is now ready for use and can be activated by calling `M-x ecb-activate' or `ecb-minor-mode'. Now you can either starting using ECB or you can do these optional installation steps: 6. Reading the online help with `ecb-show-help' Maybe you are interested to read the online-help of ECB before first start. 7. Bytecompiling ECB with `ecb-byte-compile' This byte compiles ECB. You can safely ignore all messages if there are any. (You can also bytecompile ECB from the command-line either by using the `Makefile' or by using the batch-file `make.bat'; just read the comments in that file you choose.) 8. Installing the Info-help of ECB The ECB distribution contains a subdirectory `info-help' which contains the online-help of ECB in Info-format. You can install this online help so it's available in the Top-directory of Info. There are two ways to do this: - Use "install-info" (recommended): 1. Copy the files of the subdirectory `info-help' into the info-directory of Emacs 2. Install the file `info-help/ecb.info' with the command "install-info" (if available on your system) in the `dir'-file. The supplied `Makefile' offers a target `install-help' which does both of these steps. You have just to call `make install-help' with the correct EMACSINFOPATH set (see the comment in `Makefile'). Here is an example: make EMACSINFOPATH=/path/to/emacs/info install-help - Manual Installation: Copy the files of the subdirectory `info-help' into the info-directory of Emacs and modify the file `dir' manually. But it doesn't matter if you do not execute this step (8.) because the online help of ECB is always available though, see `ecb-show-help' (*note Interactive ECB commands::). ---------- Footnotes ---------- (1) The speedbar-version shipped with GNU Emacs <= 21.3 does not satisfy the requirements for this feature - download a newer one! (2) This works at least for Emacs 20.X and Emacs 21.X but XEmacs may have slightly different mechanisms; see the XEmacs documentation (3) Cause of full loading of ECB itself and also the packages semantic, eieio and speedbar regardless if ECB is started. (4) ECB, semantic, eieio and speedbar are first loaded after starting ECB or with other words: ECB and semantic are not loaded if you do not use/need them  File: ecb.info, Node: Setting up Emacs, Next: First steps, Prev: Installation, Up: Install and first steps How to set up Emacs for file parsing with ECB ============================================= *Please note*: Normally it should not necessary for you to bother with the following stuff unless you have problems getting ECB working correctly for you. * Menu: * General hints:: General hints for a correct setup * Setting up semantic:: How to setup semantic correctly * Non-semantic files:: Setup for file types not supported by semantic  File: ecb.info, Node: General hints, Next: Setting up semantic, Prev: Setting up Emacs, Up: Setting up Emacs General hints for a correct setup --------------------------------- ECB is for browsing files and therefore you have to setup your Emacs-configuration properly so the file-parsing engines like semantic, imenu or etags can be activated automatically for parsing your Emacs-Lisp, C, C++ or Java buffers(1). For this Emacs must activate the correct `major-mode' for the source-files and Emacs can only do this if the option `auto-mode-alist' is setup correctly. The correct major-modes and possible file-extensions(2) are: LANGUAGE MAJOR-MODE EXTENSION(S) Emacs Lisp `emacs-lisp-mode' .el C `c-mode' .h, .c C++ `c++-mode' .h, .hxx, .hh, .HH, .cxx, .cpp, .cc, .CC Java `java-mode' or `jde-mode' (if you use .java JDEE) Example: If you want files with extension ".cpp" being c++-parsed by semantic and ECB, your `auto-mode-alist' must contain an entry like: ("\\.cpp\\'" . c++-mode) After this ECB will correctly parse your ".cpp"-sources and display all the parsing information in the ECB-methods buffer. ---------- Footnotes ---------- (1) semantic supports some more "languages" like Makefiles etc. but these are the most important ones. (2) Especially for C++ and C you can use any extension you want but these are the most common ones!  File: ecb.info, Node: Setting up semantic, Next: Non-semantic files, Prev: General hints, Up: Setting up Emacs Setting up semantic ------------------- To ensure ECB and semantic are working correctly for all by semantic supported languages you have to pay attention to the following aspects concerning your Emacs-setup: 1. Setting up semantic itself For all semantic-supported file-types parsing files is done completely by semantic. ECB just displays the parsing results. For all needs of ECB semantic is completely setup by ECB itself, i.e. ECB sets up semantic for you! You have only to add the installation directory of semantic to your `load-path' (in an appropriate way)! *Please note*: If you setup semantic for yourself following the recommendations in the installation instructions of semantic then you have probably added code to your startup-file like: (setq semantic-load-turn-everything-on t) (require 'semantic-load) Be aware that this also enables the minor-modes `semantic-show-dirty-mode' and `semantic-show-unmatched-syntax-mode' where the former one highlights all code which has to be reparsed with dark background (which results in large portions of dark background ;-) and the latter one underlines all syntax which can not be parsed. Especially the former one can be really annoying. To switch off these modes you can add to your startup-file: (global-semantic-show-dirty-mode -1) (global-semantic-show-unmatched-syntax-mode -1) 2. Checking your hooks If you have already checked point (1.) and if you have still problems getting ECB/semantic working properly for your sources you should check the related major-mode hook. Every major-mode X has a hook with name "X-hook" which is evaluated after activating the major-mode (see above, 2.), e.g. the hook for the major-mode `c++-mode' is `c++-mode-hook'. Semantic adds automatically during load-time a special "semantic-setup" to these major-mode hooks(1) in form of a "setup-function". Example: For c and c++ modes semantic adds `semantic-default-c-setup' to `c-mode-hook' and `c++-mode-hook'. If your own Emacs-setup (e.g. in `.emacs' or `site-lisp/site-start.el') overwrites such a major-mode-hook then semantic can not be activated for this major-mode and in consequence ECB can not work properly too! Check if your Emacs-setup uses somewhere `setq' for adding code to a major-mode-hook. *IMPORTANT*: Use `add-hook' instead of `setq'(2)! If your source-files are "running" with correct `major-mode' and correct major-mode hooks ECB and semantic will do what you expect them doing! ---------- Footnotes ---------- (1) Of course only for major-modes supported by semantic! (2) `setq' replaces/overwrites the current value of a hook with the new value whereas `add-hook' *adds* the new value to the old-value of the hook!  File: ecb.info, Node: Non-semantic files, Prev: Setting up semantic, Up: Setting up Emacs Setup for file types not supported by semantic ---------------------------------------------- From version 1.94 on ECB supports also parsing and displaying file-contents for file-types not supported by semantic (i.e. there is no semantic-grammar available for such file-types). Such non-semantic file-types can often be parsed by imenu and/or etags. Both of these parsing methods are now supported: ECB can display the results of imenu and/or etags in its Method-buffer. ECB uses for this speedbar-logic. Therefore the following speedbar options takes effect for this feature: - `speedbar-dynamic-tags-function-list' - `speedbar-tag-split-minimum-length' - `speedbar-tag-regroup-maximum-length' - `speedbar-tag-hierarchy-method' Normally there should no need for you to bother with these options, because the default values are suitable for most situations! But if you are not satisfied with the parsing/display results then you can change some of these options.  File: ecb.info, Node: First steps, Prev: Setting up Emacs, Up: Install and first steps First steps after activating ECB first time =========================================== This section of the ECB online-help is displayed automatically by ECB after activating ECB first time and describes what are the first basic steps: 1. Configure where ECB can find your sources: Call `M-x customize-option RET ecb-source-path RET'(1). This lets you customize the option `ecb-source-path' with the customize-feature of Emacs. This opens a customize-buffer where you can insert all the directories where ECB can find your source-files. Save your changes with the button "Save for future sessions" and then throw away this customize-buffer either by killing it with `M-x kill-buffer' or clicking at the button "Finish". 2. Read the online-help of ECB: The online-help of ECB is available via - calling `M-x ecb-show-help', - pressing `C-c . o' or - using the menu "ECB". (The section you are currently reading is part of the online-help of ECB) 3. Start working with ECB. ---------- Footnotes ---------- (1) This means first hitting the keys `M' (Meta- or Alt-key) and `x' simultaneously, inserting "customize-option" in the minibuffer, hitting RETURN, inserting "ecb-source-path" in the minibuffer and finally hitting RETURN again  File: ecb.info, Node: Overview, Next: Activation and Deactivation, Prev: Install and first steps, Up: Top Overview ******** ECB is a global minor-mode which offers a couple of "ECB-windows" for browsing your sources comfortable with the mouse and the keyboard. These "special" windows are also called "tree-buffer" in this manual. Every "item" in such a tree-buffer, i.e. every line, is also called a "node" of this tree-buffer. There are currently three different types of ECB-windows/tree-buffers: - ECB-Directories - ECB-Sources - ECB-Methods In addition to these "special" ECB-windows you have always one or two "edit-windows" (*note The edit-window::) in the ECB-frame and at the bottom a "compilation-window" (optional), where all the output of Emacs-compilation (compile, grep etc.) is shown (*note Temp- and compile-buffers::). The following "ascii-screenshot" illustrates the typical layout of the ECB-frame(1): ------------------------------------------------------------------ | | | | Directories | | | | | |--------------| | | | | | Sources | | | | | |--------------| Edit-window(s) | | | (can be splitted in two windows) | | Methods | | | | | |--------------| | | | | | History | | | | | ------------------------------------------------------------------ | | | Compilation-window (optional) | | | ------------------------------------------------------------------ In the following subsections the "special" ECB-windows will be explained in detail. * Menu: * ECB Directories-buffer:: Contents of the ECB Directories-buffer * ECB Sources-buffer:: Contents of the ECB Sources/history-buffer * ECB Methods-buffer:: Contents of the ECB Methods-buffer ---------- Footnotes ---------- (1) This is only one example of the layouts ECB offers, see *Note Changing the ECB-layout::  File: ecb.info, Node: ECB Directories-buffer, Next: ECB Sources-buffer, Prev: Overview, Up: Overview ECB Directories-buffer ====================== * Select directories (and - if enabled - source files) in the "ECB-Directories" buffer by clicking a mouse button on the directory name or by hitting RETURN when the cursor is placed on the item line, see *Note Usage of ECB::. IMPORTANT: If you use the POWER-click (i.e. hold down the SHIFT-key while clicking with the primary mouse button (*note Using the mouse::) or RETURN (*note Using the keyboard::)) on a directory node in the this buffer then the directory-contents-cache for this directory will be refreshed and actualized. * Directory names with a "[+]" symbol after (or before) them can be expanded/collapsed by clicking on the symbol, pressing the TAB key (*note Using the keyboard::) when the cursor is placed on the package line or clicking a mouse button on the item, see *Note Using the mouse::. * Right clicking on an item will open a popup menu where different operations on the item under the mouse cursor can be performed. * Pressing F2 will open the ECB customization group (*note Customizing::) in the edit window. F3 shows the online help in the edit-window. Pressing F4 in the ECB-directories buffer will offer adding a new source-path.  File: ecb.info, Node: ECB Sources-buffer, Next: ECB Methods-buffer, Prev: ECB Directories-buffer, Up: Overview ECB Sources-buffer ================== * Source files can be selected by clicking a mouse button (*note Using the mouse::) or hitting RETURN (*note Using the keyboard::) on the source row in the "ECB-Sources" or "ECB- History" windows. IMPORTANT: If you use the POWER-click (i.e. hold down the SHIFT-key while clicking with the primary mouse button (*note Using the mouse::) or RETURN (*note Using the keyboard::)) on a source row in the ECB-Sources or ECB-History windows then the source will not be displayed in the 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 (*note ECB Methods-buffer::. So you can get an overlook over the source without changing the buffer in the edit-window. * Clicking on the source file with the secondary mouse button or C-RETURN (*note Usage of ECB::) will open the source file in the other edit window. * Right clicking on a source file will open a popup menu where different operation on the item under the mouse cursor can be performed.  File: ecb.info, Node: ECB Methods-buffer, Prev: ECB Sources-buffer, Up: Overview ECB Methods-buffer ================== The "ECB-Methods" buffer contains all parsed and recognized tokens of the current source-buffer. It is called "Method-buffer" because ECB is mostly designed for browsing sourcecode files and for programming-languages these tokens are often methods (and variables etc.) To simplify explanations we talk in the following only about methods and variables - but in general the method-buffer can contain any kind of tokens (e.g. sections and subsections for texinfo buffers). * When a method/variable is selected with the primary mouse button (*note Using the mouse::) or RETURN (*note Using the keyboard::) the edit buffer will jump to the method/variable. IMPORTANT: If you use the POWER-click (i.e. hold down the SHIFT-key while clicking with the primary mouse button (*note Using the mouse::) or RETURN (*note Using the keyboard::)) on a node in this buffer then the edit-buffer will be narrowed to the selected token (see also option `ecb-token-visit-post-actions'). But this works only for sources parsed by semantic, not by imenu or etags! * Clicking on a method/variable with the secondary mouse button or C-RETURN (*note Usage of ECB::) will jump to the method in the other edit window. * Right clicking on a method/variable will open a popup menu where different operation on the item under the mouse cursor can be performed.  File: ecb.info, Node: Activation and Deactivation, Next: Usage of ECB, Prev: Overview, Up: Top Activation and Deactivation *************************** This chapter describes all aspects of activating and deactivating ECB. * Menu: * Standard activation:: How to manually (de)activate ECB * Automatic activation:: Automatically (de)activating ECB *IMPORTANT*: Regardless of the activation-type (standard or automatic) the activation-process of ECB is always completely failure-save. This means any error during any step of the activation-process forces a complete cleanup (e.g. removing hooks, disabling advices etc.) of all settings ECB did (e.g. adding hooks, activating advices etc.) until the failure. Therefore if ECB-activation stops cause of a failure then you can be sure that your Emacs has the same state as before the ECB-activation-start!  File: ecb.info, Node: Standard activation, Next: Automatic activation, Prev: Activation and Deactivation, Up: Activation and Deactivation Standard activation and deactivation ==================================== Call `M-x ecb-activate' and `M-x ecb-deactivate' to activate or deactivate ECB(1). If you want ECB started in a new frame see the option `ecb-new-ecb-frame' (default is nil). `ecb-activate' always raises and selects the ECB-frame even if ECB is already started. Because ECB is a global minor-mode it can also be (de)activated/toggled by `M-x ecb-minor-mode'. The following sequence of hooks is evaluated during activation of ECB: 1. `ecb-before-activate-hook' 2. 3. `ecb-activate-before-layout-draw-hook' 4. `ecb-redraw-layout-before-hook' 5. 6. `ecb-redraw-layout-after-hook' 7. `ecb-activate-hook' The following sequence of hooks is evaluated during deactivation of ECB: 1. `ecb-before-deactivate-hook' 2. 3. `ecb-deactivate-hook' ---------- Footnotes ---------- (1) Activation is also possible via the menu "Tools -> Start Code Browser (ECB)".  File: ecb.info, Node: Automatic activation, Prev: Standard activation, Up: Activation and Deactivation Automatic activation and deactivation ===================================== There are three options for auto. (de)activation ECB after Emacs-start and also major-mode based. `ecb-auto-activate' This option is for auto. activating ECB after Emacs-startup. Set this to not nil and ECB will automatically be started after Emacs comes up. `ecb-major-modes-activate' `ecb-major-modes-deactivate' These option give you the possibility to activate (rsp. deactivate) ECB on a major-mode basis, means you can define for which major-modes ECB should be activated and for which modes it should deactivated (See *Note Activation hook-sequence:: and *Note Deactivation hook-sequence::). If activating or deactivating is too strong you can also customize ECB with these two option only hiding/showing it's ECB-windows (tree-buffers) on a major-mode basis. At last this is nothing more than auto. calling `ecb-toggle-ecb-windows' (*note Interactive ECB commands::) depending which major-mode is active. If you activate ECB on a major-mode basis you probably want switch off displaying the tip of the day. You can do this with the option `ecb-tip-of-the-day'.  File: ecb.info, Node: Usage of ECB, Next: Customizing, Prev: Activation and Deactivation, Up: Top Usage of ECB ************ This chapter describes in a detailed manner all aspects of using the Emacs Code Browser. * Menu: * Using the mouse:: Working with the mouse * Using the keyboard:: Working with the keyboard * The edit-window:: How to use the edit-window(s) * Temp- and compile-buffers:: Displaying temp- and compilation-buffers * The Methods buffer:: Using and customizing he Methods-buffer * The ECB-layout:: Changing, customizing, redrawing, creating * Hiding the ECB windows:: Hiding/Showing the ECB-windows * Maximizing the ECB windows:: Maximizing the ECB-windows * Back/forward navigation:: Back- and forward navigation like a browser * ECB-window synchronizing:: Auto./manual synchronizing the ECB-windows * Interactive ECB commands:: All interactive user-commands of ECB  File: ecb.info, Node: Using the mouse, Next: Using the keyboard, Prev: Usage of ECB, Up: Usage of ECB Working with the mouse in the ECB-windows ========================================= Normally you get best usage if you use ECB with a mouse. ECB distinguishes between a "primary" and a "secondary" mouse-button. With the option `ecb-primary-secondary-mouse-buttons' the following combinations of primary and secondary mouse-buttons are possible: - primary: mouse-2, secondary: C-mouse-2(1). This is the default. - primary: mouse-1, secondary: C-mouse-1 - primary: mouse-1, secondary: mouse-2 If you change this during ECB is activated you must deactivate and activate ECB again to take effect. The primary mouse-button ------------------------ A click with the primary button causes the main effect in each ECB-buffer: - ECB Directories: Expanding/collapsing nodes and displaying files in the ECB-Sources buffer. - ECB sources/history: Opening the file in that edit-window specified by the option `ecb-primary-mouse-jump-destination'. - ECB Methods: Jumping to the method in that edit-window specified by the option `ecb-primary-mouse-jump-destination'. The POWER- or SHIFT-click ------------------------- A click with the primary mouse-button while the SHIFT-key is pressed is called the POWER-click and does the following (depending on the ECB-buffer where the POWER-click occurs): - ECB Directory: Refreshing the directory-contents-cache (see `ecb-cache-directory-contents'). - ECB sources/history: Only displaying the source-contents in the method-buffer but not displaying the source-file in the edit-window. This means it opens the clicked source only in the background and shows all its methods/variables in ECB-Methods; the buffer of the edit-window is not changed! This is very useful to get only an overlook for a certain source. - ECB Methods: Narrowing to the clicked method/variable/ect... (see `ecb-token-visit-post-actions'). But this works only for sources parsed by semantic, not by imenu or etags! Per default the complete node-name of an item in a tree-buffer is displayed in the echo-area if the mouse moves over it, regardless if the related window is the active one or not. You get the same effect always after a POWER-click. In general: Via `ecb-show-node-info-in-minibuffer' you can specify in a detailed manner for every ECB tree-buffer when and which node-info should be displayed in the minibuffer. The secondary mouse-button -------------------------- The secondary mouse-button is for opening (jumping to) the file in the other window (see the documentation `ecb-primary-mouse-jump-destination'). The right mouse-button ---------------------- In each ECB-buffer mouse-3 (= right button) opens a special context popup-menu for the clicked item where you can choose several senseful actions. With the options `ecb-directories-menu-user-extension', `ecb-sources-menu-user-extension', `ecb-methods-menu-user-extension' and `ecb-history-menu-user-extension' you can add new commands to the popup-menus. With the options `ecb-directories-menu-sorter', `ecb-sources-menu-sorter', `ecb-methods-menu-sorter' and `ecb-history-menu-sorter' you can even re-arrange all the entries of the popup-menus. Horizontal scrolling with the mouse ----------------------------------- In each tree-buffer of ECB you can easily scroll left and right with the mouse if the option `ecb-tree-easy-hor-scroll' is not `nil'. The reason for this is: XEmacs has horizontal scroll-bars so invisible parts beyond the right window-border of a tree-buffer can always made visible very easy. GNU Emacs does not have hor. scroll-bars so especially with the mouse it is quite impossible to scroll smoothly right and left. The functions `scroll-left' and `scroll-right' can be annoying and are also not bound to mouse-buttons. ECB offers three ways for smoothly hor. scrolling with GNU Emacs if `ecb-tree-easy-hor-scroll' is a positive integer-value S: * In all ECB-tree-buffers the keys `M-mouse-1' and `M-mouse-3' are bound to scrolling left rsp. right with scroll-step S. * Clicking with mouse-1 or mouse-2 onto the edge of the modeline has the same effect, i.e. if you click with mouse-1 onto the left \(resp right) edge of the modeline you will scroll left \(resp. right) with scroll-step S. * Additionally `C-M-mouse-1' and `C-M-mouse-3' are bound to scrolling left rsp. right with scroll-step `window-width' - 2. This is NOT done for XEmacs cause of its horizontal scrollbars. If you want scrolling left and right with the mouse in XEmacs then activate the horizontal scrollbars. ---------- Footnotes ---------- (1) means mouse-2 while CTRL-key is pressed.  File: ecb.info, Node: Using the keyboard, Next: The edit-window, Prev: Using the mouse, Up: Usage of ECB Working with the keyboard in the ECB-windows ============================================ ECB offers the `ecb-mode-map' which binds the most important functions of ECB to keys so you can easily use ECB in every window(1) without a mouse. IMPORTANT: Do not modify `ecb-mode-map' directly! The option `ecb-key-map' defines all ECB keybindings, including a common prefix-key (This is by default `C-c .'). If there are conflicts with other minor-modes or packages you can define very easy another prefix. Please read carefully the description of `ecb-key-map' (*note ecb-general::).! The following sections describe special topics about using the keyboard in the ECB-tree-buffers: * Menu: * Navigation/Selection:: Keyboard navigation/selection in a tree-buffer * Incremental search:: Find nodes as fast as possible * Personal keybindings:: Adding personal keybindings to a tree-buffer ---------- Footnotes ---------- (1) Regardless if a tree-window or an edit-window  File: ecb.info, Node: Navigation/Selection, Next: Incremental search, Prev: Using the keyboard, Up: Using the keyboard Navigation and Selection in a tree-buffer ----------------------------------------- In the ECB-buffers RETURN and TAB are the most important keys: * RETURN does the same as the primary button and C-RETURN does the same as the secondary button. S-RETURN is the same as the SHIFT-click or POWER-click. The terms "primary", "secondary", "SHIFT-" and "POWER-click" are explained in *Note Using the mouse::. See also the option `ecb-tree-RET-selects-edit-window' and the function `ecb-toggle-RET-selects-edit-window' which is bound to `C-t' in each tree-buffer of ECB! * TAB always expands or collapses expandable nodes. The RETURN and TAB keys can not be (re)defined with `ecb-key-map'! If you set `ecb-tree-navigation-by-arrow' to not nil then the left- and right-arrow keys work in the ECB tree-window in the following smart way: * Left-arrow: If node is expanded then it will be collapsed otherwise (i.e. current node is either not expandable or not expanded) point jumps to the next "higher" node in the hierarchical tree (higher means the next higher level or - if no higher level available - the next higher node on the same level). * Right-arrow: If node is expandable but not expanded then it will be expanded. Otherwise (i.e. current node is either not expandable or already expanded) point jumps to the next following node (which is the first subnode in case of an already expanded node or simply the next node in the following line).  File: ecb.info, Node: Incremental search, Next: Personal keybindings, Prev: Navigation/Selection, Up: Using the keyboard Incremental search for a node in current tree-buffer ---------------------------------------------------- Each display-able key (e.g. all keys normally bound to `self-insert-command') is appended to the current search-pattern. The tree-buffer tries to jump to the first node which matching the current search-pattern either as substring or as prefix (see below). If no match is found then nothing is done. There are some special keys: * `backspace' and `delete': Delete the last character from the search-pattern. * `home': Delete the complete search-pattern * `end': Expand either to a complete node if current search-pattern is already unique or expands to the greatest common substring or prefix of the nodes. If there are at least two nodes with the same greatest common-prefix than every hit of `end' jumps to the next node with this common prefix. For better overlooking the current search-pattern is shown in the echo area. After selecting a node with RET the search-pattern is cleared out. With `ecb-tree-incremental-search' you can specify if the current search-pattern must be a real prefix of the node (default) or if any substring is matched. For faster and easier finding the right node in a ecb-window the incremental search ignores the following non interesting stuff: - any leading spaces - expand/collapse-buttons: [+] rsp. [-] - protection-signs (+, -, #) in the method-window if uml-notation is used - variables types or return-types in front of variable- or method-names. - const specifier for variables This means: Just type in the prefix (rsp. a substring) of a class-, variable-, method-, directory- or filename and ECB will bring you as fast as possible to the node you want. Incremental node-search uses the value of `case-fold-search'. Tip: The `ecb-minor-mode' offers you in the `ecb-mode-map' (customizable via `ecb-key-map') some keys for selecting every window of the ecb-frame. This makes window-selection a childīs play. For example you can jump into the method-window by hitting `C-c . gm'.  File: ecb.info, Node: Personal keybindings, Prev: Incremental search, Up: Using the keyboard Adding personal keybindings --------------------------- There are five hooks which can be used for adding personal keybindings to the ECB tree-buffers: - `ecb-common-tree-buffer-after-create-hook' - `ecb-directories-buffer-after-create-hook' - `ecb-sources-buffer-after-create-hook' - `ecb-methods-buffer-after-create-hook' - `ecb-history-buffer-after-create-hook' These hooks are called directly after tree-buffer creation so they can be used to add personal local keybindings(1) either to all tree-buffers (`ecb-common-tree-buffer-after-create-hook') or just to a certain tree-buffer. Here is a list which keys MUST NOT be rebound: * `RET' and all combinations with `Shift' and `Ctrl': Used for selecting nodes in all tree-buffers. * `TAB': Used for expanding/collapsing nodes in all tree-buffers. * `C-t': Used for toggling "jump after selection" in all tree-buffers, see command `ecb-toggle-RET-selects-edit-window'. * All self-inserting characters: Used for easy and fast navigation in all tree-buffers, *Note Incremental search::. * `F2', `F3', `F4': Used for customizing ECB, adding source-path in the directories buffer. The following example binds `C-a' to some useful code in ALL tree-buffers and `C-d' to even more useful code ONLY in the directories buffer: (add-hook 'ecb-common-tree-buffer-after-create-hook (lambda () (local-set-key (kbd "C-a") (lambda () (interactive) (message "ECB is great!"))))) (add-hook 'ecb-directories-buffer-after-create-hook (lambda () (local-set-key (kbd "C-d") (lambda () (interactive) (message "ECB is wonderful!"))))) ---------- Footnotes ---------- (1) To be more general: They can be used to run any arbitrary lisp code after a tree-buffer creation!