Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Latest changes for release 1.94 (support of non-semantic-sources and …

…better

speedbar integration)
  • Loading branch information...
commit 2556d3ef03b5638c8800d0107e4e878c2e52d0ed 1 parent c4bdcf4
berndl authored
View
43 NEWS
@@ -1,20 +1,24 @@
-* Changes for ECB version
+* Changes for ECB version 1.94
-** Fixed bugs:
+** Supporting of non-semantic-sources.
-*** 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.
+*** Native parsing and displaying source-contents of imenu supported files
-*** 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.
+*** 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".
@@ -23,10 +27,6 @@
to update a speedbar-window to the current selected directory of the
ECB-directories-window.
-** Handling of non-semantic-files. Now the contents of files which can not be
- parsed by semantic but by imenu or etags can be displayed in the
- ECB-methods-window. See new option `ecb-process-non-semantic-files'.
-
** 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.
@@ -34,6 +34,19 @@
** 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
View
5 README
@@ -1,4 +1,4 @@
-Readme for the Emacs Code Browser (ECB) version 1.93
+Readme for the Emacs Code Browser (ECB) version 1.94
About
@@ -23,7 +23,8 @@ ECB requires the following packages:
- 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.
View
2  RELEASE_NOTES
@@ -1,4 +1,4 @@
-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:
--------
View
19 ecb-face.el
@@ -291,6 +291,25 @@ Changes take first effect after finishing and reactivating ECB!"
(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
View
54 ecb-layout.el
@@ -129,8 +129,8 @@
(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
+;; 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)
@@ -1985,8 +1985,10 @@ during evaluating BODY the current window is always dedicated at the end!"
(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)
(condition-case error-data
(ecb-set-speedbar-buffer)
@@ -1995,7 +1997,7 @@ during evaluating BODY the current window is always dedicated at the end!"
(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)
@@ -2008,12 +2010,46 @@ during evaluating BODY the current window is always dedicated at the end!"
(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
View
170 ecb-speedbar.el
@@ -6,10 +6,11 @@
;; 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.
@@ -28,15 +29,27 @@
;;; 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
@@ -44,22 +57,25 @@
;;; 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
@@ -71,12 +87,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)
@@ -87,8 +111,6 @@ the cdr the advice-class \(before, around or after). If a function should be
adviced with more than one class \(e.g. with a before and an after-advice)
then for every class a cons must be added to this list.")
-
-
(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
@@ -207,10 +229,11 @@ future this could break."
;;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)
@@ -235,6 +258,7 @@ future this could break."
(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)
@@ -263,6 +287,114 @@ future this could break."
(buffer-live-p speedbar-buffer))
(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)
;;; ecb-speedbar.el ends here
View
9 ecb-upgrade.el
@@ -178,8 +178,9 @@
(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
@@ -265,6 +266,10 @@ The car is the old option symbol and the cdr is a 2-element-list with:
(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)))
View
642 ecb.el
@@ -10,7 +10,7 @@
;; 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
@@ -310,12 +310,16 @@ always true."
(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
@@ -390,6 +394,10 @@ command.")
: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
@@ -554,21 +562,37 @@ layouts sources should be displayed in the directories window."
(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))
@@ -608,8 +632,8 @@ 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 the speedbar updated because you need speedbar reflecting the
-current-directory contents so you can select files.
+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
@@ -913,7 +937,10 @@ switched on too. There are three possible choices:
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)
@@ -981,7 +1008,10 @@ the current source-buffer."
: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)
@@ -1001,7 +1031,10 @@ only show that token. To display the entire buffer again, click on a source file
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)
@@ -1027,7 +1060,10 @@ suffix and a special face for the bucket token.
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)
@@ -1079,7 +1115,10 @@ this functionality set the function for a major-mode \(e.g. `jde-mode') to
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)
@@ -1154,7 +1193,10 @@ This means that in `c-mode' only \"struct\"s and \"typedef\"s are displayed
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)
@@ -1317,7 +1359,10 @@ For oo-programming languages where the methods of a class can be defined
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"))))
@@ -1330,7 +1375,10 @@ to the corresponding location in the edit-window.
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)
@@ -1388,7 +1436,9 @@ A symbol describing how to sort the tokens of this type:
- 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)
@@ -1422,7 +1472,10 @@ If there is a bucket-name \(the node-name stripped of the settings in
`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"
@@ -1430,8 +1483,10 @@ then 'Parents."
(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"
@@ -1440,7 +1495,10 @@ For valid values of this option see `ecb-methods-nodes-expand-spec'!"
(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)
@@ -1457,7 +1515,10 @@ For valid values of this option see `ecb-methods-nodes-expand-spec'!"
- 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)
@@ -1473,7 +1534,10 @@ A small value of about 0.25 seconds saves CPU resources and you get even
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)
@@ -1600,11 +1664,6 @@ delay."
'ecb-window-sync-function))))
:initialize 'custom-initialize-default)
-(defcustom ecb-process-non-semantic-files nil
- "*Display content of non-semantic-files in the ECB-methods-buffer."
- :group 'ecb-general
- :type 'boolean)
-
(defcustom ecb-tree-incremental-search 'prefix
"*Enable incremental search in the ECB-tree-buffers. For a detailed
explanation see the online help section \"Working with the keyboard in the ECB
@@ -1738,7 +1797,7 @@ POWER-click occurs):
+ 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').
@@ -2131,6 +2190,105 @@ keybindings only for the history-buffer of ECB."
: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
;;====================================================
@@ -2276,21 +2434,30 @@ check the result if `ecb-debug-mode' is nil in which case the function
(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 ecb-speedbar-buffer-name))))
(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 ecb-speedbar-buffer-name))))
(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 ecb-speedbar-buffer-name))))
(defun ecb-goto-window-history ()
"Make the ECB-history window the current window."
@@ -2905,7 +3072,15 @@ then nothing is done unless first optional argument FORCE is not nil."
(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
@@ -2990,19 +3165,27 @@ current-buffer is saved."
(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
@@ -3035,11 +3218,8 @@ displayed with window-start and point at beginning of buffer."
;; the hook was not called therefore here manually
(ecb-rebuild-methods-buffer-with-tokencache
current-tokencache
- ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: Maybe this can cause
- ;; performance-drawbacks because with this non-semantic (but imenu
- ;; or etags buffers) will be rescaned in
- ;; `ecb-rebuild-methods-buffer-with-tokencache'!)
- (semantic-active-p))))
+ (semantic-active-p)
+ nil rebuild-non-semantic)))
(when scroll-to-top
(save-selected-window
(ecb-exec-in-methods-window
@@ -3060,159 +3240,31 @@ removes only the token-tree for SOURCE-FILE-NAME from the cache."
(setq ecb-token-tree-cache
(adelete 'ecb-token-tree-cache source-file-name))))
-(defun ecb-handle-non-semantic-tags ()
- (require 'speedbar)
- (require 'imenu)
- (let* ((lst (speedbar-fetch-dynamic-tags (buffer-file-name
- (current-buffer))))
- (tag-list (cdr lst))
- (methods speedbar-tag-hierarchy-method)
- (speedbar-tag-split-minimum-length 2)
- (speedbar-tag-regroup-maximum-length 2)
- bucket-list token-list misc-token-list token)
- (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)))
- )
- ;; Here we create a new token-stream in semantic format which is in
- ;; addition already bucketized (in the meaning of `semantic-bucketize').
- ;; ECB will not bucketize this stream again because `ecb-add-tokens' has
- ;; an additional argument which prevents this.
- (while tag-list
- (cond ((null (car-safe tag-list)) nil) ;this would be a separator
- ((speedbar-generic-list-tag-p (car tag-list))
- (setq token
- (list (car (car tag-list))
- 'misc ;; was: (intern (car (car tag-list)))
- nil nil nil
- (make-vector 2 (cdr (car tag-list)))))
- (setq misc-token-list
- (cons token misc-token-list)))
- ((speedbar-generic-list-positioned-group-p (car tag-list))
- ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: currently we do not
- ;; interpret positioned groups....maybe in future versions....
- nil)
- ((speedbar-generic-list-group-p (car tag-list))
- (setq token-list nil)
- ;; Here we must process recursive, because some of the tags can
- ;; be groups itself (example: files in cperl-mode)
- ;; groups will be intepreted as type-tokens like:
- ;; type-token: ("name" 'type "typename" (children)
- ;; nil nil [start end])
- ;;
- ;; "typename" is the groupname, (children) ist the list of
- ;; group-elements...for these the recursions begins again...
- ;;
- ;; The Children of a new type a either:
- ;; - groups, then 'type and the game begins again
- ;; - plain tags, then new token with the groupname als type
- (setq token-list (ecb-handle-non-semantic-generic-list-group
- (car (car tag-list)) (cdr (car tag-list))))
- (setq bucket-list
- (cons (cons (car (car tag-list))
- token-list)
- bucket-list)))
- (t (speedbar-message "speedbar-insert-generic-list: malformed list!")
- ))
- (setq tag-list (cdr tag-list)))
- (when misc-token-list
- (setq bucket-list
- (cons (cons "Misc" misc-token-list)
- bucket-list)))
- bucket-list
- ))
-
-;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: cperl-mode files do not work 100%
-;; because the hierachies of +Hierarchie+ etc...are not displayed as a
-;; hierarchie but only a one single token....We have to fix this later...
-(defun ecb-handle-non-semantic-generic-list-group (group-name group-children
- &optional bucketize)
- (let ((token-list nil)
- (misc-token-list nil))
- (dolist (tag group-children)
- (if (speedbar-generic-list-group-p tag)
- (setq token-list
- (cons (list (car tag)
- 'type
- "class" ;; was: group-name
- (ecb-handle-non-semantic-generic-list-group
- (car tag) (cdr tag) t)
- nil nil nil (make-vector 2 1))
- token-list))
- (setq misc-token-list
- (cons (list (car tag)
- (intern group-name)
- nil nil nil
- (make-vector 2 (cdr tag)))
- misc-token-list))))
- (if bucketize
- (progn
- (cons (cons "Misc"
- misc-token-list)
- (if token-list
- (list (cons "Types"
- token-list))
- token-list)))
- (append token-list misc-token-list))))
-
-;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: A not very well working version:
-;; (defun ecb-handle-non-semantic-generic-list-group (group-name group-children
-;; &optional bucketize)
-;; (let ((token-list nil)
-;; (misc-token-list nil))
-;; (dolist (tag group-children)
-;; (if (speedbar-generic-list-group-p tag)
-;; (setq token-list
-;; (cons (list (car tag)
-;; 'type
-;; group-name
-;; (if bucketize
-;; (semantic-bucketize
-;; (ecb-handle-non-semantic-generic-list-group
-;; (car tag) (cdr tag) t))
-;; (ecb-handle-non-semantic-generic-list-group
-;; (car tag) (cdr tag) t))
-;; nil nil nil (make-vector 2 1))
-;; token-list))
-;; (setq token-list
-;; (cons (list (car tag)
-;; (intern group-name)
-;; nil nil nil
-;; (make-vector 2 (cdr tag)))
-;; token-list))))
-;; token-list))
-
-
+;; 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
+function is added to the hook `semantic-after-toplevel-cache-change-hook'.
-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'.
+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))
;; The functions of the hook
@@ -3221,14 +3273,19 @@ it is cleared."
;; 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
@@ -3244,32 +3301,66 @@ it is cleared."
(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 non-semantic-handling-p)
+ new-tree non-semantic-handling)
+
(if ecb-debug-mode
(dolist (tok updated-cache)
(ecb-semantic-assert-valid-token tok)))
- ;; here we process non-semantic buffers if the user wants this
+
+ ;; 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)))
- (setq updated-cache (ecb-handle-non-semantic-tags))
- (if updated-cache (setq non-semantic-handling-p t)))
- (unless (and no-update cached-tree)
- (setq new-tree (tree-node-new "root" 0 nil))
- (if non-semantic-handling-p
- (ecb-add-tokens new-tree updated-cache nil t)
+ (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
@@ -3280,35 +3371,79 @@ it is cleared."
;; 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
(if (semantic-active-p)
- (semantic-clear-toplevel-cache)
- ;; for non-semantic-buffers not parsed via imenu (but maybe with etags)
- ;; we must save the buffer because otherwise it can not be reparsed by
- ;; tools like etags.
- (if (null imenu--index-alist) (save-buffer)))
- (ecb-update-methods-buffer--internal)))
+ (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)
@@ -3324,9 +3459,9 @@ is not changed."
;; 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
@@ -3346,7 +3481,7 @@ is not changed."
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
@@ -3360,8 +3495,8 @@ It does several tasks:
(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
@@ -4009,9 +4144,13 @@ Examples:
- 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))
@@ -4038,13 +4177,19 @@ on again quickly with `ecb-toggle-auto-expand-token-tree' or \[C-c . a]."
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
@@ -4130,7 +4275,8 @@ can last a long time - depending of machine- and disk-performance."
(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))
@@ -4172,11 +4318,9 @@ can last a long time - depending of machine- and disk-performance."
;; 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
@@ -4656,6 +4800,12 @@ That is remove the unsupported :help stuff."
: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"
@@ -5275,7 +5425,7 @@ does all necessary after finishing ediff."
;; 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'!
@@ -5300,8 +5450,6 @@ does all necessary after finishing ediff."
(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))
View
762 ecb.texi
@@ -42,7 +42,7 @@
@c edit the Makefile to change the version number. mechanism stolen
@c from Tramp
@macro ecbver{}
-1.93
+1.94
@end macro
@@ -68,8 +68,10 @@ This is the user manual for ECB version @ecbver{}.
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
@@ -135,9 +137,15 @@ mailing list @email{ecb-list@@lists.sourceforge.net} via
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
@@ -203,6 +211,7 @@ All customizable options of ECB
* 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
@@ -227,6 +236,7 @@ Tips and tricks
* 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
@@ -259,7 +269,7 @@ and what are the first steps after activation of ECB.
@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
@@ -417,61 +427,32 @@ online help of ECB is always available though, see
@end enumerate
@node Setting up Emacs, First steps, Installation, Install and first steps
-@section How to set up Emacs for file parsing
+@section How to set up Emacs for file parsing with ECB
@strong{NOTE}: Normally it should not necessary for you to bother with
the following stuff unless you have problems getting ECB working
-correctly for you.
-
-To ensure ECB and semantic are working correctly for all by semantic
-supported languages you have to pay attention to the following aspects
-concerning your Emacs-setup:
-
-@enumerate
-@item Setting up semantic
-
-Parsing files is done completely by semantic. ECB just displays the
-parsing results. For all needs of ECB semantic is completely setup by
-ECB itself, i.e. ECB sets up semantic for you! You have only to add
-the installation directory of semantic to your @code{load-path} (in an
-appropriate way)!
-
-@strong{NOTE}: If you setup semantic for yourself following the
-recommendations in the installation instructions of semantic then you
-have probably added code to your startup-file like:
+correctly for you.
-@example
-(setq semantic-load-turn-everything-on t)
-(require 'semantic-load)
-@end example
-
-Be aware that this also enables the minor-modes
-@code{semantic-show-dirty-mode} and
-@code{semantic-show-unmatched-syntax-mode} where the former one
-highlights all code which has to be reparsed with dark background
-(which results in large portions of dark background ;-) and the latter
-one underlines all syntax which can not be parsed. Especially the
-former one can be really annoying.
-
-To switch off these modes you can add to your startup-file:
-
-@example
-(global-semantic-show-dirty-mode -1)
-(global-semantic-show-unmatched-syntax-mode -1)
-@end example
-
-@item Activating the correct major-mode
+@menu
+* General hints:: General hints for a correct setup
+* Setting up semantic:: How to setup semantic correctly
+* Non-semantic files:: Setup for file types not supported by semantic
+@end menu
-ECB is for browsing source-files and therefore you have to setup your
-Emacs-configuration properly so semantic can be activated
-automatically for parsing your Emacs-Lisp, C, C++ or Java
-buffers@footnote{semantic supports some more ``languages'' like
-Makefiles etc. but these are the most important ones.}. For this Emacs
-must activate the correct @code{major-mode} for the source-files and
-Emacs can only do this if the option @code{auto-mode-alist} is setup
-correctly. The correct major-modes and possible
-file-extensions@footnote{Especially for C++ and C you can use any
-extension you want but these are the most common ones!} are:
+@node General hints, Setting up semantic, Setting up Emacs, Setting up Emacs
+@subsection General hints for a correct setup
+
+ECB is for browsing files and therefore you have to setup your
+Emacs-configuration properly so the file-parsing engines like
+semantic, imenu or etags can be activated automatically for parsing
+your Emacs-Lisp, C, C++ or Java buffers@footnote{semantic supports
+some more ``languages'' like Makefiles etc. but these are the most
+important ones.}. For this Emacs must activate the correct
+@code{major-mode} for the source-files and Emacs can only do this if
+the option @code{auto-mode-alist} is setup correctly. The correct
+major-modes and possible file-extensions@footnote{Especially for C++
+and C you can use any extension you want but these are the most common
+ones!} are:
@multitable @columnfractions 0.20 0.50 0.30
@@ -517,17 +498,57 @@ like:
@end example
After this ECB will correctly parse your ``.cpp''-sources and display
-all the semantic information in the ECB-methods buffer.
+all the parsing information in the ECB-methods buffer.
+
+@node Setting up semantic, Non-semantic files, General hints, Setting up Emacs
+@subsection Setting up semantic
+
+To ensure ECB and semantic are working correctly for all by semantic
+supported languages you have to pay attention to the following aspects
+concerning your Emacs-setup:
+
+@enumerate
+@item Setting up semantic itself
+
+For all semantic-supported file-types parsing files is done completely
+by semantic. ECB just displays the parsing results. For all needs of
+ECB semantic is completely setup by ECB itself, i.e. ECB sets up
+semantic for you! You have only to add the installation directory of
+semantic to your @code{load-path} (in an appropriate way)!
+
+@strong{NOTE}: If you setup semantic for yourself following the
+recommendations in the installation instructions of semantic then you
+have probably added code to your startup-file like:
+
+@example
+(setq semantic-load-turn-everything-on t)
+(require 'semantic-load)
+@end example
+
+Be aware that this also enables the minor-modes
+@code{semantic-show-dirty-mode} and
+@code{semantic-show-unmatched-syntax-mode} where the former one
+highlights all code which has to be reparsed with dark background
+(which results in large portions of dark background ;-) and the latter
+one underlines all syntax which can not be parsed. Especially the
+former one can be really annoying.
+
+To switch off these modes you can add to your startup-file:
+
+@example
+(global-semantic-show-dirty-mode -1)
+(global-semantic-show-unmatched-syntax-mode -1)
+@end example
@anchor{Checking your hooks}
@item Checking your hooks
-If you have already checked points (1.) and (2.) and if you have still
-problems getting ECB/semantic working properly for your sources you
-should check the related major-mode hook. Every major-mode X has a
-hook with name ``X-hook'' which is evaluated after activating the
-major-mode (see above, 2.), e.g. the hook for the major-mode
-@code{c++-mode} is @code{c++-mode-hook}.
+If you have already checked point (1.) and if you have still problems
+getting ECB/semantic working properly for your sources you should
+check the related major-mode hook. Every major-mode X has a hook with
+name ``X-hook'' which is evaluated after activating the major-mode
+(see above, 2.), e.g. the hook for the major-mode @code{c++-mode} is
+@code{c++-mode-hook}.
Semantic adds automatically during load-time a special
``semantic-setup'' to these major-mode hooks@footnote{Of course only
@@ -553,6 +574,30 @@ If your source-files are ``running'' with correct @code{major-mode}
and correct major-mode hooks ECB and semantic will do what you expect
them doing!
+@node Non-semantic files, , Setting up semantic, Setting up Emacs
+@subsection Setup for file types not supported by semantic
+
+From version 1.94 on ECB supports also parsing and displaying
+file-contents for file-types not supported by semantic (i.e. there is
+no semantic-grammar available for such file-types).
+
+Such non-semantic file-types can often be parsed by imenu and/or
+etags. Both of these parsing methods are now supported: ECB can
+display the results of imenu and/or etags in its Method-buffer. ECB
+uses for this speedbar-logic. Therefore the following speedbar options
+takes effect for this feature:
+
+@itemize @minus
+@item @code{speedbar-dynamic-tags-function-list}
+@item @code{speedbar-tag-split-minimum-length}
+@item @code{speedbar-tag-regroup-maximum-length}
+@item @code{speedbar-tag-hierarchy-method}
+@end itemize
+
+Normally ther should no need for you to bother with these options,
+because the default values are suitable for most situations! But if
+you are not satisfied with the parsing/display results then you can
+change some of these options.
@node First steps, , Setting up Emacs, Install and first steps
@section First steps after activating ECB first time
@@ -725,20 +770,27 @@ operation on the item under the mouse cursor can be performed.
@section ECB Methods-buffer
@cindex Methods
-@cindex Methods
+The @dfn{ECB-Methods} buffer contains all parsed and recognized tokens
+of the current source-buffer. It is called ``Method-buffer'' because
+ECB is mostly designed for browsing sourcecode files and for
+programming-languages these tokens are often methods (and variables
+etc.) To simplify explanations we talk in the following only about
+methods and variables - but in general the method-buffer can contain
+any kind of tokens (e.g. sections and subsections for texinfo
+buffers).
+
@itemize @bullet
@item
-The @dfn{ECB-Methods} buffer contains the methods (and variables, if
-you want) in the selected source file. When a method/variable is
-selected with the primary mouse button (@pxref{Using the mouse}) or
-RETURN (@pxref{Using the keyboard}) the edit buffer will jump to the
-method/variable.
+When a method/variable is selected with the primary mouse button
+(@pxref{Using the mouse}) or RETURN (@pxref{Using the keyboard}) the
+edit buffer will jump to the method/variable.
IMPORTANT: If you use the POWER-click (i.e. hold down the SHIFT-key
while clicking with the primary mouse button (@pxref{Using the mouse})
or RETURN (@pxref{Using the keyboard})) on a node in this buffer then
the edit-buffer will be narrowed to the selected token (see also
-option @code{ecb-token-jump-narrow}).
+option @code{ecb-token-jump-narrow}). But this works only for sources
+parsed by semantic, not by imenu or etags!
@item
Clicking on a method/variable with the secondary mouse button or C-RETURN
@@ -820,7 +872,7 @@ If activating or deactivating is too strong you can also customize ECB
with these two option only hiding/showing it's ECB-windows
(tree-buffers) on a major-mode basis. At last this is nothing more
than auto. calling @code{ecb-toggle-ecb-windows} (@pxref{Interactive
-ECB commands} depending which major-mode is active.
+ECB commands}) depending which major-mode is active.
@end table
If you activate ECB on a major-mode basis you probably want switch off
@@ -915,7 +967,8 @@ source.
@item ECB Methods:
Narrowing to the clicked method/variable/ect... (see
-@code{ecb-token-jump-narrow}).
+@code{ecb-token-jump-narrow}). But this works only for sources parsed
+by semantic, not by imenu or etags!
@end itemize
Per default the complete node-name of an item in a tree-buffer is
@@ -1113,7 +1166,7 @@ be used to add personal local keybindings@footnote{To be more general:
They can be used to run any arbitrary lisp code after a tree-buffer
creation!} either to all tree-buffers
(@code{ecb-common-tree-buffer-after-create-hook}) or just to a certain
-tree-buffer. Here is a list which keys MUST NOT be rebind:
+tree-buffer. Here is a list which keys MUST NOT be rebound:
@itemize @bullet
@item @kbd{RET} and all combinations with @kbd{Shift} and @kbd{Ctrl}:
@@ -1279,6 +1332,31 @@ open compilation-buffers in the sense of
@node The Methods buffer, The ECB-layout, Temp- and compile-buffers, Usage of ECB
@section Using and customizing the ECB-Methods buffer
+ECB is mostly designed to display parsing information for files
+supported by semantic. But from version 1.94 on it also supports other
+parsing engines like imenu and etags, so also files not supported by
+semantic but by imenu/etags can be displayed in the Method-buffer of
+ECB. Therefore we have to intruduce some terminology:
+
+@cindex semantic-sources
+@anchor{Definiton of semantic- and non-semantic-sources}
+@itemize @minus
+@item @dfn{semantic-sources}:
+These are filestypes for which a semantic grammar is available, so the
+files are parsable by semantic. These sources are supported best by
+ECB and most of the following options and descriptions are related to
+these filetypes. Examples are programming-sources like C++, C, Java,
+Emacs-Lisp and Texinfo-file and some more.
+
+@cindex non-semantic-sources
+@item @dfn{non-semantic-files}:
+For these files there is no semantic-grammar available so they can not
+be parsed by semantic. Examples are Perl-, LaTeX- and TeX-files. But
+for many of these files imenu and/or etags parsers exist. ECB supports
+now parsing and displaying these file-types too and it uses for this
+some speedbar-logic.
+@end itemize
+
This chapter describes how to use and customize the Methods-buffer of
ECB.
@@ -1302,8 +1380,11 @@ a buffer at one glance. Or you can expand exactly that tokens of a
certain indentation level.
Which node-types are expanded (resp. collapsed) by this command
-depends on the options @code{ecb-methods-nodes-expand-spec} and
-@code{ecb-methods-nodes-collapse-spec}!
+depends for semantic-sources on the options
+@code{ecb-methods-nodes-expand-spec} and
+@code{ecb-methods-nodes-collapse-spec}! For non-sematic-sources always
+all node-types are expanded/collapsed, i.e. the two options above
+takes no effect for these files.
@subsubsection Automatic expanding the ECB-methods-buffer
@@ -1315,7 +1396,7 @@ collapsed) then no node is highlighted if the auto. expanding feature
is switched off.
You can either switch on this feature with the option
-@code{ecb-auto-expand-token-tree} or with even easier with the command
+@code{ecb-auto-expand-token-tree} or even easier with the command
@code{ecb-toggle-auto-expand-token-tree}.
There is another option
@@ -1323,21 +1404,23 @@ There is another option
explicit and auto. expanding best working together. See the
documentation of this option to get the details.
+The autom. expanding feature is only available for semantic-sources!
+
@node Customizing the display, Rebuilding the Methods, Expanding, The Methods buffer
@subsection Customizing the display of the Methods-buffer
@cindex semantic token
@cindex token
The ECB-Methods buffer is probably the most important browsing window
-offered by ECB. It displays all semantic informations of the current
-buffer in the edit-window.
-
-ECB gets all informations displayed in this Methods-buffer from the
-semantic-library. This library parses auto. the current source-buffer
-in the edit-window of ECB and returns all information in form of
-@dfn{tokens} to ECB which displays them in a browsable form in its
-Method-buffer. See @ref{ECB Methods-buffer} for information how to use the
-Methods-buffer.
+offered by ECB. It displays all parsing informations of the current
+source-buffer (the buffer displayed in the edit-window).
+
+Normally ECB gets all informations displayed in this Methods-buffer
+from the semantic-library - at least for semantic-sources. This
+library parses auto. the current source-buffer in the edit-window of
+ECB and returns all information in form of @dfn{tokens} to ECB which
+displays them in a browsable form in its Method-buffer. See @ref{ECB
+Methods-buffer} for information how to use the Methods-buffer.
There are several options to customize which tokens ECB should display
in general, if the tokens should be collapsed or expanded, how to
@@ -1365,13 +1448,40 @@ These are the most important options for this topic but it is
recommended to have a look into the customize-group @code{ecb-methods}
(@pxref{ecb-methods}) and check all the options offered there!
+All these options are only relevant for semantic-sources and take no
+effect for non-sematic-sources!
+
@node Rebuilding the Methods, , Customizing the display, The Methods buffer
@subsection Rebuilding the Methods-buffer
In almost all cases there is @strong{NO} need to manually rebuild the
-method-buffer, because it is always done automatically if necessary.
-But nevertheless there exist a few rare scenarios where a complete
-manual rebuild can be necessary. Here is one example:
+method-buffer, because it is always done automatically if necessary;
+the mechanism depends on the sources:
+
+@itemize @minus
+@item semantic-sources:
+The command @code{global-semantic-auto-parse-mode} switches on autom.
+reparsing of semantic-sources.
+
+@item non-sematic-sources (imenu supported):
+You can switch on autom. rescanning/reparsing with the option
+@code{imenu-auto-rescan}. But nevertheless you have to manually
+rebuild the Method-buffer (with the autom. updated imenu-tags) via the
+command @code{ecb-rebuild-methods-buffer}.
+
+@item non-sematic-sources (etags supported):
+For these sources there is no builtin auto-rescan mechanism, because
+etags is an external tool it can only operate on the saved
+file-contents. So rescanning the buffer contents would need to save
+the buffer before. Therefore there is no builtin auto-rescan mechanism
+because this would always result in saving the buffer and running an
+external tool. But of course you can program such a an
+etags-auto-rescan mechanism for yourself!
+@end itemize
+
+Besides for etags-supported non-sematic-sources there exist a few rare
+scenarios also for the other sources where a complete manual rebuild
+can be necessary. Here is one example:
Depending on the semantic-version: If an elisp-file is parsed which
contains a defun X in the middle where the closing ) is missing, then
@@ -1380,7 +1490,11 @@ incomplete ECB-method buffer. In such a case you must complete the
defun X and then completely reparse the elisp-file and rebuild the ECB
method buffer!
-A complete manually rebuild is done by @code{ecb-rebuild-methods-buffer}.
+A complete manually rebuild is done by
+@code{ecb-rebuild-methods-buffer}. For etags-parsed
+non-sematic-sources this causes an automatic saving of the
+source-buffer because otherwise etags would not operate with the
+latest contents!
@node The ECB-layout, Hiding the ECB windows, The Methods buffer, Usage of ECB
@section Changing, customizing, redrawing and creating layouts
@@ -2004,6 +2118,33 @@ see @ref{Creating a new ECB-layout}); just customize the option
@end group
@end example
+@item Layout ``left-dir-plus-speedbar''
+@example
+@group
+-------------------------------------------------------
+| | |
+| Directories | |
+| | |
+| | |
+| | |
+| | |
+| | |
+|-------------| |
+| | |
+| | |
+| | |
+| Speedbar | |
+| | |
+| | |
+| | |
+-------------------------------------------------------
+| |
+| Compilation |
+| |
+-------------------------------------------------------
+@end group
+@end example
+
@end table
@node Redrawing the ECB-layout, Changing window sizes, Changing the ECB-layout, The ECB-layout
@@ -2552,10 +2693,14 @@ should normally expand all nodes expect there are nodes which are
indented deeper than 10.
@end itemize
-Note: This command switches off auto. expanding of the method-buffer
+Note 1: This command switches off auto. expanding of the method-buffer
if @code{ecb-expand-methods-switch-off-auto-expand} is not nil. But it
can be switched on again quickly with
@code{ecb-toggle-auto-expand-token-tree} or @kbd{[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
+@code{ecb-process-non-semantic-files}) @var{FORCE-ALL} is always true!
@end deffn
@deffn Command expand-directory-nodes
@@ -2572,7 +2717,9 @@ Goto the ecb compilation window @code{ecb-compile-window}.
@end deffn
@deffn Command goto-window-directories
-Make the ECB-directories window the current window.
+Make the ECB-directories window the current window. If
+@code{ecb-use-speedbar-instead-native-tree-buffer} is @code{dir} then
+goto to the speedbar-window.
@end deffn
@deffn Command goto-window-edit1
@@ -2588,11 +2735,15 @@ Make the ECB-history window the current window.
@end deffn
@deffn Command goto-window-methods
-Make the ECB-methods window the current window.
+Make the ECB-methods window the current window. If
+@code{ecb-use-speedbar-instead-native-tree-buffer} is @code{method}
+then goto to the speedbar-window.
@end deffn
@deffn Command goto-window-sources
-Make the ECB-sources window the current window.
+Make the ECB-sources window the current window. If
+@code{ecb-use-speedbar-instead-native-tree-buffer} is @code{source}
+then goto to the speedbar-window.
@end deffn
@deffn Command jde-display-class-at-point
@@ -2606,7 +2757,7 @@ the method-completion feature of JDEE (see
@var{$CLASSPATH}, then in current-directory.
Works only for classes where the source-code (i.e. the *.java-file) is
-available."
+available.
@end deffn
@deffn Command minor-mode &optional arg
@@ -2629,10 +2780,14 @@ navigation}.
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:
+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:
+
+@itemize
+@item
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.
@@ -2640,9 +2795,12 @@ 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.
+@item
+For not semantic supported buffers which can be parsed by imenu or
+etags (see @code{ecb-process-non-semantic-files}) because for these
+buffers there is no builtin auto-rebuild mechanism. For these buffers
+this command calls @code{ecb-rebuild-methods-buffer-for-non-semantic}.
+@end itemize
@end deffn
@deffn Command redraw-layout
@@ -2825,7 +2983,7 @@ elisp-code but only with the customize-feature!
@tab @code{ecb-windows-height}
@item @code{ecb-window-sync-delay}
@tab @code{ecb-windows-width}
-@item @code{ecb-use-speedbar-for-directories}
+@item @code{ecb-use-speedbar-instead-native-tree-buffer}
@tab @code{ecb-toggle-layout-sequence}
@item @code{ecb-mode-line-data}
@end multitable
@@ -2903,8 +3061,13 @@ ECB-layout}).
@item ecb-token-display-function
@itemx ecb-type-token-display
@itemx ecb-show-tokens
-How to display the entries in the ECB-method window
-(@pxref{Customizing the display}).
+How to display the entries in the ECB-method window for semantic
+supported sources (@pxref{Customizing the display}). These options
+take only effect for semantic-sources (@pxref{Definiton of semantic-
+and non-semantic-sources}).
+@item ecb-process-non-semantic-files
+Displaying file-contents for not by semantic supported files too, e.g.
+for LaTeX- and perl-sources.
@end table
But to make ECB working best for you it is also recommened to have a
@@ -2937,6 +3100,7 @@ readable option index. @xref{Option Index}.
* 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
@end menu
@node ecb-general, ecb-directories, Customizable options, Customizable options
@@ -3351,7 +3515,8 @@ displaying the source-file in the edit-window.
@item ECB Methods:
Narrowing to the clicked method/variable/ect... (see
-@code{ecb-token-jump-narrow}).
+@code{ecb-token-jump-narrow}). This works only for semantic supported
+sources but not for imenu- or etags-supported ones!
@end itemize
In addition always the whole node-name is displayed in the minibuffer after a
@@ -3784,19 +3949,32 @@ that is used as it's display name. If no alias is set, the path is
used as display name.
@end defopt
-@defopt use-speedbar-for-directories
-If true then uses speedbar for displaying and handling directories.
-This means that speedbar is integrated in the ECB-frame and is displayed in
-that window normally displaying the standard ECB-directories-buffer.
+@defopt use-speedbar-instead-native-tree-buffer
+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,
+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 takes effect in all layouts which contain a directory window.
+This option can have four valid values:
+@itemize @minus
+@item @code{nil}: Do not use speedbar (default)
+@item @code{dir}: Use speedbar instead of the standard directories-buffer
+@item @code{source}: Use speedbar instead of the standard sources-buffer
+@item @code{method}: Use speedbar instead of the standard methods-buffer
+@end itemize
-Note: A similar effect and useability is available by setting this option to
-nil and setting @code{ecb-show-sources-in-directories-buffer} to not nil, because
-this combination displays also directories and sources in one window.
+Note: For directories and sources a similar effect and useability is
+available by setting this option to @code{nil} (or @code{method}) and
+setting @code{ecb-show-sources-in-directories-buffer} to not
+@code{nil}, because this combination displays also directories and
+sources in one window.
-@code{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.
+@code{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.
@end defopt
@@ -3966,6 +4144,9 @@ edit-buffer is contained in @code{ecb-methods-nodes-expand-spec}.
Like expand-spec but expands all tokens regardess of the setting in
@code{ecb-methods-nodes-expand-spec}.
@end itemize
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@@ -3984,12 +4165,18 @@ The default are empty prefix/suffix-strings and
'ecb-bucket-token-face'. But an alternative can be for example @code{("["
"]" nil)} which means no special face and a display like ``[+]
[<bucket-name>]''.
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@defopt exclude-parents-regexp
Regexp which parent classes should not be shown in the methods buffer
(see also @code{ecb-show-parents}). If nil then all parents will be
shown if @code{ecb-show-parents} is not nil.
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@defopt expand-methods-switch-off-auto-expand
@@ -4011,6 +4198,9 @@ set expand-level.
@defopt font-lock-tokens
Adds font-locking (means highlighting) to the ECB-method buffer.
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@defopt highlight-token-header-after-jump
@@ -4034,6 +4224,9 @@ No highlighting is done.
@end itemize
See also @code{ecb-highlight-token-with-point-delay}.
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@defopt highlight-token-with-point-delay
@@ -4045,6 +4238,9 @@ 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.
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@defopt methods-buffer-after-create-hook
@@ -4107,6 +4303,9 @@ If you change this option you have to restart ECB to take effect.
@defopt methods-nodes-collapse-spec
Semantic token-types collapsed by @code{ecb-expand-methods-nodes}.
For valid values of this option see @code{ecb-methods-nodes-expand-spec}!
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@@ -4128,6 +4327,9 @@ If there is a bucket-name (the node-name stripped of the settings in
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 @code{Parents}.
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@@ -4146,6 +4348,9 @@ defined outside the class-definition (e.g. C++, Eieio) the function
@code{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.
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@defopt scroll-window-after-jump
@@ -4161,6 +4366,9 @@ CLOS or Eieio source-code there can exist some positionless nodes like
variable-attributes in a @code{defclass} form which are only displayed
if this option is nil. Displaying such nodes can be sensefull even if
they can not be jumped.
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@defopt show-tokens
@@ -4209,6 +4417,9 @@ buffer.
@end itemize
@end table
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@defopt token-display-function
@@ -4276,6 +4487,9 @@ If the value is @code{nil}, i.e. neither a function for a major-mode
is defined nor the special 'default, then
@code{semantic-prototype-nonterminal} is used for displaying the
tokens.
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@defopt token-jump-narrow
@@ -4285,6 +4499,9 @@ a source file or call @code{widen} (@kbd{C-x n w}).
Note: The same effect can be achieved by using the POWER-click in the
methods-buffer (@pxref{Using the mouse}).
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@defopt token-jump-sets-mark
@@ -4365,6 +4582,9 @@ and in all other modes ``class''es and grouping-tokens (see
@code{ecb-token-display-function},
@code{ecb-group-function-tokens-with-parents}) have special faces and
the ``class'' specifier-string is removed from the display.
+
+This options takes only effect for semantic-sources - means sources
+supported by semantic!
@end defopt
@@ -5041,6 +5261,14 @@ only the face @code{ecb-default-highlight-face}.
Changes take first effect after finishing and reactivating ECB!
@end defopt
+@defopt method-non-semantic-face
+Face used for for displaying tokens of sources not supported by
+semantic.
+
+Changes take first effect after finishing and reactivating ECB!
+@end defopt
+
+
@defopt methods-general-face
Basic face for the ECB methods buffer. This defines the basic face the
whole methods buffer should displayed with. If the face
@@ -5152,6 +5380,9 @@ the methods buffer.
Basic face for the ECB methods buffer. It�s recommended to define here
the font-family, the font-size, the basic color etc.
+@item ecb-method-non-semantic-face:
+Define face used for displaying tokens of sources not supported by semantic.
+
@item ecb-source-face:
Define face used for highlighting current source in the sources
buffer.
@@ -5312,7 +5543,7 @@ Note: If you got ECB as a standard XEmacs-package maybe the
HTML-online-documentation is not included.
@end defopt
-@node ecb-eshell, , ecb-help, Customizable options
+@node ecb-eshell, ecb-non-semantic, ecb-help, Customizable options
@subsection Group ecb-eshell
@noindent
@@ -5337,6 +5568,96 @@ interactively but normally it is called autom. by the
@code{ecb-current-buffer-sync-hook}.
@end defopt
+@node ecb-non-semantic, , ecb-eshell, Customizable options
+@subsection Group ecb-non-semantic
+
+@defopt auto-save-before-etags-methods-rebuild
+Automatic saving of current buffer before rebuilding its methods.
+
+This option is only relevant for sources which are supported and
+parsed by etags (see @code{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
+@code{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.
+@end defopt
+
+@defopt non-semantic-exclude-modes
+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
+@code{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
+@code{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.
+@end defopt
+
+@defopt non-semantic-methods-initial-expand
+Initially expand all tokens for not by semantic supported sources.
+This option can be customized on a major-mode basis, i.e. if a
+@code{major-mode} is contained in this option then al tokens for this
+modes will be initially expanded - otherwise not.
+@end defopt
+
+@defopt non-semantic-parsing-function
+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 @code{speedbar-insert-generic-list}. speedbar has
+already included two functions @code{speedbar-fetch-dynamic-imenu} and
+@code{speedbar-fetch-dynamic-etags} which can be used for parsing
+buffers with imenu resp. etags.
+
+This option takes only effect if @code{ecb-process-non-semantic-files}
+is not nil: Then ECB checks for non-semantic buffers if current
+@code{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 @code{speedbar-dynamic-tags-function-list} are called in
+that sequence they are listed in this variable. See option
+@code{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
+@code{speedbar-use-imenu-flag} must be set to not nil!
+@end defopt
+
+@defopt process-non-semantic-files
+Display content of non-semantic-files in the ECB-methods-buffer. See
+also @code{ecb-non-semantic-parsing-function}.
+@end defopt
+
+@defopt rebuild-non-semantic-methods-before-hook
+Hook running at beginning of the function
+@code{ecb-rebuild-methods-buffer-for-non-semantic}. This function is
+always called by the command @code{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 @code{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 @code{run-hook-with-args-until-failure}
+for description how these function are processed.
+@end defopt
@node Submitting problem report, Upgrading, Customizing, Top
@@ -5624,6 +5945,7 @@ situations.
* 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
@end menu
@node Changing faces, Small screens, Tips and tricks, Tips and tricks
@@ -5798,14 +6120,22 @@ it into the ECB and the ECB-frame, @xref{Integrating speedbar}.
It is very easy to integrate speedbar into ECB. There are two
different ways to do this:
-You can either use speedbar in the directories window of ECB instead
-of the builtin directory-browser of ECB. Or you can integrate an extra
-speedbar-window into a layout independent of the existence of a
-directory-window. The former one can be done via the option
-@code{ecb-use-speedbar-for-directories} and for the latter one you can
-either use the builtin layout ``left-dir-plus-speedbar'' or you have
-to create your own layout interactively with the command
-@code{ecb-create-new-layout}.
+@enumerate
+@item
+You can either use speedbar in the directories-, sources- or
+methods-window of ECB instead of the builtin directory-, sources- or
+methods-browser of ECB. This can be done via the option
+@code{ecb-use-speedbar-instead-native-tree-buffer}.
+
+@item
+Or you can integrate an extra speedbar-window into a layout
+independent of the existence of a directory-, sources- or
+methods-window. For this you can either use the builtin layout