Commits

Anonymous committed 9b9ba60

Sync with current upstream 2.27. See file NEWS.

  • Participants
  • Parent commits c48e7e3

Comments (0)

Files changed (26)

+2004-08-31  Klaus Berndl  <klaus.berndl@sdm.de>
+	
+	* Sync with current upstream 2.27
+
+2004-08-31  Klaus Berndl  <klaus.berndl@sdm.de>
+	
+	* Renamed ecb-images/methods/height_15_to_21 to
+		 height_14_to_21
+
 2004-04-14  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.18 released.
 # Boston, MA 02111-1307, USA.
 
 VERSION = 1.18
-AUTHOR_VERSION = 2.24
+AUTHOR_VERSION = 2.27
 MAINTAINER = Klaus Berndl <klaus.berndl@sdm.de>
 PACKAGE = ecb
 PKG_TYPE = regular
 DATA_16_FILES = $(wildcard ecb-images/directories/height-10/*.xpm)
 DATA_16_DEST = $(PACKAGE)/ecb-images/directories/height-10
 
-DATA_17_FILES = $(wildcard ecb-images/methods/height-15_to_21/*.xpm)
-DATA_17_DEST = $(PACKAGE)/ecb-images/methods/height-15_to_21
+DATA_17_FILES = $(wildcard ecb-images/methods/height-14_to_21/*.xpm)
+DATA_17_DEST = $(PACKAGE)/ecb-images/methods/height-14_to_21
+
+DATA_18_FILES = $(wildcard ecb-images/default/height-14/*.xpm)
+DATA_18_DEST = $(PACKAGE)/ecb-images/default/height-14
+DATA_19_FILES = $(wildcard ecb-images/directories/height-14/*.xpm)
+DATA_19_DEST = $(PACKAGE)/ecb-images/directories/height-14
 
 
 PRELOADS = -l compile -l ecb-util -l ecb-eshell \

File Makefile.upstream

 # have set this variable to 'xemacs' if you want byte-compile with XEmacs!
 EMACS=emacs
 
+# In the following path-settings of this section use always FORWARD-SLASHES
+# as directory-separator even with MS Windows systems.
+
 # -------- Compiling ECB with the cedet-library 1.0 ----------------------
 
 # cedet 1.0 (contains a.o. semantic 2.0, eieio 0.18 and speedbar 0.15). If
 # you want compile ECB with the cedet library then set here the full path
-# to the cedet-installation directory.
+# to the cedet-installation directory. If you do not want using the
+# cedet-suite but separate semantic-, eieio- and speedbar-pathes set this
+# variable to empty.
 
 #CEDET=
-CEDET=C:/Programme/emacs-21/site-lisp/multi-file-packages/cedet-1.0beta2b
+CEDET=c:/Programme/emacs-21/site-lisp/package-development/cedet
+#CEDET=c:/Programme/emacs-21/site-lisp/multi-file-packages/cedet-1.0beta3b
 
 # -------- Compiling ECB with the semantic < 2.0 -------------------------
 
-# If you want not compile ECB with the cedet1.0-library then do not set
-# CEDET above!
+# If you do not want compiling ECB with the cedet1.0-library then do not
+# set CEDET above!
 
 # If semantic, eieio and speedbar are added to load-path within some
 # Elisp-statements in the Emacs initialization-files (e.g. .emacs or
 # site-start.el) then set here again the load-path of the semantic-version,
-# the eieio-version and the speedbar-version loaded into your Emacs (use
-# always FORWARD-SLASHES as directory-separator even with MS Windows
-# systems). Make sure you compile ECB with the semantic-, eieio- and
-# speedbar-version you load into Emacs!
+# the eieio-version and the speedbar-version loaded into your Emacs. Make
+# sure you compile ECB with the semantic-, eieio- and speedbar-version you
+# load into Emacs!
 
 # If you are using XEmacs with already installed XEmacs-packages for
 # semantic, eieio and speedbar or if you are using a file subdirs.el with
 
 # For the ECB-maintainers: Change the version-number here and not
 # elsewhere!
-ecb_VERSION=2.24
+ecb_VERSION=2.27
 
 include ecb-makedef.mk
 
 	@$(CP) -r $(ecb_IMAGE_DIR) ecb-$(ecb_VERSION)
 	@find ecb-$(ecb_VERSION)/$(ecb_IMAGE_DIR) -name CVS -print | xargs rm -Rf
 	@find ecb-$(ecb_VERSION)/$(ecb_IMAGE_DIR) -name *~ -print | xargs $(RM)
+	@find ecb-$(ecb_VERSION)/$(ecb_IMAGE_DIR) -name *.png -print | xargs $(RM)
 	@tar -cvzf ecb-$(ecb_VERSION).tar.gz ecb-$(ecb_VERSION)
 	@$(RM) -R ecb-$(ecb_VERSION)
 
+* Changes for ECB version 2.27
+
+** The option `ecb-auto-expand-tag-tree-collapse-other' now has three possible
+   choices. You can decide between auto-collapsing only when point stays onto
+   a tag in the edit-window or even when point doesn't stay onto a tag (which
+   then results in a full collapsed methods-buffer). ECB autom. upgrades the
+   old setting of this option to the new type. Thanks to Javier Oviedo
+   <joviedo@telogy.com> for the suggestion.
+
+** Not accessible directories are displayed in a different face in the
+   directory-browser. See the new option `ecb-directory-not-accessible-face'
+   and the new face with same name.
+   
+** Enhancements to the permanent compile-window
+   
+*** Enlarging the compile-window does not destroy some ecb-windows
+    With previous versions of ECB enlarging the permanent compile-window has
+    often destroyed some ecb-windows if the compile-window has occupied a
+    large portion of the frame-height (e.g. half of the frame). Beginning with
+    ECB 2.27 such a ecb-window-damage is either prevented or - if it still
+    occurs (can not be prevented in all situations) - ECB now has a
+    "self-healing"-mechanism which immediatelly repairs the layout via
+    idle-checks if the current window-layout is correct for the current
+    `ecb-layout-name'. Conclusion: Enlarging or shrinking the compile-window
+    should never damage the ecb-windows! Thanks to Javier Oviedo
+    <joviedo@telogy.com> for a great problem-report!
+
+    Caution: If bytecompiled user-defined layouts are used (ie. the file,
+    which contains the user-defined layouts is byte-compiled) then you MUST
+    recompile this file with ECB 2.27 active!
+
+*** Now `ecb-store-window-sizes' and `ecb-restore-window-sizes' also work when
+    called during a permanent compile-window is visible and also when these
+    commands are called with another compile-window state than the other (e.g.
+    when the window-sizes are stored without a compile-window and restored
+    with a compile-window).
+
+*** Now ECB ensures that the permanent compile-window has always its specified
+    size when shrinked either by Emacs/ECB or by the command
+    `ecb-toggle-compile-window-height'.
+
+*** Now ECB ensures that all ecb-windows have always either their default or
+    stored size size after the compile-window has been shrinked either by
+    Emacs/ECB or by the command `ecb-toggle-compile-window-height'.
+
+*** ECB takes into account the new Emacs-option `grep-window-height' when it
+    compute the max. allowed size of its permanent compile-window. More
+    generally spoken: It takes into account all options with name
+    *-window-height defined for modes which are defined by the macro
+    `define-compilation-mode'. This mechanism is available in the forthcoming
+    Emacs 21.4 (and of course with current CVS-Emacs 21).
+    
+** Fixed Bugs
+
+*** Added a workaround for a bug in the custom-library of current release 21.3
+    of GNU Emacs which causes under certain circumstances the autom.
+    option-upgrading-feature of ECB to fail. Same for the command
+    `ecb-store-window-sizes'. Thanks for reporting this annoying bug and great
+    help to Christoph Ludwig <cludwig@cdc.informatik.tu-darmstadt.de>
+
+
+
+* Changes for ECB version 2.26
+
+** Improved the performance of the directories-buffer-display
+   Reduced the need of completely rebuilding the whole directories-tree-buffer
+   when just switching between buffers and the related directories are already
+   expanded. This can dramatically increase the speed of the tree-buffer
+   display when displaying the sources-files in the directories-buffer (see
+   `ecb-show-sources-in-directories-buffer'). Thanks to Rob Walker
+   <rob.lists@tenfoot.org.uk> for tracking down the performance bottleneck and
+   supplying a first patch.
+
+** Per default all mouse-actions in the special ECB-buffers are now triggered
+   first after releasing the mouse-button and not when pressed as with
+   previous ECB-versions. This is the standard behavior of Emacs and of most
+   applications. But with the new option `ecb-tree-mouse-action-trigger' a
+   user can switch back to the old behavior.
+
+   As a side effect now the ECB-tree-buffers can be used during an active
+   isearch - at least with GNU Emacs. Thanks to Markus Gritsch
+   <gritsch@iue.tuwien.ac.at> for pointing to this problem.
+
+** ECB sets autom. temp-buffer-resize-mode rsp. temp-buffer-shrink-to-fit when
+   needed. This modes are needed when a permanent compile-window is used
+   because otherwise the correct sizing of the compile-window according to the
+   settings in ecb-compile-window-temporally-enlarge and
+   ecb-enlarged-compilation-window-max-height is not possible. After disabling
+   the permanent compile-window or when deactivating ECB the original settings
+   of these modes are restored!
+      
+** Some regexp-options has been changed to regexp-list-options:
+   `ecb-excluded-directories-regexp' --> `ecb-excluded-directories-regexps'
+   `ecb-source-file-regexps'         --> `ecb-source-file-regexps'
+   `ecb-exclude-parents-regexp'      --> `ecb-exclude-parents-regexps'
+
+   All these options now accept (and require) a list of regexps instead of
+   exactly one big regexp. This allows easier regexp-definition and follows
+   now the way Emacs goes with other regexp-options like `same-window-regexps'
+   or `special-display-regexps' which are also lists of regexps.
+
+   ECB autom. upgrades your old settings to the new option-types rsp. also
+   -names (if the option has been renamed).
+
+** New option `ecb-history-exclude-file-regexps' for excluding certain files
+   from being displayed in the history-buffer of ECB. Currently the filenames
+   TAGS and semantic.cache are excluded per default. Thanks to Javier Oviedo
+   <joviedo@telogy.com> for the suggestion.
+
+** ECB now displays read-only sourcefiles in a different face.
+   For this a new option and a new face are offered both named
+   `ecb-source-read-only-face' (default: italic) which is used to display
+   source-files in the sources-tree-buffer (or in the directories-tree-buffer
+   if `ecb-show-sources-in-directories-buffer' is not nil) if the file is
+   read-only.
+       
+** Fixed bugs
+
+*** Fixed merging faces with XEmacs.
+    Now options like `ecb-type-tag-display' (merges own ECB-faces to already
+    by semantic faced tags) work also correct with XEmacs. ECB-versions prior
+    to 2.26 has not merged the ECB-faces to the already applied faces of a
+    text but instead replaced the applied faces with the ECB ones. Now all
+    faces are merged.
+
+*** Now the command `ecb-expand-methods-nodes' and all the expand-* menu-entries
+    in the popup-menu of the methods-buffer work for non-semantic-buffers too.
+
+*** Fixed a bug concerning `ecb-auto-expand-tag-tree-collapse-other'.
+    Thanks to Javier Oviedo <joviedo@telogy.com> for pointing to the problem.
+
+*** Handles not existing source-paths in `ecb-source-path' correct.
+    These paths are now ignored with a warning.
+
+    
+
+* Changes for ECB version 2.25
+
+** More flexible sorting of the Sources- and the History-buffer
+
+*** `ecb-sort-history-items' has been renamed to `ecb-history-sort-method'
+    and offers now the same choices as the already existing option
+    `ecb-sources-sort-method'.
+
+*** Two new options `ecb-sources-sort-ignore-case' and
+    `ecb-history-sort-ignore-case' which allow to ignore case when sorting the
+    Sources- and/or the History-buffer. Thanks for suggestion to Markus
+    Gritsch <gritsch@iue.tuwien.ac.at>. Per default case is now ignored.
+
+** New icons for parent-display in the Methods-buffer.
+   Thanks to Markus Gritsch <gritsch@iue.tuwien.ac.at> for contributing the
+   icon-images.
+
+** Fixed Bugs
+
+*** Fixed an annoying bug which results sometimes in an error "stack-overflow
+    error in equal" when using `senator-try-expand-semantic' which is called
+    when you use hippie-expand for example. Maybe the bug occured also in
+    other situation but now this bug has been extirpated!
+
+*** Fixed a bug in the mechanism which prescanes directories for emptyness.
+    Now a directory is checked if it is accessible before it is prescanned -
+    otherwise the prescan could fail with an error.
+
+*** Fixed a bug in the autom. option-upgrading-mechanism.
+    Thanks to Javier Oviedo <joviedo@telogy.com> for pointing to the
+    underlying problem.
+
+
+
 * Changes for ECB version 2.24
 
 ** Enhancements for the Methods-buffer
        
 *** Changes to the image-icons of the tree-buffers
 
-**** Alle image-files have been renamed from <IMAGENAME>.xpm to
+**** All image-files have been renamed from <IMAGENAME>.xpm to
      ecb-<IMAGENAME>.xpm. This was necessary because the icons for "open" and
      "close" in Emacs toolbar got superseeded by ECB's icons for "open" and
      "close". The problem was, that ECB was using the same names for the icon
      files "open.xpm" and "close.xpm" as emacs toolbar does. This problem
-     occurs if the image-directory of ECB is contained in the `load-path' which
-     is when ECB is installed in the site-lisp directory of Emacs with the
-     default subdirs.el of Emacs which adds automatically all subdirectories to
-     the load-path (and therefore also subdirectories which does not contain
-     elisp-files but only images - btw: not really smart;-). Thanks for
-     pointing out that to Roland Schaeuble <roland.schaeuble@siemens.com>.
+     occurs if the image-directory of ECB is contained in the `load-path'
+     which is when ECB is installed in the site-lisp directory of Emacs with
+     the default subdirs.el of Emacs which adds automatically all
+     subdirectories to the load-path (and therefore also subdirectories which
+     does not contain elisp-files but only images - btw: not really smart;-).
+     Thanks to Roland Schaeuble <roland.schaeuble@siemens.com> for pointing
+     out that.
 
 **** Added all image-icons in a 10-point height.
      Thanks to Nick Cross <nick@goots.org> for sizing down the images.
    visibility-state of the ecb-windows or the compile-window. Called without a
    prefix-arg this command now preserves the state of the ecb-windows as well
    as the state of the compile-window. Called with TWO prefix-args means an
-   emergence-redraw (see documentation of `ecb-redraw-layout').
+   emergency-redraw (see documentation of `ecb-redraw-layout').
 
 ** New command `ecb-display-news-for-upgrade'.
    ECB autom. displays after an upgrade a short summary of the most important
-README for the Emacs Code Browser (ECB) version 2.24
+README for the Emacs Code Browser (ECB) version 2.27
 
 
 About
 
 ecb-list@lists.sourceforge.net
 
+*IMPORTANT*: Cause of extra appearance of SPAM in the mailing-lists,
+SourceForge has changed its policy: Now it is only possible to post to the
+mailing-list for users who have subscribed this mailing-list.
+
+So please be aware you will not be able to send comments, bug reports and
+improvement suggestions before you have subscribed the ECB-mailing-list. See
+the section "Mailing-list" at the ECB-website at http://ecb.sourceforge.net
+how to do this.
+

File RELEASE_NOTES

-This file contains some important release-notes for ECB version 2.24
+This file contains some important release-notes for ECB version 2.27
 
 General:
 --------
 Upgrading from any version:
 ---------------------------
 
+The option `ecb-auto-expand-tag-tree-collapse-other' has changed its type. ECB
+autom. upgrades your old setting to the new option-type.
+
+
+Upgrading from any version < 2.26:
+----------------------------------
+
+Some regexp-options has been changed to regexp-list-options:
+`ecb-excluded-directories-regexp' --> `ecb-excluded-directories-regexps'
+`ecb-source-file-regexps'         --> `ecb-source-file-regexps'
+`ecb-exclude-parents-regexp'      --> `ecb-exclude-parents-regexps'
+
+All these options now accept (and require) a list of regexps instead of
+exactly one big regexp. ECB autom. upgrades your old settings to the new
+option-types rsp. also -names (if the option has been renamed).
+
+
+Upgrading from versions < 2.25:
+-------------------------------
+
+`ecb-sort-history-items' has been renamed to `ecb-history-sort-method'. ECB
+autom. upgrades your old setting to the new option-name and -type.!
+
+
+Upgrading from versions < 2.23:
+-------------------------------
+
 The option `ecb-show-tags' has changed its type. ECB autom. upgrades your old
 setting to the new option-type.!
 

File ecb-autogen.el

 (defun ecb-autogen-update-header ()
   "Update header of the auto-generated autoloads file.
 Run as `write-contents-hooks'."
-  (when (string-equal generated-autoload-file (buffer-file-name))
+  (when (ecb-string= generated-autoload-file (buffer-file-name))
     (let ((tag (format ";;; %s ---" (file-name-nondirectory
                                      (buffer-file-name)))))
       (message "Updating header...")

File ecb-compilation.el

   (catch 'exit
     (dolist (b (ecb-compilation-buffer-names))
       (if (null (cdr b))
-          (if (string= name (car b))
+          (if (ecb-string= name (car b))
               (throw 'exit name))
         (save-match-data
           (if (string-match (car b) name)
        (index 0))
 
     (setq buffer-list (sort buffer-list (lambda(first second)
-                                          (string-lessp (buffer-name first)
-                                                        (buffer-name second)))))
+                                          (ecb-string< (buffer-name first)
+                                                       (buffer-name second)))))
     (dolist(buffer buffer-list)
       (when (ecb-compilation-buffer-p buffer)
         (setq buffer-names

File ecb-create-layout.el

   "Ensure calling `ecb-create-layout-cancel' during deleting the
 layout-creation frame."
   (let ((frame (or (ad-get-arg 0) (selected-frame))))
-    (when (string= (ecb-frame-parameter frame 'name)
-                   ecb-create-layout-frame-name)
+    (when (ecb-string= (ecb-frame-parameter frame 'name)
+                       ecb-create-layout-frame-name)
       (ecb-create-layout-cancel))))
 
 (defun ecb-create-layout-frame-ok ()
              (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))))
+          (sort ecb-create-layout-buf-types 'ecb-string<))))
 
 (defun ecb-create-layout-remove-from-buf-type (type)
   (when (stringp type)
     (setq ecb-create-layout-buf-types
-          (sort (delete type ecb-create-layout-buf-types) 'string-lessp))))
+          (sort (delete type ecb-create-layout-buf-types) 'ecb-string<))))
 
 (defun ecb-create-layout-buffer-type ()
   (get-text-property (point-min) 'ecb-create-layout-type))
             (ecb-query-string "Split method:"
                               '("at-point" "half")
                               "Insert a fraction between 0.1 and 0.9"))
-           (fraction (cond ((string= split-method "at-point")
+           (fraction (cond ((ecb-string= split-method "at-point")
                             nil)
-                           ((string= split-method "half")
+                           ((ecb-string= split-method "half")
                             0.5)
                            ((floatp (string-to-number split-method))
                             (string-to-number split-method))
                            (t 0.5)))
            (real-split-factor
-            (if (string= split-type "horizontal")
+            (if (ecb-string= split-type "horizontal")
                 (ecb-create-layout-split-hor fraction)
               (ecb-create-layout-split-ver fraction))))
       ;; creating new fitting buffers
                                (mapcar (function (lambda (elem)
                                                    (car elem)))
                                        ecb-buildin-layouts))
-               'string<))
+               'ecb-string<))
         (layout-name nil))
     (if (= (length new-layout-list) 0)
         (ecb-error "There are no layouts to delete!")

File ecb-eshell.el

       (when (and (bufferp my-eshell-buffer)
                  (stringp my-reference-directory)
                  (stringp my-eshell-directory)
-                 (not (string-equal (ecb-fix-filename my-reference-directory)
-                                    (ecb-fix-filename my-eshell-directory))))
+                 (not (ecb-string= (ecb-fix-filename my-reference-directory)
+                                   (ecb-fix-filename my-eshell-directory))))
         (ecb-eshell-save-buffer-history
          (save-excursion
            (set-buffer my-eshell-buffer)

File ecb-examples.el

           ;; synchronizing for real filesource-buffers
             
           ;; Let us be smart: We synchronize only if sourcebuffer has changed
-          (when (not (string= (ecb-fix-filename filename)
-                              (ecb-fix-filename
-                               ecb-examples-bufferinfo-last-file)))
+          (when (not (ecb-string= (ecb-fix-filename filename)
+                                  (ecb-fix-filename
+                                   ecb-examples-bufferinfo-last-file)))
             ;; set new last-file-name so we can check next time if changed
             (setq ecb-examples-bufferinfo-last-file filename)
             ;; we display the file-infos for current source-file
           "ECB must be activated!")
   (assert (equal (selected-frame) ecb-frame) nil
           "The ECB-frame must be selected!")
-  (assert (not (string= ecb-layout-name "example-layout1")) nil
+  (assert (not (ecb-string= ecb-layout-name "example-layout1")) nil
           "The examples-layout1 is already active!")
   
   ;; activating the synchronization of the bufferinfo-window
 
   ;; switch to our prefered layout
   (setq ecb-windows-height 6)
-  (setq ecb-compile-window-height 5)
-  (ecb-layout-switch "example-layout1"))
+  (setq ecb-compile-window-height 8)
+  (let ((ecb-change-layout-preserves-compwin-state nil))
+    (ecb-layout-switch "example-layout1")))
 
 
 
           "ECB must be activated!")
   (assert (equal (selected-frame) ecb-frame) nil
           "The ECB-frame must be selected!")
-  (assert (string= ecb-layout-name "example-layout1") nil
+  (assert (ecb-string= ecb-layout-name "example-layout1") nil
           "The example-layout1 is not active!")
   
   (remove-hook 'ecb-current-buffer-sync-hook
   :group 'ecb-face-options
   :type 'face)
 
+(defface ecb-source-read-only-face (ecb-face-default nil nil t)
+  "*Define a face for displaying read-only sources."
+  :group 'ecb-faces)
+ 
+(defcustom ecb-source-read-only-face
+  'ecb-source-read-only-face
+  "*Face for read-only sources."
+  :group 'ecb-sources
+  :group 'ecb-directories
+  :group 'ecb-face-options
+  :type 'face)
+
+(defface ecb-directory-not-accessible-face (ecb-face-default nil nil nil
+                                                             'ecb-default-general-face
+                                                             "gray60"
+                                                             "gray60"
+                                                             nil nil
+                                                             nil "gray60")
+  "*Define a face for displaying not accessible dirs in the directories buffer."
+  :group 'ecb-faces)
+ 
+(defcustom ecb-directory-not-accessible-face
+  'ecb-directory-not-accessible-face
+  "*Face for not accessible dirs in the directories buffer."
+  :group 'ecb-directories
+  :group 'ecb-face-options
+  :type 'face)
+
 (defface ecb-type-tag-class-face (ecb-face-default nil t)
   "*Define face used with option `ecb-type-tag-display'."
   :group 'ecb-faces)

File ecb-file-browser.el

   :type 'string)
 
 
-(defcustom ecb-excluded-directories-regexp "^\\(CVS\\|\\.[^xX]*\\)$"
+(defcustom ecb-excluded-directories-regexps '("^\\(CVS\\|\\.[^xX]*\\)$")
   "*Directories that should not be included in the directories list.
-The value of this variable should be a regular expression."
+The value of this variable should be a list of regular expressions."
   :group 'ecb-directories
-  :type 'regexp)
+  :type '(repeat (regexp :tag "Directory-regexp")))
 
+(defsubst ecb-check-dir-exclude (dir)
+  (ecb-match-regexp-list dir ecb-excluded-directories-regexps))
 
 (defcustom ecb-auto-expand-directory-tree 'best
   "*Automatically expand the directory tree to the current source file.
   :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\\)$")))
+  '((".*" . (("\\(^\\(\\.\\|#\\)\\|\\(~$\\|\\.\\(elc\\|obj\\|o\\|class\\|lib\\|dll\\|a\\|so\\|cache\\)$\\)\\)")
+             ("^\\.\\(emacs\\|gnus\\)$"))))
   "*Specifies which files are shown as source files.
 This is done on directory-base, which means for each directory-regexp the
 files to display can be specified. If more than one directory-regexp matches
 
 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 sources-buffer of ECB iff: The file does not match the exclude regexp
-OR the file matches the include regexp.
+list of exclude regexps and the second element is a list of include regexps. A
+file is displayed in the sources-buffer of ECB iff: The file does not match
+any of the exclude regexps OR the file matches at least one of the include
+regexps.
 
 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'
   (but including .emacs and .gnus)
 - Common source file types (.c, .java etc.)
 In addition to these predefined values a custom exclude and include
-combination can be defined.
+combination can be defined. Here each list must at least contain one regexp -
+this can be a least the empty regexp \"\"!
 
 Tips for the directory- and file-regexps: \"$^\" matches no files/directories,
 \".*\" matches all files/directories."
                        (choice :tag "Files to display"
                                :menu-tag "Files to display"
                                (const :tag "All files"
-                                      :value ("" ""))
+                                      :value (("") ("")))
                                (const :tag "All, but no backups, objects, etc..."
-                                      :value ("\\(^\\(\\.\\|#\\)\\|\\(~$\\|\\.\\(elc\\|obj\\|o\\|class\\|lib\\|dll\\|a\\|so\\|cache\\)$\\)\\)" "^\\.\\(x?emacs\\|gnus\\)$"))
+                                      :value (("\\(^\\(\\.\\|#\\)\\|\\(~$\\|\\.\\(elc\\|obj\\|o\\|class\\|lib\\|dll\\|a\\|so\\|cache\\)$\\)\\)") ("^\\.\\(x?emacs\\|gnus\\)$")))
                                (const :tag "Common source file types"
-                                      :value ("" "\\(\\(M\\|m\\)akefile\\|.*\\.\\(java\\|el\\|c\\|cc\\|h\\|hh\\|txt\\|html\\|texi\\|info\\|bnf\\)\\)$"))
+                                      :value (("") ("\\(\\(M\\|m\\)akefile\\|.*\\.\\(java\\|el\\|c\\|cc\\|h\\|hh\\|txt\\|html\\|texi\\|info\\|bnf\\)\\)$")))
                                (list :tag "Custom"
-                                     (regexp :tag "Exclude regexp"
-                                             :value "")
-                                     (regexp :tag "Include regexp"
-                                             :value ""))))))
+                                     (repeat (regexp :tag "Exclude regexp"
+                                                     :value ""))
+                                     (repeat (regexp :tag "Include regexp"
+                                                     :value "")))))))
 
 
 (defcustom ecb-show-source-file-extension t
   :group 'ecb-sources
   :type 'boolean)
 
-
 (defcustom ecb-sources-sort-method 'name
   "*Defines how the source files are sorted.
 - 'name: Sorting by name.
-- 'extension: Sorting first by name and then by extension.
+- 'extension: Sorting first by extension and then by name.
 - nil: No sorting, means source files are displayed in the sequence returned by
-  `directory-files' \(called without sorting)."
+  `directory-files' \(called without sorting).
+See also `ecb-sources-sort-ignore-case'."
   :group 'ecb-sources
   :type '(radio (const :tag "By name"
                        :value name)
                 (const :tag "No sorting"
                        :value nil)))
 
+(defcustom ecb-sources-sort-ignore-case t
+  "*Ignore case for sorting the source-files of the Sources-buffer.
+See also `ecb-sources-sort-method'."
+  :group 'ecb-sources
+  :type 'boolean)
 
 (defcustom ecb-history-buffer-name " *ECB History*"
   "*Name of the ECB history buffer.
   :group 'ecb-history
   :type 'string)
 
+(defcustom ecb-history-exclude-file-regexps '("TAGS$" "semantic\\.cache$")
+  "*List of regexps which exclude source-files from being historized. Be aware
+that each always full filenames \(ie. incl. full path) are matched against
+these regexps! Therefore be carefore with regexps beginning with ^!"
+  :group 'ecb-history
+  :type '(repeat (regexp :tag "Source-regexp")))
 
-(defcustom ecb-sort-history-items nil
-  "*Sorts the items in the history buffer."
+(defsubst ecb-check-filename-for-history-exclude (filename)
+  (ecb-match-regexp-list filename ecb-history-exclude-file-regexps))
+
+(defcustom ecb-history-sort-method 'name
+  "*Defines how the entries in the history-buffer are sorted.
+- 'name: Sorting by name.
+- 'extension: Sorting first by extension and then by name.
+- nil: No sorting, means the most recently used buffers are on the top of the
+       history and the seldom used buffers at the bottom.
+See also `ecb-history-sort-ignore-case'."
+  :group 'ecb-sources
+  :type '(radio (const :tag "By name"
+                       :value name)
+                (const :tag "By extension"
+                       :value extension)
+                (const :tag "No sorting"
+                       :value nil)))
+
+(defcustom ecb-history-sort-ignore-case t
+  "*Ignore case for sorting the history-entries.
+See also `ecb-history-sort-method'."
   :group 'ecb-history
   :type 'boolean)
 
 
 
 (defun ecb-expand-directory-tree (path node)
+  "Expands the directory part so the node representing PATH is visible.
+Start with the childrens of NODE. Return not nil when an expansion has been
+done \(so normally the tree-buffer must be rebuild). Return nil if the
+expansion-state of the tree can show without any further expansion the node
+representing PATH."
   (catch 'exit
     (dolist (child (tree-node-get-children node))
       (let ((data (tree-node-get-data child)))
         (when (and (>= (length path) (length data))
-                   (string= (substring path 0 (length data)) data)
+                   (ecb-string= (substring path 0 (length data)) data)
                    (or (= (length path) (length data))
                        (eq (elt path (length data)) ecb-directory-sep-char)))
-          (let ((was-expanded (tree-node-is-expanded child)))
+          (let ((was-expanded (or (not (tree-node-is-expandable child))
+                                  (tree-node-is-expanded child))))
             (tree-node-set-expanded child t)
             (ecb-update-directory-node child)
             (throw 'exit
   "Return the related source-exclude-include-regexps of
 `ecb-source-file-regexps' if DIR matches any directory-regexp in
 `ecb-source-file-regexps'."
-  (catch 'exit
-    (dolist (elem ecb-source-file-regexps)
-      (let ((case-fold-search t))
-        (save-match-data
-          (if (string-match (car elem) dir)
-              (throw 'exit (cdr elem))))
-        nil))))
+  (ecb-match-regexp-list dir ecb-source-file-regexps 'car 'cdr))
 
 
 (defun ecb-files-from-cvsignore (dir)
 
 (defun ecb-check-directory-for-cvsignore-exclude (dir)
   "Return not nil if DIR matches a regexp in `ecb-sources-exclude-cvsignore'."
-  (catch 'exit
-    (dolist (elem ecb-sources-exclude-cvsignore)
-      (let ((case-fold-search t))
-        (save-match-data
-          (if (string-match elem dir)
-              (throw 'exit elem)))
-        nil))))
+  (ecb-match-regexp-list dir ecb-sources-exclude-cvsignore))
 
-                                                   
+(defun ecb-get-sources-sort-function (sort-method &optional ignore-case)
+  "According to SORT-METHOD \(which can either be 'name, 'extension or nil)
+and IGNORE-CASE return a function which can be used as argument for `sort'."
+  (cond ((equal sort-method 'name)
+         (function (lambda (a b)
+                     (ecb-string< a b ecb-sources-sort-ignore-case))))
+        ((equal sort-method 'extension)
+         (function
+          (lambda(a b)
+            (let ((ext-a (file-name-extension a t))
+                  (ext-b (file-name-extension b t)))
+              (if (ecb-string= ext-a ext-b ecb-sources-sort-ignore-case)
+                  (ecb-string< a b ecb-sources-sort-ignore-case)
+                (ecb-string< ext-a ext-b ecb-sources-sort-ignore-case))))))
+        (t (function (lambda (a b)
+                       nil)))))
+
+
 (defun ecb-get-files-and-subdirs (dir)
   "Return a cons cell where car is a list of all files to display in DIR and
 cdr is a list of all subdirs to display in DIR. Both lists are sorted
       (let ((files (directory-files (ecb-fix-path dir) nil nil t))
             (source-regexps (or (ecb-check-directory-for-source-regexps
                                  (ecb-fix-filename dir))
-                                '("" "")))
+                                '(("") (""))))
             (cvsignore-files (if (ecb-check-directory-for-cvsignore-exclude dir)
                                  (ecb-files-from-cvsignore dir)))
             sorted-files source-files subdirs cache-elem)
         ;; if necessary sort FILES
         (setq sorted-files
-              (cond ((equal ecb-sources-sort-method 'name)
-                     (sort files 'string<))
-                    ((equal ecb-sources-sort-method 'extension)
-                     (sort files (function
-                                  (lambda(a b)
-                                    (let ((ext-a (file-name-extension a t))
-                                          (ext-b (file-name-extension b t)))
-                                      (if (string= ext-a ext-b)
-                                          (string< a b)
-                                        (string< ext-a ext-b)))))))
-                    (t files)))
+              (if ecb-sources-sort-method
+                  (sort files (ecb-get-sources-sort-function
+                               ecb-sources-sort-method))
+                files))
         ;; divide real files and subdirs. For really large directories (~ >=
         ;; 2000 entries) this is the performance-bottleneck in the
         ;; file-browser of ECB.
         (dolist (file sorted-files)
           (if (file-directory-p (ecb-fix-filename dir file))
-              (if (not (string-match ecb-excluded-directories-regexp file))
-                  (setq subdirs (append subdirs (list file))))
-            (if (and (not (member file cvsignore-files))
-                     (or (string-match (cadr source-regexps) file)
-                         (not (string-match (car source-regexps) file))))
-                (setq source-files (append source-files (list file))))))
+              (when (not (ecb-check-dir-exclude file))
+                (when (ecb-string= file "C:/System Volume Information" t) ;; (not (file-accessible-directory-p file))
+                  (ecb-merge-face-into-text file
+                                            ecb-directory-not-accessible-face))
+                (setq subdirs (append subdirs (list file))))
+            (when (and (not (member file cvsignore-files))
+                       (or (ecb-match-regexp-list file (cadr source-regexps))
+                           (not (ecb-match-regexp-list file (car source-regexps)))))
+              (when (not (file-writable-p file))
+                (ecb-merge-face-into-text file ecb-source-read-only-face))
+              (setq source-files (append source-files (list file))))))
         
         (setq cache-elem (cons dir (cons source-files subdirs)))
         ;; check if this directory must be cached
            (ecb-sources-cache-add-full ecb-path-selected-directory
                                        new-cache-elem))))
            
-     (when (not (string= dir-before-update ecb-path-selected-directory))
+     (when (not (ecb-string= dir-before-update ecb-path-selected-directory))
        (tree-buffer-scroll (point-min) (point-min))))))
 
 (defun ecb-sources-filter-by-ext (ext-str)
   (interactive)
   (let ((choice (ecb-query-string "Filter sources by:"
                                   '("extension" "regexp" "nothing"))))
-    (cond ((string= choice "extension")
+    (cond ((ecb-string= choice "extension")
            (ecb-sources-filter-by-ext
             (read-string "Insert the filter-extension without leading dot: ")))
-          ((string= choice "regexp")
+          ((ecb-string= choice "regexp")
            (ecb-sources-filter-by-regexp))
           (t (ecb-apply-filter-to-sources-buffer nil)))))
 
   ;; displayed in the mode-line. See `ecb-sources-filter-modeline-prefix'.
   (ecb-mode-line-format))
 
+(defun ecb-matching-source-paths (path-to-match &optional sorted)
+  "Return all source-paths of `ecb-source-path' which match PATH-TO-MATCH. If
+SORTED is not nil then the paths are sorted by descending length, means the
+longest path \(which is the best matching) is the first elem and the shortest
+path the last elem. Otherwise the matching paths are returned in that sequence
+they occur in `ecb-source-paths'."
+  (let* ((p-t-m (ecb-fix-filename path-to-match))
+         (normed-current-source-paths
+          (mapcar (function (lambda (elem)
+                              (ecb-fix-filename (if (listp elem) (car elem) elem))))
+                  (append (ecb-get-source-paths-from-functions)
+                          ecb-source-path)))
+         (matching-paths
+          (delq nil
+                (mapcar (lambda (elem)
+                          (save-match-data
+                            (if (string-match (concat "^" (regexp-quote elem))
+                                              p-t-m)
+                                elem)))
+                        normed-current-source-paths))))
+    (if (not sorted)
+        matching-paths
+      (sort matching-paths
+            (lambda (lhs rhs)
+              (> (length lhs) (length rhs)))))))
+
+(defun ecb-get-best-matching-source-path ()
+  "Return the best-matching source-path for the current selected source."
+  (car (ecb-matching-source-paths ecb-path-selected-source t)))
+
 (defun ecb-set-selected-directory (path &optional force)
   "Set the contents of the ECB-directories and -sources buffer correct for the
 value of PATH. If PATH is equal to the value of `ecb-path-selected-directory'
       ;; if ecb-path-selected-directory has not changed then there is no need
       ;; to do anything here because neither the content of directory buffer
       ;; nor the content of the sources buffer can have been changed!
-      (when (or force (not (string= last-dir ecb-path-selected-directory)))
+      (when (or force (not (ecb-string= last-dir ecb-path-selected-directory)))
         (when (or (not (ecb-show-sources-in-directories-buffer-p))
                   ecb-auto-expand-directory-tree)
           (ecb-exec-in-directories-window
-           (let (start)
+           (let (start was-expanded)
              (when ecb-auto-expand-directory-tree
                ;; Expand tree to show selected directory
                (setq start
                      (if (equal ecb-auto-expand-directory-tree 'best)
                          ;; If none of the source-paths in the buffer
                          ;; `ecb-directories-buffer-name' matches then nil
-                         ;; otherwise the node of the best matching source-path
-                         (cdar (sort (delete nil
-                                             (mapcar (lambda (elem)
-                                                       (let ((data (tree-node-get-data elem)))
-                                                         (save-match-data
-                                                           (if (string-match
-                                                                (concat "^"
-                                                                        (regexp-quote data))
-                                                                ecb-path-selected-directory)
-                                                               (cons data elem)
-                                                             nil))))
-                                                     (tree-node-get-children (tree-buffer-get-root))))
-                                     (lambda (lhs rhs)
-                                       (> (length (car lhs)) (length (car rhs))))))
+                         ;; otherwise the node of the best matching
+                         ;; source-path
+                         (let ((best-source-path
+                                (car (ecb-matching-source-paths
+                                      ecb-path-selected-directory t))))
+                           (if best-source-path
+                               (tree-buffer-find-node-data
+                                (ecb-fix-filename best-source-path))))
                        ;; we start at the root node
                        (tree-buffer-get-root)))
                (when (and (equal ecb-auto-expand-directory-tree 'best)
                           start)
+                 (setq was-expanded (or (not (tree-node-is-expandable start))
+                                        (tree-node-is-expanded start)))
                  ;; expand the best-match node itself
                  (tree-node-set-expanded start t)
-                 ;; This functions ensures a correct expandable-state of
+                 ;; This function ensures a correct expandable-state of
                  ;; start-node
                  (ecb-update-directory-node start))
                ;; start recursive expanding of either the best-matching node or
                ;; the root-node itself.
-               (ecb-expand-directory-tree ecb-path-selected-directory
-                                          (or start
-                                              (tree-buffer-get-root)))
-               (tree-buffer-update))
+               (if (or (ecb-expand-directory-tree ecb-path-selected-directory
+                                                  (or start
+                                                      (tree-buffer-get-root)))
+                       (not was-expanded))
+                   (tree-buffer-update)
+                 (tree-buffer-recenter start (selected-window))))
+;;              (ecb-expand-directory-tree ecb-path-selected-directory
+;;                                           (or start
+;;                                               (tree-buffer-get-root)))
+;;                (tree-buffer-update))
              (when (not (ecb-show-sources-in-directories-buffer-p))
                (tree-buffer-highlight-node-data ecb-path-selected-directory
                                                 start)))))
 
 (defun ecb-add-all-buffers-to-history ()
   "Add all current file-buffers to the history-buffer of ECB.
-If `ecb-sort-history-items' is not nil then afterwards the history is sorted
-alphabetically. Otherwise the most recently used buffers are on the top of the
-history and the seldom used buffers at the bottom."
+Dependend on the value of `ecb-history-sort-method' afterwards the history is
+sorted either by name or by extension. If `ecb-history-sort-method' is nil the
+most recently used buffers are on the top of the history and the seldom used
+buffers at the bottom."
   (interactive)
   (ecb-reset-history-filter)
   (ecb-add-buffers-to-history))
   (save-excursion
     (ecb-buffer-select ecb-history-buffer-name)
     (tree-node-remove-child-data (tree-buffer-get-root) filename)
-    (when (funcall (car ecb-history-filter)
-                   filename)
+    (when (and (not (ecb-check-filename-for-history-exclude filename))
+               (funcall (car ecb-history-filter) filename))
       (tree-node-add-child-first
        (tree-buffer-get-root)
        (tree-node-new
 
 
 (defun ecb-sort-history-buffer ()
-  "Sort the history buffer according to `ecb-sort-history-items'."
-  (when ecb-sort-history-items
+  "Sort the history buffer according to `ecb-history-sort-method'."
+  (when ecb-history-sort-method
     (save-excursion
       (ecb-buffer-select ecb-history-buffer-name)
       (tree-node-sort-children
        (tree-buffer-get-root)
-       (function (lambda (l r) (string< (tree-node-get-name l)
-                                        (tree-node-get-name r))))))))
+       (cond ((equal ecb-history-sort-method 'name)
+              (function (lambda (l r)
+                          (ecb-string< (tree-node-get-name l)
+                                       (tree-node-get-name r)
+                                       ecb-history-sort-ignore-case))))
+             ((equal ecb-history-sort-method 'extension)
+              (function
+               (lambda (l r)
+                 (let* ((a (tree-node-get-name l))
+                        (b (tree-node-get-name r))
+                        (ext-a (file-name-extension a t))
+                        (ext-b (file-name-extension b t)))
+                   (if (ecb-string= ext-a ext-b ecb-history-sort-ignore-case)
+                       (ecb-string< a b ecb-history-sort-ignore-case)
+                     (ecb-string< ext-a ext-b ecb-history-sort-ignore-case))))))
+             (t (function (lambda (a b)
+                            nil))))))))
 
 
 (defun ecb-update-history-window (&optional filename)
      (tree-buffer-highlight-node-data filename))))
 
 (defun ecb-set-selected-source (filename other-edit-window
-					 no-edit-buffer-selection)
+					 no-edit-buffer-selection hide)
   "Updates all the ECB buffers and loads the file. The file is also
-displayed unless NO-EDIT-BUFFER-SELECTION is set to non nil. In such case
-the file is only loaded invisible in the background, all semantic-parsing
-and ECB-Buffer-updating is done but the content of the main-edit window
-is not changed. For the allowed values of OTHER-EDIT-WINDOW see
-`ecb-combine-ecb-button/edit-win-nr'."
+displayed unless NO-EDIT-BUFFER-SELECTION is set to non nil. In such case the
+file is only loaded invisible in the background, all semantic-parsing and
+ECB-Buffer-updating is done but the content of the main-edit window is not
+changed. For the allowed values of OTHER-EDIT-WINDOW see
+`ecb-combine-ecb-button/edit-win-nr'. If HIDE is not nil then ECB hides the
+ecb-windows after displaying the file in an edit-window."
   (ecb-select-source-file filename)
   (if no-edit-buffer-selection
       ;; load the selected source in an invisible buffer, do all the
 			       other-edit-window)
     (ecb-update-methods-buffer--internal 'scroll-to-begin)
     (setq ecb-major-mode-selected-source major-mode)
-    (ecb-tag-sync 'force)))
+    (ecb-tag-sync 'force)
+    (if hide
+        (ecb-hide-ecb-windows))))
+             
 
 (defun ecb-clear-history ()
   "Clears the ECB history-buffer."
        (tree-buffer-highlight-node-data ecb-path-selected-source)))))
 
 
-(defun ecb-tree-node-add-files
+ (defun ecb-tree-node-add-files
   (node path files type include-extension old-children
         &optional not-expandable)
   "For every file in FILES add a child-node to NODE."
                        file
                      (file-name-sans-extension file)))
            (displayed-file file-1))
-      ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: Hier wenn dann den
-      ;; empty-check einbauen wenn type = 0!
       (tree-node-add-child
        node
        (ecb-new-child
     rpaths))
 
 
-(defun ecb-path-matching-any-source-path-p (path)
-  (let ((source-paths (append (ecb-get-source-paths-from-functions)
-                              ecb-source-path)))
-    (catch 'exit
-      (dolist (dir source-paths)
-        (let ((norm-dir (ecb-fix-filename (if (listp dir) (car dir) dir) nil t)))
-          (save-match-data
-            (if (string-match (regexp-quote norm-dir)
-                              (ecb-fix-filename (file-name-directory path)))
-                (throw 'exit norm-dir)))
-          nil)))))
-
-
 (defun ecb-update-directories-buffer ()
   "Updates the ECB directories buffer."
   (interactive)
 	   (let* ((path (if (listp dir) (car dir) dir))
 		  (norm-dir (ecb-fix-filename path nil t))
 		  (name (if (listp dir) (cadr dir) norm-dir)))
-	     (tree-node-add-child
-	      node
-              ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: Hier wenn dann den
-              ;; empty-check einbauen!
-	      (ecb-new-child old-children name 2 norm-dir
-                             (ecb-check-emptyness-of-dir norm-dir)
-			     (if ecb-truncate-long-names 'beginning)))))
+             (if (file-accessible-directory-p norm-dir)
+                 (tree-node-add-child
+                  node
+                  (ecb-new-child old-children name 2 norm-dir
+                                 (ecb-check-emptyness-of-dir norm-dir)
+                                 (if ecb-truncate-long-names 'beginning)))
+               (if (listp dir)
+                   (ecb-warning "Source-path %s with alias %s is not accessible - ignored!"
+                                norm-dir (cadr dir))
+                 (ecb-warning "Source-path %s is not accessible - ignored!" norm-dir)))))
          (tree-buffer-update))))))
 
 
-;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: DAS TESTEN TESTEN TESTEN
 (defvar ecb-directory-empty-cache nil
   "Cache for every directory if it is empty or not. This is an alist where an
 element looks like:
                (equal (cdr cache-value) show-sources))
           (car cache-value)
         (ecb-directory-empty-cache-remove dir)
-        (let ((entries (directory-files dir nil nil t))
+        (let ((entries (and (file-accessible-directory-p dir)
+                            (directory-files dir nil nil t)))
               (just-files-means-empty (not show-sources))
               (full-file-name nil)
               (empty-p nil))
 a node with matching TYPE and DATA in OLD-CHILDREN. If found no new node is
 created but only the fields of this node will be updated. Otherwise a new node
 is created."
-  ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: Here we prescan for emptyness
-  ;; of directories in case DATA is a directory. We do this with
-  ;; `ecb-get-files-and-subdirs' because:
-  ;; - only this function takes all ecb-options into account which influences
-  ;;   the display of certain directories or files
-  ;; - this function gets its informations from a fast cache access if
-  ;;   possible
-  ;; - stores autom. all scanned directories in its cache so for the next time
-  ;;   the access is as fast as possible.
-  ;; Nevertheless this mechanism increases the time ECB now needs when
-  ;; clicking onto a directory or expanding a directory - the real loss of
-  ;; time depends on the number of entries for the directory of DATA! So it
-  ;; would be good if we good enhance this! The best would be a fast routine
-  ;; which checks only if a directory contains subdirs and/or files and then
-  ;; we give 'ecb-get-files-and-subdirs' a new argument which tells this
-  ;; function if only the dir should be checked for emptyness or if a full
-  ;; files- and subdirs-contents-access should be made. But i doubt if this is
-  ;; possible.
-  ;; When all this performs fast enough then we make an customizable option
-  ;; for `ecb-prescan-directories-for-emptyness'
-;;   (if (and ecb-prescan-directories-for-emptyness
-;;            (file-directory-p data))
-;;       (let ((files-and-subdirs (ecb-get-files-and-subdirs data)))
-;;         (if (and (= (length (cdr files-and-subdirs)) 0)
-;;                  (or (not (ecb-show-sources-in-directories-buffer-p))
-;;                      (= (length (car files-and-subdirs)) 0)))
-;;             (setq not-expandable t))))
-;;   (if (and ecb-prescan-directories-for-emptyness
-;;            (file-directory-p data)
-;;            (ecb-check-emptyness-of-dir data))
-;;       (setq not-expandable t))
   (catch 'exit
     (dolist (child old-children)
       (when (and (equal (tree-node-get-data child) data)
     (ecb-update-directories-buffer)
     (if (and (not no-prompt-for-future-session)
              (y-or-n-p "Add the new source-path also for future-sessions? "))
-        (customize-save-variable 'ecb-source-path ecb-source-path)
+        (ecb-customize-save-variable 'ecb-source-path ecb-source-path)
       (customize-set-variable 'ecb-source-path ecb-source-path))))
 
 (tree-buffer-defpopup-command ecb-add-source-path-node
                              ecb-source-path))
       (ecb-update-directories-buffer)
       (if (y-or-n-p "Delete source-path also for future-sessions? ")
-          (customize-save-variable 'ecb-source-path ecb-source-path)
+          (ecb-customize-save-variable 'ecb-source-path ecb-source-path)
         (customize-set-variable 'ecb-source-path ecb-source-path)))))
 
 
        (ecb-speedbar-update-contents)))
 
 
-(defun ecb-directory-clicked (node ecb-button edit-window-nr shift-mode)
+(defun ecb-directory-clicked (node ecb-button edit-window-nr shift-mode meta-mode)
   "Handle clicking onto NODE in the directories-buffer. ECB-BUTTON can be 1, 2
 or 3. If 3 then EDIT-WINDOW-NR contains the number of the edit-window the NODE
 should be displayed. For 1 and 2 the value of EDIT-WINDOW-NR is ignored."
 ;;            (tree-buffer-update node)))
       (ecb-set-selected-source (tree-node-get-data node)
                                (ecb-combine-ecb-button/edit-win-nr ecb-button edit-window-nr)
-			       shift-mode))))
+			       shift-mode meta-mode))))
 
 
-(defun ecb-source-clicked (node ecb-button edit-window-nr shift-mode)
+(defun ecb-source-clicked (node ecb-button edit-window-nr shift-mode meta-mode)
   "Handle clicking onto NODE in the sources-buffer. ECB-BUTTON can be 1, 2 or
 3. If 3 then EDIT-WINDOW-NR contains the number of the edit-window the NODE
 should be displayed. For 1 and 2 the value of EDIT-WINDOW-NR is ignored."
       (ecb-mouse-over-source-node node nil nil 'force))
   (ecb-set-selected-source (tree-node-get-data node)
                            (ecb-combine-ecb-button/edit-win-nr ecb-button edit-window-nr)
-			   shift-mode))
+			   shift-mode meta-mode))
 
 
-(defun ecb-history-clicked (node ecb-button edit-window-nr shift-mode)
+(defun ecb-history-clicked (node ecb-button edit-window-nr shift-mode meta-mode)
   "Handle clicking onto NODE in the history-buffer. ECB-BUTTON can be 1, 2 or
 3. If 3 then EDIT-WINDOW-NR contains the number of the edit-window the NODE
 should be displayed. For 1 and 2 the value of EDIT-WINDOW-NR is ignored."
       (ecb-mouse-over-history-node node nil nil 'force))
   (ecb-set-selected-source (tree-node-get-data node)
                            (ecb-combine-ecb-button/edit-win-nr ecb-button edit-window-nr)
-                           shift-mode))
+                           shift-mode meta-mode))
 
 (defun ecb-expand-directory-nodes (level)
   "Set the expand level of the nodes in the ECB-directories-buffer.
                                                        ecb-directories-buffer-name)
                              (and (not (equal (ecb-show-node-info-when ecb-directories-buffer-name)
                                               'never))
-                                  (not (string= (tree-node-get-data node)
-                                                (tree-node-get-name node)))
+                                  (not (ecb-string= (tree-node-get-data node)
+                                                    (tree-node-get-name node)))
                                   (eq (tree-node-get-parent node)
                                       (tree-buffer-get-root))))
                      (if (equal (ecb-show-node-info-what ecb-directories-buffer-name)
   "Open current source-file the 1. edit-window."
   ;; We can use `ecb-source-clicked' for history-buffer too because shift-mode
   ;; is nil.
-  (ecb-source-clicked node 3 1 nil))
+  (ecb-source-clicked node 3 1 nil nil))
 (tree-buffer-defpopup-command ecb-open-source-in-editwin2
   "Open current source-file the 2. edit-window."
-  (ecb-source-clicked node 3 2 nil))
+  (ecb-source-clicked node 3 2 nil nil))
 (tree-buffer-defpopup-command ecb-open-source-in-editwin3
   "Open current source-file the 3. edit-window."
-  (ecb-source-clicked node 3 3 nil))
+  (ecb-source-clicked node 3 3 nil nil))
 (tree-buffer-defpopup-command ecb-open-source-in-editwin4
   "Open current source-file the 4. edit-window."
-  (ecb-source-clicked node 3 4 nil))
+  (ecb-source-clicked node 3 4 nil nil))
 (tree-buffer-defpopup-command ecb-open-source-in-editwin5
   "Open current source-file the 5. edit-window."
-  (ecb-source-clicked node 3 5 nil))
+  (ecb-source-clicked node 3 5 nil nil))
 (tree-buffer-defpopup-command ecb-open-source-in-editwin6
   "Open current source-file the 6. edit-window."
-  (ecb-source-clicked node 3 6 nil))
+  (ecb-source-clicked node 3 6 nil nil))
 (tree-buffer-defpopup-command ecb-open-source-in-editwin7
   "Open current source-file the 7. edit-window."
-  (ecb-source-clicked node 3 7 nil))
+  (ecb-source-clicked node 3 7 nil nil))
 (tree-buffer-defpopup-command ecb-open-source-in-editwin8
   "Open current source-file the 8. edit-window."
-  (ecb-source-clicked node 3 8 nil))
+  (ecb-source-clicked node 3 8 nil nil))
 
 (defun ecb-dir/source/hist-menu-editwin-entries ()
   "Generate popup-menu-entries for each edit-window if there are at least 2
   (interactive)
   (let ((choice (ecb-query-string "Filter history by:"
                                   '("extension" "regexp" "no filter"))))
-    (cond ((string= choice "extension")
+    (cond ((ecb-string= choice "extension")
            (ecb-history-filter-by-ext
             (read-string "Insert the filter-extension without leading dot: ")))
-          ((string= choice "regexp")
+          ((ecb-string= choice "regexp")
            (ecb-history-filter-by-regexp))
           (t (ecb-add-all-buffers-to-history)))))
 
   (tree-buffer-create
    ecb-directories-buffer-name
    ecb-frame
+   ecb-tree-mouse-action-trigger
    'ecb-interpret-mouse-click
    'ecb-tree-buffer-node-select-callback
    'ecb-tree-buffer-node-expand-callback
   (tree-buffer-create
    ecb-sources-buffer-name
    ecb-frame
+   ecb-tree-mouse-action-trigger
    'ecb-interpret-mouse-click
    'ecb-tree-buffer-node-select-callback
    'ecb-tree-buffer-node-expand-callback
    'ecb-mouse-over-source-node
    'equal
    nil
-   nil                     ;(list 0) ;; set this list if you want leaf-symbols
+   ;; set this list if you want leaf-symbols TODO: Klaus Berndl
+   ;; <klaus.berndl@sdm.de>: If we want to display the VC-state in the
+   ;; sources-icon then we should set this argument to nil because then we
+   ;; must compute the needed icon in the file-browser and not in the
+   ;; tree-buffer-library (analogue to the methods-icons computet in the
+   ;; methods-browser).
+   nil ;; (list 0)
    'ecb-sources-menu-creator
    (list (cons 0 ecb-sources-menu-title-creator))
    (nth 1 ecb-truncate-lines)
   (tree-buffer-create
    ecb-history-buffer-name
    ecb-frame
+   ecb-tree-mouse-action-trigger
    'ecb-interpret-mouse-click
    'ecb-tree-buffer-node-select-callback
    'ecb-tree-buffer-node-expand-callback
 already the current values of all ECB options, the current backtrace-buffer if
 there is any and the current message-buffer. You will be asked for a
 problem-report subject and then you must insert a description of the problem.
-Please describe the problem as detailed as possible!"
+Please describe the problem as detailed as possible!
+
+*IMPORTANT*: Cause of extra appearance of SPAM in the mailing-lists,
+SourceForge has changed its policy: Now it is only possible to post to the
+mailing-list for users who have subscribed this mailing-list. So please be
+aware you will not be able to send comments, bug reports and improvement
+suggestions before you have subscribed the ECB-mailing-list. See the section
+\"Mailing-list\" at the ECB-website at http://ecb.sourceforge.net how to do
+this."
+
   (interactive)
   (when (or ecb-minor-mode
             (y-or-n-p "ECB should be active when submitting a problem-report. Force report? "))
         (insert "There was no *ecb-tag-dump* buffer" ))
       (insert "\n-----------------------------------------------------\n\n")
 
+      ;;insert the contents of the trace-output buffer if it is there. 
+;;       (insert "\n\n-----------------------------------------------------\n")
+;;       (if tag-dump-buffer
+;;           (progn
+;;             (insert "The contents of the *ecb-tag-dump* buffer were\n\n")
+;; 	    (insert-buffer tag-dump-buffer)
+;;             ;; we must force the mark
+;; 	    (goto-char (mark t))
+;;             (insert "\nEnd Insert *ecb-tag-dump* buffer" ))
+;;         (insert "There was no *ecb-tag-dump* buffer" ))
+;;       (insert "\n-----------------------------------------------------\n\n")
+
       ;;insert the contents of the backtrace buffer if it is there. 
       (insert "\n\n-----------------------------------------------------\n")
       (if backtrace-buffer
                                     ,(if (boundp 'ediff-quit-hook)
                                          'ediff-quit-hook)))
                           (function (lambda (l r)
-                                      (string< (symbol-name l)
-                                               (symbol-name r))))))
+                                      (ecb-string< (symbol-name l)
+                                                   (symbol-name r))))))
         (semantic-vars (sort (delete nil
                                      `(semantic-after-toplevel-cache-change-hook
                                        semantic-after-partial-cache-change-hook
                                        semantic-uml-colon-string
                                        semantic-orphaned-member-metaparent-type))
                              (function (lambda (l r)
-                                         (string< (symbol-name l)
-                                                  (symbol-name r))))))
+                                         (ecb-string< (symbol-name l)
+                                                      (symbol-name r))))))
         (speedbar-vars (sort '(speedbar-dynamic-tags-function-list
                                speedbar-tag-hierarchy-method
                                speedbar-tag-group-name-minimum-length
                                speedbar-fetch-etags-arguments
                                speedbar-fetch-etags-parse-list)
                              (function (lambda (l r)
-                                         (string< (symbol-name l)
-                                                  (symbol-name r))))))
+                                         (ecb-string< (symbol-name l)
+                                                      (symbol-name r))))))
         (ecb-options (mapcar
                       'intern
                       (sort
                        (let (completion-ignore-case)
                          (all-completions "ecb-" obarray 'user-variable-p))
-                       'string-lessp)))
+                       'ecb-string<)))
         (ecb-internal-vars (sort '(ecb-path-selected-directory
                                    ecb-path-selected-source
                                    ecb-use-semantic-grouping
                                    ecb-windows-hidden
                                    ecb-toggle-layout-state
                                    ecb-current-maximized-ecb-buffer-name
-                                   ecb-tree-buffers-of-current-layout)
+                                   ecb-special-ecb-buffers-of-current-layout)
                                  (function (lambda (l r)
-                                             (string< (symbol-name l)
-                                                      (symbol-name r)))))))
+                                             (ecb-string< (symbol-name l)
+                                                          (symbol-name r)))))))
     (append emacs-vars semantic-vars speedbar-vars
             ecb-internal-vars ecb-options)))
 
 (silentcomp-defun jde-open-get-path-prefix-list)
 (silentcomp-defun jde-open-find-java-file-name)
 (silentcomp-defun jde-gen-class-buffer)
+(silentcomp-defvar jde-sourcepath)
 
 (require 'ecb-util)
 (require 'ecb-layout)
 (require 'ecb-file-browser)
 (require 'ecb-method-browser)
 
+
+(defgroup ecb-jde-integration nil
+  "Settings for the JDEE-integration in the Emacs code browser."
+  :group 'ecb
+  :prefix "ecb-jde-")
+
+
+(defcustom ecb-jde-set-directories-buffer-to-jde-sourcepath nil
+  "*THIS FEATURE IS NOT YET FINISHED"
+  :group 'ecb-jde-integration
+  :type '(radio (const :tag "No" :value nil)
+                (const :tag "Add" :value add)
+                (const :tag "Replace" :value replace)))
+
 (defun ecb-jde-display-class-at-point ()
   "Displays in the ECB-methods-buffer contents of class under point.
 This means displays the contents \(methods, attributes etc...) of the class
                   ;; we have found the java-sourcefile. So let�s display its
                   ;; contents in the method-buffer of ECB
                   (ecb-exec-in-methods-window
-                   (ecb-set-selected-source java-file-name nil t))))
+                   (ecb-set-selected-source java-file-name nil t nil))))
             
             (ecb-error "Can not parse the thing at point!")))
       (message "You need JDE >= 2.2.6 and Senator for using this feature!"))))
         (jde-gen-class-buffer file)
       (find-file file))))
 
+
+(defun ecb-jde-get-source-path ()
+  (mapcar 'jde-normalize-path jde-sourcepath))
+
+(defun ecb-jde-update-ecb-source-paths ()
+  (interactive)
+  (cond ((equal ecb-jde-set-directories-buffer-to-jde-sourcepath 'add)
+         (add-hook 'ecb-source-path-functions
+                   'ecb-jde-get-source-path))
+        ((equal ecb-jde-set-directories-buffer-to-jde-sourcepath 'replace)
+         (setq ecb-source-path (ecb-jde-get-source-path)))
+        (t
+         (remove-hook 'ecb-source-path-functions
+                      'ecb-jde-get-source-path)))
+  (ecb-update-directories-buffer))
+
+
 (when (locate-library "efc")
   (require 'efc)
   (if (boundp 'efc-dialog-show-before-hook)

File ecb-layout.el

 (silentcomp-defvar window-size-fixed)
 (silentcomp-defun fit-window-to-buffer)
 (silentcomp-defvar temp-buffer-resize-mode)
+(silentcomp-defun temp-buffer-resize-mode)
+
+;; Emacs 21
+(silentcomp-defvar grep-window-height)
 
 (eval-when-compile
   ;; to avoid compiler grips
                                 value))))
   :type 'string)
 
+(defun ecb-enable-temp-buffer-shrink-to-fit (arg)
+  "Enables `temp-buffer-resize-mode' \(GNU Emacs) rsp.
+`temp-buffer-shrink-to-fit' \(XEmacs) when a comile-window is used. When the
+compile-window is disabled or when ECB is deactivated then the old state of
+these modes/variables is restored."
+  (if arg
+      (progn
+        ;; store old value if not already done
+        (or (get 'ecb-enable-temp-buffer-shrink-to-fit
+                 'ecb-old-temp-buffer-shrink-to-fit)
+            (put 'ecb-enable-temp-buffer-shrink-to-fit
+                 'ecb-old-temp-buffer-shrink-to-fit
+                 (cons 'stored
+                       (if ecb-running-xemacs
+                           temp-buffer-shrink-to-fit
+                         temp-buffer-resize-mode))))
+        ;; now we activate temp-buffer-shrinking
+        (if ecb-running-xemacs
+            (setq temp-buffer-shrink-to-fit t)
+          (temp-buffer-resize-mode 1))
+        )
+    ;; reset to the original value
+    (and (get 'ecb-enable-temp-buffer-shrink-to-fit
+              'ecb-old-temp-buffer-shrink-to-fit)
+         (if ecb-running-xemacs
+             (setq temp-buffer-shrink-to-fit
+                   (cdr (get 'ecb-enable-temp-buffer-shrink-to-fit
+                             'ecb-old-temp-buffer-shrink-to-fit)))
+           (temp-buffer-resize-mode
+            (if (cdr (get 'ecb-enable-temp-buffer-shrink-to-fit
+                          'ecb-old-temp-buffer-shrink-to-fit))
+                1
+              -1))))
+    (put 'ecb-enable-temp-buffer-shrink-to-fit
+         'ecb-old-temp-buffer-shrink-to-fit
+         nil)))
+
 (defcustom ecb-compile-window-height nil
   "*Height of the durable compilation-window of ECB.
 If you want a compilation window shown at the bottom of the ECB-layout
                    (when (and (boundp 'ecb-minor-mode)
                               ecb-minor-mode
                               (frame-live-p ecb-frame))
+                     (ecb-enable-temp-buffer-shrink-to-fit value)
                      (let ((curr-frame (selected-frame)))
                        (unwind-protect
                            (progn
   :type '(radio (const :tag "No compilation window" nil)
                 (number :tag "Window height" :value 6)))
 
+
+
 (defcustom ecb-compile-window-width 'frame
   "*Width of the compile-window.
 
                 (const :tag "Both of them" :value both)
                 (const :tag "Never" :value nil)))
 
+(defcustom ecb-maximize-ecb-window-after-selection nil
+  "*If not nil maximize current tree-window after selection.
+When selecting another not-tree-window after such an automatic maximizing all
+tree-windows of current layout are displayed again. But a tree-window is not
+maximized if either a node has been selected via primary- oder secondarc
+mouse-button or the popup-menu of that tree-buffer has been opened."
+  :group 'ecb-layout
+  :type 'boolean)
+
 ;; A value of never makes no sense because it is not much effort to prevent
 ;; all interactive shrinking commands (incl. mouse-commands) from shrinking it
 ;; below ecb-compile-window-height and it is also not worth. IMHO preventing
 If one of the special ecb-windows is selected then always the \"next\"
 ecb-window is choosen \(whereas the next ecb-window of the last ecb-window is
 the first ecb-window). In the context of an `other-window'-call the ARG of
-`other-window' will be taken into account.
+`other-window' will be taken into account. If there is only one ecb-window
+then ECB considers also the edit-windows!
 
 If the compile-window is selected then always the last selected edit-window
 will be used unless `other-window' has been called with a prefix-argument
   "Return a list of all current visible special dedicated ECB-windows
 \(starting from the left-most top-most window) in the order `other-window'
 would walk through these windows."
-  (let ((windows-list (or winlist
-                          (ecb-window-list ecb-frame 0
-                                           (frame-first-window ecb-frame)))))
+  (let ((windows-list (or winlist (ecb-canonical-windows-list))))
     (delete nil (mapcar (function (lambda (elem)
                                     (if (window-dedicated-p elem)
                                         elem)))
 These are all windows in the `ecb-frame' which are not identical to the
 compile-window and not identical to one of the visible ECB-windows."
   (let ((comp-win-state (ecb-compile-window-state))
-        (windows-list (or winlist
-                          (ecb-window-list ecb-frame 0
-                                           (frame-first-window ecb-frame)))))
+        (windows-list (or winlist (ecb-canonical-windows-list))))
     (delete nil (mapcar (function (lambda (elem)
                                     (if (and (not (window-dedicated-p elem))
                                              (or (not (equal comp-win-state 'visible))
 
 ;; ====== internal variables ====================================
 
-
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL
 (defvar ecb-frame nil
   "Frame where ECB runs. This frame is only set if this variable is nil or the
 value points to a dead frame. Deactivation and activation of ECB does not set
 (defvar ecb-edit-window nil
   "Only used internally by `ecb-redraw-layout-full'. Do not refer to this
 variable because the value is not predictable!")
+
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL
 (defvar ecb-last-edit-window-with-point nil
   "The edit-window of ECB which had the point before an emacs-command is
 done.")
+
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL
 (defvar ecb-last-source-buffer nil
   "The source-buffer of `ecb-last-edit-window-with-point'.")
+
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL
 (defvar ecb-last-compile-buffer-in-compile-window nil
   "The buffer in the compile-window before an emacs-command is done.")
+
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL
 (defvar ecb-compile-window nil
   "Window to display compile-output in.")
+
+;; We need this absolute # of lines of the compile-window-height because if it
+;; is specified by a fraction of the frame (e.g. 0.1) we need this information
+;; at all places where the compile-window will be shrunken back to its
+;; specified height and computing the height from the value of
+;; `ecb-compile-window-height' will often be unequal to that height drawn by
+;; `ecb-redraw-layout-full' ==> we store and use the height drawn by this
+;; function.
+(defvar ecb-compile-window-height-lines nil
+  "Contains always the absolute number of lines \(incl. modeline) of the
+compile-window direct after a full redraw. Only set by
+`ecb-redraw-layout-full' and evaluated and used by *all* mechanisms of ECB
+which shrink back the compile-window to its specified height without doing a
+full redraw!!")
+
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL
 (defvar ecb-compile-window-was-selected-before-command nil
   "Not nil only if the `ecb-compile-window' was selected before most recent
 command.")
+
+(defvar ecb-layout-default-window-sizes nil
+  "Contains the the sizes of the ecb-windows of the current layout exactly as
+drawn by the layout-function \(see `ecb-redraw-layout-full').")
+
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL
 (defvar ecb-windows-hidden nil
   "Used with `ecb-toggle-ecb-windows'. If true the ECB windows are hidden. Do
 not change this variable!")
-(defvar ecb-tree-buffers-of-current-layout nil)
+
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL ???
+(defvar ecb-special-ecb-buffers-of-current-layout nil)
 
 (defun ecb-initialize-layout ()
   ;; We do not initialize the `ecb-frame'!
         ecb-last-compile-buffer-in-compile-window nil
         ecb-current-maximized-ecb-buffer-name nil
         ecb-cycle-ecb-buffer-state nil
-        ecb-tree-buffers-of-current-layout nil
+        ecb-special-ecb-buffers-of-current-layout nil
         ecb-windows-hidden nil
         ecb-compile-window nil
         ecb-layout-prevent-handle-compile-window-selection nil
         ecb-layout-prevent-handle-ecb-window-selection nil
         ecb-ecb-window-was-selected-before-command nil
-        ecb-compile-window-was-selected-before-command nil)
+        ecb-compile-window-was-selected-before-command nil
+        ecb-compile-window-height-lines nil)
   (ecb-window-config-cache-clear))
 
 (defun ecb-layout-debug-error (&rest args)
 
 (require 'compile)
 
-;; TODO: Klaus Berndl <klaus.berndl@sdm.de>:
-;; The new variables `grep-window-height', `grep-auto-highlight', and
-;; `grep-scroll-output' can beused to override the corresponding compilation mode
-;; settings for grep commands. This is new in Emacs 21.4 so we have to handle it!
-
+;; GNU Emacs 21.4 has has a new variable `grep-window-height'. Cause of the
+;; smart mechanism of the new compile-library of Emacs 21.4 which sets autom.
+;; for all compilation-* variables local values in the derived modes (like
+;; `grep-mode) according to the value of the equivalent variable in the
+;; derived mode (e.g. if `grep-window-height' has a special value in
+;; `grep-mode' then the new macro `define-compilation-mode' sets the local
+;; value of `compilation-window-height' to the value of `grep-window-height').
+;; we have not to deal with special variables like `grep-window-height' (see
+;; `define-compilation-mode') in the functions `compilation-set-window-height'
+;; and `ecb-toggle-compile-window-height'!
 (defadvice compilation-set-window-height (around ecb)
   "Makes the function compatible with ECB."
-;;   (if (or (not (equal (window-frame (ad-get-arg 0)) ecb-frame))
   (if (not (equal (window-frame (ad-get-arg 0)) ecb-frame))
       (ecb-with-original-basic-functions
        (ecb-with-original-functions
         (ecb-toggle-compile-window-height -1)
       ;; we prevent to shrink the compile-window below
       ;; `ecb-compile-window-height'
-      (let* ((compile-window-height-lines (ignore-errors
-                                            (ecb-normalize-number
-                                             ecb-compile-window-height
-                                             (1- (frame-height)))))
-             (comp-win-height-value (ecb-buffer-local-value
+      (let* ((comp-win-height-value (ecb-buffer-local-value
                                      'compilation-window-height
                                      (window-buffer (ad-get-arg 0))))
              (compilation-window-height (if (and ecb-compile-window-prevent-shrink-below-height
                                                  comp-win-height-value
-                                                 compile-window-height-lines
+                                                 ecb-compile-window-height-lines
                                                  (< comp-win-height-value
-                                                    compile-window-height-lines))
-                                            compile-window-height-lines
+                                                    ecb-compile-window-height-lines))
+                                            ecb-compile-window-height-lines
                                           comp-win-height-value)))
         (and compilation-window-height
              ;; Klaus Berndl <klaus.berndl@sdm.de>: we do nothing if an unsplitted
              ;; which might not be the same as the selected window's buffer.
              (save-excursion
                (let ((w (selected-window)))
-                 (ecb-layout-debug-error "compilation-set-window-height: window: %s, cur-win: %s"
-                                         (ad-get-arg 0) w)
+                 (ecb-layout-debug-error "compilation-set-window-height: window: %s, cur-win: %s, cur-height: %d"
+                                         (ad-get-arg 0) w
+                                         (ecb-window-full-height (ad-get-arg 0)))
                  (unwind-protect
                      (progn
                        (select-window (ad-get-arg 0))
           (ad-with-originals 'walk-windows
             (walk-windows (function (lambda (w)
                                       (if (or (member (buffer-name (window-buffer w))
-                                                      ecb-tree-buffers-of-current-layout)
+                                                      ecb-special-ecb-buffers-of-current-layout)
                                               (equal w ecb-compile-window))
                                           nil
                                         ;; for an edit-window we call the
                    (member ecb-compile-window-temporally-enlarge
                            '(after-selection nil))
                    ;; The *Completions*-buffer must always being enlarged!
-                   (not (string= (buffer-name (window-buffer (ad-get-arg 0)))
-                                 "*Completions*")))
+                   (not (ecb-string= (buffer-name (window-buffer (ad-get-arg 0)))
+                                     "*Completions*")))
               (ecb-toggle-compile-window-height -1)
             (save-excursion
               (set-buffer (window-buffer (ad-get-arg 0)))
                                       (current-buffer))
               ;; we prevent to shrink the compile-window below
               ;; `ecb-compile-window-height'
-              (let* ((compile-window-height-lines (ignore-errors (ecb-normalize-number
-                                                                  ecb-compile-window-height
-                                                                  (1- (frame-height)))))
-                     (window-min-height (if (and (equal (ad-get-arg 0) ecb-compile-window)
-                                                 (and ecb-compile-window-prevent-shrink-below-height
-                                                      (not (interactive-p)))
-                                                 window-min-height
-                                                 compile-window-height-lines
-                                                 (< window-min-height
-                                                    compile-window-height-lines))
-                                            compile-window-height-lines
-                                          window-min-height))
-                     (n 0)
-                     (test-pos
-                      (- (point-max)
-                         ;; If buffer ends with a newline, ignore it when counting
-                         ;; height unless point is after it.
-                         (if (and (not (eobp))
-                                  (eq ?\n (char-after (1- (point-max)))))
-                             1 0)))
-                     (mini (frame-property (window-frame (ad-get-arg 0)) 'minibuffer))
-                     (edges (window-pixel-edges (selected-window))))
+              (let ((window-min-height (if (and (equal (ad-get-arg 0) ecb-compile-window)
+                                                (and ecb-compile-window-prevent-shrink-below-height
+                                                     (not (interactive-p)))
+                                                window-min-height
+                                                ecb-compile-window-height-lines
+                                                (< window-min-height
+                                                   ecb-compile-window-height-lines))
+                                           ecb-compile-window-height-lines
+                                         window-min-height))
+                    (n 0)
+                    (test-pos
+                     (- (point-max)
+                        ;; If buffer ends with a newline, ignore it when counting
+                        ;; height unless point is after it.
+                        (if (and (not (eobp))
+                                 (eq ?\n (char-after (1- (point-max)))))
+                            1 0)))
+                    (mini (frame-property (window-frame (ad-get-arg 0)) 'minibuffer))
+                    (edges (window-pixel-edges (selected-window))))
                 (if (and (< 1 (let ((frame (selected-frame)))
                                 (select-frame (window-frame (ad-get-arg 0)))
                                 (unwind-protect
                (edges (ecb-window-edges))
                ;; we prevent to shrink the compile-window below
                ;; `ecb-compile-window-height'
-               (compile-window-height-lines (ignore-errors (ecb-normalize-number
-                                                            ecb-compile-window-height
-                                                            (1- (frame-height)))))
                (window-min-height (if (and (equal (ad-get-arg 0) ecb-compile-window)
                                            (and ecb-compile-window-prevent-shrink-below-height
                                                 (not (interactive-p)))
                                            window-min-height
-                                           compile-window-height-lines
+                                           ecb-compile-window-height-lines
                                            (< window-min-height
-                                              compile-window-height-lines))
-                                      compile-window-height-lines
+                                              ecb-compile-window-height-lines))
+                                      ecb-compile-window-height-lines
                                     window-min-height)))
           (if (and (< 1 (ecb-with-original-basic-functions
                          (count-windows)))
                (member ecb-compile-window-temporally-enlarge
                        '(after-selection nil))
                ;; The *Completions* buffer must always being enlarged!!
-               (not (string= (buffer-name (current-buffer)) "*Completions*")))
+               (not (ecb-string= (buffer-name (current-buffer)) "*Completions*")))
           (progn
             (ecb-layout-debug-error "resize-temp-buffer-window: buffer: shrink to comp-win-height")
             (ecb-toggle-compile-window-height -1))
         ;; we prevent to shrink the compile-window below
         ;; `ecb-compile-window-height'
-        (let* ((compile-window-height-lines (ignore-errors (ecb-normalize-number
-                                                            ecb-compile-window-height
-                                                            (1- (frame-height)))))
-               (window-min-height (if (and window-min-height
-                                           compile-window-height-lines
-                                           ecb-compile-window-prevent-shrink-below-height
-                                           (< window-min-height
-                                              compile-window-height-lines))
-                                      compile-window-height-lines
-                                    window-min-height)))
+        (let ((window-min-height (if (and window-min-height
+                                          ecb-compile-window-height-lines
+                                          ecb-compile-window-prevent-shrink-below-height
+                                          (< window-min-height
+                                             ecb-compile-window-height-lines))
+                                     ecb-compile-window-height-lines
+                                   window-min-height)))
           (unless (or (one-window-p 'nomini)
                       ;; Klaus Berndl <klaus.berndl@sdm.de>: we do nothing if an unsplitted
                       ;; edit-window should be resized because this would fail (e.g. if
 (defvar ecb-ecb-window-was-selected-before-command nil)
 (defvar ecb-layout-prevent-handle-ecb-window-selection nil)
 
-(defcustom ecb-maximize-ecb-window-after-selection nil
-  "*If not nil maximize current tree-window after selection.
-When selecting another not-tree-window after such an automatic maximizing all
-tree-windows of current layout are displayed again. But a tree-window is not
-maximized if either a node has been selected via primary- oder secondarc
-mouse-button or the popup-menu of that tree-buffer has been opened."
-  :group 'ecb-layout
-  :type 'boolean)
-
 ;; VERY IMPORTANT: pre-command- and the post-command-hook must NOT use any
 ;; function which calls `ecb-window-list' because this would slow-down the
 ;; performance of all Emacs-versions unless GNU Emacs 21 because they have no
              (ecb-layout-debug-error "ecb-layout-post-command-hook: shrink")
              (ecb-toggle-compile-window-height -1)))))
   (if ecb-layout-prevent-handle-ecb-window-selection
-      (setq ecb-layout-prevent-handle-ecb-window-selection nil)
+      (progn
+        (setq ecb-layout-prevent-handle-ecb-window-selection nil))
     (when (and ecb-minor-mode
                ecb-maximize-ecb-window-after-selection
                (equal (selected-frame) ecb-frame)
     ;; here we have no active minibuffer!
     (let ((nth-win (or nth-window 1)))
       (cond ((equal point-loc 'ecb)
-             (ecb-next-listelem ecb-win-list (selected-window) nth-win))
+             (ecb-next-listelem (if (and ecb-win-list
+                                         (= 1 (length ecb-win-list)))
+                                    (append ecb-win-list edit-win-list)
+                                  ecb-win-list)
+                                (selected-window) nth-win))
             ((equal point-loc 'compile)
              (if (= nth-win 1)
                  (or (and ecb-last-edit-window-with-point
 Returns the window NTH-WINDOW steps away from the current window. If
 NTH-WINDOW is nil then it is treated as 1."
   (let* ((nth-win (or nth-window 1))
-         (windows-list (ecb-window-list ecb-frame 0
-                                        (frame-first-window ecb-frame)))
+         (windows-list (ecb-canonical-windows-list))
          (edit-win-list (ecb-canonical-edit-windows-list windows-list))
          (ecb-win-list (ecb-canonical-ecb-windows-list windows-list))
          (point-loc (ecb-where-is-point edit-win-list))
              ;; we must check if the current-buffer in the edit-window is
              ;; the same as the buffer argument for the current call and if
              ;; yes we must switch to the buffer returned by `other-buffer'.
-             (if (string= buf-name
-                          (buffer-name (window-buffer (car (ecb-canonical-edit-windows-list)))))
+             (if (ecb-string= buf-name
+                              (buffer-name (window-buffer (car (ecb-canonical-edit-windows-list)))))
                  (switch-to-buffer (other-buffer buf-name
                                                  nil ecb-frame))))
             (select-frame curr-frame)))))))
 
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL
 (defvar ecb-edit-area-creators nil)
 
 (defsubst ecb-edit-area-creators-init ()
                              window edit-win-list))
                   ;; If we have deleted that window which was current at call-time
                   ;; we have to ensure that point stays in the next edit-window
-                  (if (equal curr-window-before window)
-                      (let ((edit-win-list-after (ecb-canonical-edit-windows-list)))
-                        (if (not (member (selected-window) edit-win-list-after))
-                            (select-window (car edit-win-list-after)))))))))))))
+                  (when (equal curr-window-before window)
+                    (let ((edit-win-list-after (ecb-canonical-edit-windows-list)))
+                      (if (not (member (selected-window) edit-win-list-after))
+                          (select-window (car edit-win-list-after)))))))))))))
 
 (defadvice delete-other-windows (before ecb)
   "Does nothing special but only storing the fact that the other edit-windows
   (let ((buffer (ecb-buffer-obj buffer-or-name)))
     (member buffer (ecb-get-current-visible-ecb-buffers))))
 
-  
+(defun ecb-buffer-is-the-only-visible-ecb-buffer-p (buffer-or-name)
+  "Return not nil if BUFFER-OR-NAME is currently the only visible ecb-buffer."
+  (let ((buffer (ecb-buffer-obj buffer-or-name))
+        (current-ecb-buffers (ecb-get-current-visible-ecb-buffers)))
+    (and (= (length current-ecb-buffers) 1)
+         (equal buffer (car current-ecb-buffers)))))
 
 (defun ecb-set-minor-mode-text ()
   (setq ecb-minor-mode-text
   (ecb-toggle-ecb-windows 1))
 
 
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL
 (defvar ecb-current-maximized-ecb-buffer-name nil
   "If not nil then it contains the buffer-name of the current maximized
 ecb-buffer. If nil then this means currently there is no ecb-buffer maximized.
     (let ((buf-name (or ecb-buffer-name
                         (buffer-name (current-buffer))))
           (compwin-hidden (equal 'hidden (ecb-compile-window-state))))
-      (when (member buf-name ecb-tree-buffers-of-current-layout)
+      (when (member buf-name ecb-special-ecb-buffers-of-current-layout)
         (ecb-redraw-layout-full
          nil
          (cdr (assoc buf-name
           ((equal curr-point 'compile)
            (ecb-window-select ecb-compile-window)))))
 
+;; Klaus Berndl <klaus.berndl@sdm.de>: FRAME-LOCAL
 (defvar ecb-cycle-ecb-buffer-state nil
   "State of ecb-buffer-cycling. An alist where the car is the list of all
 buffer-names of the ecb-buffers of current layout and the cdr the index which
   (setq ecb-available-layouts
         (sort ecb-available-layouts
               (function (lambda (l r)
-                          (string< (car l) (car r)))))))
+                          (ecb-string< (car l) (car r)))))))
 
 (defun ecb-available-layouts-remove (name)
   "Remove layout with NAME from `ecb-available-layouts'."
       (setq ecb-available-layouts
             (sort (delete elem ecb-available-layouts)
                   (function (lambda (l r)
-                              (string< (car l) (car r)))))))))
+                              (ecb-string< (car l) (car r)))))))))
 
 (defun ecb-get-layout-type (name)
   "Return the type of layout NAME."
      (ecb-layout-type-p (quote ,type) t)
      (defun ,(intern (format "ecb-layout-function-%s" name)) (&optional create-code-fcn)
        ,doc
-       (when (and ecb-compile-window-height
-                  (or (equal ecb-compile-window-width 'frame)
-                      (equal (ecb-get-layout-type ecb-layout-name) 'top)))
-         (ecb-split-ver (- ecb-compile-window-height) t t)
-         (setq ecb-compile-window (next-window)))
+       ;; Klaus Berndl <klaus.berndl@sdm.de>: creating the compile-window is
+       ;; now done in `ecb-redraw-layout-full'!
+;;        (when (and ecb-compile-window-height
+;;                   (or (equal ecb-compile-window-width 'frame)
+;;                       (equal (ecb-get-layout-type ecb-layout-name) 'top)))
+;;          (ecb-split-ver (- ecb-compile-window-height) t t)
+;;          (setq ecb-compile-window (next-window)))
        ,(cond ((equal type 'left)
                '(ecb-split-hor ecb-windows-width t))
               ((equal type 'right)
              (funcall create-code-fcn)
              (select-window (next-window)))
          ,@create-code)
-       (when (and ecb-compile-window-height
-                  (equal ecb-compile-window-width 'edit-window)
-                  (not (equal (ecb-get-layout-type ecb-layout-name) 'top)))
-         (ecb-split-ver (- ecb-compile-window-height) t t)
-         (setq ecb-compile-window (next-window)))
+       ;; Klaus Berndl <klaus.berndl@sdm.de>: creating the compile-window is
+       ;; now done in `ecb-redraw-layout-full'!
+;;        (when (and ecb-compile-window-height
+;;                   (equal ecb-compile-window-width 'edit-window)
+;;                   (not (equal (ecb-get-layout-type ecb-layout-name) 'top)))
+;;          (ecb-split-ver (- ecb-compile-window-height) t t)
+;;          (setq ecb-compile-window (next-window)))
        (setq ecb-edit-window (selected-window)))
      (defalias (quote ,(intern
                         (format "ecb-delete-window-in-editwindow-%s"
 WINDOW-CONFIG must be got from the adviced version of
 `current-window-configuration'."
   (not (equal (nth 3 window-config)
-              (list ecb-layout-name ecb-compile-window-height
+              (list ecb-frame ecb-layout-name ecb-compile-window-height
                     ecb-compile-window-width
                     ecb-windows-width ecb-windows-height))))
               
                      nil
                    (ecb-get-current-visible-ecb-buffers))
                  (if (ecb-compile-window-live-p)
-                     (ecb-position (ecb-window-list ecb-frame 0
-                                                    (frame-first-window ecb-frame))
+                     (ecb-position (ecb-canonical-windows-list)
                                    ecb-compile-window))
-                 (list ecb-layout-name ecb-compile-window-height
+                 ;; We add here as first element `ecb-frame' and also in the
+                 ;; check of `ecb-window-configuration-invalidp'! Then a
+                 ;; ecb-window-config made from a frame which is now deleted
+                 ;; would be always invalid, which would be more consistency
+                 ;; with the return-value of `set-window-configuration' (see
+                 ;; docstring)
+                 ;;
+                 ;; This element is only used in
+                 ;; `ecb-window-configuration-invalidp'!
+                 (list ecb-frame ecb-layout-name ecb-compile-window-height
                        ecb-compile-window-width
                        ecb-windows-width ecb-windows-height)
                  ecb-edit-area-creators
             (and (nth 1 config)
                  (ecb-set-windows-dedicated-state (nth 1 config) t))
             (when (nth 2 config)
-              (let ((win-list (ecb-window-list ecb-frame 0
-                                               (frame-first-window ecb-frame))))
+              (let ((win-list (ecb-canonical-windows-list)))