Commits

berndl  committed 0e19cc4

Sync with current upstream 1.94; see NEWS for details.

  • Participants
  • Parent commits 6c58326

Comments (0)

Files changed (16)

+2003-06-27  Klaus Berndl  <klaus.berndl@sdm.de>
+
+	* Sync with current upstream 1.94, see NEWS for details.
+
 2003-03-27  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.06 released.

File Makefile.upstream

 
 # For the ECB-maintainers: Change the version-number here and not
 # elsewhere!
-ecb_VERSION=1.93
+ecb_VERSION=1.94
 
 
 RM=rm -f
 	@echo "Byte-compiling ECB with LOADPATH=${LOADPATH} ..."
 	@$(RM) $(ecb_LISP_ELC) ecb-compile-script
 	@echo "(add-to-list 'load-path nil)" > ecb-compile-script
-	@if test ! -z "${SEMANTIC}" ; then\
+	@if test ! -z "${SEMANTIC}"; then\
 	   echo "(add-to-list 'load-path \"$(SEMANTIC)\")" >> ecb-compile-script; \
 	fi
-	@if test ! -z "${EIEIO}" ; then\
+	@if test ! -z "${EIEIO}"; then\
 	   echo "(add-to-list 'load-path \"$(EIEIO)\")" >> ecb-compile-script; \
 	fi
-	@if test ! -z "${LOADPATH}" ; then\
+	@if test ! -z "${LOADPATH}"; then\
 	   for loadpath in ${LOADPATH}; do \
 	      echo "(add-to-list 'load-path \"$$loadpath\")" >> ecb-compile-script; \
 	   done; \
 all: ecb online-help
 
 online-help: $(ecb_TEXI)
-	@if test -x "$(MAKEINFO)" ; then\
+	@if test -x "$(MAKEINFO)"; then\
 	   $(RM) -R $(ecb_INFO_DIR) $(ecb_HTML_DIR); \
 	   $(MKDIR) $(ecb_INFO_DIR) $(ecb_HTML_DIR); \
 	   echo Generating info-format...; \
 	   $(TEXI2DVI) --clean $<; \
 	   $(DVIPDFM) $(ecb_DVI); \
 	   $(RM) $(ecb_DVI); \
-	elif test -x "$(TEXI2DVI)" -a -x "$(DVIPS)" -a -x "$(PS2PDF)" ; then\
+	elif test -x "$(TEXI2DVI)" -a -x "$(DVIPS)" -a -x "$(PS2PDF)"; then\
 	   $(RM) $(ecb_DVI) $(ecb_PS) $(ecb_PDF); \
 	   echo Generating pdf-format with dvips and ps2pdf ...; \
 	   $(TEXI2DVI) --quiet --clean $<; \
 
 
 install-help: $(ecb_INFO_DIR)/$(ecb_INFO)
