Anonymous avatar Anonymous committed 6115922

Sync with current upstream 1.96, see NEWS for details.

Comments (0)

Files changed (28)

+2003-09-18  Klaus Berndl  <klaus.berndl@sdm.de>
+
+	* Sync with current upstream 1.96, see NEWS for details.
+
 2003-07-18  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.10 released.
 # Boston, MA 02111-1307, USA.
 
 VERSION = 1.10
-AUTHOR_VERSION = 1.95.1
+AUTHOR_VERSION = 1.96
 MAINTAINER = Klaus Berndl <klaus.berndl@sdm.de>
 PACKAGE = ecb
 PKG_TYPE = regular
 	ecb-help.elc ecb-layout.elc ecb-mode-line.elc ecb-navigate.elc \
 	ecb-util.elc tree-buffer.elc ecb-buffertab.elc ecb-speedbar.elc \
 	ecb-upgrade.elc ecb-layout-defs.elc ecb-tod.elc silentcomp.elc \
-	ecb-create-layout.elc ecb-examples.elc ecb-autogen.elc ecb-jde.elc
+	ecb-create-layout.elc ecb-examples.elc ecb-autogen.elc ecb-jde.elc \
+	ecb-winman-support.elc
+
 
 EXTRA_SOURCES = NEWS README RELEASE_NOTES
 

Makefile.upstream

 # This Makefile byte-compiles the ECB lisp files and generates online-help.
 
+# Copyright (C) 2000 - 2003 Jesper Nordenberg,
+#                           Klaus Berndl,
+#                           Kevin A. Burton,
+#                           Free Software Foundation, Inc.
+
+# Author: Jesper Nordenberg <mayhem@home.se>
+#         Klaus Berndl <klaus.berndl@sdm.de>
+#         Kevin A. Burton <burton@openprivacy.org>
+# Maintainer: Klaus Berndl <klaus.berndl@sdm.de>
+#             Kevin A. Burton <burton@openprivacy.org>
+# Keywords: browser, code, programming, tools
+# Created: 2001
+
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2, or (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+
+# You should have received a copy of the GNU General Public License along with
+# GNU Emacs; see the file COPYING.  If not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
 # $Id$
 
+
 # ========================================================================
 # User configurable section
 
 EMACS=emacs
 
 # If semantic, eieio and speedbar are added to load-path within some
-# elisp-statements in the Emacs initialisation-files (e.g. .emacs or
+# Elisp-statements in the Emacs initialization-files (e.g. .emacs or
 # site-start.el) then set here again the load-path of the semantic-version,
 # the eieio-version and the speedbar-version loaded into your Emacs (use
 # always FORWARD-SLASHES as directory-separator even with MS Windows
 # systems). Make sure you compile ECB with the semantic-, eieio- and
 # speedbar-version you load into Emacs!
 
-# If you are using XEmacs with already installed xemacs-packages for
+# If you are using XEmacs with already installed XEmacs-packages for
 # semantic, eieio and speedbar or if you are using a file subdirs.el with
 # GNU Emacs which adds semantic, eieio and speedbar then there is NO need
 # to set the load-path for semantic, eieio or speedbar.
 #      make SEMANTIC="path/to/semantic" EIEIO="path/to/eieio" \
 #           SPEEDBAR="path/to/speedbar "EMACS="path/to/emacs"
 #
-#   if you want to set either different load-pathes or Emacs-binary and
+#   if you want to set either different load-paths or Emacs-binary and
 #   you do not want edit the Makefile. Do not forget quoting the arguments
 #   if they contain spaces!
 #
 
 # For the ECB-maintainers: Change the version-number here and not
 # elsewhere!
-ecb_VERSION=1.95.1
+ecb_VERSION=1.96
 
 
 RM=rm -f
             ecb-eshell.el ecb-cycle.el ecb-face.el ecb-compilation.el \
             ecb-upgrade.el ecb-create-layout.el silentcomp.el \
             ecb-speedbar.el ecb-examples.el ecb-tod.el ecb-autogen.el \
-	    ecb-jde.el
+	    ecb-jde.el ecb-winman-support.el
 
 ecb_LISP_ELC=$(ecb_LISP_EL:.el=.elc)
 
+* Changes for ECB version 1.96
+
+** ECB can work together with the window-managers escreen and winring
+   This allows to run applications like Gnus, VM or BBDB in the same frame as
+   ECB! See the new lib ecb-winman-support.el and read the section
+   "Window-managers and ECB" in the chapter "Tips and tricks" in the
+   info-manual of ECB.
+   
+   Thanks to Johann "Myrkraverk" Oskarsson <myrkraverk@users.sourceforge.net>
+   who has reported some bugs related to escreen and has therefore motivated a
+   lot to add support for the well known window-managers escreen and winring.
+
+** ECB can display the window-number in the modeline of the special windows.
+   The left-top-most window in a frame has the window-number 0 and all other
+   windows are numbered with increasing numbers in the sequence, functions
+   like `other-window' or `next-window' would walk through the frame. This
+   allows to jump to windows by name as described at the Emacs-Wiki
+   http://www.emacswiki.org/cgi-bin/wiki.pl?SwitchingWindows.
+
+   See the new option `ecb-mode-line-display-window-number'. Currently this
+   feature is only available for GNU Emacs 21.X, because neither GNU Emacs <
+   21 nor XEmacs can dynamically evaluate forms in the mode-line.
+
+   Thanks to Johann "Myrkraverk" Oskarsson <myrkraverk@users.sourceforge.net>
+   for suggesting this.
+
+   In addition the already existing options `ecb-mode-line-data' and
+   `ecb-mode-line-prefixes' are now more flexible and are now able to define
+   special modelines not only for the 4 builtin ECB-tree-buffers but for every
+   special ECB-buffer. ECB will autom. upgrade the old values of these options
+   as best as possible to their new types!
+               
+** Much better support of the ECB-compile-window
+
+*** General overhaul for displaying buffers in the ECB-compile-window.
+    The whole mechanism has been rewritten so now using a durable
+    compile-window is much safer and works as well as without one. Now all
+    buffers displayed with `display-buffer' are checked if they are
+    "compilation-buffers" in the sense of the function
+    `ecb-compilation-buffer-p' and then displayed in the compile-window of
+    ECB. Especially temp-buffers displayed with `with-output-to-temp-buffer'
+    (e.g. *Help*-buffers) are now much better supported.
+
+    Simply said: All buffers for which `ecb-compilation-buffer-p' says t are
+    now *always* displayed in the compile-window (if there is any) with
+    complete consideration of Emacs-options like `compilation-window-height',
+    `temp-buffer-max-height', `temp-buffer-resize-mode' (GNU Emacs),
+    `temp-buffer-shrink-to-fit' (XEmacs) etc. All other buffer not.
+
+*** New layout-option `ecb-compile-window-width'.
+    Thanks for suggestion to John S. Yates, Jr. <jyates@netezza.com>
+
+*** New layout-option `ecb-compile-window-prevent-shrink-below-height'
+
+*** Better and more reliable eshell-integration. Now the compile-window fits
+    always autom. to the output of the last eshell-command.
+
+*** All options related to the ECB-compile-window have been moved to the new
+    customization-group "ecb-compilation" which is a subgroup of "ecb-layout".
+    
+** Safer handling of all adviced functions of ECB
+   All ECB-advices are now active if and only if ECB is running. Just loading
+   the ECB-library doesn't activate any ECB-advice! Also if there is an error
+   during the activation-process of ECB then all advices are always disabled
+   automatically.
+
+** ECB can visit tokens in a smarter way
+
+*** Narrowing via popup-menu of the Methods-buffer includes now the documentation
+    of the token if located outside of the token (e.g. Javadoc for Java).
+
+*** More flexible definition what to do after visiting a token via the
+    Methods-buffer. See the new option `ecb-token-visit-post-actions' which now
+    replaces the options ecb-highlight-token-header-after-jump',
+    `ecb-scroll-window-after-jump' and `ecb-token-jump-narrow'.
+
+** ECB selects autom. the current default-directory after activation even if
+   no file-buffer is displayed in the edit-window. This is useful if ECB is
+   autom. activated after startup of Emacs and Emacs is started without a
+   file-argument. So the directory from which the startup has performed is
+   auto. selected in the ECB-directories buffer and the ECB-sources buffer
+   displays the contents of this directory. See new option
+   `ecb-display-default-dir-after-start'. 
+
+** ECB preserves the split-state of the frame after activation rsp. deactivation
+   This is done if the already existing option `ecb-split-edit-window' has the
+   new value t.
+      
+** New command `ecb-toggle-window-sync' for fast toggling between autom.
+   synchronization of the ECB-buffers is switched on and off.
+
+** The popup-menu of the Directories-buffer allows opening a dir with Dired.
+   The Sources-Buffer offers the same for the current selected directory. In
+   the History-buffer the directory of the selected file-buffer can be
+   "dired".
+
+** Now manually resizing of the ECB-windows is possible even if
+   `ecb-fix-window-size' is not nil for current layout. Thanks for suggestion
+   Massimiliano Mirra <mmirra@libero.it>. Only relevant for GNU Emacs 21.X.
+
+** ECB does not call any functions of the cl-library at runtime.
+
+** Fixed Bugs
+
+*** Fixed all the file- and directory-commands in the popup-menus.
+    Now the Directories- and Sources-buffers are autom. updated after creating
+    rsp. deleting source-files or directories.
+
+*** Jumping to some tokens for Perl sources failed. This is fixed now.
+
+*** Now the buffer-names displayed in the History-window are always uptodate,
+    even if file-buffers are killed/opened during hidden ECB-windows.
+
+*** Fixed a conflict between ECB and `tmm-menubar' (tmm.el)
+    
+*** Fixed a lot of misspellings in the ECB-online-help and also in all comments
+    and strings of the sources.
+
+*** Fixed a bug in `ecb-toggle-enlarged-compilation-window'.
+    This function has been also renamed to `ecb-toggle-compile-window-height'.
+
+*** Fixed a bug in the layout-engine related to dedicated windows.
+    Thanks to Johann "Myrkraverk" Oskarsson <myrkraverk@users.sourceforge.net>
+    who helped to find this bug.
+
+*** Fixed some references in the info-manual of ECB.
+
+
+
 * Changes for ECB version 1.95.1
 
 ** Now the ecb-windows can be "maximized", means all other ecb-windows are
    latest ECB version >= 1.95.1! If the user-defined layouts are not
    byte-compiled then there is nothing to do.
 
-** Some default keybindings have changed; see RELEASE_NOTES for details.
+** Some default key-bindings have changed; see RELEASE_NOTES for details.
 
-** All popup-menus of the ECB-tree-buffers can be openend via [Meta-m]
+** All popup-menus of the ECB-tree-buffers can be opened via [Meta-m]
 
 ** Fixed bugs
 
    `ecb-tree-use-image-icons'.
 
 ** Adding hideshow to the popup-menu of the Methods-buffer.
-   This popup-menu now offers two entries for hiding resp. showing the block
-   of that token in the Methods-buffer for which the popup-menu was openend.
+   This popup-menu now offers two entries for hiding rsp. showing the block
+   of that token in the Methods-buffer for which the popup-menu was opened.
    This is done with the hideshow.el library.
    Thanks to Christoff Pale <christoff_pale@yahoo.com> for suggestion.
 
 ** Horizontal scrolling of the tree-buffers by clicking the edges of the
    modeline with mouse-1 or mouse-2. I.e. if you click with mouse-1 onto the
-   left (resp right) egde of the modeline you will scroll left (resp. right)
+   left (rsp right) edge of the modeline you will scroll left (rsp. right)
    with the scroll-step defined in `ecb-tree-easy-hor-scroll'. This is only
    for GNU Emacs because XEmacs has hor. scrollbars.
    
-** Changed default keybindings:
+** Changed default key-bindings:
    - C-c . r:  `ecb-rebuild-methods-buffer'
    - C-c . lc: `ecb-change-layout'
    - C-c . lr: `ecb-redraw-layout'
 
 ** Enhancements to the tree-buffers:
    
-*** Now user-extensions can be added to the popup-menues of the tree-buffers.
+*** Now user-extensions can be added to the popup-menus of the tree-buffers.
     See new options `ecb-directories-menu-user-extension',
     `ecb-sources-menu-user-extension', `ecb-methods-menu-user-extension',
     `ecb-history-menu-user-extension'.
      
 *** The command `ecb-store-window-sizes' can now also store fixed sizes.
     If called with a prefix arg then fixed sizes are stored instead of
-    fractions of frame-width resp. -height.
+    fractions of frame-width rsp. -height.
 
 *** The command `split-window' is now also adviced to work properly.
 
 ** Enhancements for the tree-buffers
 
-*** "Create Source" in the popup-menues now work also for non-java-files.
+*** "Create Source" in the popup-menus now work also for non-java-files.
 
 *** ecb-truncate-lines can now be set different for each ECB-tree-buffer.
 
 ** Added a command `ecb-jde-display-class-at-point' which displays the contents
    of the java-class under point in the methods-buffer of ECB.
 
-** Renamed previous HISTORY file to NEWS and reformate it for outline-mode.
+** Renamed previous HISTORY file to NEWS and reformated it for outline-mode.
 
 
 
 *** Fixes a bug in upgrading stored window-sizes from ECB 1.80 to ECB >= 1.90.
     Fixes also two bugs in `ecb-store-window-sizes' if default-values are used in
     `ecb-layout-window-sizes' or if ecb-windows have frame-height as height
-    (resp. frame-width as width) . (Klaus)
+    (rsp. frame-width as width) . (Klaus)
 
 *** Fixed a bug in the navigation-history of ECB which sometimes has prevented
     that a user can open files from the sources/history buffer or clicking onto
    
 *** Fixed an annoying bug which results in an error "Wrong type argument:
     integer-or-marker-p nil)" after a full buffer reparse. ECB 1.80 has repaired
