Anonymous avatar Anonymous committed 1fb53ef

synced up with current mainstream 1.93

Comments (0)

Files changed (25)

+test-install
 ecb*.html
+2003-03-27  Klaus Berndl  <klaus.berndl@sdm.de>
+
+	* Sync with current upstream 1.93
+
 2003-03-09  Ben Wing  <ben@xemacs.org>
 
 	* Makefile:
 # Boston, MA 02111-1307, USA.
 
 VERSION = 1.04
-AUTHOR_VERSION = 1.92.1
+AUTHOR_VERSION = 1.93
 MAINTAINER = Klaus Berndl <klaus.berndl@sdm.de>
 PACKAGE = ecb
 PKG_TYPE = regular

Makefile.upstream

 
 # For the ECB-maintainers: Change the version-number here and not
 # elsewhere!
-ecb_VERSION=1.92.1
+ecb_VERSION=1.93
 
 
 RM=rm -f
 
 
 autoloads:
+	@$(RM) $(ecb_AUTOLOADS) $(ecb_AUTOLOADS)c
 	$(EBATCH) -l ecb-autogen -f ecb-update-autoloads
 
 
+* Changes for ECB version 1.93
+
+** Fixed bugs:
+
+*** The adviced version of `other-window' now works correct too if a
+    minibuffer-window is active.
+
+*** The commands of `winner-mode' are now only forbidden in the ECB-frame
+    but work in any other frame.
+
+*** `scroll-all-mode' now works correct in other frames than the ECB-frame.
+
+*** Removed the annoying message "Partial reparsing..."
+
+** Enhancements to the layout:
+
+*** Slightly better redrawing current layout especially if the layout contains
+    a compile-window.
+
+*** ECB autom. displays hidden compile-window before starting a compilation.
+    This is done if `ecb-compile-window-height' is not nil but the
+    compile-window is currently hidden by `ecb-toggle-compile-window'. Of
+    course this works also for grep and other compile-modes. Same for
+    `switch-to-buffer' and `switch-to-buffer-other-window' if called for a
+    compilation-buffer in the sense of `ecb-compilation-buffer-p'.
+
+*** `switch-to-buffer-other-window' now works more naturally within the
+    ECB-frame, especially if a compile-window is used.
+
+*** `ecb-toggle-compile-window' now has a default key-binding: [C-c . \]
+
+*** Now also layouts with user-defined special ecb-windows can be created
+    interactively. See the online-manual for further details.
+
+** Enhancements to the tree-buffers:
+   
+*** Now user-extensions can be added to the popup-menues 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 methods-buffer now has a popup-menu with senseful actions
+    
+** New option `ecb-sources-exclude-cvsignore' which allows to exclude files from
+   being displayed in the sources-buffer if they are contained in a .cvsignore
+   file.
+
+** ECB now also works with buffers "online" extracted from archives.
+   Buffers extracted from an archive in `tar-mode' or `archive-mode' are now
+   correct handled as if they were normal file-buffers. This feature doesn't
+   work with XEmacs cause of its tar-mode and arc-mode implementation which
+   does not handle extracted files as normal files.
+
+** ECB now checks at load-time if the required packages semantic and eieio are
+   at least available - regardless of the needed version. If at least one of
+   these packages is missing then ECB offers to download and install it. More
+   details are available in the installation instructions.
+
+
+
 * Changes for ECB version 1.92.1
 
 ** Fixed bugs:
-Readme for the Emacs Code Browser (ECB) version 1.92.1
+Readme for the Emacs Code Browser (ECB) version 1.93
 
 
 About
 -----
 
 This package contains a code browser for several programming-languages for
-(X)Emacs. For instructions on how to use the browser read the online-help (see
-"Usage" below). The latest version of this package can be found at:
+(X)Emacs. For instructions on how to use the browser read the online-help
+either with the shipped info-manual (see "Usage" below) or direct from the
+ECB-Homepage at http://ecb.sourceforge.net.
 
-http://ecb.sourceforge.net
+The latest version can be found at: http://ecb.sourceforge.net
 
 
 Requirements
 ------------
 
-ECB requires the following packages being properly installed:
+ECB requires the following packages:
 - Semantic, author version between 1.4 and 1.4.9
   (http://cedet.sourceforge.net/semantic.shtml)
 - Eieio, author version between 0.17 and 0.17.9
   (http://cedet.sourceforge.net/eieio.shtml).
-
+  
 - Optional: speedbar, author version 0.14beta1 or higher
   (http://cedet.sourceforge.net/eieio.shtml)
   This is only needed if the speedbar-integration of ECB is used
    with (X)Emacs. You have to install exactly a version ECB requires and also
    to make sure that the correct version is loaded into (X)Emacs!
 
-   But ECB checks auto. during start-time if the correct versions of semantic
-   and eieio are installed and gives you proper feedback.
+   But ECB performs two automatic checks:
+
+    - At load-time: It checks if the packages semantic and eieio are at least
+      installed so ECB can be loaded. If not it offers to download and
+      install them.
+
+    - At start-time: It checks if the correct versions of semantic and eieio
+      are installed and gives you proper feedback.
+
+    So if you are not sure if you have installed the required packages at all
+    or if you have installed the correct versions of these packages then do
+    not worry about this, just go on with the following installation steps: If
+    ECB is missing something it will give you proper feedback and support not
+    later than at load-time or start-time!
 
 3. Add the new ECB-directory to your `load-path' variable.
 
-This file contains some important release-notes for ECB version 1.92.1
+This file contains some important release-notes for ECB version 1.93
 
 General:
 --------
 ;;
 ;; Automatically generate autoloads for ECB
 ;;
-;; This code is completely copied from semantic-autogen.el, the autoload
-;; generator of semantic.
+;; This code is based onto semantic-autogen.el, the autoload generator of
+;; semantic.
 ;;
+
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
 ;;; Code
 ;;
 
 (eval-when-compile
   (require 'silentcomp))
 
-;; Emacs knows only a variable noninteractive whereas XEmacs knows both,
-;; funvtion and variable. Therefore we silence here the byte-compiler.
-(silentcomp-defun noninteractive)
-
-;;; Compatibility
-(defun ecb-autogen-noninteractive ()
-  "Return non-nil if running non-interactively."
-  (if (featurep 'xemacs)
-      (noninteractive)
-    noninteractive))
-
-(when (ecb-autogen-noninteractive)
+(when (ecb-noninteractive)
   ;; If the user is doing this non-interactively, we need to set up
   ;; these conveniences.
   (add-to-list 'load-path nil)
   (interactive)
   (if ecb-regular-xemacs-package-p
       (ecb-error "Updating autoloads not possible for regular XEmacs-packages!")
-    (when (and (not ecb-running-xemacs)
-               (not (file-exists-p (expand-file-name ecb-autogen-file))))
-      ;; generate a new one if ecb-autogen-file does not exist, but do this not
-      ;; for XEmacs because XEmacs must(!) handle this itself
+    (if (file-exists-p (expand-file-name ecb-autogen-file))
+        (delete-file (expand-file-name ecb-autogen-file)))
+    (when (not ecb-running-xemacs)
+      ;; generate a new one but do this not for XEmacs because XEmacs must(!)
+      ;; handle this itself
       (with-temp-file (expand-file-name ecb-autogen-file)
         (insert "
     (let* ((default-directory (file-name-directory (locate-library "ecb")))
            )
       (batch-update-autoloads))
     ;; XEmacs adds autom. the provide statement but for GNU Emacs we must do
-    ;; this.
+    ;; this:
     (when (not ecb-running-xemacs)
       (save-excursion
         (set-buffer (find-file-noselect (expand-file-name ecb-autogen-file)))

ecb-compilation.el

 ;; NOTE: If you enjoy this software, please consider a donation to the EFF
 ;; (http://www.eff.org)
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
+
 ;;; Code:
 
 (eval-when-compile

ecb-create-layout.el

 ;;
 ;; Contains code for easy creating new layouts
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
+
 ;;; Code
 
 (eval-when-compile
         \"methods\" or \"history\") the current window
         should be.
  C-u: Unsplit, ie. delete current window
- C-t: Give the current window a type (\"directories\",
-      \"sources\", \"methods\" or \"history\")
+ C-t: Give the current window a builtin type
+      (\"directories\", \"sources\", \"methods\" or
+      \"history\") or any arbitary user-defined type
+      (\"other\"). See the Online-manual!
 
  C-c: Cancel layout creation. This does not save the
       layout. Deletes this frame.
       - Which type (\"directories\", \"sources\", \"methods\" or \"history\") the current
         window should be.
  C-u: Unsplit, ie. delete current window
- C-t: Give the current window a type (\"directories\", \"sources\", \"methods\" or \"history\")
+ C-t: Give the current window a builtin type (\"directories\", \"sources\", \"methods\" or
+      \"history\") or any arbitray user-defined type (\"other\"). See the Online-manual!
 
  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
     factor))
 
 (defun ecb-create-layout-add-to-buf-types (type)
-  (when (stringp type)
+  (when (and (stringp type)
+             (member type ecb-create-layout-all-buf-types))
     (add-to-list 'ecb-create-layout-buf-types type)
     (setq ecb-create-layout-buf-types
           (sort ecb-create-layout-buf-types 'string-lessp))))
     (put-text-property (point-min) (1+ (point-min)) 'ecb-create-layout-factor
                        factor)))
 
+
+(defun ecb-create-layout-gen-lisp-for-buffer-type (type)
+  (let ((func-sym (intern (format "ecb-set-%s-buffer" type))))
+    (ecb-create-layout-gen-lisp
+     `(if (fboundp (quote ,func-sym))
+          (,func-sym)
+        (ecb-set-default-ecb-buffer)))))
+  
+
 (defun ecb-create-layout-set-buffer-to-type (&optional type)
   (interactive)
   (when (ecb-create-layout-frame-ok)
                                             (ecb-create-layout-buffer-type)))
     (let ((new-type (or (and (stringp type) type)
                         (ecb-query-string "Type of current ECB-tree-buffer:"
-                                          ecb-create-layout-buf-types))))
+                                          ecb-create-layout-buf-types
+                                          "Insert the buffer type"))))
       ;; 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))
       ;; setting the new buffer type in the buffer itself
       (ecb-create-layout-set-buffer-type new-type)
       (when (interactive-p)
-        (ecb-create-layout-gen-lisp
-         `(,(intern (format "ecb-set-%s-buffer" new-type))))
+        (ecb-create-layout-gen-lisp-for-buffer-type new-type)
         (ecb-create-layout-next-window))
       new-type)))
 
         (ecb-create-layout-new-buffer))
       ;; asking for the buffer type
       (ecb-create-layout-set-buffer-factor real-split-factor)
-      (ecb-create-layout-gen-lisp
-       `(,(intern (format "ecb-set-%s-buffer"
-                          (ecb-create-layout-set-buffer-to-type old-buf-type)))))
+      (ecb-create-layout-gen-lisp-for-buffer-type
+       (ecb-create-layout-set-buffer-to-type old-buf-type))
       (ecb-create-layout-next-window))))
 
 (defun ecb-create-layout-forward-char ()
 ;; information. For example graphical debuggers (like JDEbug of JDEE) could be
 ;; made this way.
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
+
 ;; $Id$
 
 ;;; Code
 ;; This file contains all options with type 'face and all face-definitions of
 ;; ECB.
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
+;;; Code
+
 (eval-when-compile
   (require 'silentcomp))
 
 ;;
 ;; Contains all online-help for ECB (stolen something from recentf.el)
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
 ;; $Id$
 
 ;;; Code
 ;; Contains code for JDEE integrations into ECB or vice versa
 ;; JDEE is available at http://jdee.sunsite.dk/
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
 ;;; Code
 
 (eval-when-compile
         (jde-gen-class-buffer file)
       (find-file file))))
 
+(when (locate-library "efc")
+  (require 'efc)
+  (if (boundp 'efc-dialog-show-before-hook)
+      (add-hook 'efc-dialog-show-before-hook
+                (function (lambda ()
+                            (ecb-toggle-compile-window -1)))))
+  
+  (if (boundp 'efc-dialog-close-after-hook)
+      (add-hook 'efc-dialog-close-after-hook
+                (function (lambda ()
+                            (ecb-toggle-compile-window 1))))))
+
+
 (silentcomp-provide 'ecb-jde)
 
 ;;; ecb-jde.el ends here

ecb-layout-defs.el

 ;; This file is part of the ECB package which can be found at:
 ;; http://ecb.sourceforge.net
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
+;;; Code
+
 (eval-when-compile
   (require 'silentcomp))
 
 ;; - `ecb-with-some-adviced-functions'
 ;;
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
 ;; $Id$
 
 ;;; Code:
 (silentcomp-defvar scroll-bar-mode)
 ;; only Emacs 21 has this
 (silentcomp-defvar window-size-fixed)
+(silentcomp-defun fit-window-to-buffer)
 
 ;; ecb-speedbar is only loaded if ecb-use-speedbar-for-directories is set to
 ;; true
                                 value))))
   :type 'string)
 
+;; (defcustom ecb-compile-window-show nil
+;;   :group 'ecb-layout
+;;   :initialize 'custom-initialize-default
+;;   :set (function (lambda (symbol value)
+;;                    (ecb-set-window-size-fixed nil)
+;;                    (funcall ecb-layout-option-set-function
+;;                             symbol value)))
+;;   :type '(radio (const :tag "No compile-window" nil)
+;;                 (const :tag "Show always" :value always)
+;;                 (const :tag "Show on demand" :value demand)))
+  
 (defvar ecb-old-compilation-window-height compilation-window-height)
 
 (defcustom ecb-compile-window-height nil
   :type '(radio (const :tag "No compilation window" nil)
                 (number :tag "Window height" :value 5)))
 
+
 (defcustom ecb-compile-window-temporally-enlarge 'after-compilation
   "*Let Emacs temporally enlarge the compile-window of the ECB-layout.
 
 (defcustom ecb-layout-always-operate-in-edit-window
   '(delete-window
     delete-other-windows
-    switch-to-buffer
-    switch-to-buffer-other-window)
+    switch-to-buffer)
   "*Adviced window functions work always in the edit-window.
 If we are in an ECB special buffer (methods, directories, etc), and any of the
 adviced windowing functions is called \(see `ecb-advice-window-functions'), we
 otherwise either an error is reported or some other special reaction; see the
 documentation of the adviced functions for this.
 
-For `other-window' and `other-window-for-scrolling' this makes no sense,
-therefore you can not enable this for both of them.
+For `other-window', `other-window-for-scrolling' and
+`switch-to-buffer-other-window' this makes no sense, therefore you can not
+enable this for them.
 
 Per default this is enabled for `delete-window', `delete-other-windows',
-`switch-to-buffer' and `switch-to-buffer-other-window'."
+`switch-to-buffer'."
   :group 'ecb-layout
   :type '(set (const :tag "delete-window"
                      :value delete-window)
               (const :tag "split-window"
                      :value split-window)
               (const :tag "switch-to-buffer"
-                     :value switch-to-buffer)
-              (const :tag "switch-to-buffer-other-window"
-                     :value switch-to-buffer-other-window)))
+                     :value switch-to-buffer)))
 
 (defcustom ecb-layout-switch-to-compilation-window
   '(switch-to-buffer)
-  "*Switch-to-buffer...-functions switch to `ecb-compile-window'. If the
-buffer argument of `switch-to-buffer' or `switch-to-buffer-other-window' is an
+  "*Switching buffer functions switch always in `ecb-compile-window'.
+
+If the buffer argument of such functions \(e.g. `switch-to-buffer') is a
 compilation buffer as defined with `ecb-compilation-buffer-p' we will select
-the `ecb-compile-window' first. This is useful if you always want your
-compilation buffers within the compilation window and not within the edit
-window.
+the `ecb-compile-window' and display there the buffer. This is useful if you
+always want your compilation buffers within the compilation window and not
+within the edit window.
 
 Note the difference between `ecb-layout-always-operate-in-edit-window' and this
-option: If a switch-to-buffer...-function is contained in the former one, then
+option: If a buffer-switching function is contained in the former one, then
 we always jump first into the edit-window regardless of the destination
 buffer. If also contained in this option then ECB checks the destination buffer
 and then selects the `ecb-compile-window' if it is a compilation-buffer in the
 meaning of `ecb-compilation-buffer-p'!
 
-Per default this is only enabled for `switch-to-buffer'. We provide the option
-for `switch-to-buffer-other-window' too but the assumption is that when a user
-asks for a buffer in another window it should always be presented in another
-window."
+Currently this seemes only making sense for `switch-to-buffer'."
   :group 'ecb-layout
   :type '(set (const :tag "switch-to-buffer"
-                     :value switch-to-buffer)
-              (const :tag "switch-to-buffer-other-window"
-                     :value switch-to-buffer-other-window)))
+                     :value switch-to-buffer)))
 
 (defun ecb-canonical-ecb-windows-list ()
   "Return a list of all current visible special dedicated ECB-windows
                                     name)))
                    (set symbol value))))
 