-	@if test -x "$(INSTALLINFO)" -a -f "$(EMACSINFOPATH)/dir" ; then\
+	@if test -x "$(INSTALLINFO)" -a -f "$(EMACSINFOPATH)/dir"; then\
 	   echo Installing the Online-help in $(INSTALLINFO)...; \
 	   $(CP) $(ecb_INFO_DIR)/*info* $(EMACSINFOPATH); \
 	   $(INSTALLINFO) $< $(EMACSINFOPATH)/dir; \
+* Changes for ECB version 1.94
+
+** Supporting of non-semantic-sources.
+
+*** Native parsing and displaying source-contents of imenu supported files
+
+*** Native parsing and displaying source-contents of etags supported files
+
+*** There are some new options like `ecb-process-non-semantic-files',
+    `ecb-non-semantic-parsing-function' and `ecb-method-non-semantic-face' and
+    one new face `ecb-method-non-semantic-face'. See new customize group
+    "ecb-non-semantic"!
+    
+** Better speedbar integration into the ECB-frame
+
+*** Now speedbar can be used not only as replacement for the
+    ECB-directory-browser in the directory-window but also instead of the
+    sources- or the methods-buffer/window. See new option
+    `ecb-use-speedbar-instead-native-tree-buffer' which replaces the old
+    option `ecb-use-speedbar-for-directories'.
+
+*** Now speedbar can be integrated into an arbitrary layout in the same way as
+    the other four special buffers (directories, sources, methods and
+    history). See new example layout with name "left-dir-plus-speedbar".
+
+*** New option `ecb-directories-update-speedbar' which helps you
+    to update a speedbar-window to the current selected directory of the
+    ECB-directories-window.
+
+** New option `ecb-compilation-predicates' for better specifying which buffers
+   should be treated as compilation-buffers and therefore be displayed in the
+   compile-window of ECB - if there is any.
+   
+** Better customizing of the mode-line of an ECB-tree-buffer.
+   See the new option `ecb-mode-line-data'.
+
+** Fixed bugs:
+
+*** Using "Add source path" from the popup-menu now doesn't open the Windows
+    file-dialog-box onto Windows-systems because this would prevent this
+    command from working.
+
+*** Smart arrowkey-navigation in the tree-buffers is now even smarter.
+    Thanks to John Russel <jorussel@cisco.com> for suggestion.
+
+*** If ECB was activated with a layout which does not contain a
+    directory-buffer then you got always an empty directory-buffer even after
+    switching to a layout with a directory-buffer. This is fixed now.
+
+    
+
 * Changes for ECB version 1.93
 
 ** Fixed bugs:
-Readme for the Emacs Code Browser (ECB) version 1.93
+Readme for the Emacs Code Browser (ECB) version 1.94
 
 
 About
   
 - Optional: speedbar, author version 0.14beta1 or higher
   (http://cedet.sourceforge.net/eieio.shtml)
-  This is only needed if the speedbar-integration of ECB is used
+  This is only needed if the speedbar-integration of ECB is used or if
+  non-semantic-sources should be parsed and displayed.
 - Optional: If Java code is edited the ECB works best when the JDE package
   (http://sunsite.auc.dk/jde) is installed.
 

File RELEASE_NOTES

-This file contains some important release-notes for ECB version 1.93
+This file contains some important release-notes for ECB version 1.94
 
 General:
 --------

File ecb-compilation.el

 
 (defvar ecb-compilation-buffer-names-internal nil
   "This variable is for ECB internal use and can be used by ECB to add
-buffer-names to the set displayed in the compile-window. Type is the same as
-of option `ecb-compilation-buffer-names'")
+buffer-names to the set specified in `ecb-compilation-buffer-names'. Type is
+the same as of option `ecb-compilation-buffer-names'")
 
 (defun ecb-compilation-buffer-names ()
   "Return the set of buffer names which should be displayed in the
-compile-window of ECB."
+compile-window of ECB. This is a list combined of
+`ecb-compilation-buffer-names' and `ecb-compilation-buffer-names-internal'."
   (append ecb-compilation-buffer-names
           ecb-compilation-buffer-names-internal))
 
 
 (defvar ecb-compilation-major-modes-internal nil
   "This variable is for ECB internal use and can be used by ECB to add
-  major-mode symbols to the set displayed in the compile-window.")
+major-mode symbols to the set specified in `ecb-compilation-major-modes'.")
 
 (defun ecb-compilation-major-modes ()
   "Return all major-mode symbols which should be displayed in the
-compile-window."
+compile-window. This is a list combined of `ecb-compilation-major-modes' and
+`ecb-compilation-major-modes-internal'."
   (append ecb-compilation-major-modes
           ecb-compilation-major-modes-internal))
 
+
+(defcustom ecb-compilation-predicates '(comint-check-proc)
+  "*Predicate when a buffer should be treated as compilation-buffer -
+even if `compilation-buffer-p' says nil.
+
+Every element of this list has to be a function or lambda-expression which
+gets as argument a buffer-object and which has to return not nil when this
+buffer should be treated as compilation-buffer and therefore be displayed in
+the compile-window of ECB \(if there is any).
+
+In combination with the values of `ecb-compilation-buffer-names' and
+`ecb-compilation-major-modes' ECB decides when a buffer is displayed in the
+compile-window.
+
+Default value is the function `comint-check-proc' which returns not nil when
+the buffer is related to a living process."
+  :group 'ecb-compilation-content
+  :group 'ecb-layout
+  :type '(repeat (symbol :tag "Compilation predicate")))
+
+(defvar ecb-compilation-predicates-internal nil
+  "This variable is for ECB internal use and can be used by ECB to add
+predicates to the set defined in `ecb-compilation-predicates'.")
+
+(defun ecb-compilation-predicates ()
+  "Return all predicates which should be used to test if a buffer should be
+displayed in the compile-window. This is a list combined of
+`ecb-compilation-predicates' and `ecb-compilation-predicates-internal'."
+  (append ecb-compilation-predicates
+          ecb-compilation-predicates-internal))
+
+
+
 (defun ecb-compilation-get-buffers()
   "Get all known compilation buffer names.  See `ecb-compilation-buffer-p'."
 
 
     buffer-names))
 
-;; (ecb-compilation-registered-buffer-p "*Help: insert*")
 
 (defun ecb-compilation-buffer-p(buffer-or-name)
-  "Test if the given buffer is a compilation buffer. Note that in this case we
-define 'compilation buffer' as a buffer that should ideally be displayed in the
-`ecb-compile-window'. This means that in some situations this might not be the
-result of a `compile-internal'. A good example would be the *Help* buffer or the
-`ecb-eshell-buffer-name'.
+  "Test if the given buffer BUFFER-OR-NAME should be treated as a compilation
+buffer. Note that in this case we define \"compilation buffer\" as a buffer
+that should ideally be displayed in the compile-window of ECB \(see
+`ecb-compile-window-height'). This means that in some situations this might
+not be the result of a real `compile-internal'. A good example would be the
+*Help* buffer or the `ecb-eshell-buffer-name'.
 
-BUFFER can be the name of a buffer or a buffer-objekt.
+BUFFER-OR-NAME can be the name of a buffer or a buffer-object.
 
-This function is non-nil if the name of BUFFER is either contained in the list
-returned by the function `ecb-compilation-buffer-names', or its `major-mode'
-is contained in the list returned by the function
-`ecb-compilation-major-modes', or if `compilation-buffer-p' returns true."
+This function returns non-nil - i.e. buffer will be treated as
+compilation-buffer - if:
 
+- The name of the buffer is contained in the list returned by the function
+  `ecb-compilation-buffer-names' or
+- the `major-mode' of the buffer is contained in the list returned by the
+  function `ecb-compilation-major-modes' or
+- if `compilation-buffer-p' returns true or
+- one of the predicates returned by `ecb-compilation-predicates' returns not
+  nil for the buffer.
+
+Summary for ECB-endusers: A buffer will be treated as compilation-buffer if
+either 
+- `compilation-buffer-p' returns not nil, i.e. if a real compilation-buffer or
+- if at least one of the options `ecb-compilation-buffer-names',
+  `ecb-compilation-major-modes' or `ecb-compilation-predicates' define the
+  buffer as compilation-buffer."
   ;;determine the best valid for the buffer.
   (let ((buffer (cond ((stringp buffer-or-name)
                        (get-buffer buffer-or-name))
                       ((bufferp buffer-or-name)
                        buffer-or-name)
                       (t
-                       nil))))
-
+                       nil)))
+        (ecb-comp-predicates (ecb-compilation-predicates)))
     (when buffer
 
       ;;test if this is a valid buffer by name.
           ;;else test if this is a regular compilation buffer
           (if (compilation-buffer-p buffer)
               t
-            ;;else check if this is a comint buffer
-            (if (and (fboundp 'comint-check-proc)
-                     (comint-check-proc buffer))
+            ;; we do not use run-hook-with-args-until-success because we have
+            ;; to check if the functions are bound!!
+            (if (dolist (p ecb-comp-predicates)
+                  (if (and (fboundp p) (funcall p buffer))
+                      (return t)))
                 t
-              ;;else it isn't a complication buffer
               nil)))))))
 
 ;; Klaus Berndl <klaus.berndl@sdm.de>: The following mechanism is necessary to

File ecb-create-layout.el

 (defconst ecb-create-layout-buf-prefix " *ECB-LC-")
 (defconst ecb-create-layout-frame-name "Creation of a new ECB-layout")
 (defconst ecb-create-layout-all-buf-types
-  '("directories" "history" "methods" "sources"))
+  '("directories" "history" "methods" "sources" "speedbar"))
 
 (defconst ecb-create-layout-help-text-left-right
   "
         \"other\" (i.e. you can specify any fraction
         between 0.1 and 0.9)
       - Which type (\"directories\", \"sources\",
-        \"methods\" or \"history\") the current window
-        should be.
+        \"methods\", \"history\", \"speedbar\") the
+        current window should be.
  C-u: Unsplit, ie. delete current window
  C-t: Give the current window a builtin type
-      (\"directories\", \"sources\", \"methods\" or
-      \"history\") or any arbitary user-defined type
-      (\"other\"). See the Online-manual!
+      (\"directories\", \"sources\", \"methods\",
+      \"history\", \"speedbar\") or any arbitary user-
+      defined type (\"other\"). See the Online-manual!
 
  C-c: Cancel layout creation. This does not save the
       layout. Deletes this frame.
       - If \"vertical\" or \"horizontal\" split
       - How to split: \"at-point\", \"half\" or \"other\" (i.e. you can specify any
         fraction between 0.1 and 0.9)
-      - Which type (\"directories\", \"sources\", \"methods\" or \"history\") the current
-        window should be.
+      - Which type (\"directories\", \"sources\", \"methods\", \"history\", \"speedbar\")
+        the current window should be.
  C-u: Unsplit, ie. delete current window
- C-t: Give the current window a builtin type (\"directories\", \"sources\", \"methods\" or
-      \"history\") or any arbitray user-defined type (\"other\"). See the Online-manual!
+ C-t: Give the current window a builtin type (\"directories\", \"sources\", \"methods\",
+      \"history\", \"speedbar\") or any arbitray user-defined type (\"other\").
 
  C-c: Cancel layout creation. This does not save the layout. Deletes this frame.
  C-q: Save current defined layout and quit the layout creation. You will be asked for a
                 (face :tag "Special face"
                       :value ecb-method-face)))
 
+(defface ecb-method-non-semantic-face (ecb-face-default nil nil nil
+                                           'ecb-methods-general-face
+                                           "brown" "brown")
+  "*Define face used for displaying tokens of sources not supported by
+semantic."
+  :group 'ecb-faces)
+
+(defcustom ecb-method-non-semantic-face 'speedbar-tag-face
+  "*Face used for for displaying tokens of sources not supported by
+semantic. Default is the face used by speedbar for tags.
+
+Changes take first effect after finishing and reactivating ECB!"
+  :group 'ecb-face-options
+  :group 'ecb-methods
+  :type '(radio (const :tag "Use ecb-default-highlight-face"
+                       :value ecb-default-highlight-face)
+                (face :tag "Special face"
+                      :value ecb-method-face)))
+
 (defface ecb-history-face (ecb-face-default nil nil nil
                                             'ecb-default-highlight-face
                                             "yellow" nil

File ecb-layout-defs.el

   (select-window (previous-window (selected-window) 0)))
 
 
+(ecb-layout-define "left-dir-plus-speedbar" left
+  "This function creates the following layout:
+
+   -------------------------------------------------------
+   |              |                                      |
+   |  Directories |                                      |
+   |              |                                      |
+   |              |                                      |
+   |              |                                      |
+   |              |                                      |
+   |              |                                      |
+   |--------------|                 Edit                 |
+   |              |                                      |
+   |              |                                      |
+   |              |                                      |
+   |  Speedbar    |                                      |
+   |              |                                      |
+   |              |                                      |
+   |              |                                      |
+   -------------------------------------------------------
+   |                                                     |
+   |                    Compilation                      |
+   |                                                     |
+   -------------------------------------------------------
+
+If you have not set a compilation-window in `ecb-compile-window-height' then
+the layout contains no durable compilation window and the other windows get a
+little more place. This layout works best if it is contained in
+`ecb-show-sources-in-directories-buffer'!"
+  (ecb-set-directories-buffer)
+  (ecb-split-ver 0.5)
+  (ecb-set-speedbar-buffer)
+  (select-window (next-window)))
+
+
 (defconst ecb-buildin-layouts (copy-list ecb-available-layouts)
   "All layouts defined until now.")
 

File ecb-layout.el

 (silentcomp-defvar window-size-fixed)
 (silentcomp-defun fit-window-to-buffer)
 
-;; ecb-speedbar is only loaded if ecb-use-speedbar-for-directories is set to
-;; true
-(silentcomp-defun ecb-set-speedbar-buffer)
+;; ecb-speedbar is only loaded if ecb-use-speedbar-instead-native-tree-buffer
+;; is set to not nil
+(silentcomp-defun ecb-speedbar-set-buffer)
 (silentcomp-defun ecb-speedbar-deactivate)
 (silentcomp-defvar ecb-speedbar-buffer-name)
 
      (set-window-dedicated-p (selected-window) t)))
 
 (defun ecb-set-directories-buffer ()
-  (let ((set-directories-buffer (not ecb-use-speedbar-for-directories)))
-    ;; first we act depending on the value of ecb-use-speedbar-for-directories
+  (let ((set-directories-buffer
+         (not (equal ecb-use-speedbar-instead-native-tree-buffer 'dir))))
+    ;; first we act depending on the value of
+    ;; ecb-use-speedbar-instead-native-tree-buffer
     (when (not set-directories-buffer)
-      (require 'ecb-speedbar)
       (condition-case error-data
-          (ecb-with-dedicated-window
-           (ecb-set-speedbar-buffer))
+          (ecb-set-speedbar-buffer)
         ;; setting the speedbar buffer has failed so we set
         ;; set-directories-buffer to t ==> standard-directories-buffer is set!
         (error (message "%s" error-data)
                (setq set-directories-buffer t))))
     ;; maybe we need to set the standard directories buffer:
-    ;; - if ecb-use-speedbar-for-directories is nil or
+    ;; - if ecb-use-speedbar-instead-native-tree-buffer is not 'dir or
     ;; - if setting the speedbar buffer has failed.
     (when set-directories-buffer
       (if (featurep 'ecb-speedbar)
       (ecb-with-dedicated-window
        (switch-to-buffer ecb-directories-buffer-name)))))
 
+(defun ecb-set-speedbar-buffer ()
+  (require 'ecb-speedbar)
+  (ecb-with-dedicated-window (ecb-speedbar-set-buffer)))
+
 (defun ecb-set-sources-buffer ()
-  (ecb-with-dedicated-window
-   (switch-to-buffer ecb-sources-buffer-name)))
+  (let ((set-sources-buffer
+         (not (equal ecb-use-speedbar-instead-native-tree-buffer 'source))))
+    ;; first we act depending on the value of
+    ;; ecb-use-speedbar-instead-native-tree-buffer
+    (when (not set-sources-buffer)
+      (condition-case error-data
+          (ecb-set-speedbar-buffer)
+        ;; setting the speedbar buffer has failed so we set
+        ;; set-sources-buffer to t ==> standard-sources-buffer is set!
+        (error (message "%s" error-data)
+               (setq set-sources-buffer t))))
+    ;; maybe we need to set the standard sources buffer:
+    ;; - if ecb-use-speedbar-instead-native-tree-buffer is not 'source or
+    ;; - if setting the speedbar buffer has failed.
+    (when set-sources-buffer
+      (if (featurep 'ecb-speedbar)
+          (ignore-errors (ecb-speedbar-deactivate)))
+      (ecb-with-dedicated-window
+       (switch-to-buffer ecb-sources-buffer-name)))))
 
 (defun ecb-set-methods-buffer ()
-  (ecb-with-dedicated-window
-   (switch-to-buffer ecb-methods-buffer-name)))
+  (let ((set-methods-buffer
+         (not (equal ecb-use-speedbar-instead-native-tree-buffer 'method))))
+    ;; first we act depending on the value of
+    ;; ecb-use-speedbar-instead-native-tree-buffer
+    (when (not set-methods-buffer)
+      (condition-case error-data
+          (ecb-set-speedbar-buffer)
+        ;; setting the speedbar buffer has failed so we set
+        ;; set-method-buffer to t ==> standard-methods-buffer is set!
+        (error (message "%s" error-data)
+               (setq set-methods-buffer t))))
+    ;; maybe we need to set the standard methods buffer:
+    ;; - if ecb-use-speedbar-instead-native-tree-buffer is not 'method or
+    ;; - if setting the speedbar buffer has failed.
+    (when set-methods-buffer
+      (if (featurep 'ecb-speedbar)
+          (ignore-errors (ecb-speedbar-deactivate)))
+      (ecb-with-dedicated-window
+       (switch-to-buffer ecb-methods-buffer-name)))))
 
 (defun ecb-set-history-buffer ()
   (ecb-with-dedicated-window
    + `ecb-set-sources-buffer'
    + `ecb-set-methods-buffer'
    + `ecb-set-history-buffer'
+   + `ecb-set-speedbar-buffer'
    Each layout can only contain one of each tree-buffer-type!
 
    In addition to these functions there is a general macro:
       
       (setq ecb-windows-hidden nil)
 
-      ;; synchronize the special ecb-buffers if necessary (means if not all
-      ;; ecb-windows of current layout were visible before redraw) and
-      ;; fillup the history new with all buffers if the history buffer was not
-      ;; shown before the redisplay but now (means if the layout has changed)
       (let ((current-ecb-windows (ecb-get-current-visible-ecb-buffers)))
+        ;; fillup the history new with all buffers if the history buffer was
+        ;; not shown before the redisplay but now (means if the layout has
+        ;; changed)
         (when (and (not (member (get-buffer ecb-history-buffer-name)
                                 ecb-windows-before-redraw))
                    (member (get-buffer ecb-history-buffer-name)
                            current-ecb-windows))
           (ecb-add-all-buffers-to-history))
+        ;; update the directories buffer if the directories buffer was not
+        ;; shown before the redisplay but now (means if the layout has
+        ;; changed)
+        (when (and (not (member (get-buffer ecb-directories-buffer-name)
+                                ecb-windows-before-redraw))
+                   (member (get-buffer ecb-directories-buffer-name)
+                           current-ecb-windows))
+          (ecb-update-directories-buffer))
+        ;; deactivate the speedbar stuff if the speedbar-integration-buffer
+        ;; was shown before but not now
+        (when (and (featurep 'ecb-speedbar)
+                   (member (get-buffer ecb-speedbar-buffer-name)
+                           ecb-windows-before-redraw)
+                   (not (member (get-buffer ecb-speedbar-buffer-name)
+                                current-ecb-windows)))
+          (ignore-errors (ecb-speedbar-deactivate)))
+        ;; synchronize the special ecb-buffers if necessary (means if not all
+        ;; ecb-windows of current layout were visible before redraw) and
         (when (and (not (equal ecb-windows-before-redraw current-ecb-windows))
                    (not no-buffer-sync))
           (ecb-current-buffer-sync t)))

File ecb-mode-line.el

                       (string :tag "Custom prefix" :value ""))))
 
 
+(defcustom ecb-mode-line-data '(selected selected selected nil)
+  "*Data shown in the modelines of the standard ECB tree-buffers.
+For every ECB-tree-buffer there are two predefined values:
+ECB-directories: 'selected \(current selected directory) and nil \(Nothing).
+ECB-sources: 'selected \(current selected directory) and nil \(Nothing).
+ECB-methods: 'selected \(current selected source) and nil \(Nothing).
+ECB-history: nil \(Nothing).
+
+In addition for every tree-buffer a function can be specified which gets three
+args \(name of the tree-buffer, current selected directory and current
+selected source-file) and must return a string which will be displayed in the
+modeline.
+
+The whole modeline of the tree-buffer consists of the prefix of
+`ecb-mode-line-prefixes' and the data of `ecb-mode-line-data'."
+  :group 'ecb-general
+  :set (function (lambda (symbol value)
+                   (set symbol value)
+                   (if (and (boundp 'ecb-minor-mode)
+                            ecb-minor-mode)
+                       (ecb-mode-line-format))))
+  :initialize 'custom-initialize-default
+  :type '(list (radio :tag "Directory-buffer"
+                      (const :tag "Current selected directory"
+                             :value selected)
+                      (const :tag "Nothing" :value nil)
+                      (function :tag "Custom function" :value ignore))
+               (radio :tag "Sources-buffer"
+                      (const :tag "Current selected directory"
+                             :value selected)
+                      (const :tag "Nothing" :value nil)
+                      (function :tag "Custom function" :value ignore))
+               (radio :tag "Methods-buffer"
+                      (const :tag "Current selected source"
+                             :value selected)
+                      (const :tag "Nothing" :value nil)
+                      (function :tag "Custom function" :value ignore))
+               (radio :tag "History-buffer"
+                      (const :tag "Nothing" :value nil)
+                      (function :tag "Custom function" :value ignore))))
+  
+
 (defun ecb-mode-line-format ()
   "Update all of the modelines of each buffer."
   (save-excursion
     ;; update the modeline for each visible(!!) ECB-buffer (some ECB-buffers
     ;; are not visible in all layouts!)  
-    (ecb-mode-line-set ecb-directories-buffer-name (nth 0 ecb-mode-line-prefixes)
-		       ecb-path-selected-directory)
-    (ecb-mode-line-set ecb-sources-buffer-name (nth 1 ecb-mode-line-prefixes)
-		       ecb-path-selected-directory)
-    (ecb-mode-line-set ecb-methods-buffer-name (nth 2 ecb-mode-line-prefixes)
-		       (when ecb-path-selected-source
-			 (file-name-nondirectory ecb-path-selected-source)))
-    (ecb-mode-line-set ecb-history-buffer-name (nth 3 ecb-mode-line-prefixes))))
+    (ecb-mode-line-set ecb-directories-buffer-name
+                       (nth 0 ecb-mode-line-prefixes)
+                       (cond ((equal (nth 0 ecb-mode-line-data) 'selected)
+                              ecb-path-selected-directory)
+                             ((null (nth 0 ecb-mode-line-data))
+                              nil)
+                             ((functionp (nth 0 ecb-mode-line-data))
+                              (funcall (nth 0 ecb-mode-line-data)
+                                       ecb-directories-buffer-name
+                                       ecb-path-selected-directory
+                                       ecb-path-selected-source))))
+    (ecb-mode-line-set ecb-sources-buffer-name
+                       (nth 1 ecb-mode-line-prefixes)
+                       (cond ((equal (nth 1 ecb-mode-line-data) 'selected)
+                              ecb-path-selected-directory)
+                             ((null (nth 1 ecb-mode-line-data))
+                              nil)
+                             ((functionp (nth 1 ecb-mode-line-data))
+                              (funcall (nth 1 ecb-mode-line-data)
+                                       ecb-sources-buffer-name
+                                       ecb-path-selected-directory
+                                       ecb-path-selected-source))))
+    (ecb-mode-line-set ecb-methods-buffer-name
+                       (nth 2 ecb-mode-line-prefixes)
+                       (cond ((equal (nth 2 ecb-mode-line-data) 'selected)
+                              (when ecb-path-selected-source
+                                (file-name-nondirectory ecb-path-selected-source)))
+                             ((null (nth 2 ecb-mode-line-data))
+                              nil)
+                             ((functionp (nth 2 ecb-mode-line-data))
+                              (funcall (nth 2 ecb-mode-line-data)
+                                       ecb-methods-buffer-name
+                                       ecb-path-selected-directory
+                                       ecb-path-selected-source))))
+    (ecb-mode-line-set ecb-history-buffer-name
+                       (nth 3 ecb-mode-line-prefixes)
+                       (cond ((null (nth 3 ecb-mode-line-data))
+                              nil)
+                             ((functionp (nth 3 ecb-mode-line-data))
+                              (funcall (nth 3 ecb-mode-line-data)
+                                       ecb-history-buffer-name
+                                       ecb-path-selected-directory
+                                       ecb-path-selected-source))))))
+                       
 
 (defun ecb-mode-line-set (buffer-name prefix &optional text)
   "Sets the mode line for a buffer. The mode line has the scheme:
       (ecb-mode-line-update-buffer
        buffer-name
        (concat shown-prefix
-               (if text
+               (if (stringp text)
                    (ecb-mode-line-get-directory
                     shown-prefix
                     text

File ecb-speedbar.el

 ;; Copyright (C) 2000-2003 Kevin A. Burton (burton@openprivacy.org)
 
 ;; Author: Kevin A. Burton (burton@openprivacy.org)
+;;         Klaus berndl (klaus.berndl@sdm.de)
 ;; Maintainer: Kevin A. Burton (burton@openprivacy.org)
+;;             Klaus berndl (klaus.berndl@sdm.de)
 ;; Location: http://relativity.yi.org
 ;; Keywords: 
-;; Version: 1.1.
 
 ;; This file is [not yet] part of GNU Emacs.
 
 
 ;;; Commentary:
 
-;; This package provide speedbar integration for the ECB.
+;; This package provide speedbar integration and using for the ECB.
 ;;
-;; This allows you to:
+;; There are two complete different aspects of integration/using speedbar for
+;; ECB:
 ;;
-;; - Sync up to the speedbar with the current buffer.
+;; 1. Integration the speedbar itself into the ecb-frame:
 ;;
-;; - Files opened with the speedbar are displayed in the ecb source window.
+;;    This allows you to:
+;;    
+;;    - Sync up to the speedbar with the current buffer.
+;;    
+;;    - Files opened with the speedbar are displayed in the ecb source window.
 ;;
-;; Note that this is tested with recent speedbars >= 0.14beta2. If the
+;; 2. Using the speedbar-mechanism for parsing files supported not by semantic
+;;    but by imenu and/or etags.
+;;
+;;    This is not done via the speedbar-display but only the parsing mechanism
+;;    of `speedbar-fetch-dynamic-tags' is used and the tags are natively
+;;    display in the methods-buffer of ECB!
+;;
+;; Note that this is tested with recent speedbars >= 0.14beta1. If the
 ;; speedbar implementation changes a lot this could break.
 ;;
 ;; If you enjoy this software, please consider a donation to the EFF
 
 ;;; History:
 ;;
-;; - Thu DEc 19 2002 6:54 PM (klaus.berndl@sdm.de): Full integrated in ECB and
+;; - Mon Jun 23 2003 11:54 AM (klaus.berndl@sdm.de): Added speedbar-mechanism
+;;   for parsing files not supported by semantic but by imenu and/or etags.
+;;
+;; - Thu Dec 19 2002 6:54 PM (klaus.berndl@sdm.de): Full integrated in ECB and
 ;;   fixed some bugs. Now the speedbar integration seems to work very well.
 ;;
 ;; - Sat Dec 15 2001 03:10 AM (burton@openprivacy.org): only sync up the eshell
-;; if the current file is in a different dir than the speedbar.
+;;   if the current file is in a different dir than the speedbar.
 ;;
 ;; - Fri Dec 14 2001 10:11 PM (burton@openprivacy.org): when we hit <ENTER> on a
-;; file in the speedbar window, a new window is created.
+;;   file in the speedbar window, a new window is created.
 ;;
 ;; - Sun Nov 18 2001 01:46 AM (burton@openprivacy.org): BUG: we need to set
-;; dframe-activate-frame to the current frame and NOT use an invisible frame.
-;; This is important because when I select a buffer in ECB it can't use the
-;; invisible frame.  :(
+;;   dframe-activate-frame to the current frame and NOT use an invisible
+;;   frame. This is important because when I select a buffer in ECB it can't
+;;   use the invisible frame. :(
 ;;
-;; Sat Nov 10 2001 09:30 PM (burton@openprivacy.org): implementation of
-;; ecb-delete-other-windows-in-editwindow-20
+;; - Sat Nov 10 2001 09:30 PM (burton@openprivacy.org): implementation of
+;;   ecb-delete-other-windows-in-editwindow-20
 
 
 
 (require 'speedbar)
 (require 'ecb-util)
 
+;; imenu
+(silentcomp-defvar imenu--rescan-item)
+(silentcomp-defvar imenu--index-alist)
+
+
 (defconst ecb-speedbar-version-ok (and (boundp 'speedbar-version)
                                        (stringp speedbar-version)
                                        (string-match "^0\\.\\(1[4-9]\\|[2-9][0-9]*\\)"
                                                      speedbar-version))
-  "ECB can only integrate speedbar versions >= 0.14beta1 so the value is only
-true for these versions.")
+  "ECB can only integrate and use speedbar versions >= 0.14beta1 so the value
+is only true for these versions.")
+
+(if (not ecb-speedbar-version-ok)
+    (ecb-error "Integrating speedbar or parsing of non-semantic-sources need speedbar-version >= 0.14beta1!"))
 
 (defconst ecb-speedbar-adviced-functions '((speedbar-click . around)
                                            (speedbar-frame-mode . around)
 adviced with more than one class \(e.g. with a before and an after-advice)
 then for every class a cons must be added to this list.")
 
-
-
 (defadvice speedbar-click (around ecb)
   "Makes the function compatible with ECB. If ECB is active and the window of
 `ecb-speedbar-buffer-name' is visible \(means a layouts uses the
          (select-window (get-buffer-window ecb-speedbar-buffer-name)))))
 
 
-(defun ecb-set-speedbar-buffer()
+(defun ecb-speedbar-set-buffer()
   "Set the speedbar buffer within ECB."
   (ecb-speedbar-activate)
   (set-window-buffer (selected-window)
     ;;reset the selection variable
     (setq speedbar-last-selected-file nil)))
 
+
 (defun ecb-speedbar-deactivate ()
   "Reset things as before activating speedbar by ECB"
   (if (not ecb-speedbar-version-ok)
-      (error "Speedbar integration needs speedbar-version >= 0.14beta1!")      
+      (error "Speedbar integration needs speedbar-version >= 0.14beta1!")
     (ecb-speedbar-disable-advices)
   
     (setq speedbar-frame nil)
       (setq speedbar-buffer nil))))
 
 
+
+(defun ecb-speedbar-active-p ()
+  "Return not nil if speedbar is active and integrated in the `ecb-frame'."
+  (and (get-buffer ecb-speedbar-buffer-name)
+       (get-buffer-window (get-buffer ecb-speedbar-buffer-name) ecb-frame)))
+
+(defun ecb-speedbar-update-contents ()
+  "Encapsulate updating the speedbar."
+  (speedbar-update-contents))
+
 (defun ecb-speedbar-current-buffer-sync()
   "Update the speedbar so that we sync up with the current file."
   (interactive)
                                     ecb-default-directory))
                  speedbar-buffer
                  (buffer-live-p speedbar-buffer))
-        (speedbar-update-contents)))))
+        (ecb-speedbar-update-contents)))))
+
+
+;; Handling of files which can not be parsed by semantic (i.e. there is no
+;; semantic-grammar available) but which can be parsed by imenu and/or etags
+;; via speedbar.
+
+(require 'tree-buffer)
+(require 'ecb-face)
+(defun ecb-create-non-semantic-tree (node tag-list)
+  "Add all tags of TAG-LIST with side-effects as children to NODE. TAG-LIST is
+a list generated by `ecb-get-tags-for-non-semantic-files'. TAG-LIST is of the
+form:
+\( \(\"name\" . marker-or-number) <-- one tag at this level
+  \(\"name\" \(\"name\" . mon) (\"name\" . mon) )  <-- one group of tags
+  \(\"name\" mon \(\"name\" . mon) )             <-- group w/ a pos. and tags
+
+Groups can contain tags which are groups again...therefore this function is
+called recursive for the elements of a group.
+
+Return NODE."
+  (let ((new-node nil))
+    (dolist (tag tag-list)
+      (cond ((null tag) nil)            ;this would be a separator
+            ((speedbar-generic-list-tag-p tag)
+             (tree-node-new (progn
+                              (set-text-properties
+                               0 (length (car tag))
+                               `(face ,ecb-method-non-semantic-face) (car tag))
+                              (car tag))
+                            0
+                            (list (car tag)
+                                  (intern (car tag))
+                                  nil nil nil
+                                  (make-vector 2 (cdr tag)))
+                            t
+                            node))
+            ((speedbar-generic-list-positioned-group-p tag)
+             (ecb-create-non-semantic-tree
+              (setq new-node
+                    (tree-node-new (progn
+                                     (set-text-properties
+                                      0 (length (car tag))
+                                      `(face ,ecb-method-non-semantic-face) (car tag))
+                                     (car tag))
+                                   0
+                                   (list (car tag)
+                                         (intern (car tag))
+                                         nil nil nil
+                                         (make-vector 2 (car (cdr tag))))
+                                   nil node))
+              (cdr (cdr tag)))
+             (tree-node-set-expanded new-node
+                                     (member major-mode
+                                             ecb-non-semantic-methods-initial-expand)))
+            ((speedbar-generic-list-group-p tag)
+             (ecb-create-non-semantic-tree
+              (setq new-node
+                    (tree-node-new (progn
+                                     (set-text-properties
+                                      0 (length (car tag))
+                                      `(face ,ecb-method-non-semantic-face) (car tag))
+                                     (car tag))
+                                   1
+                                   nil nil node))
+              (cdr tag))
+             (tree-node-set-expanded new-node
+                                     (member major-mode
+                                             ecb-non-semantic-methods-initial-expand)))
+            (t (ecb-error "ecb-create-non-semantic-tree: malformed tag-list!")
+               )))
+    node))
+
+(defun ecb-get-tags-for-non-semantic-files ()
+  "Get a tag-list for current source-file. This is done via the
+`speedbar-fetch-dynamic-tags' mechanism which supports imenu and etags."
+  (if (not ecb-speedbar-version-ok)
+      (error "Parsing of non-semantic-sources needs speedbar-version >= 0.14beta1!")
+    (require 'imenu)
+    (if (member major-mode ecb-non-semantic-exclude-modes)
+        nil
+      (let* ((lst (let ((speedbar-dynamic-tags-function-list
+                         (if (not (assoc major-mode
+                                         ecb-non-semantic-parsing-function))
+                             speedbar-dynamic-tags-function-list
+                           (list (cons (cdr (assoc major-mode
+                                                   ecb-non-semantic-parsing-function))
+                                       'identity)))))
+                    (speedbar-fetch-dynamic-tags (buffer-file-name
+                                                  (current-buffer)))))
+             (tag-list (cdr lst))
+             (methods speedbar-tag-hierarchy-method))
+    
+        ;; removing the imenu-Rescan-item
+        (if (string= (car (car tag-list)) (car imenu--rescan-item))
+            (setq tag-list (cdr tag-list)))
+        ;; If imenu or etags returns already groups (etags will do this probably
+        ;; not, but imenu will do this sometimes - e.g. with cperl) then we do not
+        ;; regrouping with the speedbar-methods of
+        ;; `speedbar-tag-hierarchy-method'!
+        (when (dolist (tag tag-list t)
+                (if (or (speedbar-generic-list-positioned-group-p tag)
+                        (speedbar-generic-list-group-p tag))
+                    (return nil)))
+          (while methods
+            (setq tag-list (funcall (car methods) tag-list)
+                  methods (cdr methods))))
+        tag-list))))
+
 
 (silentcomp-provide 'ecb-speedbar)
 

File ecb-upgrade.el

     (ecb-layout-switch-to-compilation-window . (ecb-layout-switch-to-compilation-window
                                                  ecb-upgrade-switch-to-compilation-window))
     (ecb-truncate-lines . (ecb-truncate-lines
-                           ecb-upgrade-truncate-lines)))
-  
+                           ecb-upgrade-truncate-lines))
+    (ecb-use-speedbar-for-directories . (ecb-use-speedbar-instead-native-tree-buffer
+                                         ecb-upgrade-use-speedbar-for-directories)))
   "Alist of all options which should be upgraded for current ECB-version.
 There are several reasons why an option should be contained in this alist:
 a) An old option has just be renamed in current-ECB version but has still the
                       (ecb-upgrade-layout-nr2name elem)))
           old-val))
 
+(defun ecb-upgrade-use-speedbar-for-directories (old-val)
+  (if old-val
+      'dir))
+
 ;; not used anymore beginning with ECB 1.91.1
 ;; (defun ecb-upgrade-layout-window-sizes (old-val)
 ;;   (let ((l (copy-tree old-val)))
 
 ;; IMPORTANT: The version-number is auto-frobbed from the Makefile. Do not
 ;; change it here!
-(defconst ecb-version "1.93"
+(defconst ecb-version "1.94"
   "Current ECB version.")
 
 ;; This program is free software; you can redistribute it and/or modify it under
 (silentcomp-defvar tar-subfile-mode)
 (silentcomp-defvar archive-subfile-mode)
 
-;; ecb-speedbar is first loaded if ecb-use-speedbar-for-directories is set to
-;; true
+;; ecb-speedbar is are first loaded if
+;; ecb-use-speedbar-instead-native-tree-buffer is set to not nil or if
+;; non-semantic-sources are openend and ecb-process-non-semantic-files is not
+;; nil.
+(silentcomp-defun ecb-speedbar-active-p)
 (silentcomp-defun ecb-speedbar-deactivate)
 (silentcomp-defvar ecb-speedbar-buffer-name)
+(silentcomp-defun ecb-speedbar-update-contents)
+(silentcomp-defun ecb-get-tags-for-non-semantic-files)
+(silentcomp-defun ecb-create-non-semantic-tree)
 
 ;;====================================================
 ;; Variables
   :group 'ecb
   :prefix "ecb-")
 
+(defgroup ecb-non-semantic nil
+  "Settings for parsing and displaying non-semantic files."
+  :group 'ecb
+  :prefix "ecb-")
 
 (defcustom ecb-use-recursive-edit nil
   "*Tell ECB to use a recursive edit so that it can easily be deactivated
                         (string :tag "Layout name"))))
 
 
-(defcustom ecb-use-speedbar-for-directories nil
-  "*If true then uses speedbar for displaying and handling directories.
+(defcustom ecb-use-speedbar-instead-native-tree-buffer nil
+  "*If true then uses speedbar for directories, sources or methods.
 This means that speedbar is integrated in the ECB-frame and is displayed in
-that window normally displaying the standard ECB-directories-buffer.
-
-This option takes effect in all layouts which contain a directory window.
-
-Note: A similar effect and useability is available by setting this option to
-nil and setting `ecb-show-sources-in-directories-buffer' to not nil, because
-this combination displays also directories and sources in one window.
-
-`ecb-use-speedbar-for-directories' is for people who like the speedbar way
-handling directories amd source-files and want it in conjunction with ECB."
+that window normally displaying the standard ECB-directories-buffer,
+ECB-sources-buffer or ECB-methods-buffer.
+
+This option takes effect in all layouts which contain either a directory
+window, a sources window or a method window.
+
+This option can have four valid values:
+- nil: Do not use speedbar \(default)
+- dir: Use speedbar instead of the standard directories-buffer
+- source: Use speedbar instead of the standard sources-buffer
+- method: Use speedbar instead of the standard methods-buffer
+
+Note: For directories and sources a similar effect and useability is available
+by setting this option to nil \(or 'method) and setting
+`ecb-show-sources-in-directories-buffer' to not nil, because this combination
+displays also directories and sources in one window.
+
+`ecb-use-speedbar-instead-native-tree-buffer' is for people who like the
+speedbar way handling directories and source-files or methods and want it in
+conjunction with ECB."
+  :group 'ecb-general
   :group 'ecb-directories
-  :type 'boolean
+  :group 'ecb-sources
+  :group 'ecb-methods
+  :type '(radio (const :tag "Do not use speedbar" :value nil)
+                (const :tag "For directories" :value dir)
+                (const :tag "For sources" :value source)
+                (const :tag "For methods" :value method))
   :set (function (lambda (sym val)
                    (set sym val)
                    (let ((ecb-redraw-layout-quickly nil))
                      (ecb-redraw-layout-full)))))
 
+(defcustom ecb-directories-update-speedbar 'auto
+  "*Update an integrated speedbar after selecting a directory.
+
+If not nil then an integrated speedar will be updated after selecting a
+directory in the ECB-directories-buffer so the speedbar displays the contents
+of that directory.
+
+Of course this option makes only sense if the integrated speedbar is displayed
+in addition to the ECB-directories-buffer.
+
+This option can have the following values:
+- t: Always update speedbar.
+- nil: Never update speedbar.
+- auto: Update when senseful \(see scenarios below)
+- <function>: A user-defined function. The function is called after a
+  directory is selected, gets the selected directory as argument and has to
+  return nil if the the integrated speedbar should NOT be updated.
+
+Two example-scenarios where different values for this option can be senseful:
+
+If `ecb-show-sources-in-directories-buffer' is not nil or you have a layout
+where an ECB-sources-buffer is visible then you probably want to use the
+ECB-directories-buffer \(and/or the ECB-sources-buffer) for directory- and
+file-browsing. If you have in addition an integrated speedbar running then you
+probably want to use speedbar instead of the ECB-methods-buffer for
+source-content-browsing. In this case you probably want the speedbar not be
+updated because you do not need speedbar reflecting the current-directory
+contents but only the contents of the currently selected source-file and the
+integrated speedbar updates itself autom. for the latter one!
+
+If `ecb-show-sources-in-directories-buffer' is nil and there is also no
+ECB-sources-buffer visible in the current layout then you probably want to use
+an integrated speedbar for browsing directory-contents \(i.e. the files) and
+file-contents \(instead of the ECB-methods-buffer for example). In this case
+you probably want the speedbar updated because you need speedbar reflecting
+the current-directory contents so you can select files.
+
+The value 'auto \(see above) takes exactly these two scenarios into account."
+  :group 'ecb-directories
+  :type '(radio (const :tag "Always" :value t)
+                (const :tag "Never" :value nil)
+                (const :tag "Automatic" :value auto)
+                (function :tag "Custom function")))
 
 (defun ecb-show-sources-in-directories-buffer-p ()
   (cond ((equal ecb-show-sources-in-directories-buffer 'never)
   But expanding is only done if the type of the token under point in the
   edit-buffer is contained in `ecb-methods-nodes-expand-spec'.
 - all: Like expand-spec but expands all tokens regardess of the setting in
-  `ecb-methods-nodes-expand-spec'."
+  `ecb-methods-nodes-expand-spec'.
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :type '(radio (const :tag "No auto. expand" :value nil)
                 (const :tag "Expand as specified" :value expand-spec)
   :type 'boolean)
 
 (defcustom ecb-font-lock-tokens t
-  "*Adds font-locking \(means highlighting) to the ECB-method buffer."
+  "*Adds font-locking \(means highlighting) to the ECB-method buffer.
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :set (function (lambda (symbol value)
 		   (set symbol value)
 or call `widen' (C-x n w).
 
 Note: The same effect can be achieved by using the POWER-click in the
-methods-buffer \(see `ecb-primary-secondary-mouse-buttons')."
+methods-buffer \(see `ecb-primary-secondary-mouse-buttons').
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :type 'boolean)
 
 
 The default are empty prefix/suffix-strings and 'ecb-bucket-token-face'. But
 an alternative can be for example '\(\"[\" \"]\" nil) which means no special
-face and a display like \"[+] [<bucket-name>]\"."
+face and a display like \"[+] [<bucket-name>]\".
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :set (function (lambda (symbol value)
 		   (set symbol value)
 
 If the value is nil, i.e. neither a function for a major-mode is defined nor
 the special 'default, then `semantic-prototype-nonterminal' is used for
-displaying the tokens."
+displaying the tokens.
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :set (function (lambda (symbol value)
 		   (set symbol value)
 with special faces \(the specifiers itself are not removed) and in all other
 modes \"class\"es and grouping-tokens \(see `ecb-token-display-function',
 `ecb-group-function-tokens-with-parents') have special faces and the \"class\"
-specifier-string is removed from the display."
+specifier-string is removed from the display.
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :set (function (lambda (symbol value)
 		   (set symbol value)
 outside the class-definition \(e.g. C++, Eieio) the function
 `ecb-group-function-tokens-with-parents' can be used to get a much better
 method-display in the methods-window of ECB, because all method
-implementations of a class are grouped together."
+implementations of a class are grouped together.
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :type '(repeat (cons (symbol :tag "Major-mode")
                        (function :tag "Postprocess function"))))
 Example: With CLOS or Eieio source-code there can exist some positionless
 nodes like variable-attributes in a `defclass' form which are only displayed
 if this option is nil. Displaying such nodes can be sensefull even if they can
-not be jumped."
+not be jumped.
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :type 'boolean)
 
 - access: Sort by token access (public, protected, private) and then by name.
 - nil:    Don't sort tokens. They appear in the same order as in the source
           buffer.
-"
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :set (function (lambda (symbol value)
 		   (set symbol value)
 `semantic-symbol->name-assoc-list' then the symbol with this bucket-name as
 name is also a valid symbol for this list. Example: In ECB there are buckets
 \"\[Parents\]\". The bucket-name is \"Parents\" and the valid symbol-name is
-then 'Parents."
+then 'Parents.
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :type '(radio (const :tag "All node-types" :value all)
                 (repeat :tag "Node-type list"
 
 (defcustom ecb-methods-nodes-collapse-spec 'all
   "*Semantic token-types collapsed by `ecb-expand-methods-nodes'.
-
-For valid values of this option see `ecb-methods-nodes-expand-spec'!"
+For valid values of this option see `ecb-methods-nodes-expand-spec'!
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :type '(radio (const :tag "All node-types" :value all)
                 (repeat :tag "Node-type list"
 (defcustom ecb-exclude-parents-regexp nil
   "*Regexp which parent classes should not be shown in the methods buffer
 \(see also `ecb-show-parents'). If nil then all parents will be shown if
-`ecb-show-parents' is not nil."
+`ecb-show-parents' is not nil.
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :set (function (lambda (symbol value)
 		   (set symbol value)
 - highlight: Only highlight the current method of the edit window in the
   method window if the method is visible in the method-window.
 - nil: No highlighting is done.
-See also `ecb-highlight-token-with-point-delay'."
+See also `ecb-highlight-token-with-point-delay'.
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :type '(radio (const :tag "Highlight and scroll window"
                        :value highlight-scroll)
 though almost the same effect as if you set no delay. But such a delay
 prevents also \"jumping backward/forward\" during scrolling within
 java-classes if point goes out of method-definition into class-definition.
-Therefore the default value is a delay of 0.25 seconds."
+Therefore the default value is a delay of 0.25 seconds.
+
+This options takes only effect for semantic-sources - means sources supported
+by semantic!"
   :group 'ecb-methods
   :type '(radio (const :tag "No highlighting delay"
                        :value nil)
 + Sources- and History-buffer: Only displaying the source-contents in the
   method-buffer but not displaying the source-file in the edit-window.
 + Methods-buffer: Narrowing to the clicked method/variable/ect... \(see
-  `ecb-token-jump-narrow').
+  `ecb-token-jump-narrow'). This works only for sources supported by semantic!
 
 In addition always the whole node-name is displayed in the minibuffer after a
 POWER-click \(for this see also `ecb-show-node-info-in-minibuffer').
   :group 'ecb-history
   :type 'hook)
 
+(defcustom ecb-process-non-semantic-files (if (locate-library "speedbar")
+                                              t)
+  "*Display contents of non-semantic-files in the ECB-methods-buffer. See also
+`ecb-non-semantic-parsing-function'."
+  :group 'ecb-general
+  :group 'ecb-non-semantic
+  :type 'boolean)
+
+(defcustom ecb-non-semantic-parsing-function nil
+  "*Define mode-dependend parsing functions for non-semantic files.
+This is an alist where the car is a major-mode symbol and the cdr is a
+function-symbol of a function which should be used for parsing a non-semantic
+buffer, i.h. a buffer for which no semantic grammar exists. Such a function
+gets one argument - the filename of current buffer - and has to generate and
+return a token/tag list which is understandable by
+`speedbar-insert-generic-list'. speedbar has already included two functions
+`speedbar-fetch-dynamic-imenu' and `speedbar-fetch-dynamic-etags' which can be
+used for parsing buffers with imenu resp. etags.
+
+This option takes only effect if `ecb-process-non-semantic-files' is not nil:
+Then ECB checks for non-semantic buffers if current `major-mode' is contained
+in this option and if yes, then the specified parsing function is called;
+if not then the cars of the elements of `speedbar-dynamic-tags-function-list'
+are called in that sequence they are listed in this variable. See option
+`speedbar-dynamic-tags-function-list' for further details.
+
+In most cases imenu-parsing is preferable over etags-parsing because imenu
+operates on Emacs-buffers and needs no external tool and therefore parsing
+works also if current contents of a buffer are not saved to disk. But maybe
+sometimes etags may return better parsing results.
+
+IMPORTANT: if imenu-parsing should be used then the option
+`speedbar-use-imenu-flag' must be set to not nil!"
+  :group 'ecb-methods
+  :group 'ecb-non-semantic
+  :type '(repeat (cons (symbol :tag "Major-mode")
+                       (function :tag "Parsing function"))))
+
+
+(defcustom ecb-non-semantic-methods-initial-expand nil
+  "*Initially expand all tokens for not by semantic supported sources.
+This option can be customized on a major-mode basis, i.e. if a `major-mode' is
+contained in this option then al tokens for this modes will be initially
+expanded - otherwise not."
+  :group 'ecb-methods
+  :group 'ecb-non-semantic
+  :type '(repeat :tag "Expand this modes"
+                 (symbol :tag "major mode")))
+
+(defcustom ecb-auto-save-before-etags-methods-rebuild t
+  "*Automatic saving of current buffer before rebuilding its methods.
+
+This option is only relevant for sources which are supported and parsed by
+etags \(see `ecb-process-non-semantic-files'). Because etags is an external
+tool a source-buffer can only be reparsed if the buffer is saved to disk. So
+the command `ecb-rebuild-methods-buffer' checkes for sources which are not
+supported by semantic or imenu if either this option is t or if the major-mode
+of the source-buffer is contained in this list: In both cases ECB saves the
+current source-buffer before it re-runs etags for reparsing the source.
+If nil or if the major-mode is not contained then no automatic saving will be
+done!
+
+For all source supported by semantic or by imenu this option takes no effect."
+  :group 'ecb-methods
+  :group 'ecb-non-semantic
+  :type '(radio (const :tag "For all etags modes" :value t)
+                (repeat :tag "For these modes" (symbol :tag "Major-mode"))))
+
+(defcustom ecb-non-semantic-exclude-modes '(sh-mode fundamental-mode text-mode)
+  "*Exclude modes from parsing with imenu or etags.
+Per default, ECB tries to parse all file-types not supported by semantic with
+imenu or etags or some other method \(for details see the option
+`ecb-non-semantic-parsing-function'). If a file-type can not be parsed by
+semantic, imenu or etags than this simply results in an empty method-buffer
+for this file. But nevertheless you will get a message \"Sorry, no support for
+a file of that extension\" which comes from the speedbar-library and can not
+switched off. Therefore if a `major-mode' is known as not parsable by
+semantic, imenu or etags it can be added to this option and then it will be
+excluded from being tried to parsed."
+  :group 'ecb-non-semantic
+  :type '(repeat :tag "Modes to exclude"
+                 (symbol :tag "Major-mode")))
+
+(defcustom ecb-rebuild-non-semantic-methods-before-hook nil
+  "*Hook running at beginning of the function
+`ecb-rebuild-methods-buffer-for-non-semantic' so this function is always
+called by the command `ecb-rebuild-methods-buffer' for not semantic supported
+source-types.
+
+Every function of this hook gets one argument: The complete filename of the
+current source-buffer in the edit-window. The Method-buffer is only rebuild by
+`ecb-rebuild-methods-buffer-for-non-semantic' if either the hook contains no
+function \(the default) or if no function of this hook returns nil! See
+`run-hook-with-args-until-failure' for description how these function are
+prcessed."
+  :group 'ecb-methods
+  :group 'ecb-non-semantic
+  :type 'hook)
+  
 ;;====================================================
 ;; Internals
 ;;====================================================
 
 (defun ecb-goto-window-directories ()
   "Make the ECB-directories window the current window. If
-`ecb-use-speedbar-for-directories' is not nil then goto to the
+`ecb-use-speedbar-instead-native-tree-buffer' is 'dir then goto to the
 speedbar-window."
   (interactive)
   (or (ecb-goto-window ecb-directories-buffer-name)
-      (ecb-goto-window ecb-speedbar-buffer-name)))
+      (and (equal ecb-use-speedbar-instead-native-tree-buffer 'dir)
+           (ecb-goto-window-speedbar))))
 
 (defun ecb-goto-window-sources ()
-  "Make the ECB-sources window the current window."
+  "Make the ECB-sources window the current window. If
+`ecb-use-speedbar-instead-native-tree-buffer' is 'source then goto to the
+speedbar-window."
   (interactive)
-  (ecb-goto-window ecb-sources-buffer-name))
+  (or (ecb-goto-window ecb-sources-buffer-name)
+      (and (equal ecb-use-speedbar-instead-native-tree-buffer 'source)
+           (ecb-goto-window-speedbar))))
 
 (defun ecb-goto-window-methods ()
-  "Make the ECB-methods window the current window."
+  "Make the ECB-methods window the current window. If
+`ecb-use-speedbar-instead-native-tree-buffer' is 'method then goto to the
+speedbar-window."
   (interactive)
-  (ecb-goto-window ecb-methods-buffer-name))
+  (or (ecb-goto-window ecb-methods-buffer-name)
+      (and (equal ecb-use-speedbar-instead-native-tree-buffer 'method)
+           (ecb-goto-window-speedbar))))
 
 (defun ecb-goto-window-history ()
   "Make the ECB-history window the current window."
   (interactive)
   (ecb-goto-window ecb-history-buffer-name))
 
+(defun ecb-goto-window-speedbar ()
+  "Make the ECB-speedbar window the current window. This command does nothing
+if no integrated speedbar is visible in the ECB-frame."
+  (interactive)
+  (and (require 'ecb-speedbar)
+       (ecb-speedbar-active-p)
+       (ecb-goto-window ecb-speedbar-buffer-name)))
+
 (defun ecb-goto-window-edit1 ()
   "Make the \(first) edit-window window the current window."
   (interactive)
                                            ecb-font-lock-tokens))))
 
 (defun ecb-find-add-token-bucket (node type display sort-method buckets
-                                       &optional parent-token)
+                                       &optional parent-token no-bucketize)
   "Finds a bucket containing tokens of the given type, creates nodes for them
 and adds them to the given node. The bucket is removed from the buckets list.
 PARENT-TOKEN is only propagated to `ecb-add-token-bucket'."
     (let ((bucket (cadr buckets)))
       (if (eq type (semantic-token-token (cadr bucket)))
 	  (progn
-	    (ecb-add-token-bucket node bucket display sort-method parent-token)
+	    (ecb-add-token-bucket node bucket display sort-method parent-token
+                                  no-bucketize)
 	    (setcdr buckets (cddr buckets)))
 	(ecb-find-add-token-bucket node type display sort-method
-				   (cdr buckets) parent-token)))))
+				   (cdr buckets) parent-token no-bucketize)))))
 
 (defun ecb-format-bucket-name (name)
   (let ((formatted-name (concat (nth 0 ecb-bucket-token-display)
     formatted-name))
 
 (defun ecb-add-token-bucket (node bucket display sort-method
-                                  &optional parent-token)
+                                  &optional parent-token no-bucketize)
   "Adds a token bucket to a node unless DISPLAY equals 'hidden."
   (when bucket
     (let ((name (ecb-format-bucket-name (car bucket)))
 	  (ecb-update-token-node token
                                  (tree-node-new "" 0 token t bucket-node
                                                 (if ecb-truncate-long-names 'end))
-                                 parent-token))))))
-
-(defun ecb-update-token-node (token node &optional parent-token)
+                                 parent-token no-bucketize))))))
+
+(defun ecb-update-token-node (token node &optional parent-token no-bucketize)
   "Updates a node containing a token."
   (let* ((children (semantic-nonterminal-children
                     token ecb-show-only-positioned-tokens)))
     ;; flexible
     (tree-node-set-expanded node (eq 'type (semantic-token-token token)))
     (unless (eq 'function (semantic-token-token token))
-      (ecb-add-tokens node children token)
+      (ecb-add-tokens node children token no-bucketize)
       (tree-node-set-expandable
        node (not (eq nil (tree-node-get-children node)))))))
 
                         tok ecb-show-only-positioned-tokens)
                        (concat prefix "  ")))))
 
-(defun ecb-add-tokens (node tokens &optional parent-token)
-  (ecb-add-token-buckets node parent-token (semantic-bucketize tokens)))
+(defun ecb-add-tokens (node tokens &optional parent-token no-bucketize)
+  "If NO-BUCKETIZE is not nil then TOKENS will not bucketized by
+`semantic-bucketize' but must aleady been bucketized!"
+  (ecb-add-token-buckets node parent-token
+                         (if no-bucketize
+                             tokens
+                           (semantic-bucketize tokens))
+                         no-bucketize))
 
 (defun ecb-access-order (access)
   (cond
 	  tokens-by-name))
     tokens))
 
-(defun ecb-add-token-buckets (node parent-token buckets)
+(defun ecb-add-token-buckets (node parent-token buckets &optional no-bucketize)
   "Creates and adds token nodes to the given node.
 The PARENT-TOKEN is propagated to the functions `ecb-add-token-bucket' and
 `ecb-find-add-token-bucket'."
 				   2 parent t node
 				   (if ecb-truncate-long-names 'end)))))))))
        (t (ecb-find-add-token-bucket node type display sort-method buckets
-                                     parent-token)))))
+                                     parent-token no-bucketize)))))
   (let ((type-display (ecb-get-token-type-display t)))
     (dolist (bucket buckets)
       (ecb-add-token-bucket node bucket (cadr type-display)
-                            (caddr type-display) parent-token))))
+                            (caddr type-display) parent-token no-bucketize))))
 
 (defun ecb-update-after-partial-reparse (updated-tokens)
   "Updates the method buffer and all internal ECB-caches after a partial
     (if ecb-show-source-file-extension
         f
       (file-name-sans-extension f))))
-  
+
+(defun ecb-semantic-active-for-file (filename)
+  "Return not nil if FILENAME is already displayed in a buffer and if semantic
+is active for this buffer."
+  (and (get-file-buffer filename)
+       (save-excursion
+         (set-buffer (get-file-buffer filename))
+         (semantic-active-p))))
+
 (defun ecb-select-source-file (filename &optional force)
   "Updates the directories, sources and history buffers to match the filename
 given. If FORCE is not nil then the update of the directories buffer is done
              ecb-last-edit-window-with-point
              ;; this prevents updating the method buffer after saving a not
              ;; current buffer (e.g. with `save-some-buffers'), because this
-            ;; would result in displaying a method-buffer not belonging to the
+             ;; would result in displaying a method-buffer not belonging to the
              ;; current source-buffer.
              (equal (current-buffer)
                     (window-buffer ecb-last-edit-window-with-point)))
     (ecb-select-source-file ecb-path-selected-source)
-    (ecb-update-methods-buffer--internal)))
+    (ecb-rebuild-methods-buffer)))
 
 ;; This variable is only set and evaluated by the functions
 ;; `ecb-update-methods-buffer--internal' and
 ;; `ecb-rebuild-methods-buffer-with-tokencache'!
 (defvar ecb-method-buffer-needs-rebuild t)
-(defun ecb-update-methods-buffer--internal (&optional scroll-to-top)
+
+(defun ecb-update-methods-buffer--internal (&optional scroll-to-top
+                                                      rebuild-non-semantic)
   "Updates the methods buffer with the current buffer. The only thing what
 must be done is to start the toplevel parsing of semantic, because the rest is
 done by `ecb-rebuild-methods-buffer-with-tokencache' because this function is in
 the `semantic-after-toplevel-cache-change-hook'.
 If optional argument SCROLL-TO-TOP is non nil then the method-buffer is
-displayed with window-start and point at beginning of buffer."
+displayed with window-start and point at beginning of buffer.
+
+If second optional argument REBUILD-NON-SEMANTIC is not nil then non-semantic
+sources are forced to be rescanned and reparsed by
+`ecb-rebuild-methods-buffer-with-tokencache'. The function
+`ecb-rebuild-methods-buffer-for-non-semantic' is the only one settings this
+argument to not nil!"
   (when (and (equal (selected-frame) ecb-frame)
              (get-buffer-window ecb-methods-buffer-name))
     ;; Set here `ecb-method-buffer-needs-rebuild' to t so we can see below if
       ;; `ecb-rebuild-methods-buffer-with-tokencache'...
       (if ecb-method-buffer-needs-rebuild
           ;; the hook was not called therefore here manually
-          (ecb-rebuild-methods-buffer-with-tokencache current-tokencache t)))
+          (ecb-rebuild-methods-buffer-with-tokencache
+           current-tokencache
+           (semantic-active-p)
+           nil rebuild-non-semantic)))
     (when scroll-to-top
       (save-selected-window
 	(ecb-exec-in-methods-window
     (setq ecb-token-tree-cache
           (adelete 'ecb-token-tree-cache source-file-name))))
 
+
+;; The most important function for (re)building the Method-buffer
 (defun ecb-rebuild-methods-buffer-with-tokencache (updated-cache
-						   &optional no-update
-                                                   force-nil-cache)
+						   &optional no-update-semantic
+                                                   force-nil-cache
+                                                   non-semantic-rebuild)
   "Rebuilds the ECB-method buffer after toplevel-parsing by semantic. This
-function is added to the hook `semantic-after-toplevel-cache-change-hook'. If
-
-If NO-UPDATE is not nil then the tokens of the ECB-methods-buffer are not
-updated with UPDATED-TOKENS but the method-buffer is rebuild with these tokens
-ECB has already cached in it `ecb-token-tree-cache'.
+function is added to the hook `semantic-after-toplevel-cache-change-hook'.
+
+If NO-UPDATE-SEMANTIC is not nil then the tokens of the ECB-methods-buffer are
+not updated with UPDATED-CACHE but the method-buffer is rebuild with these
+tokens ECB has already cached in it `ecb-token-tree-cache'. Only relevant for
+semantic-parsed sources!
 
 If FORCE-NIL-CACHE is not nil then the method-buffer is even rebuild if
 UPDATED-CACHE is nil. Normally a nil cache is ignored if it belongs to a
-buffer with is setup for semantic-parsing; only nil caches for no-semantic
+buffer witch is setup for semantic-parsing; only nil caches for non-semantic
 buffers \(like plain text-buffers) are used for updating the method-buffers.
 With FORCE-NIL-CACHE the method-buffer is updated with a nil cache too, i.e.
-it is cleared."
+it is cleared.
+
+IF NON-SEMANTIC-REBUILD is not nil then current non-semantic-source is forced
+to be rescanned/reparsed and therefore the Method-buffer will be rebuild too."
   (when (and ecb-minor-mode
-             (ecb-point-in-edit-window)
-;;              (equal (selected-frame) ecb-frame)
+             (equal (selected-frame) ecb-frame)
              (get-buffer-window ecb-methods-buffer-name)
-             (buffer-file-name (current-buffer))
-             ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>:
-;;              (not (string= (buffer-name (current-buffer))
-;;              jde-project-file-name))
-             
+             (buffer-file-name (current-buffer))             
              ;; The functions of the hook
              ;; `semantic-after-toplevel-cache-change-hook' are also called
              ;; after clearing the cache to set the cache to nil if a buffer
              ;; is parsed which has no tokens. Here we do not want rebuilding
              ;; the method-buffer if the cache is nil but the current buffer
              ;; is set up for semantic-parsing, because the real rebuild
-             ;; should be done after the cache is filled again.
-             ;; If this hook is called "manually" by
-             ;; `ecb-update-methods-buffer--internal' then we do an update
-             ;; also for a nil cache if the buffer is not setup for semantic
-             ;; (like text-buffers) so we can clear out the method-buffer!
+             ;; should be done after the cache is filled again. If this hook
+             ;; is called "manually" by `ecb-update-methods-buffer--internal'
+             ;; then we do an update also for a nil cache if the buffer is not
+             ;; setup for semantic (like text-buffers or non-semantic-sources)
+             ;; so we can either clear out the method-buffer or fill it with
+             ;; parsing information of non-semantic-sources!
              (or updated-cache
                  (not (semantic-active-p))
                  force-nil-cache))
+
+    ;; no-update-semantic has to be nil for non-semantic-sources!
+    (if (not (semantic-active-p)) (setq no-update-semantic nil))
+    
     ;; the following cache-mechanism MUST use the (buffer-file-name
     ;; (current-buffer)) instead of ecb-path-selected-source because in case
     ;; of opening a buffer not via directory-window but via the
     ;; update this cache-element instead of always adding a new one to the
     ;; cache. Otherwith we would get more than one cache-element for the same
     ;; source!.
+    
     (let* ((norm-buffer-file-name (ecb-fix-filename
                                    (buffer-file-name (current-buffer))))
            (cached-tree (assoc norm-buffer-file-name ecb-token-tree-cache))
-           new-tree)
+           new-tree non-semantic-handling)
+      
       (if ecb-debug-mode
           (dolist (tok updated-cache)
             (ecb-semantic-assert-valid-token tok)))
-      (unless (and no-update cached-tree)
-	(setq new-tree (tree-node-new "root" 0 nil))
-	(ecb-add-tokens new-tree (ecb-post-process-tokenlist updated-cache))
+      
+      ;; here we process non-semantic buffers if the user wants this. But only
+      ;; if either non-semantic-rebuild is true or no cached-tree exists.
+      (when (and ecb-process-non-semantic-files
+                 (null updated-cache)
+                 (not (semantic-active-p))
+                 (buffer-file-name (current-buffer))
+                 (or non-semantic-rebuild (null cached-tree)))
+        (setq updated-cache (progn
+                              (ignore-errors (require 'ecb-speedbar))
+                              (ignore-errors
+                                (ecb-get-tags-for-non-semantic-files))))
+        (setq non-semantic-handling
+              (if updated-cache 'parsed 'parsed-failed)))
+
+      ;; Now non-semantic-handling is only nil either for semantic-sources or
+      ;; for non-semantic-sources if already a cached-tree exists and
+      ;; non-semantic-rebuild is nil (i.e. no rescan and rebuild is
+      ;; necessary). A not-nil value is only possible for non-semantic-sources
+      ;; and is then either 'parsed in case the parsing was successfull or
+      ;; 'parsed-failed.
+
+      ;; We always make a new token-tree with updated-cache except for
+      ;; - semantic-sources if no-update-semantic is true and already a
+      ;;   cached-tree exists. This means this function is NOT called by
+      ;;   `semantic-after-toplevel-cache-change-hook'.
+      ;; - non-semantic-sources if non-semantic-handling is false, because
+      ;;   then no rescan has been performed and updated-cache contains
+      ;;   nothing; see comment above.
+      (unless (or (and no-update-semantic cached-tree)  ;; for semantic-sources
+                  (and (not (semantic-active-p))    ;; for non-semantic-sources
+                       (not non-semantic-handling)
+                       ;; for clearing out non-semantic-buffers too after
+                       ;; killing one; see `ecb-kill-buffer-hook'.
+                       (not force-nil-cache)))
+        (setq new-tree (tree-node-new "root" 0 nil))
+        (if non-semantic-handling
+            (if (equal non-semantic-handling 'parsed)
+                (ecb-create-non-semantic-tree new-tree updated-cache))
+          (ecb-add-tokens new-tree (ecb-post-process-tokenlist updated-cache)))
         (if cached-tree
             (setcdr cached-tree new-tree)
           (setq cached-tree (cons norm-buffer-file-name new-tree))
           (setq ecb-token-tree-cache (cons cached-tree ecb-token-tree-cache))))
+
+      ;; Now we either update the method-buffer with a newly created
+      ;; token-tree or with the token-tree from the cache (with all its
+      ;; existing expansions!)
       (save-excursion
         (ecb-buffer-select ecb-methods-buffer-name)
         (tree-buffer-set-root (cdr cached-tree))
         (setq ecb-methods-root-node (cdr cached-tree))
         (setq tree-buffer-indent ecb-tree-indent)
         (tree-buffer-update)))
-
+    
     ;; Klaus Berndl <klaus.berndl@sdm.de>: after a full reparse all overlays
     ;; stored in the dnodes of the navigation-list now are invalid. Therefore
     ;; we have changed the implementation of ecb-navigate.el from storing
     ;; signalize that the rebuild has already be done
     (setq ecb-method-buffer-needs-rebuild nil)))
 
+(defun ecb-rebuild-methods-buffer-for-non-semantic ()
+  "Rebuild the ECB-method-buffer for current source-file of the edit-window.
+This function does nothing if point stays not in an edit-window of the
+ECB-frame or if current source-file is supported by semantic!
+
+Before rebuilding the Methods-buffer the hook
+`ecb-rebuild-non-semantic-methods-before-hook' is called. The Method-buffer is
+only rebuild if either the hook contains no function \(the default) or if no
+function of this hook returns nil! See `run-hook-with-args-until-failure' for
+description how these function are prcessed.
+
+The option `ecb-auto-save-before-etags-methods-rebuild' is checked before
+rescanning the source-buffer and rebuilding the methods-buffer.
+
+This function is called by the command `ecb-rebuild-methods-buffer'."
+  (when (and ecb-minor-mode
+             (equal (selected-frame) ecb-frame)
+             (not (semantic-active-p))
+             (ecb-point-in-edit-window))
+    (when (run-hook-with-args-until-failure
+           'ecb-rebuild-non-semantic-methods-before-hook
+           (buffer-file-name))
+      ;; For etags supported non-semantic-sources we maybe have to save the
+      ;; buffer first.
+      (if (and (not (and (boundp 'imenu--index-alist)
+                         imenu--index-alist))
+               (or (equal ecb-auto-save-before-etags-methods-rebuild t)
+                   (member major-mode
+                           ecb-auto-save-before-etags-methods-rebuild)))
+          (save-buffer))
+      (ecb-update-methods-buffer--internal nil t))))
+
+(defun ecb-rebuild-methods-buffer-for-semantic ()
+  "Rebuild the ECB-method-buffer for current source-file of the edit-window.
+This function does nothing if point stays not in an edit-window of the
+ECB-frame or if current source-file is not supported by semantic!"
+  (when (and ecb-minor-mode
+             (equal (selected-frame) ecb-frame)
+             (semantic-active-p)
+             (ecb-point-in-edit-window))
+    ;; to force a really complete rebuild we must completely clear the
+    ;; semantic cache for semantic-files.
+    (semantic-clear-toplevel-cache)
+    (ecb-update-methods-buffer--internal)))
+
 (defun ecb-rebuild-methods-buffer ()
   "Updates the methods buffer with the current buffer after deleting the
 complete previous parser-information, means no semantic-cache is used! Point
-must stay in an edit-window otherwise nothing is done.
-This method is merely needed if semantic parses not the whole buffer because
-it reaches a not parsable code.
-Examples when a call to this function is necessary:
+must stay in an edit-window otherwise nothing is done. This method is merely
+needed for semantic parsed buffers if semantic parses not the whole buffer
+because it reaches a not parsable code or for buffers not supported by
+semantic but by imenu or etags.
+
+Examples when a call to this function can be necessary:
+
 + If an elisp-file is parsed which contains in the middle a defun X where the
   closing ) is missing then semantic parses only until this defun X is reached
   and you will get an incomplete ECB-method buffer. In such a case you must
   complete the defun X and then call this function to completely reparse the
   elisp-file and rebuild the ECB method buffer!
-+ If you change only the name of a method or a variable and you want the new
-  name be shown immediately in the ECB-method buffer then you must call this
-  function."
+
++ For not semantic supported buffers which can be parsed by imenu or etags
+  \(see `ecb-process-non-semantic-files') because for these buffers there is
+  no builtin auto-rebuild mechanism. For these buffers this command calls
+  `ecb-rebuild-methods-buffer-for-non-semantic'.
+
+For non-semantic-sources supported by etags the option
+`ecb-auto-save-before-etags-methods-rebuild' is checked before rescanning the
+source-buffer and rebuilding the methods-buffer."
   (interactive)
-  (when (and ecb-minor-mode
-             (equal (selected-frame) ecb-frame)
-             (ecb-point-in-edit-window)
-             (y-or-n-p "Do you want completely rebuilding the method buffer? "))
-    ;; to force a really complete rebuild we must completely clear the
-    ;; semantic cache
-    (semantic-clear-toplevel-cache)
-    (ecb-update-methods-buffer--internal)))
+    (if (semantic-active-p)
+        (ecb-rebuild-methods-buffer-for-semantic)
+      (ecb-rebuild-methods-buffer-for-non-semantic)))
 
 (defun ecb-set-selected-source (filename other-edit-window
 					 no-edit-buffer-selection)
       ;; display the methods in the METHOD-buffer. We can not go back to
       ;; the edit-window because then the METHODS buffer would be
       ;; immediately updated with the methods of the edit-window.
-      (save-excursion
-	(set-buffer (find-file-noselect filename))
-	(ecb-update-methods-buffer--internal 'scroll-to-begin))
+        (save-excursion
+          (set-buffer (find-file-noselect filename))
+          (ecb-update-methods-buffer--internal 'scroll-to-begin))
     ;; open the selected source in the edit-window and do all the update and
     ;; parsing stuff with this buffer
     (ecb-find-file-and-display ecb-path-selected-source
 It does several tasks:
 - Depending on the value in `ecb-kill-buffer-clears-history' the corresponding
   entry in the history-buffer is removed.
-- Clearing the method buffer if a semantic-parsed buffer has been killed.
+- Clearing the method buffer if a file-buffer has been killed.
 - The entry of the removed file-buffer is removed from `ecb-token-tree-cache'."
   (let ((buffer-file (ecb-fix-filename (buffer-file-name (current-buffer)))))
     ;; 1. clearing the history if necessary
                        (y-or-n-p "Remove history entry for this buffer? ")))
               (ecb-clear-history-node node)))))
 
-    ;; 2. clearing the method buffer if a semantic parsed buffer is killed
-    (if (and buffer-file (semantic-active-p))
+    ;; 2. clearing the method buffer if a file-buffer is killed
+    (if buffer-file
         (ecb-rebuild-methods-buffer-with-tokencache nil nil t))
 
     ;; 3. removing the file-buffer from `ecb-token-tree-cache'. Must be done
   (interactive)
   ;; we must manually cut a filename because we must not add filenames to
   ;; `ecb-source-path'!
-  (let* ((my-dir (ecb-fix-filename
+  (let* ((use-dialog-box nil)
+         (my-dir (ecb-fix-filename
                   (or dir
                       (file-name-directory (read-file-name "Add source path: ")))
                   t))
   (ecb-files-and-subdirs-cache-remove dir)
   (ecb-sources-cache-remove dir))
 
+(defun ecb-directory-update-speedbar (dir)
+  "Update the integrated speedbar if necessary."
+  (and (featurep 'ecb-speedbar)
+       (ecb-speedbar-active-p)
+       ;; depending on the value of `ecb-directory-update-speedbar' we have to
+       ;; check if it is senseful to update the speedbar.
+       (or (equal ecb-directories-update-speedbar t)
+           (and (equal ecb-directories-update-speedbar 'auto)
+                (not (or (get-buffer-window ecb-sources-buffer-name ecb-frame)
+                         (member ecb-layout-name
+                                 ecb-show-sources-in-directories-buffer))))
+           (and (not (equal ecb-directories-update-speedbar 'auto))
+                (functionp ecb-directories-update-speedbar)
+                (funcall ecb-directories-update-speedbar dir)))
+       (ecb-speedbar-update-contents)))
+                    
+
 (defun ecb-directory-clicked (node ecb-button shift-mode)
   (if (= 3 (tree-node-get-type node))
       (funcall (tree-node-get-data node))
             (if shift-mode
                 (ecb-remove-dir-from-caches (tree-node-get-data node)))
             
-            (ecb-set-selected-directory (tree-node-get-data node)))
-            
+            (ecb-set-selected-directory (tree-node-get-data node))
+            ;; if we have running an integrated speedbar we must update the
+            ;; speedbar 
+            (ecb-directory-update-speedbar (tree-node-get-data node)))
+          
           (ecb-exec-in-directories-window
            ;; Update the tree-buffer with optimized display of NODE
            (tree-buffer-update node)))
 - LEVEL ~ 10 should normally expand all nodes unless there are nodes which
   are indented deeper than 10.
 
-Note: This command switches off auto. expanding of the method-buffer if
+Note 1: This command switches off auto. expanding of the method-buffer if
 `ecb-expand-methods-switch-off-auto-expand' is not nil. But it can be switched
-on again quickly with `ecb-toggle-auto-expand-token-tree' or \[C-c . a]."
+on again quickly with `ecb-toggle-auto-expand-token-tree' or \[C-c . a].
+
+Note 2: All this is only valid for file-types parsed by semantic. For other
+file types which are parsed by imenu or etags \(see
+`ecb-process-non-semantic-files') FORCE-ALL is always true!"
   (interactive "P")
   (let* ((first-node (save-excursion
                        (goto-char (point-min))
 For description of LEVEL and FORCE-ALL see `ecb-expand-methods-nodes'.
 
 If RESYNC-TOKEN is not nil then after expanding/collapsing the methods-buffer
-is resynced to the current token of the edit-window."
+is resynced to the current token of the edit-window.
+
+Note: All this is only valid for file-types parsed by semantic. For other file
+types which are parsed by imenu or etags \(see
+`ecb-process-non-semantic-files') FORCE-ALL is always true!"
   (let ((symbol->name-assoc-list
          ;; if possible we get the local semantic-symbol->name-assoc-list of
          ;; the source-buffer.
          (or (save-excursion
                (ignore-errors
                  (set-buffer (get-file-buffer ecb-path-selected-source))
+                 ;; for non-semantic buffers we set force-all always to t
+                 (setq force-all (not (semantic-active-p)))
                  semantic-symbol->name-assoc-list))
              semantic-symbol->name-assoc-list)))
     (save-selected-window
         (filename ecb-path-selected-source)
         (ecb-token-jump-narrow (if shift-mode t ecb-token-jump-narrow))
         token found)
+    ;; Klaus Berndl <klaus.berndl@sdm.de>: We must highlight the token
+    (tree-buffer-highlight-node-data data)
     (cond
      ;; Type 0 = a token
      ((= type 0) (setq token data))
       (tree-node-toggle-expanded node)
       ;; Update the tree-buffer with optimized display of NODE
       (tree-buffer-update node))
-     ;; Type 2 = a token name
+     ;; Type 2 = a token name for a token not defined in current buffer; e.g.
+     ;; parent or include tokens can be such tokens!
      ;; Try to find the token
      ((= type 2)
       (set-buffer (get-file-buffer ecb-path-selected-source))
          ;; let us set the mark so the user can easily jump back.
          (if ecb-token-jump-sets-mark
              (push-mark nil t))
-;;          (when ecb-token-jump-narrow
-;;            (widen))
          (widen)
          (goto-char (ecb-semantic-token-start token))
-         (if ecb-token-jump-narrow
+         (if (and ecb-token-jump-narrow (semantic-active-p))
              (narrow-to-region (ecb-line-beginning-pos)
                                (ecb-semantic-token-end token))
            (cond
      ["Directories"
       ecb-goto-window-directories
       :active (or (ecb-window-live-p ecb-directories-buffer-name)
-                  (ignore-errors (ecb-window-live-p ecb-speedbar-buffer-name)))
+                  (and (equal ecb-use-speedbar-instead-native-tree-buffer 'dir)
+                       (ignore-errors (ecb-speedbar-active-p))))
       :help "Go to the directories window"
       ])
     (ecb-menu-item
      ["Sources"
       ecb-goto-window-sources
-      :active (ecb-window-live-p ecb-sources-buffer-name)
+      :active (or (ecb-window-live-p ecb-sources-buffer-name)
+                  (and (equal ecb-use-speedbar-instead-native-tree-buffer 'source)
+                       (ignore-errors (ecb-speedbar-active-p))))
       :help "Go to the sources window"
       ])
     (ecb-menu-item
      ["Methods and Variables"
       ecb-goto-window-methods
-      :active (ecb-window-live-p ecb-methods-buffer-name)
+      :active (or (ecb-window-live-p ecb-methods-buffer-name)
+                  (and (equal ecb-use-speedbar-instead-native-tree-buffer 'method)
+                       (ignore-errors (ecb-speedbar-active-p))))
       :help "Go to the methods/variables window"
       ])
     (ecb-menu-item
       :help "Go to the history window"
       ])
     (ecb-menu-item
+     ["Speedbar"
+      ecb-goto-window-speedbar
+      :active (ignore-errors (ecb-speedbar-active-p))
+      :help "Go to the integrated speedbar window"
+      ])
+    (ecb-menu-item
      ["Compilation"
       ecb-goto-window-compilation
       :active (and ecb-compile-window-height ecb-compile-window
       :active t
       :help "Customize options for the eshell integration of ECB"
       ])
+    (ecb-menu-item
+     ["Supporting non-semantic-sources..."
+      (customize-group "ecb-non-semantic")
+      :active t
+      :help "Customize options for parsing non-semantic-sources"
+      ])
     )
    (list
     "Upgrade and Download"
 
       ;; now we draw the layout choosen in `ecb-layout'. This function
       ;; acivates at its end also the adviced functions if necessary!
+      ;; Here are the directories- and history-buffer updated.
       (let ((ecb-redraw-layout-quickly nil))
         (ecb-redraw-layout-full 'no-buffer-sync))
     
              ((not ecb-split-edit-window)
               (delete-other-windows))))
 
-      ;; now we update the directories window - if visible
-      (ecb-update-directories-buffer)
-
       ;; now we synchronize all ECB-windows
       (ecb-current-buffer-sync 'force)
     
 
       ;; deactivate and reset the speedbar stuff
       (if (featurep 'ecb-speedbar)
-          (ecb-speedbar-deactivate))
+          (ignore-errors (ecb-speedbar-deactivate)))
 
       ;; deactivating the eshell stuff; activation is done implicitly by
       ;; `ecb-eshell-goto-eshell'!
       (remove-hook 'pre-command-hook 'ecb-layout-pre-command-hook)
       (remove-hook 'after-save-hook 'ecb-update-methods-after-saving)
       (remove-hook 'kill-buffer-hook 'ecb-kill-buffer-hook)
-      ;; ediff-stuff; we operate here only with symbols to avoid bytecompiler
-      ;; warnings
       (if (get 'ediff-quit-hook 'ecb-ediff-quit-hook-value)
           (setq ediff-quit-hook (get 'ediff-quit-hook
                                      'ecb-ediff-quit-hook-value))
 @c edit the Makefile to change the version number. mechanism stolen
 @c from Tramp
 @macro ecbver{}
-1.93
+1.94
 @end macro
 
 
 ECB stands for ``Emacs Code Browser'' and is a source code browser for
 (X)Emacs. It is a global minor-mode which displays a couple of windows
 that can be used to browse directories, files and file-contents like
-methods and variables. It supports source-code parsing for Java, C,
-C++, Elisp, Scheme and some more.
+methods and variables. It supports source-code parsing for
+semantic-supported languages like Java, C, C++, Elisp, Scheme as well
+as for source-types supported ``only'' by imenu or etags (e.g. perl,
+TeX, LaTeX etc.).
 
 @iftex
 @sp 1
 Installation and first steps of ECB
 
 * Installation::                Installation of ECB
-* Setting up Emacs::            How to set up Emacs for semantic and ECB
+* Setting up Emacs::            How to set up Emacs for file parsing with ECB
 * First steps::                 First steps after activating ECB first time
 
+How to set up Emacs for file parsing with ECB
+
+* General hints::               General hints for a correct setup
+* Setting up semantic::         How to setup semantic correctly
+* Non-semantic files::          Setup for file types not supported by semantic
+
 Overview
 
 * ECB Directories-buffer::      Contents of the ECB Directories-buffer
 * ecb-download::                Customizing how to download ECB
 * ecb-help::                    Customizing the online help of ECB
 * ecb-eshell::                  Customizing the eshell-integration
+* ecb-non-semantic::            Customizing parsing non-semantic sources
 
 Upgrading and downloading packages
 
 * Grepping directories::        Grepping directories with ECB
 * Working with JDEE::           Working best with ECB and JDEE
 * Compile-window on demand::    Displaying the compile-window on demand
+* Non-semantic sources::        Parsing and displaying non-semantic sources
 
 Entry points for elisp programmers
 
 
 @menu
 * Installation::                Installation of ECB
-* Setting up Emacs::            How to set up Emacs for semantic and ECB
+* Setting up Emacs::            How to set up Emacs for file parsing with ECB
 * First steps::                 First steps after activating ECB first time
 @end menu