-    its internal state but nevertheless the user had to reclick on the same
+    its internal state but nevertheless the user had to re-click on the same
     token after this error to really jump to a token. With ECB 1.90 this bug has
     been gone (Klaus).
 
 
 *** Silencing the byte-compiler, i.e. byte-compilation of ECB should now be
     warning free. If byte-compilation still throws warnings during
-    byte-compilation with 'ecb-byte-compile' (resp. using the Makefile or
+    byte-compilation with 'ecb-byte-compile' (rsp. using the Makefile or
     make.bat) please send this to our mailing list. (Klaus)
 
 ** Enhancements to the methods/variable/token tree-buffer:
 *** New feature: Now the methods buffer is auto. expanded if the node related to
     the current token in the edit-window is not visible (probably because its
     parent is collapsed). See new options `ecb-auto-expand-token-tree' and
-    `ecb-expand-methods-switch-off-auto-expand' and the new comand
+    `ecb-expand-methods-switch-off-auto-expand' and the new command
     `ecb-toggle-auto-expand-token-tree' (Klaus).
   
 *** New command `ecb-expand-methods-nodes' which allows precisely expanding
 
 **** Therefore the name of the option 'ecb-layout-nr' has changed to
      'ecb-layout-name'! See the docstring of 'ecb-layout-name' for the names
-     of all buildin layouts.
+     of all built-in layouts.
 
 **** In this context also the type of ecb-show-sources-in-directories-buffer has
      changed so it is now a list of layout-names where the sources should be
      - ecb-delete-new-layout: Delete an user-created (by 'ecb-create-new-layout')
        layout.
      - ecb-show-layout-help: Displays the docstring of a layout which at least
-       for buildin layouts contains a picture of the outline of this layout.
+       for built-in layouts contains a picture of the outline of this layout.
      All three commands offer TAB-completion for easy selecting a layout name.
 
 **** ECB autom. upgrades the following options to theirs new names/types:
     be located at the left and the right side of the ECB-frame. See the new
     layouts "leftright1", "leftright2" and "leftright3" for examples. Other
     layouts of this type can be created or programmed very easy with
-    'ecb-create-newlayout' resp. the macro 'ecb-layout-define'. (Klaus)
+    'ecb-create-newlayout' rsp. the macro 'ecb-layout-define'. (Klaus)
 
 *** Now ECB offers a command `ecb-create-new-layout' for interactively creating
     new layouts "by example". Read the online-help. (Klaus)
 *** Rewritten the mechanism for storing customized window-sizes. See option
     ecb-layout-window-sizes and the command ecb-store-window-sizes and
     ecb-restore-window-sizes. Now the sizes are always saved as fractions of
-    the width (resp. height) of the ECB-frame, so the stored sizes are always
+    the width (rsp. height) of the ECB-frame, so the stored sizes are always
     correct regardless of the current frame-size (Klaus). Suggested and first
     implementation by Geert Ribbers [geert.ribbers@realworld.nl]
 
     + 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 for example to add personal local keybindings either to all
+    used for example to add personal local key-bindings either to all
     tree-buffers (ecb-common-tree-buffer-after-create-hook) or just to a certain
     tree-buffer. Please read the documentation. (Klaus)
 
 
 ** Fixed bugs:
    
-*** Fixed: Now no empty tooltips are displayed if mouse moves over nodes in the
+*** Fixed: Now no empty tool-tips are displayed if mouse moves over nodes in the
     tree-buffers of ECB which can be displayed completely in the tree-window.
     (Klaus)
 
    That is because F1 is such an important key in many OS and tools (e.g. opens
    help in all windows-programs), so ECB should not hardly "rebind" it. (Klaus)
 
-** Enhancing the option 'ecb-window-sync': Now the synchronisation can take
+** Enhancing the option 'ecb-window-sync': Now the synchronization can take
    place for all buffers which have a relation to files AND directories, i.e.
    now also for dired-buffers. But per default this is switched off, see the
    doc-string. (Klaus)
 
 ** New feature and command: ecb-download-ecb. With this function you can
    download and install any arbitrary ECB-version from the ECB-website from
-   within Emacs. This is especially usefull for upgrading to the latest
+   within Emacs. This is especially useful for upgrading to the latest
    version. (Klaus)
 
 ** New debug mode for ECB which prints some debug informations in the message
    New option 'ecb-debug-mode' (also available in the Help-menu of ECB).
    (Klaus)
 
-** Some default keybindings have changed; see `ecb-key-map'. (Klaus)
+** Some default key-bindings have changed; see `ecb-key-map'. (Klaus)
 
 ** New feature: Possibility to define a sequence of layouts with new option
    `ecb-toggle-layout-sequence' and toggle very fast between them via
    + The function tree-buffer-create has a new argument NODE-DATA-EQUAL-FN. See
      the doc-string for a description (Klaus).
    + For each tree-buffer a special user-data-storage (for any arbitrary data)
-     is ceated which can be accessed via `tree-buffer-set-data-store' and
+     is created which can be accessed via `tree-buffer-set-data-store' and
      `tree-buffer-get-data-store'. See the docstring of `tree-buffer-create'.
      (Klaus)
 
 
 ** New option ecb-bucket-token-display. See doc-string for details. (Klaus)
 
-** Reorganisation of the faces used by ECB. The group 'ecb-face-options'
+** Reorganization of the faces used by ECB. The group 'ecb-face-options'
    contains now all options which type is 'face (i.e. the defcustom's) and the
    group 'ecb-faces' contains all face-definition (the defface's). In addition
    it is now possible to change easily and fast the general face for ALL
    current ECB-release. This is done during activation. If there are
    incompatible options ECB resets them to the default value of current ECB
    release and displays after activation in a temporary window which options
-   have been reset, inkl. their old-value (before the reset) and new-value
+   have been reset, incl. their old-value (before the reset) and new-value
    (after the reset). (Klaus)
 
 ** New feature ecb-tree-navigation-by-arrow: Smarter navigation in the
        buffers.
   
 ** Much better performance of the directory and file-browser in ECB, especially
-   for directories with a lot of entries (means ~ >1000, dependend on your
+   for directories with a lot of entries (means ~ >1000, dependent on your
    machine and the net-connection in case of network-drives). See also the new
    feature: ecb-cache-directory-contents. (Klaus)
 
 ** ecb-highlight-token-header-after-jump is now a boolean; which face is used
    for highlighting is defined in ecb-token-header-face. (Klaus)
 
-** New option 'ecb-post-process-semantic-tokenlist': Special postprocessing of
-   the semantic tokenlist for certain major-modes. This is usefull for
+** New option 'ecb-post-process-semantic-tokenlist': Special post-processing of
+   the semantic tokenlist for certain major-modes. This is useful for
    c++-mode. Now with the default value of this option all methods in a
    c++-implementation-file (no class/method-declaration but only method
    implementations) are grouped with respect to the class they belong. (Klaus)
 ** Now also with C++ Sources the method- and variable-protection is displayed
    correct in the ECB-method buffer (Klaus).
 
-** Fixed a bug which prevented ECB using the root path "/" on unix-like systems
+** Fixed a bug which prevented ECB using the root path "/" on Unix-like systems
    as a source-path. (Klaus)
 
-** If a file via the standard-mechanisms of Emacs (e.g. find-file) is openend,
-   then the auto. window synch (see `ecb-window-sync') has worked only correct
+** If a file via the standard-mechanisms of Emacs (e.g. find-file) is opened,
+   then the auto. window sync (see `ecb-window-sync') has worked only correct
    if the new file is located in any of the paths in `ecb-source-path'. Now ECB
    adds the path of the new file at least temporally via `ecb-add-source-path'
-   to the list of paths in `ecb-source-path', so the window-synch works always
+   to the list of paths in `ecb-source-path', so the window-sync works always
    correct. ECB asks the user if the new path should saved also for future
    sessions. (Klaus)
 
 
 ** If mouse is moved over an history-entry then the full path is shown in the
    echo-area so you can distinct better between two entries with the same name
-   but with differnt pathes; see also 'ecb-show-node-info-in-minibuffer'
+   but with different paths; see also 'ecb-show-node-info-in-minibuffer'
    (Klaus).
 
 ** New option for the history: ecb-kill-buffer-clears-history defines if
 ** Incremental node-search in the ECB-buffers now uses the value of
    `case-fold-search'. (Klaus)
 
-** Complete new customization of the ECB-keybindings. The option
+** Complete new customization of the ECB-key-bindings. The option
    `ecb-prefix-key' has been removed. There is one new option `ecb-key-map'
-   where you can customize all keysettings of ECB (including a common
+   where you can customize all key-settings of ECB (including a common
    prefixkey). (Klaus)
 
 ** ecb-add-source-path and ecb-delete-source-path now ask if saving should be
    name. Customizable with ecb-history-item-name. (Jesper)
 
 ** When jumping to a token the window can be scrolled so that the token starts 
-   at the top or center of the window. This behaviour is customizable with
+   at the top or center of the window. This behavior is customizable with
    the variable ecb-scroll-window-after-jump. (Jesper)
 
 ** Fixed a bug when retrieving parent names for a token. (Jesper)
 ** Tree-incremental-search in the ecb-windows now ignores all non interesting
    stuff:
    + any leading spaces
-   + expand/collapse-buttons: [+] resp. [-]
+   + expand/collapse-buttons: [+] rsp. [-]
    + protection-signs (+, -, #) in the method-window if uml-notation is used
-   + variables types or returntypes in front of variable- or method-names.
+   + variables types or return-types in front of variable- or method-names.
    + const specifier for variables
    This makes incremental-searching in a tree-buffer much faster and easier.
    (Klaus)
    hide all ECB windows without deactivating ECB (see 'ecb-toggle-ecb-windows')
    (Klaus).
 
-** ECB is now a global minor mode with it��s own menu "ECB" and it��s own keymap
+** ECB is now a global minor mode with it��s own menu "ECB" and it��s own key-map
    with prefix "C-c .". New function to (de)activate/toggle ECB with
    'ecb-minor-mode'. (Klaus)
 
 ** Added a section "Tips and Tricks" to the ECB online-help. (Klaus)
 
 ** Added a new layout Nr. 10 for very small screen resolutions where all
-   squarecentimeters are needed for the editing itself. This layout only
+   square-centimeters are needed for the editing itself. This layout only
    displays a method-window and a edit-window. (Klaus).
 
 ** The messages displayed after moving the mouse over a node in a tree-buffer
 
 ** Now the ECB-buffers are intelligent in displaying nodes (Klaus):
    + Expandable nodes: (e.g. a directory with it��s subdirectories). An
-     ECB-tree-window now tries always to make visisble as much as possible of
-     the subnodes of a node if a node is expanded (e.g. by clicking onto it��s
+     ECB-tree-window now tries always to make visible as much as possible of
+     the sub-nodes of a node if a node is expanded (e.g. by clicking onto it��s
      expand-symbol).
    + Other nodes: A ECB-tree-window is always best filled, means no empty lines
      if there are enough lines to fill the whole window.
 
 ** Now all tree-buffers (ECB-buffers) are read-only (Klaus)!
 
-** Better implementation of advising the functions. Now all adviceable
+** Better implementation of advising the functions. Now all advice-able
    functions are completely independent from each other (Klaus)!
 
 ** Removes the redundant modeline info and shows important
 
 ** Added new option `ecb-advice-window-functions'. Enabling the intelligent
    window functions via customize. No hook hacking necessary anymore!
-   Now the intelligent window functions are implemented by advicing (klaus).
+   Now the intelligent window functions are implemented by advicing (Klaus).
 
 ** Better online help display (Klaus).
 
    for suggestion <David.Hay@requisite.com>.
 
 ** Adviced 'other-window' acts now exactly like the original but always related
-   to 'ecb-other-window-jump-behavior' (klaus)!
+   to 'ecb-other-window-jump-behavior' (Klaus)!
 
 ** Fixed bug with 'ecb-compile-window-height'. Now ECB has always the correct
    compile-window height after compilation-output (compile, grep etc.)
-Readme for the Emacs Code Browser (ECB) version 1.95.1
+README for the Emacs Code Browser (ECB) version 1.96
 
 
 About
   IMPORTANT: The speedbar-version shipped with GNU Emacs <= 21.3 does not
   satisfy the requirements - download and install a newer one!
 
-- Optional: If Java code is edited the ECB works best when the JDE package
+- Optional: If Java code is edited the ECB works best when the JDEE package
   (http://sunsite.auc.dk/jde) is installed.
 
 If you use XEmacs you must have the packages fsf-compat (contains overlay.el)
 and c-support (contains hideshow.el) installed. If you want to read the
 online-help of ECB in HTML-format you must have the library browse-url (part
-of the mail-lib XEmacs package) installed!
+of the mail-lib XEmacs package) installed; this package is also needed for
+submitting problem-reports to the ECB-maintainers!
 
 
 Installation
 *IMPORTANT*: The following steps 1. to 8. describe installation tasks if you
 got the archive in the format available at the ECB website. If you use XEmacs
 and got ECB as regular XEmacs-package (e.g. downloaded and installed by the
-net-installer of XEmacs) then there is nothing to do for you, just start ECB
+package-manager of XEmacs) then there is nothing to do for you, just start ECB
 with `ecb-activate' or read the online-help with `ecb-show-help'.
 
 
 7. Calling `ecb-byte-compile'
 
    This byte compiles ECB. You can safely ignore all messages. (You can also
-   bytecompile ECB from the command-line either by using the `Makefile' or by
+   byte-compile 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.)
 
 -----
 
 Call "M-x ecb-activate" to activated ECB.
-Call "M-x ecb-show-help" to get a detailed online-help for ECB.
-If you are using ECB the first time you should read the complete
-online help accurately!
+
+Call "M-x ecb-show-help" to get a detailed online-help for ECB. If you are
+using ECB the first time you should read the online help accurately!
 
 
 Contacts
-This file contains some important release-notes for ECB version 1.95.1
+This file contains some important release-notes for ECB version 1.96
 
 General:
 --------
 Upgrading from any version:
 ---------------------------
 
+The options `ecb-mode-line-data' and `ecb-mode-line-prefixes' have chenged
+their type. ECB will autom. upgrade the old values of these options as best as
+possible to the new types!
+
+The option `ecb-layout-switch-to-compilation-window' has been removed. This
+mimic is now done automatically.
+
+The name of the command `ecb-toggle-enlarged-compilation-window' has been
+changed to `ecb-toggle-compile-window-height' (The old name is still available
+as alias but is deprecated). The keybinding [C-. /] remains.
+
+The command `ecb-eshell-goto-eshell' has been removed. Now just use `eshell'
+to work with the eshell. The old binding [C-. e] now simply runs `eshell'.
+
+The command `ecb-eshell-enlarge' has been removed. Now just use the standard
+ECB-command `ecb-toggle-compile-window-height' for this.
+
+
+Upgrading from a version < 1.95.1:
+----------------------------------
+
 If there are byte-compiled(!) user-defined layouts - either created
 interactively by `ecb-create-new-layout' or programmed with the macro
 `ecb-layout-define' - then the file where these user-defined layouts are saved
 version >= 1.95.1! If the user-defined layouts are not byte-compiled then
 there is nothing to do.
 
-Some default keybindings have changed; the new bindings are:
+Some default key-bindings have changed; the new bindings are:
 
   C-c . g1: `ecb-goto-window-edit1'       (was C-c . 1)
   C-c . g2: `ecb-goto-window-edit2'       (was C-c . 2)
 Upgrading from version < 1.95:
 ------------------------------
 
-Some default keybindings have changed; the new bindings are:
+Some default key-bindings have changed; the new bindings are:
 
   C-c . r:  `ecb-rebuild-methods-buffer' (was not bound before)
   C-c . lc: `ecb-change-layout'          (was C-c . l)
 + ECB now requires eieio >= 0.16 (see also README)
 
 + The option ecb-prefix-key has been removed. Now all customization of
-  keybindings is done via the new option ecb-key-map.
+  key-bindings is done via the new option ecb-key-map.
 
 + ecb-layout-window-sizes is now an association list. If you have customized
   this variable or used the ecb-store-window-sizes function, there will be an
   error when drawing the ECB layout. Reset ecb-layout-window-sizes to it's
   default value (nil) and store your window sizes using ecb-store-window-sizes.
 
-+ A new customization variable ecb-show-tokens controls the behaviour of the
++ A new customization variable ecb-show-tokens controls the behavior of the
   methods buffer. Read the documentation for more information.
 
   
 -------------------------------
 
 + Now mouse-1 and mouse-2 for opening source-files and jumping to
-  methods/variables is not longer the default keybinding. Please take a look
+  methods/variables is not longer the default key-binding. Please take a look
   at the new options 'ecb-primary-secondary-mouse-buttons' and
   'ecb-primary-mouse-jump-destination'.
 
   in the ECB-method-buffer. This bug is fixed!
 
 + For a complete list of changes and new features for versions > 1.20 see the
-  HISTORY file.
+  NEWS file.
 
 ;;; ecb-autogen.el --- Auto load statement generator
 
-;; Copyright (C) 2002 Klaus Berndl
+;; Copyright (C) 2000 - 2003 Jesper Nordenberg,
+;;                           Klaus Berndl,
+;;                           Kevin A. Burton,
+;;                           Free Software Foundation, Inc.
 
-;; Author: Klaus Berndl <klaus.berndl@sdm.de>
+;; Author: Jesper Nordenberg <mayhem@home.se>
+;;         Klaus Berndl <klaus.berndl@sdm.de>
+;;         Kevin A. Burton <burton@openprivacy.org>
 ;; Maintainer: Klaus Berndl <klaus.berndl@sdm.de>
+;;             Kevin A. Burton <burton@openprivacy.org>
 ;; Keywords: browser, code, programming, tools
+;; Created: 2003
+
+;; This program is free software; you can redistribute it and/or modify it under
+;; the terms of the GNU General Public License as published by the Free Software
+;; Foundation; either version 2, or (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+;; FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+;; details.
+
+;; You should have received a copy of the GNU General Public License along with
+;; GNU Emacs; see the file COPYING.  If not, write to the Free Software
+;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 ;; $Id$
 
-;; This file is not part of GNU Emacs.
-
-;; ECB is free software; you can redistribute it and/or modify it under the
-;; terms of the GNU General Public License as published by the Free Software
-;; Foundation; either version 2, or (at your option) any later version.
-
-;; This software is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
 ;;; Commentary:
 ;;
 ;; Automatically generate autoloads for ECB
 (eval-when-compile
   (require 'silentcomp))
 
+
 (when (ecb-noninteractive)
   ;; If the user is doing this non-interactively, we need to set up
   ;; these conveniences.
   (add-to-list 'load-path nil)
-  (setq find-file-hooks nil
-        find-file-suppress-same-file-warnings t)
+  (set (if (boundp 'find-file-hook)
+           'find-file-hook
+         'find-file-hooks) nil)
+  (setq find-file-suppress-same-file-warnings t)
   )
 
 
   "Name of the auto-generated autoloads file.")
 
 (defconst ecb-autoload-feature "ecb-autoloads"
-  "Featurename of the autoloads")
+  "Feature-name of the autoloads")
 
 (defvar ecb-autogen-subdirs nil
   "Sub-directories to scan for autoloads.")
       nil ;; Say not already written.
       )))
 
+;; We code this so clumsy to silence the bytecompiler of GNU Emacs >= 21.4 not
+;; to complain about obsoleteness of `write-contents-hooks'.
+(defun ecb-batch-update-autoloads ()
+  (let ((old-val (symbol-value (if (boundp 'write-contents-functions)
+                                   'write-contents-functions
+                                 'write-contents-hooks))))
+    (unwind-protect
+        (progn
+          (set (if (boundp 'write-contents-functions)
+                   'write-contents-functions
+                 'write-contents-hooks)
+               '(ecb-autogen-update-header))
+          (batch-update-autoloads))
+      (set (if (boundp 'write-contents-functions)
+               'write-contents-functions
+             'write-contents-hooks)
+           old-val)))) 
+
 (defun ecb-update-autoloads ()
   "Update ecb autoloads from sources.
 Autoloads file name is defined in variable `ecb-autogen-file'. If ECB is
            ;; autoload-package-name is not provided.
            (autoload-package-name "ecb")
            (subdirs (mapcar 'expand-file-name ecb-autogen-subdirs))
-           (write-contents-hooks '(ecb-autogen-update-header))
            (command-line-args-left (cons default-directory subdirs))
            )
-      (batch-update-autoloads))
+      (ecb-batch-update-autoloads))
     ;; XEmacs adds autom. the provide statement but for GNU Emacs we must do
     ;; this:
     (when (not ecb-running-xemacs)

ecb-compilation.el

-;;; ecb-compilation.el --- 
+;;; ecb-compilation.el --- code for buffers displayed in compile-window
 
-;; $Id$
+;; Copyright (C) 2000 - 2003 Jesper Nordenberg,
+;;                           Klaus Berndl,
+;;                           Kevin A. Burton,
+;;                           Free Software Foundation, Inc.
 
-;; Copyright (C) 2000-2003 Free Software Foundation, Inc.
-;; Copyright (C) 2000-2003 Kevin A. Burton (burton@openprivacy.org)
-
-;; Author: Kevin A. Burton (burton@openprivacy.org)
-;; Maintainer: Kevin A. Burton (burton@openprivacy.org)
-;; Location: http://relativity.yi.org
-;; Keywords: 
-;; Version: 1.0.0
-
-;; This file is [not yet] part of GNU Emacs.
+;; Author: Jesper Nordenberg <mayhem@home.se>
+;;         Klaus Berndl <klaus.berndl@sdm.de>
+;;         Kevin A. Burton <burton@openprivacy.org>
+;; Maintainer: Klaus Berndl <klaus.berndl@sdm.de>
+;;             Kevin A. Burton <burton@openprivacy.org>
+;; Keywords: browser, code, programming, tools
+;; Created: 2001
 
 ;; This program is free software; you can redistribute it and/or modify it under
 ;; the terms of the GNU General Public License as published by the Free Software
-;; Foundation; either version 2 of the License, or any later version.
-;;
+;; Foundation; either version 2, or (at your option) any later version.
+
 ;; This program is distributed in the hope that it will be useful, but WITHOUT
 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 ;; FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 ;; details.
-;;
+
 ;; You should have received a copy of the GNU General Public License along with
-;; this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-;; Place - Suite 330, Boston, MA 02111-1307, USA.
+;; GNU Emacs; see the file COPYING.  If not, write to the Free Software
+;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+;; $Id$
 
 ;;; Commentary:
 
 
 (require 'ecb-util)
 
-(defgroup ecb-compilation-content nil
-  "Settings for all things displayed in the compile window of ECB."
-  :group 'ecb
-  :prefix "ecb-compilation-")
-
 (defcustom ecb-compilation-buffer-names `(("*Calculator*" . nil)
                                           ("*vc*" . nil)
                                           ("*vc-diff*" . nil)
-                                          ("*Apropos*" . nil)
+                                          ,(if ecb-running-xemacs
+                                               '("\\*Apropos.*\\*" . t)
+                                             '("*Apropos*" . nil))
+                                          ("*Occur*" . nil)
+                                          ("*shell*" . nil)
+                                          ("\\*[cC]ompilation.*\\*" . t)
+                                          ("\\*i?grep.*\\*" . t)
+                                          ("*JDEE Compile Server*" . nil)
                                           ,(if ecb-running-xemacs
                                                '("\\*Help.*\\*" . t)
                                               '("*Help*" . nil))
+                                          ("*Completions*" . nil)
                                           ("*Backtrace*" . nil)
-                                          ("*shell*" . nil)
+                                          ("*Compile-log*" . nil)
                                           ("*bsh*" . nil)
                                           (,(if ecb-running-xemacs
                                                " *Message-Log*"
                                              "*Messages*") . nil))
-  "*Additional buffer names that should be displayed in the compilation
-window of ECB even if `compilation-buffer-p' says nil."
-  :group 'ecb-compilation-content
-  :group 'ecb-layout
+  "*Additional buffer names that should be displayed in the compile-window.
+Buffer names can either be defined as strings or as regexps. If the
+buffer-name of a buffer matches one of the defined string or regexp then it
+will be displayed in the compile-window of ECB even if `compilation-buffer-p'
+says nil for this buffer.
+
+It is not recommended to add the name of eshell-buffers to this list because
+ECB already handles the eshell-integration as best as possible."
+  :group 'ecb-compilation
   :type '(repeat (cons (string :tag "Buffer name")
                        (boolean :tag "Handled as regexp"))))
 
               (throw 'exit name))))
       nil)))
 
-(defcustom ecb-compilation-major-modes (list 'eshell-mode 'compilation-mode)
-  "*Additional major-mode that should be displayed in the compilation
-window of ECB even if `compilation-buffer-p' says nil."
-  :group 'ecb-compilation-content
-  :group 'ecb-layout
+(defcustom ecb-compilation-major-modes '(compilation-mode)
+  "*Additional major-mode that should be displayed in the compile-window.
+All buffers of a major-mode contained in this list are displayed in the
+compile-window even if `compilation-buffer-p' says nil for such a buffer.
+
+It is not recommended to add `eshell-mode' to this list because ECB already
+handles the eshell-integration as best as possible."
+  :group 'ecb-compilation
   :type '(repeat (symbol :tag "major-mode name")))
 
 (defvar ecb-compilation-major-modes-internal nil
 
 
 (defcustom ecb-compilation-predicates '(comint-check-proc)
-  "*Predicate when a buffer should be treated as compilation-buffer -
-even if `compilation-buffer-p' says nil.
-
+  "*Predicates when a buffer should be treated as compilation-buffer.
 Every element of this list has to be a function or lambda-expression which
 gets as argument a buffer-object and which has to return not nil when this
-buffer should be treated as compilation-buffer and therefore be displayed in
-the compile-window of ECB \(if there is any).
+buffer should be treated as compilation-buffer \(even if
+`compilation-buffer-p' says nil) and therefore be displayed in the
+compile-window of ECB \(if there is any).
 
 In combination with the values of `ecb-compilation-buffer-names' and
 `ecb-compilation-major-modes' ECB decides when a buffer is displayed in the
 
 Default value is the function `comint-check-proc' which returns not nil when
 the buffer is related to a living process."
-  :group 'ecb-compilation-content
-  :group 'ecb-layout
+  :group 'ecb-compilation
   :type '(repeat (symbol :tag "Compilation predicate")))
 
 (defvar ecb-compilation-predicates-internal nil
   "Get all known compilation buffer names.  See `ecb-compilation-buffer-p'."
 
   (let((buffer-names '())
-       (buffer-list (buffer-list))
+       (buffer-list (buffer-list ecb-frame))
        (index 0))
 
     (setq buffer-list (sort buffer-list (lambda(first second)
                                           (string-lessp (buffer-name first)
                                                         (buffer-name second)))))
-
     (dolist(buffer buffer-list)
-
       (when (ecb-compilation-buffer-p buffer)
-
         (setq buffer-names
               (append buffer-names
                       (list (cons (buffer-name buffer) index))))
-        
         (setq index (1+ index))))
 
     buffer-names))
 
 
-(defun ecb-compilation-buffer-p(buffer-or-name)
+(defun ecb-compilation-buffer-p (buffer-or-name)
   "Test if the given buffer BUFFER-OR-NAME should be treated as a compilation
 buffer. Note that in this case we define \"compilation buffer\" as a buffer
 that should ideally be displayed in the compile-window of ECB \(see
 `ecb-compile-window-height'). This means that in some situations this might
 not be the result of a real `compile-internal'. A good example would be the
-*Help* buffer or the `ecb-eshell-buffer-name'.
+*Help* buffer.
 
 BUFFER-OR-NAME can be the name of a buffer or a buffer-object.
 
-This function returns non-nil - i.e. buffer will be treated as
-compilation-buffer - if:
+This function returns the buffer-object of BUFFER-OR-NAME - i.e.
+BUFFER-OR-NAME will be treated as compilation-buffer - if:
 
 - The name of the buffer is contained in the list returned by the function
   `ecb-compilation-buffer-names' or
 - one of the predicates returned by `ecb-compilation-predicates' returns not
   nil for the buffer.
 
-Summary for ECB-endusers: A buffer will be treated as compilation-buffer if
+Otherwise nil is returned.
+
+Summary for ECB-end-users: A buffer will be treated as compilation-buffer if
 either 
 - `compilation-buffer-p' returns not nil, i.e. if a real compilation-buffer or
 - if at least one of the options `ecb-compilation-buffer-names',
 
       ;;test if this is a valid buffer by name.
       (if (ecb-compilation-registered-buffer-p (buffer-name buffer))
-          t
+          buffer
         ;;else test if this is a valid buffer by mode
         (if (save-excursion
               (set-buffer buffer)
               (member major-mode (ecb-compilation-major-modes)))
-            t
+            buffer
           ;;else test if this is a regular compilation buffer
           (if (compilation-buffer-p buffer)
-              t
+              buffer
             ;; we do not use run-hook-with-args-until-success because we have
             ;; to check if the functions are bound!!
             (if (dolist (p ecb-comp-predicates)
                   (if (and (fboundp p) (funcall p buffer))
                       (return t)))
-                t
+                buffer
               nil)))))))
 
 ;; Klaus Berndl <klaus.berndl@sdm.de>: The following mechanism is necessary to
               (setq submenu
                     (append submenu
                             (list (vector (car buffer)
-                                          `(funcall (if (ecb-compile-window-live-p)
-                                                        'switch-to-buffer
-                                                      'switch-to-buffer-other-window)
-                                                  ,(car buffer))
+                                          ;; switch-to-buffer-other-window is
+                                          ;; ok for all situations because if
+                                          ;; no compile-window it uses another
+                                          ;; edit-window otherwise it uses the
+                                          ;; compile-window. 
+                                          `(funcall 'switch-to-buffer-other-window
+                                                    ,(car buffer))
                                           :active t)))))
             
             ;;TODO: Klaus Berndl <klaus.berndl@sdm.de>: Seems not to work with
 
 (silentcomp-provide 'ecb-compilation)
 
-;;; ecb-compilation.el ends here
+;;; ecb-compilation.el ends here

ecb-create-layout.el

 ;;; ecb-create-layout.el --- creating new layouts
 
-;; Copyright (C) 2001 Jesper Nordenberg
-;; Copyright (C) 2001 Free Software Foundation, Inc.
-;; Copyright (C) 2001 Klaus Berndl <klaus.berndl@sdm.de>
+;; Copyright (C) 2000 - 2003 Jesper Nordenberg,
+;;                           Klaus Berndl,
+;;                           Kevin A. Burton,
+;;                           Free Software Foundation, Inc.
 
-;; Author: Klaus Berndl <klaus.berndl@sdm.de>
+;; Author: Jesper Nordenberg <mayhem@home.se>
+;;         Klaus Berndl <klaus.berndl@sdm.de>
+;;         Kevin A. Burton <burton@openprivacy.org>
 ;; Maintainer: Klaus Berndl <klaus.berndl@sdm.de>
-;; Keywords: java, class, browser
+;;             Kevin A. Burton <burton@openprivacy.org>
+;; Keywords: browser, code, programming, tools
+;; Created: 2002
 
-;; This program is free software; you can redistribute it and/or modify it
-;; under the terms of the GNU General Public License as published by the Free
-;; Software Foundation; either version 2, or (at your option) any later
-;; version.
+;; This program is free software; you can redistribute it and/or modify it under
+;; the terms of the GNU General Public License as published by the Free Software
+;; Foundation; either version 2, or (at your option) any later version.
 
 ;; This program is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-;; more details.
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+;; FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+;; details.
 
-;; You should have received a copy of the GNU General Public License along
-;; with GNU Emacs; see the file COPYING. If not, write to the Free Software
+;; You should have received a copy of the GNU General Public License along with
+;; GNU Emacs; see the file COPYING.  If not, write to the Free Software
 ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 ;; $Id$
 (require 'ecb-mode-line)
 (require 'ecb-util)
 
-(require 'cl) ;; for set-difference
-
 ;; XEmacs stuff
 (silentcomp-defvar vertical-divider-map)
 (silentcomp-defvar modeline-map)
 
  This is the help-screen of this mode. The window
  displaying this help text is called the edit-window
- which is neither selectable nor deletable nor
- splittable in this mode.
+ which is neither selectable nor delete-able nor
+ split-able in this mode.
 
  <left/right/up/down-arrow>: Moving around in current
  window C-n, C-p: Go to next/previous window (beside
         \"methods\", \"history\", \"speedbar\") the
         current window should be.
  C-u: Unsplit, ie. delete current window
- C-t: Give the current window a builtin type
+ C-t: Give the current window a built-in type
       (\"directories\", \"sources\", \"methods\",
-      \"history\", \"speedbar\") or any arbitary user-
+      \"history\", \"speedbar\") or any arbitrary user-
       defined type (\"other\"). See the Online-manual!
 
  C-c: Cancel layout creation. This does not save the
       in use. You have to choose a new name!
       Deletes this frame.
 
- There are NO other commands or keys avaliable. ALL
+ There are NO other commands or keys available. ALL
  other keys are disabled in this mode!
 ")
 
  ========================
 
  This is the help-screen of this mode. The window displaying this help text is called
- the edit-window which is neither selectable nor deletable nor splittable in this mode.
+ the edit-window which is neither selectable nor delete-able nor split-able in this mode.
 
  <left/right/up/down-arrow>: Moving around in current window
  C-n, C-p: Go to next/previous window (beside the edit-window)
       - Which type (\"directories\", \"sources\", \"methods\", \"history\", \"speedbar\")
         the current window should be.
  C-u: Unsplit, ie. delete current window
- C-t: Give the current window a builtin type (\"directories\", \"sources\", \"methods\",
-      \"history\", \"speedbar\") or any arbitray user-defined type (\"other\").
+ C-t: Give the current window a built-in type (\"directories\", \"sources\", \"methods\",
+      \"history\", \"speedbar\") or any arbitrary user-defined type (\"other\").
 
  C-c: Cancel layout creation. This does not save the layout. Deletes this frame.
  C-q: Save current defined layout and quit the layout creation. You will be asked for a
       layout-name. With TAB-completion you can get the names already in use.
       You have to choose a new name! Deletes this frame.
 
- There are NO other commands or keys avaliable. ALL other keys are disabled in this mode!
+ There are NO other commands or keys available. ALL other keys are disabled in this mode!
 ")
 
 (defconst ecb-create-layout-file-header
 
 (defun ecb-create-layout-initilize ()
   (setq ecb-create-layout-buf-types
-        (copy-list ecb-create-layout-all-buf-types))
+        (ecb-copy-list ecb-create-layout-all-buf-types))
   (setq ecb-create-layout-frame nil)
   (setq ecb-create-layout-edit-window nil)
   (setq ecb-create-layout-old-global-map nil)
 
 
 (defun ecb-create-layout-cancel (&rest ignore)
+  "Cancel layout-creation without saving the layout."
   (interactive)
   (when (ecb-create-layout-frame-ok)
     (ecb-create-layout-clear-all (interactive-p))
       (progn
         (setq vertical-divider-map ecb-create-layout-old-vertical-div-map)
         (setq modeline-map ecb-create-layout-old-modeline-map))
-    ;; before and after makeing frame stuff
+    ;; before and after making frame stuff
     (setq before-make-frame-hook ecb-create-layout-old-before-frame-h)
     (setq after-make-frame-functions ecb-create-layout-old-after-frame-h))
   ;; restore old debug-on-error
   
 
 (defun ecb-create-layout-set-buffer-to-type (&optional type)
+  "Give current ECB-buffer a type."
   (interactive)
   (when (ecb-create-layout-frame-ok)
     ;; adding the old buffer type to the available-list
       ;; removing the new buffer type from the available-list
       (ecb-create-layout-remove-from-buf-type new-type)
       (ecb-mode-line-set (buffer-name (current-buffer))
-                         (concat "ECB " new-type))
+                         (concat "ECB " new-type) nil t)
       ;; setting the new buffer type in the buffer itself
       (ecb-create-layout-set-buffer-type new-type)
       (when (interactive-p)
                                        (other-window 1))))))
 
 (defun ecb-create-layout-split ()
+  "Split current window."
   (interactive)
   (when (ecb-create-layout-frame-ok)
     ;; splitting
       (ecb-create-layout-next-window))))
 
 (defun ecb-create-layout-forward-char ()
+  "Move one character forward."
   (interactive)
   (when (ecb-create-layout-frame-ok)
     (unless (> (- (point) (ecb-line-beginning-pos)) (- (window-width)
       (call-interactively 'forward-char))))
 
 (defun ecb-create-layout-next-window ()
+  "Go to the next window.
+This command always goes to the next special ECB-window, i.e. it never selects
+the edit-window."
   (interactive)
   (when (ecb-create-layout-frame-ok)
     (let ((steps (if (equal (next-window) ecb-create-layout-edit-window) 2 1)))
                                          (other-window 1)))))))
 
 (defun ecb-create-layout-previous-window ()
+  "Go to the previous window.
+This command always goes to the ECB-window preceding current window, i.e. it
+never selects the edit-window."
   (interactive)
   (when (ecb-create-layout-frame-ok)
     (let ((steps (if (equal (previous-window (selected-window) 0)
                                          (other-window -1)))))))
 
 (defun ecb-create-layout-delete-window ()
+  "Delete current window."
   (interactive)
   (when (ecb-create-layout-frame-ok)
     (unless (or (equal (selected-window) ecb-create-layout-edit-window)
         (ecb-create-layout-new-buffer)))))
 
 (defvar ecb-create-layout-mode-map nil
-  "`ecb-create-layout-mode' keymap.")
+  "`ecb-create-layout-mode' key-map.")
 
 (if ecb-create-layout-mode-map
     ()
   (setq ecb-create-layout-mode-map (make-sparse-keymap))
-;;  (suppress-keymap ecb-create-layout-mode-map t)
+;;  (suppress-key-map ecb-create-layout-mode-map t)
 
   ;; for minibuffer insertion we need the following
   (dotimes (i 26)
   (erase-buffer)
   (unless do-not-fill
     (dotimes (i (window-height))
-      (insert-string
+      (insert
        (format "%s\n"
                (make-string (- (window-width)
                                (if ecb-running-xemacs 3 1))
   (setq mode-name "ECB Create-Layout")
   (use-local-map ecb-create-layout-mode-map)
   (make-variable-buffer-local 'buffer-read-only)
-  (ecb-mode-line-set (buffer-name (current-buffer)) "")
+  (ecb-mode-line-set (buffer-name (current-buffer)) "" nil t)
   (setq buffer-read-only t))
 
 (defun ecb-create-layout-init-layout (&optional new)
                 ecb-create-layout-help-text-top
               ecb-create-layout-help-text-left-right)))
   (setq ecb-create-layout-edit-window (selected-window))
-  (ecb-mode-line-set (buffer-name (current-buffer)) "   ECB edit-window")
+  (ecb-mode-line-set (buffer-name (current-buffer)) "   ECB edit-window" nil t)
   ;; The edit window must not be dedicated
   (set-window-dedicated-p (selected-window) nil)
   ;; we set the buffer for the (currently unsplitted) ECB-window
 
 
 (defun ecb-delete-new-layout ()
-  "Select a layout-name for a layout created by `ecb-create-new-layout' and
-delete this layout. This means the layout-definiton is removed from the file
+  "Select a layout-name and delete this layout.
+This means the layout-definition is removed from the file
 `ecb-create-layout-file' and the layout-function and associated aliases are
 unbound."
   (interactive)
   ;; ensure we have load all layouts defined until now
   (ecb-load-layouts)
   (let ((new-layout-list
-         (sort (set-difference (ecb-available-layouts-of-type nil)
+         (sort (ecb-set-difference (ecb-available-layouts-of-type nil)
                                (mapcar (function (lambda (elem)
                                                    (car elem)))
-                                       ecb-buildin-layouts)
-                               :test 'string=)
+                                       ecb-buildin-layouts))
                'string<))
         (layout-name nil))
     (if (= (length new-layout-list) 0)
         (ecb-error "This layout is not defined in %s!" ecb-create-layout-file)))))
 
 (defun ecb-create-layout-debug ()
+  "Debugging command for the ECB-developers."
   (interactive)
   (message "Layout-Debug: Type: %s, Factor: %s"
            (ecb-create-layout-buffer-type)
 ;;; ecb-cycle.el --- cycle buffers through ecb windows.
 
-;; $Id$
+;; Copyright (C) 2000 - 2003 Jesper Nordenberg,
+;;                           Klaus Berndl,
+;;                           Kevin A. Burton,
+;;                           Free Software Foundation, Inc.
 
-;; Copyright (C) 2000-2003 Free Software Foundation, Inc.
-;; Copyright (C) 2000-2003 Kevin A. Burton (burton@openprivacy.org)
-
-;; Author: Kevin A. Burton (burton@openprivacy.org)
-;; Maintainer: Kevin A. Burton (burton@openprivacy.org)
-;; Location: http://relativity.yi.org
-;; Keywords:
-;; Version: 1.1.0
-
-;; This file is [not yet] part of GNU Emacs.
+;; Author: Jesper Nordenberg <mayhem@home.se>
+;;         Klaus Berndl <klaus.berndl@sdm.de>
+;;         Kevin A. Burton <burton@openprivacy.org>
+;; Maintainer: Klaus Berndl <klaus.berndl@sdm.de>
+;;             Kevin A. Burton <burton@openprivacy.org>
+;; Keywords: browser, code, programming, tools
+;; Created: 2002
 
 ;; This program is free software; you can redistribute it and/or modify it under
 ;; the terms of the GNU General Public License as published by the Free Software
-;; Foundation; either version 2 of the License, or any later version.
-;;
+;; Foundation; either version 2, or (at your option) any later version.
+
 ;; This program is distributed in the hope that it will be useful, but WITHOUT
 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 ;; FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 ;; details.
-;;
+
 ;; You should have received a copy of the GNU General Public License along with
-;; this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-;; Place - Suite 330, Boston, MA 02111-1307, USA.
+;; GNU Emacs; see the file COPYING.  If not, write to the Free Software
+;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+;; $Id$
 
 ;;; Commentary:
 
 
 ;;; History:
 
-;; Fri Jan 25 2002 05:07 PM (burton@openprivacy.org): init
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
 
 ;;; TODO:
 ;;
 ;; - If possible, try to put fit the buffer so that the end of buffer is at the
 ;; end of the window... if necessary.
 
-;; What do we do if
-;;
-
 ;;; Code:
 
 (eval-when-compile
 
 
 (defun ecb-cycle-through-compilation-buffers(&optional choose-buffer)
-  "Cycle through all compilation buffers currently open and display them
-within the compilation window `ecb-compile-window' \(if this window doesn't
-exist then an error is displayed). If the currently opened buffer within the
-compilation window is not a compilation buffer, we jump to the first
-compilation buffer. If not we try to loop through all compilation buffers. If
-we hit the end we go back to the beginning.
+  "Cycle through all compilation buffers currently open.
+The choosen compilation buffer is displayed within the compilation window
+`ecb-compile-window' \(if this window doesn't exist then an error is
+displayed). If the currently opened buffer within the compilation window is
+not a compilation buffer, we jump to the first compilation buffer. If not we
+try to loop through all compilation buffers. If we hit the end we go back to
+the beginning.
 
 If CHOOSE-BUFFER is not nil then the user will be prompted for the
-compilation-buffer to swtich to.
+compilation-buffer to switch to.
 
-Afterwards always the compile-window of ECB is selected.
-
-See also the option `ecb-layout-switch-to-compilation-window'! The difference
-is that this cycling-function offers only compilation-buffers in the sense of
-`ecb-compilation-buffer-p' whereas the adviced version of `switch-to-buffer'
-offers any buffer but switches to `ecb-compile-window' if a compilation-buffer!"
+Afterwards always the compile-window of ECB is selected."
 
   (interactive "P")
-
-  (when (ecb-compile-window-live-p 'display-msg)
-    (ecb-with-original-functions
-
-     (select-window ecb-compile-window)
-
-     (if choose-buffer
+  (if (not (numberp (car (get 'ecb-compile-window-height 'saved-value))))
+      (ecb-error "This command needs a durable compile window!")
+    (if choose-buffer
+        (ecb-with-adviced-functions
          (switch-to-buffer (completing-read "ECB compilation buffer: "
-                                            (ecb-compilation-get-buffers)))
-
-       (let* ((compilation-buffers (ecb-compilation-get-buffers))
-              (current-buffer (window-buffer ecb-compile-window))
-              (current-buffer-name (buffer-name current-buffer))
-              (current nil)
-              (index nil))
-         (when (null compilation-buffers)
-           (ecb-error "No compilation buffers available."))
-
-         (if (not (ecb-compilation-buffer-p current-buffer))
-             ;;if the current bufffer is not a compilation buffer, goto the first
-             ;;compilation buffer.
-
-             (ecb-cycle-set-compilation-buffer 0 compilation-buffers)
-
-           ;;else... we need to determine what buffer to display.
-
-           (setq current (assoc current-buffer-name compilation-buffers))
-
-           (setq index (cdr current))
-
-           (if (= (1+ index) (length compilation-buffers))
-               ;;go back to the first buffer.
-               (ecb-cycle-set-compilation-buffer 0 compilation-buffers)
-             (ecb-cycle-set-compilation-buffer (1+ index)
-                                               compilation-buffers))))))))
+                                            (ecb-compilation-get-buffers))))
+      
+      (let* ((compilation-buffers (ecb-compilation-get-buffers))
+             ;; This works even if ecb-compile-window is nil (means temporally
+             ;; hidden) --> then current-buffer is the buffer of the currently
+             ;; selected window!
+             (current-buffer (window-buffer ecb-compile-window))
+             (current-buffer-name (buffer-name current-buffer))
+             (current nil)
+             (index nil))
+        (when (null compilation-buffers)
+          (ecb-error "No compilation buffers available."))
+        
+        (if (not (ecb-compilation-buffer-p current-buffer))
+            ;;if the current buffer is not a compilation buffer, goto the first
+            ;;compilation buffer.
+            
+            (ecb-cycle-set-compilation-buffer 0 compilation-buffers)
+          
+          ;;else... we need to determine what buffer to display.
+          
+          (setq current (assoc current-buffer-name compilation-buffers))
+          
+          (setq index (cdr current))
+          
+          (if (= (1+ index) (length compilation-buffers))
+              ;;go back to the first buffer.
+              (ecb-cycle-set-compilation-buffer 0 compilation-buffers)
+            (ecb-cycle-set-compilation-buffer (1+ index)
+                                              compilation-buffers)))))))
+  
 
 (defun ecb-cycle-set-compilation-buffer(index compilation-buffers)
   "Set the buffer in the compilation window."
 
-  (when (ecb-compile-window-live-p 'display-msg)
-    (let ((buffer-name (car (nth index compilation-buffers)))
-          (ecb-layout-switch-to-compilation-window '(switch-to-buffer)))
-      (message "ECB: setting compilation buffer %d/%d - %s"
-               (1+ index) (length compilation-buffers) buffer-name)
-      (switch-to-buffer buffer-name))))
+  (let ((buffer-name (car (nth index compilation-buffers))))
+    (ecb-with-adviced-functions
+     (switch-to-buffer buffer-name))))
+
 
 (silentcomp-provide 'ecb-cycle)
 
 ;;; ecb-eshell.el --- eshell integration for the ECB.
 
-;; $Id$
+;; Copyright (C) 2000 - 2003 Jesper Nordenberg,
+;;                           Klaus Berndl,
+;;                           Kevin A. Burton,
+;;                           Free Software Foundation, Inc.
 
-;; Copyright (C) 2000-2003 Free Software Foundation, Inc.
-;; Copyright (C) 2000-2003 Kevin A. Burton (burton@openprivacy.org)
-
-;; Author: Kevin A. Burton (burton@openprivacy.org)
-;; Maintainer: Kevin A. Burton (burton@openprivacy.org)
-;; Location: http://relativity.yi.org
-;; Keywords: 
-;; Version: 1.1.0
-
-;; This file is [not yet] part of GNU Emacs.
+;; Author: Jesper Nordenberg <mayhem@home.se>
+;;         Klaus Berndl <klaus.berndl@sdm.de>
+;;         Kevin A. Burton <burton@openprivacy.org>
+;; Maintainer: Klaus Berndl <klaus.berndl@sdm.de>
+;;             Kevin A. Burton <burton@openprivacy.org>
+;; Keywords: browser, code, programming, tools
+;; Created: 2001
 
 ;; This program is free software; you can redistribute it and/or modify it under
 ;; the terms of the GNU General Public License as published by the Free Software
-;; Foundation; either version 2 of the License, or any later version.
-;;
+;; Foundation; either version 2, or (at your option) any later version.
+
 ;; This program is distributed in the hope that it will be useful, but WITHOUT
 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 ;; FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 ;; details.
-;;
+
 ;; You should have received a copy of the GNU General Public License along with
-;; this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-;; Place - Suite 330, Boston, MA 02111-1307, USA.
+;; GNU Emacs; see the file COPYING.  If not, write to the Free Software
+;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+;; $Id$
 
 ;;; Commentary:
 
 ;; This package provides eshell integration for the ECB.  This basically allows
-;; you to jump to the eshell in the compilation window, synch up the current
+;; you to jump to the eshell in the compilation window, sync up the current
 ;; eshell with the current ECB buffer and run commands without getting in the
 ;; way.
 ;;
 ;;   allows you to view the eshell in minimized mode and then when you run 'ls'
 ;;   the window automatically expands.
 ;;
-;; - Sychronizes the current directory of the eshell with the current buffer
-;;   with each every ECB buffer.
+;; - Synchronizes the current directory of the eshell with the current buffer
+;;   of the either the edit-window or the ecb-windows.
 ;;
 ;; - Provides smart window layout of the eshell buffer.  This makes sure that
 ;;   the eshell is taking up the exact amount of space and that nothing is
 
 ;;; History:
 
-;; Tue Jan 14 2003 14:53 PM (klaus.berndl@sdm.de):
-;; Swiched back to the use of visible-window during body of
-;; `ecb-do-if-buffer-visible-in-ecb-frame'.
-
-;; Mon Jan 13 2003 09:33 AM (burton@peace): Fixed a bug with
-;; ecb-eshell-shrink-if-necessary if it wasn't being run from within the
-;; correct buffer. Reworked some code to restore the old behavior prior to
-;; visible-window being used as a side effect from within a macro.
-
-;; Sun Jan 05 2003 04:05 PM (burton@universe): Fixed a bug with the way we
-;; handle the switch-to-buffer after a eshell sync.
-;;
-;;     we need to make sure that that the eshell buffer isn't at the top of the
-;;     buffer history list just because we implicity changed its directory and
-;;     switched to it.  It might not be a good idea in the long term to put it
-;;     all the way at the end of the history list but it is better than leaving
-;;     it at the top.
-
-;; - Mon Dec 30 2002 6:57 PM (klaus.berndl@sdm.de):
-;;   Added ecb-eshell-start. See docstring.
-;; - Son Dec 29 2002 9:43 AM (klaus.berndl@sdm.de):
-;;   Fixes some bugs and cleans up the code:
-;;   + ecb-eshell-save-buffer-history: In macros with a let-clause we must
-;;     generate the local variables with make-symbol!!
-;;   + ecb-eshell-current-buffer-sync:
-;;     - Now only executed if called in ecb-compile-window; see comment in the
-;;       function itself.
-;;     - Normalizing directories before comparing it
-;;   + ecb-eshell-cleanse: removed (end-of-buffer) because this always sets
-;;     the mark. This should not be used in elisp-programs!
-;;   + Added to all functions ecb-eshell-running-p
-;;   + Removed a lot of superfluous save-excursion, save-window-excursion
-;;     etc...
-;;   + Removed ecb-eshell-enlarge-when-starting; eshell is always implicit
-;;     started and selected by `ecb-eshell-goto-eshell' so the option
-;;     `ecb-eshell-enlarge-when-selecting' should be enough.
-;;   + Removed the ecb-eshell-buffer-name.
-;;   + Added new option ecb-eshell-synchronize
-;;   + Moved all add-hook into ecb-eshell-activate
-;;   + Added new function ecb-eshell-deactivate
-;;   + Made ecb-eshell-activate idempotent.
-;;   
-;; - Mon Feb 04 2002 10:44 PM (burton@openprivacy.org): BUG: I think at certain
-;; conditions, we might be able to get the eshell window to expand after we
-;; automatically change directories.  I think this has to be:
-;;
-;; - Mon Feb 04 2002 10:43 PM (burton@openprivacy.org): BUGFIX: make sure the
-;; eshell is not buffer-read-only.  This is manifested by desktop.el for some
-;; reason.
-;;
-;; - Tue Jan 29 2002 03:33 AM (burton@openprivacy.org): Include the ability to
-;; startup the eshell when the ECB is started.
-;;
-;;
-;; - Tue Jan 29 2002 03:31 AM (burton@openprivacy.org): RFE: make the
-;; auto-enlargement on command execution optional, true by default.
-;;
-;; - Tue Jan 22 2002 11:38 PM (burton@openprivacy.org): enable customization
-;; 
-;; - Tue Dec 25 2001 07:54 PM (burton@openprivacy.org): We now enlarge the ecb
-;;   window when you go to it.
-;;    
-;; - Sat Dec 15 2001 01:50 AM (burton@openprivacy.org): We are not being much
-;;   smarter about saving selected windows.
-;;
-;; - Fri Dec 14 2001 05:57 PM (burton@openprivacy.org): fixed a bug which caused 
-;;
-;; - Fri Dec 14 2001 04:48 PM (burton@openprivacy.org): only run eshell/cd if
-;; the current directory is different than the eshell/pwd (this is a performance
-;; issue and needs to be added in ecb-eshell-current-buffer-sync
-;;
-;;   - we can't do this.  eshell/pwd does't return a string.  Instead we should
-;;     change to the eshell-buffer and see what the directory default-directory
-;;     is there.
-;;
-;; - Fri Dec 14 2001 03:24 PM (burton@openprivacy.org): use
-;; eshell-pre-command-hook to increase the size of the window if we are in an
-;; ECB layout (and the ecb is activated)...
-;;
-;; - Sun Nov 18 2001 07:20 PM (burton@openprivacy.org): putting the cursor one
-;;   line from the bottom of the window.
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
 
 ;;; Design:
 ;;
-;; Synching the current buffer with the eshell is done two ways.  If the buffer
-;; is visible in a window, we always resynch.  If it is not visible then
-;; ecb-eshell-goto-eshell will synch up when the user goes to the eshell buffer.
+;; Syncing the current buffer with the eshell is done two ways.  If the buffer
+;; is visible in a window, we always resync.  If it is not visible then
+;; ecb-eshell-goto-eshell will sync up when the user goes to the eshell
+;; buffer.
+;;
+;; Integrating of eshell is mostly done by advicing the command `eshell' which
+;; uses the mechanism of the display-buffer (adviced version).
 
 
 ;;; Code:
   :group 'ecb
   :prefix "ecb-eshell-")
 
-(defcustom ecb-eshell-enlarge-when-selecting t
-  "*Enlarge the compile-window if it displays the eshell and
-if it is selected by `ecb-eshell-goto-eshell'."
+(defcustom ecb-eshell-enlarge-when-eshell t
+  "*Enlarge the compile-window if it is selected by `eshell'.
+This takes only effect if the command `eshell' is called!"
+  :group 'ecb-eshell
+  :type 'boolean)
+
+(defcustom ecb-eshell-fit-window-to-command-output t
+  "*Fit the compile-window after an eshell-command to the output.
+This is done by the function `ecb-eshell-fit-window-to-output' which is added
+to `eshell-post-command-hook' ie. which is running autom. after each
+eshell-command."
   :group 'ecb-eshell
   :type 'boolean)
 
 (defcustom ecb-eshell-auto-activate nil
-  "*Startup the eshell when the ECB is activated and display it in the
-compile-window. If current layout does not display a compile-window \(see
+  "*Startup the eshell and display it in the compile-window.
+If current layout does not display a compile-window \(see
 `ecb-compile-window-height') then nothing is done."
   :group 'ecb-eshell
   :type 'boolean)
 
 (defcustom ecb-eshell-synchronize t
-  "*Synchronize the eshell with the default-directory of current
-source-buffer. The synchronization is done by `ecb-eshell-current-buffer-sync'
-which can be called interactively but normally it is called autom. by the
+  "*Synchronize eshell with the default-directory of current source-buffer.
+The synchronization is done by `ecb-eshell-current-buffer-sync' which can be
+called interactively but normally it is called autom. by the
 `ecb-current-buffer-sync-hook'."
   :group 'ecb-eshell
   :type 'boolean)
 (defvar ecb-eshell-pre-command-point nil
   "Point in the buffer we are at before we executed a command.")
 
-(defvar ecb-eshell-pre-window-enlarged nil
-  "True if we enlarged the window before we executed a command.")
+(defvar ecb-eshell-buffer-list nil
+  "List of eshell-buffers created until now.
+Background: `eshell' creates new eshell-buffers with `generate-new-buffer' if
+called with an prefix arg!")
 
-(defun ecb-eshell-start ()
-  "Create an interactive Eshell buffer.
-This function is used instead of the original `eshell' cause of a mysterious
-behavior of XEmacs which always starts eshell in the edit-window even if
-called from the compile-window. This functions ensures that eshell is started
-in that window where this function is called from!"
-  (require 'eshell)
-  (ecb-with-original-functions
-   (display-buffer (get-buffer-create eshell-buffer-name)))
-  (eshell-mode))
 
-(defun ecb-eshell-current-buffer-sync()
-  "Synchronize the eshell with the current buffer. This is only done if the
-eshell is currently visible and if either this function is called
-interactively or `ecb-eshell-synchronize' is not nil."
-  (interactive)
+(defconst ecb-eshell-adviced-functions '((eshell . around))
+  "These functions of eshell are adviced if ehsell is active during ECB is
+active. Each element of the list is a cons-cell where the car is the
+function-symbol and the cdr the advice-class \(before, around or after). If a
+function should be adviced with more than one class \(e.g. with a before and
+an after-advice) then for every class a cons must be added to this list.")
 
-  (when (and (or ecb-eshell-synchronize (interactive-p))
-             (ecb-eshell-running-p))
+(defadvice eshell (around ecb)
+  "Ensure that ehsell is running in the ECB-compile-window if any."
+  ;; we tell ECB to handle the eshell-buffers as compilation-buffers so they
+  ;; will be displayed in the compile-window (if any). We must add this as
+  ;; regexp because ehsell can open new eshell-buffers with a name created by
+  ;; generate-new-buffer-name! This approach is not completely save because if
+  ;; a users changes `eshell-buffer-name' during acivated ECB we get not
+  ;; informed about this and maybe we can handle the new buffer-name of eshell
+  ;; not as compilation-buffer. But we have no other chance: Adding the return
+  ;; value of `eshell' in the advice to `ecb-compilation-buffer-names-internal'
+  ;; does not help because `eshell' uses the new buffer-name already for
+  ;; `pop-to-buffer'. So an after advice would add the new buffer-name to late
+  ;; and a before-advice does not know the new-buffer name. The only way would
+  ;; be to reimplement the whole `eshell'-code in an around advice but this is
+  ;; not related to the benefit. IMO is it very improbably that a user changes
+  ;; `eshell-buffer-name' at all...
+  (let ((new-elem (cons (concat ".*"
+                                (regexp-quote eshell-buffer-name)
+                                ".*")
+                        t)))
+    (if (or ecb-compile-window-height
+            (numberp (car (get 'ecb-compile-window-height 'saved-value))))
+        (progn
+          (add-to-list 'ecb-compilation-buffer-names-internal new-elem)
+          (add-to-list 'ecb-compilation-major-modes-internal 'eshell-mode))
+      ;; if we have no durable compile-window we do not handle eshell autom.
+      ;; as compilation-buffer. If the user wants this then he has to modify
+      ;; `ecb-compilation-buffer-names' and/or `ecb-compilation-major-modes'.
+      ;; Therefore we remove the new-elem here from the internal lists.
+      (setq ecb-compilation-buffer-names-internal
+            (delete new-elem ecb-compilation-buffer-names-internal))
+      (setq ecb-compilation-major-modes-internal
+            (delete 'eshell-mode ecb-compilation-major-modes-internal))))
+  
+  ;; maybe we have to auto toggle our compile-window if temporally hidden
+  (when (and (numberp (car (get 'ecb-compile-window-height 'saved-value)))
+             (not (ecb-compile-window-live-p)))
+    (ecb-layout-debug-error "eshell around-advice: comp-win will be toggled.")
+    (ecb-toggle-compile-window 1))
 
-    ;;only do this if the user is looking at the eshell buffer; for this we
-    ;;have the macro `ecb-do-if-buffer-visible-in-ecb-frame'.
+  ;; some hooks
+  (add-hook 'ecb-current-buffer-sync-hook 'ecb-eshell-current-buffer-sync)  
+  (add-hook 'eshell-post-command-hook 'ecb-eshell-recenter)
+  (add-hook 'eshell-post-command-hook 'ecb-eshell-fit-window-to-output)
+  (add-hook 'eshell-pre-command-hook 'ecb-eshell-precommand-hook)
+  (add-hook 'window-size-change-functions 'ecb-eshell-window-size-change)
 
-    (ecb-do-if-buffer-visible-in-ecb-frame 'eshell-buffer-name
-      
-      ;; here we can be sure that the eshell is visible in a window of
-      ;; `ecb-frame'.
+  ;; run `eshell' --------------------------------------------
+  (ecb-eshell-save-buffer-history
+   ad-do-it)
+  ;; ---------------------------------------------------------
 
-      ;; This macro locally binds the variables visible-buffer and
-      ;; visible-window. See documentation.
+  ;; some post processing
 
-      (let ((source-buffer-directory nil)
-            (ecb-buffer-directory nil))
-      
-        ;; we synchronize only if the eshell is displayed in the
-        ;; compile-window otherwise the following ecb-eshell-cleanse would
-        ;; prevent from inserting any command if the eshell is displayed in
-        ;; the edit-window (e.g. by calling `eshell' in the edit-window)
-        (when (equal visible-window ecb-compile-window)
-          (ecb-eshell-save-buffer-history
-           ;;make sure we are clean.
-           (ecb-eshell-cleanse)
-           
-           ;;get copies of the current source directory.
-           
-           (setq source-buffer-directory default-directory)
-           
-           (save-excursion
-             (set-buffer visible-buffer)
-             (setq buffer-read-only nil)
-             (setq ecb-buffer-directory default-directory))
-           
-           ;; at this point source-buffer-directory is a snapshot of the
-           ;; source buffer window and default directory is the directory
-           ;; in the eshell window
+  ;; add the buffer of the buffer used/created by `eshell' to
+  ;; `ecb-eshell-buffer-list'
+  (add-to-list 'ecb-eshell-buffer-list ad-return-value)
 
-           (when (not (string-equal (ecb-fix-filename source-buffer-directory)
-                                    (ecb-fix-filename ecb-buffer-directory)))
-             (save-excursion
-               (set-buffer visible-buffer)
-               ;;change the directory without showing the cd command
-               (eshell/cd source-buffer-directory)
-               
-               ;;execute the command
-               (save-selected-window
-                 (select-window visible-window)
-                 (eshell-send-input)))
-             
-             (ecb-eshell-recenter)
-
-             ;; we need to make sure that that the eshell buffer isn't at the
-             ;; top of the buffer history list just because we implicity
-             ;; changed its directory and switched to it. It might not be a
-             ;; good idea in the long term to put it all the way at the end of
-             ;; the history list but it is better than leaving it at the top.
-             (bury-buffer eshell-buffer-name))))))))
-
-(defmacro ecb-eshell-save-buffer-history (&rest body)
-  "Protect the buffer-list so that the eshell buffer name is not placed early
-in the buffer list or at all if it currently doesn't exist."
-  (let ((eshell-buffer-list (make-symbol "my-buffer-list")))
-    `(let ((,eshell-buffer-list (ecb-frame-parameter (selected-frame)
-                                                    'buffer-list)))
-       (unwind-protect
-           (progn
-             ,@body)
-         (modify-frame-parameters nil (list (cons 'buffer-list
-                                                  ,eshell-buffer-list)))))))
-
-(defun ecb-eshell-recenter(&optional display-errors)
-  "Recenter the eshell window so that the prompt is at the end of the buffer."
-  (interactive (list t))
-
-  (let ((window (and (ecb-eshell-running-p)
-                     (get-buffer-window eshell-buffer-name))))
-    (if (and window
-             (window-live-p window)
-             (equal window ecb-compile-window))
-        (save-selected-window
-          (select-window window)
-          (goto-char (point-max))
-          (recenter -2))
-      (when display-errors
-        (ecb-error "Eshell not running or compile-window not live!")))))
-
-(defun ecb-eshell-running-p()
-  "Return true if eshell is currently running."
-  (and (boundp 'eshell-buffer-name)
-       (get-buffer eshell-buffer-name)))
-
-(defun ecb-eshell-goto-eshell()
-  "Go to the eshell buffer in the compile-window. If eshell is not alive then
-start it."
-  (interactive)
-  
-  ;; This is idempotent!
-  (ecb-eshell-activate)
-
-  (when ecb-eshell-enlarge-when-selecting
-    (ecb-eshell-enlarge))
+  (when ecb-eshell-enlarge-when-eshell
+    (ecb-toggle-compile-window-height 1))
 
   ;;always recenter because if the point is at the top of the eshell buffer
   ;;and we switch to it the user is not going to be able to type a command
   
   ;;sync to the current buffer
   (ecb-eshell-current-buffer-sync))
+  
+  
 
-(defun ecb-eshell-activate()
-  "Startup the eshell in the compile window. If no compile-window is visible
-then an error is reported!"
- (ecb-eshell-save-buffer-history
-   (save-excursion
-     (when (ecb-compile-window-live-p 'display-msg)
-       (select-window ecb-compile-window)
+(defun ecb-eshell-activate-integration ()
+  "Does all necessary to activate the eshell-integration. But this doesn not
+load or activate eshell - it just prepares ECB to work perfectly with eshell."
+  (ecb-enable-advices ecb-eshell-adviced-functions))
 
-       (if (not (ecb-eshell-running-p))
-           (ecb-eshell-start))
-
-       (if (ecb-eshell-running-p)
-           (set-window-buffer ecb-compile-window
-                              (get-buffer eshell-buffer-name))
-
-         (ecb-error "Can not start eshell. Please check eshell installation!")))))
-  
- (when (and (ecb-compile-window-live-p 'display-msg)
-            (ecb-eshell-running-p))
-   (add-hook 'ecb-current-buffer-sync-hook 'ecb-eshell-current-buffer-sync)
-   
-   (add-hook 'eshell-post-command-hook 'ecb-eshell-recenter)
-   (add-hook 'eshell-post-command-hook 'ecb-eshell-shrink-if-necessary)
-   (add-hook 'eshell-pre-command-hook 'ecb-eshell-enlarge)
-   
-   (add-hook 'window-size-change-functions 'ecb-eshell-window-size-change)
-   
-   (add-to-list 'ecb-compilation-buffer-names-internal
-                (cons eshell-buffer-name nil))))
-
-(defun ecb-eshell-deactivate ()
-  ;;TODO: Klaus Berndl <klaus.berndl@sdm.de>: Should we also try to exit the
-  ;;eshell itself? IMHO we should not...
+(defun ecb-eshell-deactivate-integration ()
+  (ecb-disable-advices ecb-eshell-adviced-functions)
   (remove-hook 'ecb-current-buffer-sync-hook 'ecb-eshell-current-buffer-sync)
   (remove-hook 'eshell-post-command-hook 'ecb-eshell-recenter)
-  (remove-hook 'eshell-post-command-hook 'ecb-eshell-shrink-if-necessary)
-  (remove-hook 'eshell-pre-command-hook 'ecb-eshell-enlarge)
-  (remove-hook 'window-size-change-functions 'ecb-eshell-window-size-change))  
+  (remove-hook 'eshell-post-command-hook 'ecb-eshell-fit-window-to-output)
+  (remove-hook 'eshell-pre-command-hook 'ecb-eshell-precommand-hook)
+  (remove-hook 'window-size-change-functions 'ecb-eshell-window-size-change))
 
-(defun ecb-eshell-enlarge()
-  "Enlarge the eshell so more information is visible.  This is usually done so
-that the eshell has more screen space after we execute a command. "
+(defun ecb-eshell-current-buffer-sync()
+  "Synchronize the eshell with the directory of current source-buffer.
+This is only done if the eshell is currently visible in the compile-window of
+ECB and if either this function is called interactively or
+`ecb-eshell-synchronize' is not nil."
   (interactive)
 
-  ;;use the eshell-pre-command-hook to see the point and then only enlarge if
-  ;;we enlarge past the maximum amount of lines we can use.
-  (setq ecb-eshell-pre-command-point (point))
-  
-  (when (ecb-eshell-running-p)
-    (let((window (get-buffer-window eshell-buffer-name)))
-      
-      (when (and window
-                 (window-live-p window)
-                 (equal (selected-window) ecb-compile-window)
-                 ecb-minor-mode)
+  (when (and (equal (selected-frame) ecb-frame)
+             (or ecb-eshell-synchronize (interactive-p))
+             (ecb-compile-window-live-p)
+             (not (ecb-point-in-compile-window)))
 
-        ;;is there a better way to do this? It seems that there should be a
-        ;;way to have emacs split or expand a window by 50% like it is done in
-        ;;a lot of other places (display-buffer, etc)
+    (let* ((my-eshell-buffer
+            ;; nil or a living eshell-buffer in the ecb-compile-window
+            (car (member (window-buffer ecb-compile-window)
+                         ecb-eshell-buffer-list)))
+           (my-reference-directory default-directory)
+           (my-eshell-directory (and (bufferp my-eshell-buffer)
+                                     (save-excursion
+                                       (set-buffer my-eshell-buffer)
+                                       default-directory))))
+      (when (and (bufferp my-eshell-buffer)
+                 (stringp my-reference-directory)
+                 (stringp my-eshell-directory)
+                 (not (string-equal (ecb-fix-filename my-reference-directory)
+                                    (ecb-fix-filename my-eshell-directory))))
+        (ecb-eshell-save-buffer-history
+         (save-excursion
+           (set-buffer my-eshell-buffer)
+           ;; make sure we have a clean eshell-command-line
+           (goto-char (point-max))
+           (eshell-bol)
+           (delete-region (point) (point-at-eol))
+           ;;change the directory without showing the cd command
+           (eshell/cd my-reference-directory))
+           
+         ;;execute the command
+         (save-selected-window
+           (select-window ecb-compile-window)
+           (eshell-send-input)))
+        
+        (ecb-eshell-recenter)
+        
+        ;; we need to make sure that that the eshell buffer isn't at the
+        ;; top of the buffer history list just because we implicitly
+        ;; changed its directory and switched to it. It might not be a
+        ;; good idea in the long term to put it all the way at the end of
+        ;; the history list but it is better than leaving it at the top.
+        (bury-buffer eshell-buffer-name)))))
 
-        ;;determine if we should actually go ahead and do this.
-        (when (< (window-height ecb-compile-window)
-                 (/ (frame-height) 2))
-          
-          (setq ecb-eshell-pre-window-enlarged t)
+(defmacro ecb-eshell-save-buffer-history (&rest body)
+  "Protect the buffer-list so that the eshell buffer name is not placed early
+in the buffer list or at all if it currently doesn't exist."
+  (let ((eshell-buffer-list (make-symbol "my-buffer-list")))
+    `(let ((,eshell-buffer-list (ecb-frame-parameter (selected-frame)
+                                                     'buffer-list)))
+       (unwind-protect
+           (progn
+             ,@body)
+         (modify-frame-parameters nil (list (cons 'buffer-list
+                                                  ,eshell-buffer-list)))))))
+
+(defun ecb-eshell-recenter(&optional display-errors)
+  "Recenter the eshell window so that the prompt is at the buffer-end."
+  (interactive (list t))
+
+  (if (and (equal (selected-frame) ecb-frame)
+           (ecb-compile-window-live-p)
+           ;; the buffer in the ecb-compile-window is a living eshell-buffer
+           (member (window-buffer ecb-compile-window)
+                   ecb-eshell-buffer-list))
+      (save-selected-window
+        (select-window ecb-compile-window)
+        (goto-char (point-max))
+        (recenter -2))
+    (when display-errors
+      (ecb-error "Eshell not running or compile-window not visible!"))))
+
+(defun ecb-eshell-precommand-hook ()
+  ;;use the eshell-pre-command-hook to set the point.
+  (setq ecb-eshell-pre-command-point (point)))
+
+
+(defun ecb-eshell-fit-window-to-output()
+  "Fit window of eshell to the output of last command. This function is added
+to `eshell-post-command-hook' and only called there. This function tries to
+fit the height of the compile-window best to the last command-output. The
+algorithm fit the window to the height of the last command-output but do not
+enlarge the compile-window over half of the frame-height and also not below
+`ecb-compile-window-height' (in lines)."
+  (when (and (equal (selected-frame) ecb-frame)
+             (ecb-compile-window-live-p)
+             ;; the buffer in the ecb-compile-window is a living eshell-buffer
+             (member (window-buffer ecb-compile-window)
+                     ecb-eshell-buffer-list))
+
+    ;; fit the window to the height of the last command-output but do not
+    ;; enlarge the compile-window over half of the frame-height and also not
+    ;; below `ecb-compile-window-height' (in lines).
+    (when (and ecb-eshell-fit-window-to-command-output
+               (integer-or-marker-p ecb-eshell-pre-command-point))
+      (let* ((compile-window-height-lines
+              (ecb-normalize-number ecb-compile-window-height
+                                    (1- (frame-height))))
+             (ecb-enlarged-compilation-window-max-height
+              (max (min (save-excursion
+                          (set-buffer (window-buffer ecb-compile-window))
+                          ;; we want to see the old command line too and 2
+                          ;; must be added because we have a modeline and one
+                          ;; empty line cause of the (recenter -2) in
+                          ;; `ecb-eshell-recenter'. For XEmacs it would be
+                          ;; better to check if a horiz. scrollbar is used.
+                          ;; This causes the one line more we need for XEmacs
+                          (+ (if ecb-running-xemacs 4 3)
+                             (count-lines ecb-eshell-pre-command-point
+                                          (point))))
+                        (/ (1- (frame-height)) 2))
+                   compile-window-height-lines)))
+                 (ecb-toggle-compile-window-height 1)
+        (ecb-eshell-recenter))
         
-          (ecb-enlarge-window window))))
-    (ecb-eshell-recenter)))
+      ;;reset
+      (setq ecb-eshell-pre-command-point nil))))
 
-(defun ecb-eshell-shrink-if-necessary()
-  "If we have expanded the compile buffer after a command, but there was no need
-to because the command didn't output much text, go ahead and shrink it again.
-Note that this function needs to be standalone as a hook so we have to make sure
-we execute it with the eshell buffer."
-
-    (ecb-do-if-buffer-visible-in-ecb-frame 'eshell-buffer-name
-      
-      (when (and (ecb-eshell-running-p)
-                 (equal ecb-compile-window visible-window))
-        
-        (select-window visible-window)
-      
-        ;; only shrink up if we expanded... we don't want to shrink if we just
-        ;; happend to be runnning in large mode
-        (when (and ecb-eshell-pre-command-point ecb-eshell-pre-window-enlarged
-                   (< (count-lines ecb-eshell-pre-command-point
-                                   (point))
-                      ecb-compile-window-height))
-          (ecb-toggle-enlarged-compilation-window -1)
-          (ecb-eshell-recenter))
-        
-        ;;reset
-        (setq ecb-eshell-pre-command-point nil)
-        (setq ecb-eshell-pre-window-enlarged nil))))
-
-(defun ecb-eshell-cleanse()
-  "If the user has entered text in the eshell, we need to clean it. If we
-don't do this we could end up executing a strange command resulting in a
-'command not found'."
-  (if (ecb-eshell-running-p)
-      (save-excursion
-        (set-buffer eshell-buffer-name)
-        ;; go to the buffer-end without clobbering the mark!!
-        (goto-char (point-max))
-        (eshell-bol)
-        (delete-region (point) (point-at-eol)))))
 
 (defun ecb-eshell-auto-activate-hook()
   "Activate the eshell when ECB is activated. See `ecb-eshell-auto-activate'."
   (when ecb-eshell-auto-activate
-    (ignore-errors (ecb-eshell-activate))))
+    (ignore-errors (eshell))))
 
 (defun ecb-eshell-window-size-change(frame)
   "Called when we change window sizes so that the eshell can resize."
-;;; ecb-examples.el --- examples for using ECB with elisp
+;;; ecb-examples.el --- examples for using ECB with Elisp
 
-;; Copyright (C) 2002 Jesper Nordenberg
-;; Copyright (C) 2002 Free Software Foundation, Inc.
-;; Copyright (C) 2002 Klaus Berndl <klaus.berndl@sdm.de>
+;; Copyright (C) 2000 - 2003 Jesper Nordenberg,
+;;                           Klaus Berndl,
+;;                           Kevin A. Burton,
+;;                           Free Software Foundation, Inc.
 
-;; Author: Klaus Berndl <klaus.berndl@sdm.de>
+;; Author: Jesper Nordenberg <mayhem@home.se>
+;;         Klaus Berndl <klaus.berndl@sdm.de>
+;;         Kevin A. Burton <burton@openprivacy.org>
 ;; Maintainer: Klaus Berndl <klaus.berndl@sdm.de>
-;; Keywords: java, class, browser
+;;             Kevin A. Burton <burton@openprivacy.org>
+;; Keywords: browser, code, programming, tools
+;; Created: 2002
 
-;; This program is free software; you can redistribute it and/or modify it
-;; under the terms of the GNU General Public License as published by the Free
-;; Software Foundation; either version 2, or (at your option) any later
-;; version.
+;; This program is free software; you can redistribute it and/or modify it under
+;; the terms of the GNU General Public License as published by the Free Software