-;; (defcustom ecb-scroll-all-behavior '(selected edit-windows edit-windows)
-;;   "*"
-;;   :group 'ecb-layout
-;;   :type '(list (choice :tag "ECB-windows" :menu-tag "ECB-windows"
-;;                        (const :tag "Selected window" :value selected)
-;;                        (const :tag "All ECB-windows" :value ecb-windows)
-;;                        (const :tag "All windows" :value all))
-;;                (choice :tag "Edit windows" :menu-tag "Edit-windows"
-;;                        (const :tag "Selected window" :value selected)
-;;                        (const :tag "Both Edit-windows" :value edit-windows)
-;;                        (const :tag "All windows" :value all))
-;;                (choice :tag "Compile-window" :menu-tag "Compile-windows"
-;;                        (const :tag "Selected window" :value selected)
-;;                        (const :tag "Compile- and edit-windows" :value edit-windows)
-;;                        (const :tag "All windows" :value all))))
-              
 
 (defcustom ecb-hide-ecb-windows-before-hook nil
   "*Hooks run direct before the ECB windows will be hidden either by
 
 
 (defadvice winner-mode (around ecb)
-  "Prevents `winner-mode' from being activated during ECB is active."
-  (ecb-error "Activating winner-mode is not possible as long as ECB is active!"))
+  "Prevents `winner-mode' from being activated for the ECB-frame."
+  (if (equal (selected-frame) ecb-frame)
+      (ecb-error "Can't use winner-mode functions in the ecb-frame.")))
+
+(defadvice winner-redo (around ecb)
+  "Prevents `winner-redo' from being used within the ECB-frame."
+  (if (equal (selected-frame) ecb-frame)
+      (ecb-error "Can't use winner-mode functions in the ecb-frame.")))
+
+(defadvice winner-undo (around ecb)
+  "Prevents `winner-undo' from being used within the ECB-frame."
+  (if (equal (selected-frame) ecb-frame)
+      (ecb-error "Can't use winner-mode functions in the ecb-frame.")))
+
 
 (defadvice scroll-all-mode (after ecb)
   "With active ECB `scroll-all-mode' scrolls only the two edit-windows if point
           (ecb-option-get-value 'ecb-other-window-jump-behavior))))
 
 (defadvice count-windows (around ecb)
-  "Return the current number of edit-windows if point is in an edit-window. If
-point is not in an edit-window return always 1. This advice is only enabled if
-`scroll-all-mode' is active! This advice is only enabled and disabled by
-`ecb-enable-count-windows-advice'!"
-  (setq ad-return-value (if (and (ecb-point-in-edit-window)
-                                 (ecb-edit-window-splitted))
-                            2
-                          1)))
+  "If the selected frame is the ecb-frame then return the current number of
+edit-windows if point is in an edit-window and always return 1 if point is not
+in an edit-window. In any other frame return the number of visible windows.
+
+This advice is only enabled if `scroll-all-mode' is active! This advice is
+only enabled and disabled by `ecb-enable-count-windows-advice'!"
+  (if (equal (selected-frame) ecb-frame)
+      (setq ad-return-value (if (and (ecb-point-in-edit-window)
+                                     (ecb-edit-window-splitted))
+                                2
+                              1))
+    ad-do-it))
 
 (defun ecb-enable-count-windows-advice (arg)
   "Enable the around-advice of `count-windows'."
       (unless (or (one-window-p 'nomini)
                   (equal (ecb-edit-window-splitted) 'horizontal)
                   (not (pos-visible-in-window-p (point-min))))
+        ;; needed for TAB-completion if this offers the completions in a
+        ;; temp-buffer. Without this manually split the whole edit-window
+        ;; would be used for the completions which is not the default-behavior
+        ;; of Emacs.
+        ;; Therefore we split the edit-window if not already done (means the
+        ;; completion has not splitted the window but currently uses the whole
+        ;; edit-window for display. Then we switch back to the last
+        ;; source-buffer of the edit-window and then we jump to the
+        ;; next-window which now displays the completions. Then we can go with
+        ;; resizing. 
         (when (not (ecb-edit-window-splitted))
           (split-window-vertically)
           (switch-to-buffer ecb-last-source-buffer)
           (other-window 1))
-        (let* ((max-height (if (functionp temp-buffer-max-height)
-                               (funcall temp-buffer-max-height (current-buffer))
-                             temp-buffer-max-height))
-               (win-height (1- (window-height)))
-               (min-height (1- window-min-height))
-               (text-height (window-buffer-height (selected-window)))
-               (new-height (max (min text-height max-height) min-height)))
-          (enlarge-window (- new-height win-height))))))
+        (if ecb-running-emacs-21
+            (fit-window-to-buffer
+             (selected-window)
+             (if (functionp temp-buffer-max-height)
+                 (funcall temp-buffer-max-height (current-buffer))
+               temp-buffer-max-height))
+          (let* ((max-height (if (functionp temp-buffer-max-height)
+                                 (funcall temp-buffer-max-height (current-buffer))
+                               temp-buffer-max-height))
+                 (win-height (1- (window-height)))
+                 (min-height (1- window-min-height))
+                 (text-height (window-buffer-height (selected-window)))
+                 (new-height (max (min text-height max-height) min-height)))
+            (enlarge-window (- new-height win-height)))))))
 
   ) ;; end of (if ecb-running-xemacs...)
 
 
 (put 'ecb-with-some-adviced-functions 'lisp-indent-function 1)
 
+(defun ecb-where-is-point ()
+  "Return 1 if point in first edit-window, 2 if in second edit-window,
+'compile if in compile-window and 'ecb if in any special ecb-window. Return
+nil if in a window of a frame not equal the `ecb-frame'."
+  (or (ecb-point-in-edit-window)
+      (and (ecb-point-in-compile-window)
+           'compile)
+      (and (equal (selected-frame) ecb-frame)
+           'ecb)))
+
 (defun ecb-point-in-edit-window ()
   "Return nil if point stays not in an edit-window otherwise return 1 if point
 is in the left/topmost edit-window or 2 if in the other edit-window."
 
 (defadvice other-window (around ecb)
   "The ECB-version of `other-window'. Works exactly like the original function
-with the following ECB-ajustment:
-The behavior depends on `ecb-other-window-jump-behavior'."
+with the following ECB-ajustment: The behavior depends on
+`ecb-other-window-jump-behavior'."
   (if (or (not (equal (selected-frame) ecb-frame))
           (equal ecb-other-window-jump-behavior 'all))
       ;; here we process the 'all value of `ecb-other-window-jump-behavior'
                (if (= direction 1)
                    (if (ecb-edit-window-splitted)
                        (select-window (next-window))
-                     (if (and (equal ecb-other-window-jump-behavior 'edit-and-compile)
+                     (if (and (equal ecb-other-window-jump-behavior
+                                     'edit-and-compile)
                               ecb-compile-window)
                          (ignore-errors
-                           (select-window ecb-compile-window))))
-                 (if (and (equal ecb-other-window-jump-behavior 'edit-and-compile)
-                          ecb-compile-window)
-                     (ignore-errors
-                       (select-window ecb-compile-window))
-                   (if (ecb-edit-window-splitted)
-                       (select-window (next-window))))))
-              ((ecb-point-in-compile-window)
-               (ecb-select-edit-window)
-               (if (ecb-edit-window-splitted)
-                   (if (= direction -1)
-                       (select-window (next-window)))))
-              ((equal (ecb-point-in-edit-window) 2)
-               (if (= direction 1)
-                   (if (and (equal ecb-other-window-jump-behavior 'edit-and-compile)
+                           (select-window ecb-compile-window))
+                       (if (> (minibuffer-depth) 0)
+                           (select-window (minibuffer-window ecb-frame)))))
+                 (if (> (minibuffer-depth) 0)
+                     (select-window (minibuffer-window ecb-frame))
+                   (if (and (equal ecb-other-window-jump-behavior
+                                   'edit-and-compile)
                             ecb-compile-window)
                        (ignore-errors
                          (select-window ecb-compile-window))
-                     (ecb-select-edit-window))
+                     (if (ecb-edit-window-splitted)
+                         (select-window (next-window)))))))
+              ((ecb-point-in-compile-window)
+               (if (and (= direction 1) (> (minibuffer-depth) 0))
+                   (select-window (minibuffer-window ecb-frame))
+                 (ecb-select-edit-window)
+                 (if (and (ecb-edit-window-splitted) (= direction -1))
+                     (select-window (next-window)))))
+              ((equal (ecb-point-in-edit-window) 2)
+               (if (= direction 1)
+                   (if (and (equal ecb-other-window-jump-behavior
+                                   'edit-and-compile)
+                            ecb-compile-window)
+                       (ignore-errors
+                         (select-window ecb-compile-window))
+                     (if (> (minibuffer-depth) 0)
+                         (select-window (minibuffer-window ecb-frame))
+                       (ecb-select-edit-window)))
                  (ecb-select-edit-window)))
-              (t
+              ((equal (selected-window) (minibuffer-window ecb-frame))
+               (if (= direction -1)
+                   (if (and (equal ecb-other-window-jump-behavior
+                                   'edit-and-compile)
+                            ecb-compile-window)
+                       (ignore-errors
+                         (select-window ecb-compile-window))
+                     (ecb-select-edit-window t))
+                 (ecb-select-edit-window)))
+              (t 
                (ecb-select-edit-window)))))))
 
 (defadvice delete-windows-on (around ecb)
      (if (null (ad-get-arg 0))
          (when (and (member 'delete-other-windows
                             ecb-layout-always-operate-in-edit-window)
-                    ;; this is needed because otherwise we would also select the 1.
-                    ;; edit-window if point stays in the second one!
+                    ;; this is needed because otherwise we would also select
+                    ;; the 1. edit-window if point stays in the second one!
                     (not (ecb-point-in-edit-window)))
            (ecb-select-edit-window))
        (if (window-live-p (ad-get-arg 0))
     (ecb-with-adviced-functions
      ad-do-it)))
 
-;; (defadvice split-window-vertically (around ecb)
-;;   "The ECB-version of `split-window-vertically'. Works exactly like the
-;; original function with the following ECB-ajustment:
-
-;; Called in an unsplitted edit-window then the edit window will be splitted
-;; vertically. If called in an already splitted edit-window then nothing is done.
-;; If called in any other window of the current ECB-layout it stops with an error
-;; if this function is not contained in `ecb-layout-always-operate-in-edit-window'."
-;;   (if (not (equal (selected-frame) ecb-frame))
-;;       ad-do-it
-
-;;     (when (and (member 'split-window-vertically
-;;                        ecb-layout-always-operate-in-edit-window)
-;;                (not (ecb-point-in-edit-window)))
-;;       (ecb-select-edit-window))
-    
-;;     (let ((p (ecb-point-in-edit-window)))
-;;       (if (not p)
-;;           (ecb-error "Only the edit-window of ECB is splitable!")
-;;         ;; point either in first or second edit-window
-;;         (if (not (ecb-edit-window-splitted))
-;;             ad-do-it
-;;           ;; if already splitted return the "other" edit-window
-;;           (setq ad-return-value
-;;                 (if (= p 1) (next-window) ecb-edit-window)))))))
 
 (defadvice split-window (around ecb)
   "The ECB-version of `split-window'. The meaning of WINDOW must be one of the
 
 (defadvice switch-to-buffer-other-window (around ecb)
   "The ECB-version of `switch-to-buffer-other-window'. Works exactly like the
-original but switch to the buffer always in another edit-window.
+original but with some adaptions for ECB so this function works in a
+\"natural\" way:
 
-If called in any non edit-window of the current ECB-layout then there a two
-alternatives:
-- If the function is not contained in `ecb-layout-always-operate-in-edit-window'
-  then the first edit-window is the \"other\" window for the buffer to switch.
-- Otherwise it switches to the \(first) edit-window and then choose the other
-  window.
+If called in any special ecb-window of the current ECB-layout then it goes
+always to the first edit-window and then goes on as if called from this
+edit-window.
 
-If it is already within the edit-window, and we only have one edit window, we
-split it."
+If a compile-window is used \(i.e. `ecb-compile-window-height' is not nil)
+then compilation-buffers in the sense of `ecb-compilation-buffer-p' are always
+displayed in the compile-window. If the compile-window is temporally hidden
+then it wil be displayed first. If no compile-window is used it behaves like
+the original.
 
+If called from within the compile-window then compilation-buffers will be
+displayed still there and all other buffers are displayed in one of the
+edit-windows - if the destination-buffer is already displayed in one of the
+edit-windows then this one is used otherwise it behaves like the original.
+
+If called within an edit-window it behaves like the original function except
+for compilation-buffers \(if a compile-window is used, see above)."
   (if (not (equal (selected-frame) ecb-frame))
-    ;;if we aren't in the ECB frame, we don't need to do anything, AKA perform
+      ;;if we aren't in the ECB frame, we don't need to do anything, AKA perform
       ;;default behavior.
       ad-do-it
 
-    ;; maybe we should always operate in the edit-window
-    (when (and (member 'switch-to-buffer-other-window
-                       ecb-layout-always-operate-in-edit-window)
-               (not (ecb-point-in-edit-window)))
-      (ecb-select-edit-window))
+    (let ((point-in-correct-window nil)
+          (point-location (ecb-where-is-point))
+          (destination-window (get-buffer-window (ad-get-arg 0) ecb-frame))
+          (ecb-other-window-jump-behavior 'only-edit))
 
-    (when (and (member 'switch-to-buffer-other-window
-                       ecb-layout-switch-to-compilation-window)
-               (ecb-compile-window-live-p)
-               (ecb-compilation-buffer-p (ad-get-arg 0)))
-      (select-window ecb-compile-window))
-    ;;       (when ecb-layout-switch-to-compilation-window-auto-enlarge
-    ;;         (ecb-toggle-enlarged-compilation-window 1)))
-                       
-    ;; if we have not selected the edit-window before and we are still not in
-    ;; an edit-window then we simply jump to the first edit-window. This is
-    ;; then the right other window for the buffer to switch.
-    (if (not (ecb-point-in-edit-window))
-        (ecb-select-edit-window)
-      (let ((ecb-other-window-jump-behavior 'only-edit))
+      ;; if called from an ecb-window we first jump to the edit-window. Then
+      ;; we go on as if we would be called from this edit-window.
+      (if (equal point-location 'ecb)
+          (select-window ecb-edit-window))
+      
+      (cond ((equal point-location 'compile)
+             ;; if we are in the compile-window then we stay here for
+             ;; compilation-buffers and for all other buffers we display it in
+             ;; the edit-window: If one of the edit-window display already the
+             ;; destination buffer we just use this window otherwise we use
+             ;; the `ecb-edit-window'.
+             (when (not (ecb-compilation-buffer-p (ad-get-arg 0)))
+               (if (and destination-window ;; dest-buf is in the ecb-frame
+                        (not (equal destination-window ecb-compile-window)))
+                   (select-window (get-buffer-window (ad-get-arg 0) ecb-frame))
+                 (select-window ecb-edit-window)))
+             (setq point-in-correct-window t))
+            (t ;; we stay in an edit-window
+             (if (ecb-compilation-buffer-p (ad-get-arg 0))
+                 ;; for compilation buffers we try to display them in the
+                 ;; compile-window if the user uses one.
+                 (if (ecb-compile-window-live-p)
+                     (progn
+                       (select-window ecb-compile-window)
+                       (setq point-in-correct-window t))
+                   (when (numberp (car (get 'ecb-compile-window-height 'saved-value)))
+                     (ecb-toggle-compile-window 1)
+                     (ecb-toggle-enlarged-compilation-window 1)
+                     (select-window ecb-compile-window)
+                     (setq point-in-correct-window t))))))
+
+      ;; if we are still not in the correct destination window (if dest.
+      ;; buffer is either not a compilation-buffer or - if it is - if
+      ;; `ecb-compile-window-height' is nil)
+      (when (not point-in-correct-window)
         (ecb-with-adviced-functions
          (if (ecb-edit-window-splitted)
              (other-window 1)
            (split-window-vertically)
            (other-window 1)))))
-    
-    ;; now we are always in the right other window, so we can switch to the
+  
+    ;; now we are always in the right window, so we can switch to the
     ;; buffer
     (ad-with-originals 'switch-to-buffer
       (switch-to-buffer (ad-get-arg 0) (ad-get-arg 1)))))
 
+
+;; (defadvice switch-to-buffer-other-window (around ecb)
+;;   "The ECB-version of `switch-to-buffer-other-window'. Works exactly like the
+;; original but switch to the buffer always in another edit-window.
+
+;; If called in any non edit-window of the current ECB-layout then there a two
+;; alternatives:
+;; - If the function is not contained in `ecb-layout-always-operate-in-edit-window'
+;;   then the first edit-window is the \"other\" window for the buffer to switch.
+;; - Otherwise it switches to the \(first) edit-window and then choose the other
+;;   window.
+
+;; If it is already within the edit-window, and we only have one edit window, we
+;; split it."
+
+;;   (if (not (equal (selected-frame) ecb-frame))
+;;       ;;if we aren't in the ECB frame, we don't need to do anything, AKA perform
+;;       ;;default behavior.
+;;       ad-do-it
+
+;;     (let ((point-in-correct-window nil)
+;;           (point-location (ecb-where-is-point)))
+;;       ;; maybe we should always operate in the edit-window
+;;       (when (and (member 'switch-to-buffer-other-window
+;;                          ecb-layout-always-operate-in-edit-window)
+;;                  (not (numberp point-location)))
+;;         (ecb-select-edit-window))
+
+;;       (if (ecb-compilation-buffer-p (ad-get-arg 0))
+;;           ;; for compilation buffers we try to display them in the
+;;           ;; compile-window if the user uses one.
+;;           (when (member 'switch-to-buffer-other-window
+;;                         ecb-layout-switch-to-compilation-window)
+;;             (if (ecb-compile-window-live-p)
+;;                 (progn
+;;                   (select-window ecb-compile-window)
+;;                   (setq point-in-correct-window t))
+;;               (when (numberp (car (get 'ecb-compile-window-height 'saved-value)))
+;;                 (ecb-toggle-compile-window 1)
+;;                 (ecb-toggle-enlarged-compilation-window 1)
+;;                 (select-window ecb-compile-window)
+;;                 (setq point-in-correct-window t))))
+;;         ;; if the original point was in the compile-window we display the
+;;         ;; destination buffer always in the edit-window.
+;;         (if (equal point-location 'compile)
+;;             (setq point-in-correct-window t)))
+
+;;       ;; if we have not selected the edit-window before and we are still not in
+;;       ;; an edit-window then we simply jump to the first edit-window. This is
+;;       ;; then the right other window for the buffer to switch.
+;;       (when (not point-in-correct-window)
+;;         (if (not (ecb-point-in-edit-window))
+;;             (ecb-select-edit-window)
+;;           (let ((ecb-other-window-jump-behavior 'only-edit))
+;;             (ecb-with-adviced-functions
+;;              (if (ecb-edit-window-splitted)
+;;                  (other-window 1)
+;;                (split-window-vertically)
+;;                (other-window 1)))))))
+  
+;;     ;; now we are always in the right window, so we can switch to the
+;;     ;; buffer
+;;     (ad-with-originals 'switch-to-buffer
+;;       (switch-to-buffer (ad-get-arg 0) (ad-get-arg 1)))))
+
 (defadvice switch-to-buffer (around ecb)
   "The ECB-version of `switch-to-buffer'. Works exactly like the original but
 if called in any non edit-window of the current ECB-layout there are two
 alternatives:
 - If this function is contained in `ecb-layout-always-operate-in-edit-window'
   then it jumps in the \(first) edit-window and does then it�s job.
+- If this function is contained in `ecb-layout-switch-to-compilation-window'
+  then the compile-window is selected for compile-buffers in the sense of
+  `ecb-compilation-buffer-p'.
 - Otherwise an error repoprted."
   (if (not (equal (selected-frame) ecb-frame))
       ad-do-it
 
     (if (and (member 'switch-to-buffer
                      ecb-layout-switch-to-compilation-window)
-             (ecb-compile-window-live-p)
              (ecb-compilation-buffer-p (ad-get-arg 0)))
-        (progn
-          (select-window ecb-compile-window))
-
-      ;;           (when ecb-layout-switch-to-compilation-window-auto-enlarge
-      ;;             (ecb-toggle-enlarged-compilation-window 1)))
-          
+        (if (ecb-compile-window-live-p)
+            (select-window ecb-compile-window)
+          (when (numberp (car (get 'ecb-compile-window-height 'saved-value)))
+            (ecb-toggle-compile-window 1)
+            (ecb-toggle-enlarged-compilation-window 1)
+            (select-window ecb-compile-window)))
       (if (not (ecb-point-in-edit-window))
           (ecb-error "Only in an edit-window the buffer can be switched!"))
       )
           ;; we have to unfix all our ECB windows!!
           (ecb-set-window-size-fixed nil)
           (ecb-with-original-functions
-           (let* ((config (ecb-edit-window-configuration))
+           (let* ((config (ecb-window-configuration))
                   (split-before-redraw (car (nth 0 config)))
                   (split-amount-before-redraw (cdr (nth 0 config)))
                   (window-before-redraw (nth 1 config))
 
 ;; This function must savely work even if `ecb-edit-window' is not longer
 ;; alive, which should normally not happen!
-(defun ecb-edit-window-configuration ()
+(defun ecb-window-configuration ()
+  "Return current window configuration of the ecb-frame as a list with the
+following structure:
+0. Edit-window split data: cons with car is a boolean if the edit-window is
+   splitted and cdr is the height of the `ecb-edit-window' or nil if not
+   splitted.
+1. 1 or 2 if point is one of the edit-windows, nil otherwise
+2. current point if one of the edit-windows is selected, nil otherwise.
+3. Data of the edit-window: cons with car is the buffer of the
+   `ecb-edit-window' and cdr is the `window-start' of this window.
+4. Data of the second edit-window: See 3. If the edit-window is not splitted
+   then nil.
+5. Data of the compile window or nil (if there is no compile-window visible):
+   List with first elem is the buffer of the compile-window, second elem is
+   current point of the compile-buffer if the compile-window is selected
+   \(otherwise nil) and third elem is the current height of the
+   compile-window."
   (let ((split (ecb-edit-window-splitted))
-        (selected-edit-window (ecb-point-in-edit-window)))
+        (selected-window (ecb-where-is-point)))
     (list (cons split (if (equal split 'vertical)
                           (window-height ecb-edit-window)))
-          selected-edit-window
-          (if selected-edit-window (point))
+          (if (numberp selected-window) selected-window)
+          (if (numberp selected-window) (point))
           (cons (ignore-errors (window-buffer ecb-edit-window))
                 (ignore-errors (window-start ecb-edit-window)))
           (if split
-              (cons (ignore-errors (window-buffer (next-window ecb-edit-window)))
-                    (ignore-errors (window-start (next-window ecb-edit-window)))))
+              (cons (ignore-errors (window-buffer (next-window
+                                                   ecb-edit-window)))
+                    (ignore-errors (window-start (next-window
+                                                  ecb-edit-window)))))
+          (if (and ecb-compile-window-height
+                   (ecb-compile-window-live-p))
+              (list (window-buffer ecb-compile-window)
+                    (if (equal selected-window 'compile) (point))
+                    (window-height ecb-compile-window)))
           )
     ))
 
   (ecb-with-dedicated-window
    (switch-to-buffer ecb-history-buffer-name)))
 
+(defun ecb-set-default-ecb-buffer ()
+  "Set in the current window the default ecb-buffer which is useless but is
+used if a layout calls within its creation body a non bound
+ecb-buffer-setting- function."
+  (ecb-with-dedicated-window
+   (switch-to-buffer (get-buffer-create " *ECB-default-buffer*"))
+   (when (= (buffer-size) 0)
+     (insert " This is the default\n")
+     (insert " ecb-buffer which is\n")
+     (insert " useless. Probably this\n")
+     (insert " buffer is displayed\n")
+     (insert " because the layout uses\n")
+     (insert " an unbound buffer-set\n")
+     (insert " function!"))
+   (setq buffer-read-only t)))
+
 
 ;; ======== Delete-window-functions for the different layout-types ==========
 
              (equal (selected-frame) ecb-frame))
     ;; this functions are only needed at runtime!
     (ecb-load-layouts)
-    (let* ((config (ecb-edit-window-configuration))
+    (let* ((config (ecb-window-configuration))
            (split-before-redraw (car (nth 0 config)))
            (split-amount-before-redraw (cdr (nth 0 config)))
            (window-before-redraw (nth 1 config))
                                             (ecb-normalize-number
                                              ecb-compile-window-height
                                              (1- (frame-height)))))
-           (compile-buffer-before-redraw (if (and ecb-compile-window-height
-                                                  (ecb-compile-window-live-p))
-                                             (window-buffer ecb-compile-window)))
+           (compile-window-config (nth 5 config))
+           (compile-buffer-before-redraw (nth 0 compile-window-config))
+           (compile-buffer-pos-before-redraw (nth 1 compile-window-config))
+           (compile-buffer-window-height-before-redraw
+            (nth 2 compile-window-config))
            (ecb-windows-before-redraw (ecb-get-current-visible-ecb-buffers)))
 
       ;; The following code runs with deactivated adviced functions, so the
          (let ((same-window-buffer-names nil)
                (same-window-regexps))
            (display-buffer
-            (or compile-buffer-before-redraw
+            (or (and compile-buffer-before-redraw
+                     (ecb-compilation-buffer-p compile-buffer-before-redraw)
+                     compile-buffer-before-redraw)
                 (some (function (lambda (mode)
                                   (some (function (lambda (buf)
                                                     (save-excursion
        (cond ((equal split-before-redraw 'horizontal)
               (ecb-split-hor 0.5 t))
              ((equal split-before-redraw 'vertical)
-              (ecb-split-ver (if ecb-compile-window-height 0.5
-                               split-amount-before-redraw) t)))
+              (ecb-split-ver (if (or (not compile-buffer-before-redraw)
+                                     (equal ecb-compile-window-height
+                                            compile-buffer-window-height-before-redraw))
+                                 split-amount-before-redraw
+                               0.5) t)))
        
        ;; Restore edit window buffers
        (when saved-edit-1
                    (not no-buffer-sync))
           (ecb-current-buffer-sync t)))
 
+      ;; if the compile-window was selected before redraw we go back to it
+      (when (and (ecb-compile-window-live-p)
+                 compile-buffer-pos-before-redraw)
+        (select-window ecb-compile-window)
+        (goto-char compile-buffer-pos-before-redraw))
+
       ;; after a full redraw the stored window-configuration for a quick
       ;; redraw should be actualized
       (setq ecb-activated-window-configuration (current-window-configuration)))))
             (enlarge-window (max 0 (- max-height (window-height)))))))
     (message "No ecb-compile-window in current ECB-layout!")))
 
+(defadvice compile-internal (before ecb)
+  "If `ecb-compile-window-height' is not nil and the compile-window is
+currently not visible \(probably toggled by `ecb-toggle-compile-window') then
+before the compile/grep/ect. runs the compile-window gets visible."
+  (if (and (numberp (car (get 'ecb-compile-window-height 'saved-value)))
+           (not (ecb-compile-window-live-p)))
+      (ecb-toggle-compile-window 1)))
+
 (defun ecb-toggle-compile-window (&optional arg)
   "Toggle the visibility of the compile-window of ECB. With prefix argument
 ARG, make visible if positive, otherwise invisible. The height of the
 ;;
 ;; Contains all mode-line enhancements for ECB.
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
 ;; $Id$
 
+;;; Code
+
 (eval-when-compile
   (require 'silentcomp))
 
 
 ;;; Commentary:
 
-;; 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
 
 ;;; Code:
 
 ;;
 ;; Contains code for tips of the day
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
 ;;; Code
 
 (eval-when-compile
 ;; functions ecb-package-... for downloading and installing newer versions of
 ;; packages (ecb itself and the required packages)!
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
+
 ;;; Code
 
 (eval-when-compile
                                      ecb-upgrade-cache-directory-contents))
     (ecb-source-file-regexps . (ecb-source-file-regexps
                                 ecb-upgrade-source-file-regexps))
+    (ecb-layout-always-operate-in-edit-window . (ecb-layout-always-operate-in-edit-window
+                                                 ecb-upgrade-alway-operate-in-edit-window))
+    (ecb-layout-switch-to-compilation-window . (ecb-layout-switch-to-compilation-window
+                                                 ecb-upgrade-switch-to-compilation-window))
     (ecb-truncate-lines . (ecb-truncate-lines
                            ecb-upgrade-truncate-lines)))
   
       '(t t t t)
     '(nil nil nil nil)))
 
+(defun ecb-upgrade-alway-operate-in-edit-window (old-val)
+  (let ((l (copy-tree old-val)))
+    (setq l (delete 'switch-to-buffer-other-window l))
+    l))
+
+(defun ecb-upgrade-switch-to-compilation-window (old-val)
+  (ecb-upgrade-alway-operate-in-edit-window old-val))
 
 ;; ----------------------------------------------------------------------
 ;; internal functions. Dot change anything below this line
         
         ;; Downloading with working-display
 
-        (working-status-call-process
+        (ecb-working-status-call-process
          0.1
          (concat "Downloading new " package)
          "done"
         
       ;; Downloading with working-display
 
-      (working-status-call-process
+      (ecb-working-status-call-process
        0.1
        (concat "Getting list of available versions of package " package)
        "done"
 ;; This file is part of the ECB package which can be found at:
 ;; http://ecb.sourceforge.net
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
 ;; $Id$
 
 ;;; Code:
 (silentcomp-defun line-end-position)
 (silentcomp-defun window-pixel-edges)
 (silentcomp-defun make-dialog-box)
+(silentcomp-defun display-message)
+(silentcomp-defun clear-message)
+(silentcomp-defun noninteractive)
 ;; Emacs
+(silentcomp-defvar message-log-max)
+(silentcomp-defvar message-truncate-lines)
 (silentcomp-defun x-popup-dialog)
+(silentcomp-defvar noninteractive)
   
 ;; Some constants
 (defconst ecb-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
                                    ?/))
 (defconst ecb-directory-sep-string (char-to-string ecb-directory-sep-char))
 
+(defconst ecb-temp-dir
+  (file-name-as-directory
+   (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
+       (cond ((eq system-type 'windows-nt) "c:/temp/")
+             (t "/tmp/"))))
+  "a directory where ECB can store temporary files.")
+
 (defconst ecb-ecb-dir
   (expand-file-name (file-name-directory (locate-library "ecb"))))
 (defconst ecb-semantic-dir
-  (expand-file-name (file-name-directory (locate-library "semantic"))))
+  (if (locate-library "semantic")
+      (expand-file-name (file-name-directory (locate-library "semantic")))))
 
 (defconst ecb-ecb-parent-dir (expand-file-name (concat ecb-ecb-dir "../")))
 
        (file-exists-p (expand-file-name (concat ecb-ecb-dir "auto-autoloads.el")))))
 (defconst ecb-semantic-regular-xemacs-package-p
   (and ecb-running-xemacs
+       ecb-semantic-dir
        (file-exists-p (expand-file-name (concat ecb-semantic-dir "_pkg.el")))
        (file-exists-p (expand-file-name (concat ecb-semantic-dir "auto-autoloads.el")))))
 
                                             (shrink-window-if-larger-than-buffer . around)
                                             (show-temp-buffer-in-current-frame . around)
                                             (scroll-other-window . around)
+                                            (compile-internal . before)
                                             (custom-save-all . around)
                                             (winner-mode . around)
+                                            (winner-redo . around)
+                                            (winner-undo . around)
                                             (scroll-all-mode . after))
                                         '((delete-frame . around)
                                           (compilation-set-window-height . around)
                                           (resize-temp-buffer-window . around)
                                           (shrink-window-if-larger-than-buffer . around)
                                           (scroll-other-window . around)
+                                          (compile-internal . before)
                                           (custom-save-all . around)
                                           (winner-mode . around)
+                                          (winner-redo . around)
+                                          (winner-undo . around)
                                           (scroll-all-mode . after)))
   "These functions are always adviced if ECB is active. Each element of the
 list is a cons-cell where the car is the function-symbol and the cdr the
 (defun ecb-find-assoc (list key)
   (assoc key list))
 
+;;; Compatibility
+(defun ecb-noninteractive ()
+  "Return non-nil if running non-interactively, i.e. in batch mode."
+  (if ecb-running-xemacs
+      (noninteractive)
+    noninteractive))
+
 ;; canonical filenames
 
 (defun ecb-fix-filename (path &optional filename substitute-env-vars)
                                                       (substitute-in-file-name filename)
                                                     filename))))))))
 
+
+(defun ecb-nolog-message (&rest args)
+  "Works exactly like `message' but does not log the message"
+  (let ((msg (cond ((or (null args)
+                        (null (car args)))
+                    nil)
+                   ((null (cdr args))
+                    (car args))
+                   (t
+                    (apply 'format args)))))
+    ;; Now message is either nil or the formated string.
+    (if ecb-running-xemacs
+        ;; XEmacs way of preventing log messages.
+        (if msg
+            (display-message 'no-log msg)
+          (clear-message 'no-log))
+      ;; Emacs way of preventing log messages.
+      (let ((message-log-max nil)
+            (message-truncate-lines nil))
+        (if msg
+            (message "%s" msg)
+          (message nil))))
+    msg))
+
+
+
 (defun ecb-confirm (text)
   (yes-or-no-p text))
 
       (message (concat title " " message-str)))))
 
 
-(defmacro ecb-error (&rest args)
+(defun ecb-error (&rest args)
   "Signals an error but prevents it from entering the debugger. This is
 usefull if an error-message should be signaled to the user and evaluating
 should stopped but no debugging is senseful."
-  `(let ((debug-on-error nil))
-     (error (concat "ECB " ecb-version ": "
-                    (format ,@args)))))
+  (let ((debug-on-error nil))
+    (error (concat "ECB " ecb-version ": "
+                   (apply 'format args)))))
 
 ;; trimming
 
   (ecb-excessive-trim (ecb-trim str)))
 
 
+
+;; code for a working display - complete stolen from the semantic-package.
+;; ECB has thrown away all code which is not needed by ECB
+;; The original code is written by Eric M. Ludlam <zappo@gnu.org>
+
+;; we need this here so we are independent of the semantic-package so we can
+;; download eieio and semantic even if the user has not installed any version
+;; of semantic.
+
+;;; Variables used in stages
+;;
+(defvar ecb-working-message nil
+  "Message stored when in a status loop.")
+(defvar ecb-working-donestring nil
+  "Done string stored when in a status loop.")
+(defvar ecb-working-ref1 nil
+  "A reference number used in a status loop.")
+(defvar ecb-working-last-percent 0
+  "A reference number used in a status loop.")
+
+(defun ecb-working-frame-animation-display (length number frames)
+  "Manage a simple frame-based animation for working functions.
+LENGTH is the number of characters left.  NUMBER is a passed in
+number (which happens to be ignored.).  While coders pass t into
+NUMBER, functions using this should convert NUMBER into a vector
+describing how to render the done message.
+Argument FRAMES are the frames used in the animation."
+  (cond ((vectorp number)
+	 (let ((zone (- (length (aref frames 0)) (length (aref number 0))
+			(length (aref number 1)))))
+	   (if (< (length ecb-working-donestring) zone)
+	       (concat " " (aref number 0)
+		       (make-string
+			(ceiling (/ (- (float zone)
+				       (length ecb-working-donestring)) 2)) ? )
+		       ecb-working-donestring
+		       (make-string
+			(floor (/ (- (float zone)
+				     (length ecb-working-donestring)) 2)) ? )
+		       (aref number 1))
+	     (concat " " (aref frames (% ecb-working-ref1 (length frames)))
+		     " " ecb-working-donestring))))
+	(t (concat " " (aref frames (% ecb-working-ref1 (length frames)))))))
+
+(defvar ecb-working-celeron-strings
+  [ "[O     ]" "[oO    ]" "[-oO   ]" "[ -oO  ]" "[  -oO ]" "[   -oO]"
+    "[    -O]" "[     O]" "[    Oo]" "[   Oo-]"  "[  Oo- ]" "[ Oo-  ]"
+    "[Oo-   ]" "[O-    ]"]
+  "Strings representing a silly celeron.")
+
+(defun ecb-working-celeron-display (length number)
+  "Return a string displaying a celeron as things happen.
+LENGTH is the amount of display that has been used.  NUMBER
+is t to display the done string, or the number to display."
+  (cond ((eq number t)
+	 (ecb-working-frame-animation-display length [ "[" "]" ]
+					  ecb-working-celeron-strings))
+	;; All the % signs because it then gets passed to message.
+	(t (ecb-working-frame-animation-display length number
+					    ecb-working-celeron-strings))))
+
+
+
+(defun ecb-working-dynamic-status (&optional number)
+  "show the status. If NUMBER is nil, then increment a local NUMBER from 0
+with each call. If it is a number or float, use it as the raw percentile."
+  (let* ((n (or number ecb-working-ref1))
+         (m1 (funcall 'format ecb-working-message))
+         (m2 (ecb-working-celeron-display (length m1) n)))
+    (ecb-nolog-message "%s%s" m1 m2)
+    (setq ecb-working-ref1 (1+ ecb-working-ref1))))
+
+(defmacro ecb-working-status-timeout (timeout message donestr &rest forms)
+  "Contain a block of code during which working status is shown.
+The code may call `sit-for' or `accept-process-output', so a timer
+is needed to update the message.
+TIMEOUT is the length of time to wait between message updates.
+MESSAGE is the message string to use and DONESTR is the completed text
+to use when the functions `ecb-working-status' is called from FORMS."
+  (let ((current-message (make-symbol "ecb-working-current-message")))
+    `(let* ((,current-message (current-message))
+            (ecb-working-message ,message)
+            (ecb-working-donestring ,donestr)
+            (ecb-working-ref1 0)
+            (time ,timeout)
+            (ecb-working-timer
+             (run-with-timer time time 'ecb-working-dynamic-status)))
+       (unwind-protect
+           (progn ,@forms)
+         (cancel-timer ecb-working-timer)
+         (ecb-working-dynamic-status t)
+         (message ,current-message)))))
+
+
+(defun ecb-working-status-call-process
+  (timeout message donestr program &optional infile buffer display &rest args)
+  "Display working messages while running a process.
+TIMEOUT is how fast to display the messages.
+MESSAGE is the message to show, and DONESTR is the string to add when done.
+CALLPROCESSARGS are the same style of args as passed to `call-process'.
+The are: PROGRAM, INFILE, BUFFER, DISPLAY, and ARGS.
+Since it actually calls `start-process', not all features will work."
+  (ecb-working-status-timeout timeout message donestr
+    (let ((proc (apply 'start-process "ecb-working"
+                       (if (listp buffer) (car buffer) buffer)
+                       program args)))
+      (set-process-sentinel proc 'list)
+      (while (eq (process-status proc) 'run)
+	(accept-process-output proc)
+	;; accept-process-output caused my solaris Emacs 20.3 to crash.
+	;; If this is unreliable for you, use the below which will work
+	;; in that situation.
+	;; (if (not (sit-for timeout)) (read-event))
+	))))
+
+(defun ecb-file-content-as-string (file)
+  "If FILE exists and is readable returns the contents as a string otherwise
+return nil.
+Note: No major/minor-mode is activated and no local variables are evaluated
+for FILE, but proper EOL-conversion and charcater interpretation is done!"
+  (let ((exp-filename (expand-file-name file)))
+    (if (and (file-exists-p exp-filename)
+             (file-readable-p exp-filename))
+        (with-temp-buffer
+          (insert-file-contents exp-filename)
+          (buffer-string)))))
+
+
 (silentcomp-provide 'ecb-util)
 
 ;;; ecb-util.el ends here
 
 ;; IMPORTANT: The version-number is auto-frobbed from the Makefile. Do not
 ;; change it here!
-(defconst ecb-version "1.92.1"
+(defconst ecb-version "1.93"
   "Current ECB version.")
 
 ;; This program is free software; you can redistribute it and/or modify it under
 ;;; Commentary:
 ;;
 ;; The Emacs code browser (ECB) creates four buffers: *ECB Directories*, *ECB
-;; Sources*, *ECB Methods* and *ECB History*. These buffers can be used to
+;; Sources*, *ECB Methods* and *ECB History*.  These buffers can be used to
 ;; navigate through source code with the mouse (and also with keyboard).
 ;;
 ;; To use the Emacs code browser add the ECB files to your load path and add the
 ;; The latest version of the ECB is available at
 ;; http://ecb.sourceforge.net
 
+;;; History
+;;
+;; For the ChangeLog of this file see the CVS-repository. For a complete
+;; history of the ECB-package see the file NEWS.
+
 ;; $Id$
 
 ;;; Code:
 (eval-when-compile
   (require 'silentcomp))
 
-;; semantic load
-(require 'semantic)
-;; eieio load
-(require 'eieio)
-
+;; (defun check-test (s-ver e-ver)
+;;   (interactive "sSemantic-version: \nsEieio-version: ")
+;;   (let ((ecb-all-requirements-available nil)
+;;         (semantic-version s-ver)
+;;         (eieio-version e-ver))
+;;     (ecb-check-requirements)))
 
 (defconst ecb-required-semantic-version-min '(1 4 2 0))
 (defconst ecb-required-semantic-version-max '(1 4 3 9))
 (defvar ecb-all-requirements-available nil)
 (defvar ecb-upgrade-check-done nil)
 
+;; We need this libraries already here if we miss some requirements and we
+;; want to offer the user to download them.
+(require 'ecb-upgrade)
+(require 'ecb-util)
+
+(defun ecb-check-requirements (&optional just-check)
+  "Ensure that we use the right `semantic-version' and right `eieio-version'
+and offer to download them if not installed.
+
+If JUST-CHECK is not nil then
+1. Only the version check is done but no download
+2. It returns nil if all requirements are correct, otherwise a list which
+   contains the symbol 'semantic if `semantic-version' is incorrect and 'eieio
+   if `eieio-version' is incorrect.
+
+If called in noninteractive mode \(e.g. in batch-mode) then JUST-CHECK is
+always true."
+  (when (and (or (not (boundp 'ecb-version-check)) ecb-version-check)
+             (not ecb-all-requirements-available))
+    (let ((semantic-required-version-str-min (ecb-package-version-list2str
+                                              ecb-required-semantic-version-min))
+          (semantic-required-version-str-max (ecb-package-version-list2str
+                                              ecb-required-semantic-version-max))
+          (eieio-required-version-str-min (ecb-package-version-list2str
+                                           ecb-required-eieio-version-min))
+          (eieio-required-version-str-max (ecb-package-version-list2str
+                                           ecb-required-eieio-version-max))
+          (failed-result)
+          (version-error nil)
+          (semantic-dir nil)
+          (semantic-state nil)
+          (semantic-installed-version-str nil)
+          (eieio-dir nil)
+          (eieio-state nil)
+          (eieio-installed-version-str nil))
+      ;; check if semantic version is correct
+      (when (or (not (boundp 'semantic-version))
+                (ecb-package-version-list<
+                 (ecb-package-version-str2list semantic-version)
+                 ecb-required-semantic-version-min)
+                (ecb-package-version-list<
+                 ecb-required-semantic-version-max
+                 (ecb-package-version-str2list semantic-version)))
+        (setq version-error (concat "semantic ["
+                                    semantic-required-version-str-min
+                                    ", "
+                                    semantic-required-version-str-max
+                                    "]"))
+        (setq failed-result (cons 'semantic failed-result)))
+      ;; check if eieio version is correct
+      (when (or (not (boundp 'eieio-version))
+                (ecb-package-version-list<
+                 (ecb-package-version-str2list eieio-version)
+                 ecb-required-eieio-version-min)
+                (ecb-package-version-list<
+                 ecb-required-eieio-version-max
+                 (ecb-package-version-str2list eieio-version)))
+        (setq version-error
+              (concat version-error (if version-error " and ")
+                      "eieio ["
+                      eieio-required-version-str-min
+                      ", "
+                      eieio-required-version-str-max
+                      "]"))
+        (setq failed-result (cons 'eieio failed-result)))
+      (if (null failed-result)
+          ;; this is the only place where this variable is set
+          (setq ecb-all-requirements-available t))
+      (if (or just-check (ecb-noninteractive))
+          failed-result
+        (when failed-result
+          (when ecb-regular-xemacs-package-p
+            (with-output-to-temp-buffer "*ECB downloading and installing*"
+              (princ "Current ECB is installed as regular XEmacs package and not with the\n")
+              (princ "archive available at the ECB-website. So you should use the package-manager\n")
+              (princ "of XEmacs to get the required versions of semantic and/or eieio and to\n")
+              (princ "install them also as regular XEmacs-packages! If you now proceed installing\n")
+              (princ "from the CEDET-website then the new versions will NOT be installed as\n")
+              (princ "regular XEmacs-package(s) but as \"flat\" package(s) parallel to the current\n")
+              (princ "ECB directory!\n\n")))
+          (if (not (yes-or-no-p (format "ECB requires %s. Download now? "
+                                        version-error)))
+              (ecb-error "ECB can only be used with %s! Sorry!"
+                         version-error)
+            (message nil)
+
+            ;; try to download semantic and set state and install dir
+            (if (not (member 'semantic failed-result))
+                (setq semantic-state "Correct version already loaded!")
+              (setq semantic-installed-version-str
+                    (ecb-package-get-matching-versions-str
+                     "semantic" ecb-semantic-eieio-url
+                     ecb-required-semantic-version-min
+                     ecb-required-semantic-version-max))
+              (setq semantic-dir
+                    (ecb-package-download "semantic"
+                                          semantic-installed-version-str
+                                          ecb-semantic-eieio-url))
+              (setq semantic-state (if (and semantic-dir
+                                            semantic-installed-version-str)
+                                       (concat "Installed "
+                                               semantic-installed-version-str
+                                               " in " semantic-dir)
+                                     "Download- or installing-failure!")))
+
+            ;; try to download eieio and set state and install dir
+            (if (not (member 'eieio failed-result))
+                (setq eieio-state "Correct version already loaded!")
+              (setq eieio-installed-version-str
+                    (ecb-package-get-matching-versions-str
+                     "eieio" ecb-semantic-eieio-url
+                     ecb-required-eieio-version-min
+                     ecb-required-eieio-version-max))
+              (setq eieio-dir
+                    (ecb-package-download "eieio"
+                                          eieio-installed-version-str
+                                          ecb-semantic-eieio-url))
+              (setq eieio-state (if (and eieio-dir
+                                         eieio-installed-version-str)
+                                    (concat "Installed "
+                                            eieio-installed-version-str
+                                            " in " eieio-dir)
+                                  "Download- or installing-failure!")))
+
+            ;; display the success
+            (with-output-to-temp-buffer "*ECB downloading and installing*"
+              (princ "Current state of the required packages semantic and eieio:\n\n")
+              (princ (concat "- semantic author-version must be ["
+                             semantic-required-version-str-min
+                             ", "
+                             semantic-required-version-str-max "]:\n  "))
+              (princ semantic-state)
+              (princ "\n")
+              (princ (concat "- eieio author-version must be ["
+                             eieio-required-version-str-min
+                             ", "
+                             eieio-required-version-str-max "]:\n  "))
+              (princ eieio-state)
+              (princ "\n\n")
+              (princ "After adding the new directories to your `load-path' and then restarting\n")
+              (princ "Emacs and ECB the new packages will be used.\n\n")
+              (princ "\n\n"))
+            (ecb-error "Please restart Emacs with the required packages!")))))))
+
+
+;; if we miss some of the requirements we offer the user to download and
+;; install them if Emacs ist started interactive or - in batch mode - we
+;; report an error.
+(let* ((semantic-load-ok (condition-case nil
+                             (require 'semantic)
+                           (error nil)))
+       (eieio-load-ok (condition-case nil
+                          (require 'eieio)
+                        (error nil)))
+       (missing-msg (concat (if (not semantic-load-ok) "package semantic")
+                            (when (not eieio-load-ok)
+                              (concat (if (not semantic-load-ok) " and the ")
+                                      "package eieio")))))
+  (when (not (and semantic-load-ok eieio-load-ok))
+    (if (ecb-noninteractive)
+        (ecb-error "ECB is missing the %s!" missing-msg)
+      (ecb-check-requirements))))
+
+;; If we are here we can load ECB because at least we have installed and
+;; loaded all required packages. If they have correct version will be checked
+;; at start- or byte-compile-time
+
+
 (message "ECB %s uses semantic %s and eieio %s" ecb-version
          semantic-version eieio-version)
 
 (require 'semantic-load)
 
-;; ecb loads
+;; rest of ecb loads
 (require 'tree-buffer)
 (require 'ecb-jde)
 (require 'ecb-layout)
 (require 'ecb-create-layout)
 (require 'ecb-mode-line)
-(require 'ecb-util)
 (require 'ecb-help)
 (require 'ecb-navigate)
 (require 'ecb-eshell)
 (require 'ecb-compilation)
 (require 'ecb-cycle)
 (require 'ecb-face)
-(require 'ecb-upgrade)
 (require 'ecb-tod)
 (require 'ecb-autogen)
 ;;(require 'ecb-profile)
   ;; to avoid compiler grips
   (require 'cl))
 
+
+
+
 ;; XEmacs
 (silentcomp-defun redraw-modeline)
 ;; Emacs
 (silentcomp-defun semanticdb-full-filename)
 (silentcomp-defun ediff-cleanup-mess)
 (silentcomp-defvar ediff-quit-hook)
+(silentcomp-defvar tar-subfile-mode)
+(silentcomp-defvar archive-subfile-mode)
 
 ;; ecb-speedbar is first loaded if ecb-use-speedbar-for-directories is set to
 ;; true
   "Path to currently selected source.")
 (defvar ecb-item-in-tree-buffer-selected nil
   "Only true if any item in any tree-buffer has been selected in recent
-  command.")
+command.")
 
 (defun ecb-initialize-internal-vars ()
   (setq ecb-tree-buffers nil
 There are two additional options:
 - none: No major-modes should activate ECB automatically.
 - a regexp: This means all major-modes which are not listed in
-  `ecb-major-modes-deactivate' activate ECB except the symbol-name of
+  `ecb-major-modes-deactivate' activate ECB except the `symbol-name' of
   `major-mode' matches this regexp. If this option is set then the default
   regexp excludes all Info- and customize-buffers because this buffers should
   not change anything in the ECB-activation state.
 
 (defcustom ecb-major-modes-deactivate 'none
   "*List of major-modes for which ECB should be deactivated or hidden.
-Specify if ECB should be deactivated or at least hidden if a major-mode is
-active. For each major-mode there must be added an action what should be done:
+Specify if ECB should be deactivated or at least hidden if a `major-mode' is
+active. For each `major-mode' there must be added an action what should be done:
 - hide: ECB just hides all the ECB windows like with `ecb-hide-ecb-windows'.
-- deactivate: ECB is completely deactivated after activating the major-mode.
+- deactivate: ECB is completely deactivated after activating the `major-mode'.
 
 There are two additional options:
 - none: No major-modes should deactivate/hide ECB automatically.
      `ecb-major-modes-activate' deactivate ECB.
   The cdr of this cons is a regexp: This means all major-modes which are not
   listed in `ecb-major-modes-activate' deactivate/hide ECB except the
-  symbol-name of `major-mode' matches this regexp. If this option is set then
+  `symbol-name' of `major-mode' matches this regexp. If this option is set then
   the default regexp excludes all Info- and customize-buffers because this
   buffers should not change anything in the ECB-activation state.
 
-If a major-mode is listed in `ecb-major-modes-activate' as well as in
+If a `major-mode' is listed in `ecb-major-modes-activate' as well as in
 `ecb-major-modes-deactivate' then ECB is activated!
 
 Any auto. deactivation/hiding is only done if the edit-window of ECB is
   :group 'ecb-sources
   :type 'string)
 
+
+(defcustom ecb-sources-exclude-cvsignore nil
+  "*Specify if files contained in a .cvsignore should be excluded.
+
+Value is a list of regular expressions or nil. If you want to exclude files
+listed in a .cvsignore-file from being displayed in the ecb-sources-buffer
+then specify a regexp for such a directory.
+
+If you want to exclude the contents of .cvsignore-files for every directory
+then you should add one regexp \".*\" which matches every directory.
+
+If you never want to exclude the contents of .cvsignore-files then set this
+option to nil. This is the default."
+  :group 'ecb-sources
+  :group 'ecb-directories
+  :type '(repeat (regexp :tag "Directory-regexp")))
+
+
 (defcustom ecb-source-file-regexps
   '((".*" . ("\\(^\\(\\.\\|#\\)\\|\\(~$\\|\\.\\(elc\\|obj\\|o\\|class\\|lib\\|dll\\|a\\|so\\|cache\\)$\\)\\)"
              "^\\.\\(emacs\\|gnus\\)$")))
 So the value of this option is a list of cons-cells where the car is a
 directory regexp and the cdr is a 2 element list where the first element is a
 exclude regexp and the second element is a include regexp. A file is displayed
-in the source-buffer of ECB iff: The file does not match the exclude regexp OR
-the file matches the include regexp. There are three predefined and useful
-combinations of an exclude and include regexp:
+in the sources-buffer of ECB iff: The file does not match the exclude regexp
+OR the file matches the include regexp.
+
+But regardless of the value of this option a file F is never displayed in the
+sources-buffer if the directory matches `ecb-sources-exclude-cvsignore'
+and the directory contains a file .cvsignore which contains F as an entry!
+
+There are three predefined and useful combinations of an exclude and include
+regexp:
 - All files
 - All, but no backup, object, lib or ini-files \(except .emacs and .gnus). This
   means all files except those starting with \".\", \"#\" or ending with
                     '(symbol :tag "Major mode")
                     (nconc (list 'choice ':tag "Display function"
                                  ':menu-tag '"Display function")
-                           (append 
+                           (append
                             (mapcar (lambda (f)
                                       (list 'const ':tag
                                             (symbol-name (car f)) (car f)))
                                            col-type-name)
                                           template-text))
                      (setq text (concat col-type-name template-text
-                                        col-type-spec))))                     
+                                        col-type-spec))))
                  ;; now we add some own colorizing if necessary
                  (if face
                      (setq text (ecb-merge-face-into-text text face)))
 The real synchronization is done by `ecb-current-buffer-sync'. If 'always then
 the synchronization by `ecb-current-buffer-sync' takes place always a buffer
 changes in the edit window, if nil then never. If a list of major-modes then
-only if the major-mode of the new buffer belongs NOT to this list.
+only if the `major-mode' of the new buffer belongs NOT to this list.
 
 But in every case the synchronization by `ecb-current-buffer-sync' takes only
 place if the current-buffer in the edit-window has a relation to files or
   :group 'ecb-general
   :type 'string)
 
-(defcustom ecb-temp-dir
-  (file-name-as-directory
-   (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
-       (cond ((eq system-type 'windows-nt) "c:/temp/")
-             (t "/tmp/"))))
-  "*Specify a directory where ECB can store temporary files."
-  :type '(directory :tag "Temporary Directory")
-  :group 'ecb-general)
-
 (defcustom ecb-auto-compatibility-check t
   "*Check at ECB-startup if all ECB-options have correct values.
 If not nil then all ECB-options are checked if their current value have the
   :group 'ecb-general
   :type 'boolean)
 
+(defcustom ecb-directories-menu-user-extension nil
+  "*User extensions for the popup-menu of the directories buffer.
+
+Value is a list of elements of the following type: Each element defines a new
+menu-entry and is a list containing two subelements, whereas the first is the
+name of the menu-entry and the second the function \(a function symbol or a
+lambda-expression) being called if the menu-entry is selected. If there is no
+second subelement and the first one is the string \"---\" then a
+non-selectable menu-separator is displayed.
+
+The function must follow the following guidelines:
+It takes one argument which is the tree-buffer-node of the selected node \(means
+the node for which the popup-menu has been opened). With the function
+`tree-node-get-data' the related data of this node is accessible and returns
+in case of the directories buffer the directory for which the popup-menu has
+been opened. The function can do any arbitrary things with this directory.
+
+Example for such a menu-function:
+
+\(defun ecb-my-special-dir-popup-function \(node)
+  \(let \(\(node-data=dir \(tree-node-get-data node)))
+     \(message \"Dir under node: %s\" node-data=dir)))
+
+Per default the user-extensions are added at the beginning of the builtin
+menu-entries of `ecb-directories-menu' but the whole menu can be re-arranged
+with `ecb-directories-menu-sorter'.
+
+If you change this option you have to restart ECB to take effect."
+  :group 'ecb-directories
+  :type '(repeat (choice :tag "Menu-entry" :menu-tag "Menu-entry"
+                         :value ("" ignore)
+                         (const :tag "Separator" :value ("---"))
+                         (list :tag "Menu-entry"
+                               (string :tag "Entry-name")
+                               (function :tag "Function" :value ignore)))))
+
+(defcustom ecb-sources-menu-user-extension nil
+  "*User extensions for the popup-menu of the sources buffer.
+
+For further explanations see `ecb-directories-menu-user-extension'.
+
+The node-argument of a menu-function contains as data the filename of the
+source for which the popup-menu has been opened.
+
+Per default the user-extensions are added at the beginning of the builtin
+menu-entries of `ecb-sources-menu' but the whole menu can be re-arranged
+with `ecb-sources-menu-sorter'.
+
+If you change this option you have to restart ECB to take effect."
+  :group 'ecb-sources
+  :type '(repeat (choice :tag "Menu-entry" :menu-tag "Menu-entry"
+                         :value ("" ignore)
+                         (const :tag "Separator" :value ("---"))
+                         (list :tag "Menu-entry"
+                               (string :tag "Entry-name")
+                               (function :tag "Function" :value ignore)))))
+
+(defcustom ecb-methods-menu-user-extension nil
+  "*User extensions for the popup-menu of the methods buffer.
+
+For further explanations see `ecb-directories-menu-user-extension'.
+
+The node-argument of a menu-function contains as data the semantic-token of
+the method/variable/token for which the popup-menu has been opened.
+
+Per default the user-extensions are added at the beginning of the builtin
+menu-entries of `ecb-methods-menu' but the whole menu can be re-arranged
+with `ecb-methods-menu-sorter'.
+
+If you change this option you have to restart ECB to take effect."
+  :group 'ecb-methods
+  :type '(repeat (choice :tag "Menu-entry" :menu-tag "Menu-entry"
+                         :value ("" ignore)
+                         (const :tag "Separator" :value ("---"))
+                         (list :tag "Menu-entry"
+                               (string :tag "Entry-name")
+                               (function :tag "Function" :value ignore)))))
+
+(defcustom ecb-history-menu-user-extension nil
+  "*User extensions for the popup-menu of the history buffer.
+
+For further explanations see `ecb-directories-menu-user-extension'.
+
+The node-argument of a menu-function contains as data the filename of the
+source for which the popup-menu has been opened.
+
+Per default the user-extensions are added at the beginning of the builtin
+menu-entries of `ecb-history-menu' but the whole menu can be re-arranged
+with `ecb-history-menu-sorter'.
+
+If you change this option you have to restart ECB to take effect."
+  :group 'ecb-history
+  :type '(repeat (choice :tag "Menu-entry" :menu-tag "Menu-entry"
+                         :value ("" ignore)
+                         (const :tag "Separator" :value ("---"))
+                         (list :tag "Menu-entry"
+                               (string :tag "Entry-name")
+                               (function :tag "Function" :value ignore)))))
+
+
+(defcustom ecb-directories-menu-sorter nil
+  "*Function which re-sorts the menu-entries of the directories buffer.
+
+If a function then this function is called to re-arrange the menu-entries of
+the combined menu-entries of the user-menu-extensions of
+`ecb-directories-menu-user-extension' and the builtin-menu
+`ecb-directories-menu'. If nil then no special sorting will be done and the
+user-extensions are placed in front of the builtin-entries.
+
+The function get one argument, a list of menu-entries. For the format of this
+argument see `ecb-directories-menu-user-extension'. The function must return a
+new list in the same format. Of course this function can not only re-arrange
+the entries but also delete entries or add new entries."
+  :group 'ecb-directories
+  :type '(choice :tag "Menu-sorter" :menu-tag "Menu-sorter"
+                 (const :tag "No special sorting" :value nil)
+                 (function :tag "Sort-function" :value identity)))
+
+(defcustom ecb-sources-menu-sorter nil
+  "*Function which re-sorts the menu-entries of the directories buffer.
+
+If a function then this function is called to sort the menu-entries of the
+combined menu-entries of the user-menu-extensions of
+`ecb-sources-menu-user-extension' and the builtin-menu
+`ecb-sources-menu'. If nil then no special sorting will be done and the
+user-extensions are placed in front of the builtin-entries.
+
+For the guidelines for such a sorter-function see
+`ecb-directories-menu-sorter'."
+  :group 'ecb-sources
+  :type '(choice :tag "Menu-sorter" :menu-tag "Menu-sorter"
+                 (const :tag "No special sorting" :value nil)
+                 (function :tag "Sort-function" :value identity)))
+
+(defcustom ecb-methods-menu-sorter nil
+  "*Function which re-sorts the menu-entries of the directories buffer.
+
+If a function then this function is called to sort the menu-entries of the
+combined menu-entries of the user-menu-extensions of
+`ecb-methods-menu-user-extension' and the builtin-menu
+`ecb-methods-menu'. If nil then no special sorting will be done and the
+user-extensions are placed in front of the builtin-entries.
+
+For the guidelines for such a sorter-function see
+`ecb-directories-menu-sorter'."
+  :group 'ecb-methods
+  :type '(choice :tag "Menu-sorter" :menu-tag "Menu-sorter"
+                 (const :tag "No special sorting" :value nil)
+                 (function :tag "Sort-function" :value identity)))
+
+(defcustom ecb-history-menu-sorter nil
+  "*Function which re-sorts the menu-entries of the directories buffer.
+
+If a function then this function is called to sort the menu-entries of the
+combined menu-entries of the user-menu-extensions of
+`ecb-history-menu-user-extension' and the builtin-menu
+`ecb-history-menu'. If nil then no special sorting will be done and the
+user-extensions are placed in front of the builtin-entries.
+
+For the guidelines for such a sorter-function see
+`ecb-directories-menu-sorter'."
+  :group 'ecb-history
+  :type '(choice :tag "Menu-sorter" :menu-tag "Menu-sorter"
+                 (const :tag "No special sorting" :value nil)
+                 (function :tag "Sort-function" :value identity)))
+
 (defcustom ecb-activate-before-layout-draw-hook nil
   "*Normal hook run at the end of activating the ecb-package by running
 `ecb-activate'. These hooks run after all the internal setup process but
   :group 'ecb-general
   :type 'hook)
 
-(defcustom ecb-current-buffer-sync-hook nil 
+(defcustom ecb-current-buffer-sync-hook nil
   "*Normal hook run at the end of `ecb-current-buffer-sync'.
 
 See documentation of `ecb-current-buffer-sync' for conditions when
   :group 'ecb-general
   :type 'hook)
 
-(defcustom ecb-common-tree-buffer-after-create-hook nil 
+(defcustom ecb-common-tree-buffer-after-create-hook nil
   "*Local hook running at the end of each tree-buffer creation.
 Every function of this hook is called once without arguments direct after
 creating a tree-buffer of ECB and it's local keymap. So for example a function
   :group 'ecb-general
   :type 'hook)
 
-(defcustom ecb-directories-buffer-after-create-hook nil 
+(defcustom ecb-directories-buffer-after-create-hook nil
   "*Local hook running after the creation of the directories-buffer.
 Every function of this hook is called once without arguments direct after
 creating the directories-buffer of ECB and it's local keymap. So for example a
   :group 'ecb-directories
   :type 'hook)
 
-(defcustom ecb-sources-buffer-after-create-hook nil 
+(defcustom ecb-sources-buffer-after-create-hook nil
   "*Local hook running after the creation of the sources-buffer.
 Every function of this hook is called once without arguments direct after
 creating the sources-buffer of ECB and it's local keymap. So for example a
   :group 'ecb-sources
   :type 'hook)
 
-(defcustom ecb-methods-buffer-after-create-hook nil 
+(defcustom ecb-methods-buffer-after-create-hook nil
   "*Local hook running after the creation of the methods-buffer.
 Every function of this hook is called once without arguments direct after
 creating the methods-buffer of ECB and it's local keymap. So for example a
   :group 'ecb-methods
   :type 'hook)
 
-(defcustom ecb-history-buffer-after-create-hook nil 
+(defcustom ecb-history-buffer-after-create-hook nil
   "*Local hook running after the creation of the history-buffer.
 Every function of this hook is called once without arguments direct after
 creating the history-buffer of ECB and it's local keymap. So for example a
 ;;====================================================
 
 
-;; (defun check-test (s-ver e-ver)
-;;   (interactive "sSemantic-version: \nsEieio-version: ")
-;;   (let ((ecb-all-requirements-available nil)
-;;         (semantic-version s-ver)
-;;         (eieio-version e-ver))
-;;     (ecb-check-requirements)))
-
-(defun ecb-check-requirements (&optional just-check)
-  "Ensure that we use the right `semantic-version' and right `eieio-version'
-and offer to download them if not installed.
-
-If JUST-CHECK is not nil then
-1. Only the version check is done but no download
-2. It returns nil if all requirements are correct, otherwise a list which
-   contains the symbol 'semantic if `semantic-version' is incorrect and 'eieio
-   if `eieio-version' is incorrect."
-  (when (and ecb-version-check
-             (not ecb-all-requirements-available))
-    (let ((semantic-required-version-str-min (ecb-package-version-list2str
-                                              ecb-required-semantic-version-min))
-          (semantic-required-version-str-max (ecb-package-version-list2str
-                                              ecb-required-semantic-version-max))
-          (eieio-required-version-str-min (ecb-package-version-list2str
-                                           ecb-required-eieio-version-min))
-          (eieio-required-version-str-max (ecb-package-version-list2str
-                                           ecb-required-eieio-version-max))
-          (failed-result)
-          (version-error nil)
-          (semantic-dir nil)
-          (semantic-state nil)
-          (semantic-installed-version-str nil)
-          (eieio-dir nil)
-          (eieio-state nil)
-          (eieio-installed-version-str nil))
-      ;; check if semantic version is correct
-      (when (or (ecb-package-version-list<
-                 (ecb-package-version-str2list semantic-version)
-                 ecb-required-semantic-version-min)
-                (ecb-package-version-list<
-                 ecb-required-semantic-version-max
-                 (ecb-package-version-str2list semantic-version)))
-        (setq version-error (concat "semantic ["
-                                    semantic-required-version-str-min
-                                    ", "
-                                    semantic-required-version-str-max
-                                    "]"))
-        (setq failed-result (cons 'semantic failed-result)))
-      ;; check if eieio version is correct
-      (when (or (ecb-package-version-list<
-                 (ecb-package-version-str2list eieio-version)
-                 ecb-required-eieio-version-min)
-                (ecb-package-version-list<
<