Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

latest fixes and changes for next release

  • Loading branch information...
commit 11071f9f01afb3fa3ba52eeb53168e414a916510 1 parent 34e5781
berndl authored
View
2  Makefile
@@ -122,7 +122,7 @@ INSTALLINFO=/usr/bin/install-info
# For the ECB-maintainers: Change the version-number here and not
# elsewhere!
-ecb_VERSION=2.33
+ecb_VERSION=2.40
#ecb_VERSION=2.32
include ecb-makedef.mk
View
172 NEWS
@@ -1,4 +1,4 @@
-* Changes for ECB version 2.33
+* Changes for ECB version 2.40
** ECB now requires full CEDET-suite being installed (at least version 1.0pre6)
@@ -15,22 +15,6 @@
semantic-versions and ECB uses this power, especially the power of the
semantic-analyzer.
-** Better compatibility with CEDET 1.0preX and semantic 2.0preX
-
-*** The ECB-analyse-window now works very well with current semantic analyzer
- There is an own synchronize-option-set for the analyse-window:
- `ecb-analyse-buffer-sync', `ecb-analyse-buffer-sync-delay' and
- `ecb-analyse-buffer-sync-hook'. See the docstrings. The advantage is, that
- now the synchronizing of the analyse-window can be customized separately
- from the other ECB-windows. THis is important because for the
- analyse-window a higher delay (or even disabled auto.synchronizing)
- increases usability a lot. See the info-manual.
-
-*** Fix compatibility about some changes of semantic concerning adopting
- external member-functions (as in C++ or eieio).
-
-*** ECB now works very well with semantic-idle-scheduler-mode (s.a.)
-
** Completely reworked synchronizing mechanism of the ECB-windows
Now there are separate options for synchronizing:
@@ -54,9 +38,25 @@
`ecb-eshell-buffer-sync-delay' to 'basic then the value of
`ecb-basic-buffer-sync-delay' is used.
- The enhancement allows much more control for the synchronizing of certain
+ This enhancement allows much more control for the synchronizing of certain
windows.
+** Better compatibility with CEDET >= 1.0pre6 and semantic >= 2.0pre6
+
+*** The ECB-analyse-window now works very well with current semantic analyzer
+ There is an own synchronize-option-set for the analyse-window:
+ `ecb-analyse-buffer-sync', `ecb-analyse-buffer-sync-delay' and
+ `ecb-analyse-buffer-sync-hook'. See the docstrings. The advantage is, that
+ now the synchronizing of the analyse-window can be customized separately
+ from the other ECB-windows. THis is important because for the
+ analyse-window a higher delay (or even disabled auto.synchronizing)
+ increases usability a lot. See the info-manual.
+
+*** Fix compatibility about some changes of semantic concerning adopting
+ external member-functions (as in C++ or eieio).
+
+*** ECB now works very well with semantic-idle-scheduler-mode (s.a.)
+
** More user-responsible buffer-parsing based on the idle-mechanism of semantic
Force a reparse of the semantic-source if the idle-scheduler is off.
@@ -98,13 +98,6 @@
immediatelly and not interruptable (as with the idle-scheduler of
semantic), which can be quite annoying with big source-files.
-** ECB is able to work with indirect buffers if the base-buffer is filebased
-
- Now you can work with indirect-buffers as well as with normal file-buffers,
- i.e. indirect buffers are shown in the history��, their contents are
- displayed in the methods-buffer, the ECB-analyse-buffer works with them,
- autom. synchronizing the ECB-tree-buffers works for them etc...
-
** Complete reworked history-buffer
*** The history is able to deal with indirect-buffer entries.
@@ -149,9 +142,9 @@
`ecb-history-dead-buffer-face' and `ecb-history-indirect-buffer-face' and
equaly named new faces.
-** Sticky parent-node for all ECB-windows of type tree-buffer
+** Sticky parent-node for all special ECB-windows of type tree-buffer
- In the header-line (only for GNU Emacs) of a tree-buffer always the
+ Only for GNU Emacs: in the header-line of a tree-buffer always the
current-parent node of the first visible node is displayed (if there is a
parent node). This sticky node is exactly in the same manner clickable as
all other nodes. There is a new option `ecb-tree-make-parent-node-sticky'
@@ -162,8 +155,8 @@
This is not a user-visible change but enhances the stability of ECB by
using now a new advice-backbone which guarantes that all ecb-advices are
enabled rsp. disabled correctly depending on the surrounding context.
- Introducing three new macros `defecb-advice-set', `defecb-advice' and
- `ecb-with-original-adviced-function-set'.
+ Introducing four new macros `defecb-advice-set', `defecb-advice',
+ `ecb-with-original-adviced-function-set' and `ecb-with-ecb-advice'.
** Changes in the version control support of ECB
@@ -183,9 +176,9 @@
This is by offering `ecb-vc-recompute-state' as an alias to the function
`vc-recompute-state' as state-check function for this option.
-*** Makes CVS-support fully compatible with Emacs 22 and 23
+*** CVS-support is now fully compatible with Emacs 22 and 23
-** New features rsp. commands
+** New options rsp. commands
*** New command `ecb-goto-window-edit-by-smart-selection'
@@ -196,83 +189,92 @@
`pop-up-frames'. It allows three value: Always, only when a permanent
compile-window is used and never. This makes ECB fully compatible with the
option `pop-up-frames'.
-
-** Full compatibility with Gnu Emacs 22
-*** `balance-windows' now works with Emacs 22 too
- Cause of the completely new implemantation based on `window-tree' ECB
- uses a new machanism for enabling balance-windows to work properly with
- active ECB, so only the edit-windows are balanced but all ecb-windows
- remain on their sizes.
+** Much better compatibility with current Emacs-versions
-*** view-mode works also when a permanent compile-window is active
- This is especially important for displaying help and completions.
+*** Full compatibility with Gnu Emacs 22
-*** `master-mode' now works with Emacs 22
+**** `balance-windows' now works with Emacs 22 too
+ Cause of the completely new implemantation based on `window-tree' ECB
+ uses a new machanism for enabling balance-windows to work properly with
+ active ECB, so only the edit-windows are balanced but all ecb-windows
+ remain on their sizes.
-*** Grepping from ECB now uses per default `lgrep' rsp. `rgrep'.
+**** view-mode works also when a permanent compile-window is active
+ This is especially important for displaying help and completions.
-**** The option `ecb-grep-function' defaults to `lgrep' if available
- If not it tries `igrep' or 'grep'.
+**** `master-mode' now works with Emacs 22
-**** `ecb-grep-find-function' has been renamed to `ecb-grep-recursive-function'
- It defaults to `rgrep' if available. If not it tries `igrep-find' or
- `grep-find'. The old value is automatically upgraded to the new option
- name.
+**** Grepping from ECB now uses per default `lgrep' rsp. `rgrep'.
-*** Fixed problems with `ecb-fix-window-size' and active compile-windows
- With Emacs >= 22 the bugs of Emacs 21.3.X concerning `window-size-fixed'
- are fixed by the Emacs-team so now ECB supports this feature also with
- active compile-window.
+***** The option `ecb-grep-function' defaults to `lgrep' if available
+ If not it tries `igrep' or 'grep'.
-*** Fixed small lack in the `switch-to-buffer-other-window'-advice.
- In Emacs 22 this command ignores the settings in `same-window-*'. Now ECB
- adopts this behavior also for its adviced version so the command works
- in a smart manner optimized for ECB.
+***** `ecb-grep-find-function' has been renamed to `ecb-grep-recursive-function'
+ It defaults to `rgrep' if available. If not it tries `igrep-find' or
+ `grep-find'. The old value is automatically upgraded to the new option
+ name.
-** Much better compatibility with forthcoming Gnu Emacs 23
+**** Fixed problems with `ecb-fix-window-size' and active compile-windows
+ With Emacs >= 22 the bugs of Emacs 21.3.X concerning `window-size-fixed'
+ are fixed by the Emacs-team so now ECB supports this feature also with
+ active compile-window.
-*** Removed an annoying behavior which has set the mark hundred of times even
- when the user just moves the cursor.
-
- This comes from a change within Emacs 23 and the function `goto-line'
- which sets the mark in Emacs 23. This is not necessary when not used as
- command but as internal utility. Now ECB uses its own goto-line-function
- which does not set the mark --> No unnecessary mark settings with Emacs
- 23.
+**** Fixed small lack in the `switch-to-buffer-other-window'-advice.
+ In Emacs 22 this command ignores the settings in `same-window-*'. Now ECB
+ adopts this behavior also for its adviced version so the command works
+ in a smart manner optimized for ECB.
+
+*** Much better compatibility with forthcoming Gnu Emacs 23
-*** The adviced `display-buffer' is now fully compatible with Emacs 23
- This means simply that you can work with ECB and Emacs 23 as you expect.
+**** Removed an annoying behavior which has set the mark hundred of times even
+ when the user just moves the cursor.
+
+ This comes from a change within Emacs 23 and the function `goto-line'
+ which sets the mark in Emacs 23. This is not necessary when not used as
+ command but as internal utility. Now ECB uses its own goto-line-function
+ which does not set the mark --> No unnecessary mark settings with Emacs
+ 23.
-*** Fixing some incompatibilities with Emacs 23 concerning using temp. buffers
+**** The adviced `display-buffer' is now fully compatible with Emacs 23
+ This means simply that you can work with ECB and Emacs 23 as you expect.
- The fit-window-to-buffer version of Emacs 23 can destroy windows and is
- therefore not useable within ECB - now ECB has its own - stolen and
- adapted from Emacs 22.
+**** Fixing some incompatibilities with Emacs 23 concerning using temp. buffers
- In addition to this the internal help-window-manager of Emacs 23
- (responsible for displaying *Help*-buffers) chooses sometimes dedicated
- windows (which is a problem because ECB uses dedicated windows for its
- own special ECB-windows) whereas Emacs 22 doesn't do this. Now ECB works
- smoothly with Emacs 23 help-system. Same for view-mode.
+ The fit-window-to-buffer version of Emacs 23 can destroy windows and is
+ therefore not useable within ECB - now ECB has its own - stolen and
+ adapted from Emacs 22.
+
+ In addition to this the internal help-window-manager of Emacs 23
+ (responsible for displaying *Help*-buffers) chooses sometimes dedicated
+ windows (which is a problem because ECB uses dedicated windows for its
+ own special ECB-windows) whereas Emacs 22 doesn't do this. Now ECB works
+ smoothly with Emacs 23 help-system. Same for view-mode.
-*** ediff-support of ECB is now also fully Emacs 23-compatible
+**** ediff-support of ECB is now also fully Emacs 23-compatible
- Emacs 23 uses dedicated windows: Now ECB can deal with frame-layouts where
- some windows are neither an ecb-, edit- nor a compile-window. Therefore
- now also single-frame mode (see `ediff-windows-setup-function') of ediff
- wirks smoothly with ECB.
+ Emacs 23 uses dedicated windows: Now ECB can deal with frame-layouts where
+ some windows are neither an ecb-, edit- nor a compile-window. Therefore
+ now also single-frame mode (see `ediff-windows-setup-function') of ediff
+ wirks smoothly with ECB.
-*** All this together makes the new layout-engine of ECB much more robust so ECB
- works smoothly with forthcoming Emacs 23.
+**** All this together makes the new layout-engine of ECB much more robust so ECB
+ works smoothly with forthcoming Emacs 23.
-** Better compatibility with XEmacs 21.4
+*** Better compatibility with XEmacs 21.4 and XEmacs 21.5
-*** Compatibility has been increased but is still not perfect. There is a need
+ Compatibility has been increased but is still not perfect. There is a need
for much more tests with XEmacs. This can not been done by the
ECB-maintainer because it costs too much effort. Any help from
XEmacs-gurus using ECB for their daily work is very appreciated.
+** ECB is able to work with indirect buffers if the base-buffer is filebased
+
+ Now you can work with indirect-buffers as well as with normal file-buffers,
+ i.e. indirect buffers are shown in the history��, their contents are
+ displayed in the methods-buffer, the ECB-analyse-buffer works with them,
+ autom. synchronizing the ECB-tree-buffers works for them etc...
+
** Deprecated, disabled and deactivated features:
*** The commands `ecb-download-ecb' and `ecb-download-semantic' are deactivated
View
5 README
@@ -1,4 +1,4 @@
-README for the Emacs Code Browser (ECB) version 2.33
+README for the Emacs Code Browser (ECB) version 2.40
About
@@ -15,9 +15,6 @@ The latest version can be found at: http://ecb.sourceforge.net
Requirements
------------
-The easiest way is to follow the steps "Requirements in a nutshell". Just
-do this and the requirements are fulfilled.
-
1. Emacs-version: ECB works only with (X)Emacs >= 21! If you have an older
one, please upgrade.
View
9 RELEASE_NOTES
@@ -1,4 +1,4 @@
-This file contains some important release-notes for ECB version 2.33
+This file contains some important release-notes for ECB version 2.40
General:
--------
@@ -18,6 +18,13 @@ No special notes beyond the contents of README.
Upgrading from any version:
---------------------------
+If you are upgrading from version newer then 2.27 (ie. ecb-version > 2.27)
+then you can skip the rest of this release notes.
+
+
+Upgrading from any version < 2.27:
+----------------------------------
+
The option `ecb-auto-expand-tag-tree-collapse-other' has changed its type. ECB
autom. upgrades your old setting to the new option-type.
View
150 ecb-advice-test.el
@@ -36,13 +36,14 @@
;; 2. Call M-x ecb-test-with-original-advice-set
;; 3. Compare the Output in the message-buffer with the expected output at the
;; end of this file
-;; 4. If there are differences besides the timestamps then send this output to
+;; 4. If there are differences then send this output to
;; the ecb-mailing-list (see Info-manual)
(eval-when-compile
(require 'silentcomp))
(require 'ecb-util)
+(require 'ecb-common-browser)
(defecb-advice-set ecb-advice-test-set
"An advice-set only for testing the advice-mechanism of ECB")
@@ -65,6 +66,24 @@
"An advice"
(message "I'm the AFTER advice of ecb-advice-test-defun-2"))
+(defun ecb-advice-test-defun-3 ()
+ (message "I'm the ORIGINAL function ecb-advice-test-defun-3"))
+
+(defecb-advice ecb-advice-test-defun-3 around ecb-always-disabled-advices
+ "An always disabled advice"
+ (message "I'm the AROUND advice of (the always disabled) ecb-advice-test-defun-3"))
+
+(defecb-advice ecb-advice-test-defun-3 after ecb-always-disabled-advices
+ "An always disabled advice"
+ (message "I'm the AFTER advice of (the always disabled) ecb-advice-test-defun-3"))
+
+(defun ecb-advice-test-defun-4 ()
+ (message "I'm the ORIGINAL function ecb-advice-test-defun-4"))
+
+(defecb-advice ecb-advice-test-defun-4 around ecb-always-disabled-advices
+ "An always disabled advice"
+ (message "I'm the AROUND advice of (the always disabled) ecb-advice-test-defun-4"))
+
(defun ecb-test-with-original-advice-set ()
(interactive)
(let ((ecb-advices-debug-error t))
@@ -72,11 +91,40 @@
(progn
(message "!!! BEGIN ecb-test-with-original-advice-set !!!!")
(ecb-enable-advices 'ecb-advice-test-set)
+ (ecb-disable-advices 'ecb-always-disabled-advices)
(ecb-advice-test-defun-1)
(ecb-advice-test-defun-2)
+ (ecb-advice-test-defun-3)
+ (ecb-advice-test-defun-4)
(ecb-with-original-adviced-function-set 'ecb-advice-test-set
(ecb-advice-test-defun-1)
+ (message "LOC-0.1 ecb-test-with-original-advice-set")
+ (ecb-with-ecb-advice 'ecb-advice-test-defun-3 'around
+ (ecb-advice-test-defun-1)
+ (ecb-advice-test-defun-2)
+ (ecb-advice-test-defun-3)
+ (ecb-advice-test-defun-4)
+ (ecb-with-ecb-advice 'ecb-advice-test-defun-3 'around
+ (ecb-advice-test-defun-3)
+ (ecb-advice-test-defun-4)
+ (ecb-with-ecb-advice 'ecb-advice-test-defun-3 'after
+ (ecb-advice-test-defun-3)
+ (ecb-advice-test-defun-4)
+ (ecb-with-ecb-advice 'ecb-advice-test-defun-4 'around
+ (ecb-advice-test-defun-3)
+ (ecb-advice-test-defun-4))
+ (message "LOC-0.2 ecb-test-with-original-advice-set")
+ (ecb-advice-test-defun-3)
+ (ecb-advice-test-defun-4))
+ (message "LOC-0.3 ecb-test-with-original-advice-set")
+ (ecb-advice-test-defun-3)
+ (ecb-advice-test-defun-4))
+ (message "LOC-0.4 ecb-test-with-original-advice-set")
+ (ecb-advice-test-defun-3)
+ (ecb-advice-test-defun-4))
(ecb-advice-test-defun-2)
+ (ecb-advice-test-defun-3)
+ (ecb-advice-test-defun-4)
(message "LOC-1 ecb-test-with-original-advice-set")
(ecb-with-original-adviced-function-set 'ecb-advice-test-set
(ecb-advice-test-defun-1)
@@ -100,6 +148,8 @@
(ecb-disable-advices 'ecb-advice-test-set)
(ecb-advice-test-defun-1)
(ecb-advice-test-defun-2)
+ (ecb-advice-test-defun-3)
+ (ecb-advice-test-defun-4)
(message "!!! END ecb-test-with-original-advice-set !!!!"))))
@@ -107,23 +157,82 @@
;; !!! BEGIN ecb-test-with-original-advice-set !!!!
;; ECB 2.33: debug enabling the advice-set: ecb-advice-test-set
-;; ECB 2.33: debug enabling of 'after' advice ecb-advice-test-defun-2 [18:33:55]
-;; ECB 2.33: debug enabling of 'before' advice ecb-advice-test-defun-2 [18:33:55]
-;; ECB 2.33: debug enabling of 'around' advice ecb-advice-test-defun-1 [18:33:55]
-;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-1 [18:33:55]
+;; ECB 2.33: debug enabling of 'after' advice ecb-advice-test-defun-2
+;; ECB 2.33: debug enabling of 'before' advice ecb-advice-test-defun-2
+;; ECB 2.33: debug enabling of 'around' advice ecb-advice-test-defun-1
+;; ECB 2.33: debug disabling the advice-set: ecb-always-disabled-advices
+;; ECB 2.33: debug disabling of 'around' advice ecb-advice-test-defun-4
+;; ECB 2.33: debug disabling of 'after' advice ecb-advice-test-defun-3
+;; ECB 2.33: debug disabling of 'around' advice ecb-advice-test-defun-3
+;; ECB 2.33: debug disabling of 'around' advice count-windows
+;; ECB 2.33: debug disabling of 'around' advice one-window-p
+;; ECB 2.33: debug disabling of 'around' advice walk-windows
+;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-1
;; I'm the AROUND advice of ecb-advice-test-defun-1
-;; ECB 2.33: debug calling of 'before' advice ecb-advice-test-defun-2 [18:33:55]
+;; ECB 2.33: debug calling of 'before' advice ecb-advice-test-defun-2
;; I'm the BEFORE advice of ecb-advice-test-defun-2
;; I'm the ORIGINAL function ecb-advice-test-defun-2
-;; ECB 2.33: debug calling of 'after' advice ecb-advice-test-defun-2 [18:33:55]
+;; ECB 2.33: debug calling of 'after' advice ecb-advice-test-defun-2
;; I'm the AFTER advice of ecb-advice-test-defun-2
+;; I'm the ORIGINAL function ecb-advice-test-defun-3
+;; I'm the ORIGINAL function ecb-advice-test-defun-4
;; ECB 2.33: debug with original advice-set: ecb-advice-test-set - ENTRY
;; ECB 2.33: debug disabling the advice-set: ecb-advice-test-set
-;; ECB 2.33: debug disabling of 'after' advice ecb-advice-test-defun-2 [18:33:55]
-;; ECB 2.33: debug disabling of 'before' advice ecb-advice-test-defun-2 [18:33:55]
-;; ECB 2.33: debug disabling of 'around' advice ecb-advice-test-defun-1 [18:33:55]
+;; ECB 2.33: debug disabling of 'after' advice ecb-advice-test-defun-2
+;; ECB 2.33: debug disabling of 'before' advice ecb-advice-test-defun-2
+;; ECB 2.33: debug disabling of 'around' advice ecb-advice-test-defun-1
+;; I'm the ORIGINAL function ecb-advice-test-defun-1
+;; LOC-0.1 ecb-test-with-original-advice-set
+;; ECB 2.33: debug with always disabled ecb-advice: around ecb-advice-test-defun-3 - ENTRY
+;; ECB 2.33: debug enabling of 'around' advice ecb-advice-test-defun-3
;; I'm the ORIGINAL function ecb-advice-test-defun-1
;; I'm the ORIGINAL function ecb-advice-test-defun-2
+;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-3
+;; I'm the AROUND advice of (the always disabled) ecb-advice-test-defun-3
+;; I'm the ORIGINAL function ecb-advice-test-defun-4
+;; ECB 2.33: debug with always disabled ecb-advice: around ecb-advice-test-defun-3 - ENTRY
+;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-3
+;; I'm the AROUND advice of (the always disabled) ecb-advice-test-defun-3
+;; I'm the ORIGINAL function ecb-advice-test-defun-4
+;; ECB 2.33: debug with always disabled ecb-advice: after ecb-advice-test-defun-3 - ENTRY
+;; ECB 2.33: debug enabling of 'after' advice ecb-advice-test-defun-3
+;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-3
+;; I'm the AROUND advice of (the always disabled) ecb-advice-test-defun-3
+;; ECB 2.33: debug calling of 'after' advice ecb-advice-test-defun-3
+;; I'm the AFTER advice of (the always disabled) ecb-advice-test-defun-3
+;; I'm the ORIGINAL function ecb-advice-test-defun-4
+;; ECB 2.33: debug with always disabled ecb-advice: around ecb-advice-test-defun-4 - ENTRY
+;; ECB 2.33: debug enabling of 'around' advice ecb-advice-test-defun-4
+;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-3
+;; I'm the AROUND advice of (the always disabled) ecb-advice-test-defun-3
+;; ECB 2.33: debug calling of 'after' advice ecb-advice-test-defun-3
+;; I'm the AFTER advice of (the always disabled) ecb-advice-test-defun-3
+;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-4
+;; I'm the AROUND advice of (the always disabled) ecb-advice-test-defun-4
+;; ECB 2.33: debug disabling of 'around' advice ecb-advice-test-defun-4
+;; ECB 2.33: debug with always disabled ecb-advice: around ecb-advice-test-defun-4 - EXIT
+;; LOC-0.2 ecb-test-with-original-advice-set
+;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-3
+;; I'm the AROUND advice of (the always disabled) ecb-advice-test-defun-3
+;; ECB 2.33: debug calling of 'after' advice ecb-advice-test-defun-3
+;; I'm the AFTER advice of (the always disabled) ecb-advice-test-defun-3
+;; I'm the ORIGINAL function ecb-advice-test-defun-4
+;; ECB 2.33: debug disabling of 'after' advice ecb-advice-test-defun-3
+;; ECB 2.33: debug with always disabled ecb-advice: after ecb-advice-test-defun-3 - EXIT
+;; LOC-0.3 ecb-test-with-original-advice-set
+;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-3
+;; I'm the AROUND advice of (the always disabled) ecb-advice-test-defun-3
+;; I'm the ORIGINAL function ecb-advice-test-defun-4
+;; ECB 2.33: debug with always disabled ecb-advice: around ecb-advice-test-defun-3 - EXIT
+;; LOC-0.4 ecb-test-with-original-advice-set
+;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-3
+;; I'm the AROUND advice of (the always disabled) ecb-advice-test-defun-3
+;; I'm the ORIGINAL function ecb-advice-test-defun-4
+;; ECB 2.33: debug disabling of 'around' advice ecb-advice-test-defun-3
+;; ECB 2.33: debug with always disabled ecb-advice: around ecb-advice-test-defun-3 - EXIT
+;; I'm the ORIGINAL function ecb-advice-test-defun-2
+;; I'm the ORIGINAL function ecb-advice-test-defun-3
+;; I'm the ORIGINAL function ecb-advice-test-defun-4
;; LOC-1 ecb-test-with-original-advice-set
;; ECB 2.33: debug with original advice-set: ecb-advice-test-set - ENTRY
;; I'm the ORIGINAL function ecb-advice-test-defun-1
@@ -144,27 +253,28 @@
;; ECB 2.33: debug with original advice-set: ecb-advice-test-set - EXIT
;; LOC-5 ecb-test-with-original-advice-set
;; ECB 2.33: debug enabling the advice-set: ecb-advice-test-set
-;; ECB 2.33: debug enabling of 'after' advice ecb-advice-test-defun-2 [18:33:55]
-;; ECB 2.33: debug enabling of 'before' advice ecb-advice-test-defun-2 [18:33:55]
-;; ECB 2.33: debug enabling of 'around' advice ecb-advice-test-defun-1 [18:33:55]
+;; ECB 2.33: debug enabling of 'after' advice ecb-advice-test-defun-2
+;; ECB 2.33: debug enabling of 'before' advice ecb-advice-test-defun-2
+;; ECB 2.33: debug enabling of 'around' advice ecb-advice-test-defun-1
;; ECB 2.33: debug with original advice-set: ecb-advice-test-set - EXIT
-;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-1 [18:33:55]
+;; ECB 2.33: debug calling of 'around' advice ecb-advice-test-defun-1
;; I'm the AROUND advice of ecb-advice-test-defun-1
-;; ECB 2.33: debug calling of 'before' advice ecb-advice-test-defun-2 [18:33:55]
+;; ECB 2.33: debug calling of 'before' advice ecb-advice-test-defun-2
;; I'm the BEFORE advice of ecb-advice-test-defun-2
;; I'm the ORIGINAL function ecb-advice-test-defun-2
-;; ECB 2.33: debug calling of 'after' advice ecb-advice-test-defun-2 [18:33:55]
+;; ECB 2.33: debug calling of 'after' advice ecb-advice-test-defun-2
;; I'm the AFTER advice of ecb-advice-test-defun-2
;; LOC-6 ecb-test-with-original-advice-set
;; ECB 2.33: debug disabling the advice-set: ecb-advice-test-set
-;; ECB 2.33: debug disabling of 'after' advice ecb-advice-test-defun-2 [18:33:55]
-;; ECB 2.33: debug disabling of 'before' advice ecb-advice-test-defun-2 [18:33:55]
-;; ECB 2.33: debug disabling of 'around' advice ecb-advice-test-defun-1 [18:33:55]
+;; ECB 2.33: debug disabling of 'after' advice ecb-advice-test-defun-2
+;; ECB 2.33: debug disabling of 'before' advice ecb-advice-test-defun-2
+;; ECB 2.33: debug disabling of 'around' advice ecb-advice-test-defun-1
;; I'm the ORIGINAL function ecb-advice-test-defun-1
;; I'm the ORIGINAL function ecb-advice-test-defun-2
+;; I'm the ORIGINAL function ecb-advice-test-defun-3
+;; I'm the ORIGINAL function ecb-advice-test-defun-4
;; !!! END ecb-test-with-original-advice-set !!!!
-
(silentcomp-provide 'ecb-advice-test)
;;; ecb-advice-test.el ends here
View
310 ecb-common-browser.el
@@ -635,6 +635,316 @@ examples how to use this macro!"
;; Internals
;;====================================================
+;;; ----- advice stuff -------------------------------------
+
+(defvar ecb-adviced-function-sets nil
+ "A list of adviced-function sets defined with `defecb-advice-set'.
+Each element is a cons-cell where car is the advice-set-var and cdr is an
+indicator if the caller of `ecb-with-original-adviced-function-set' is the
+outmost caller.
+
+DO NOT CHANGE THIS!")
+
+(defvar ecb-adviced-permanent-function-sets nil
+ "A list of symbols, each of them an advice-set which should be permanent.
+Permanent means this advice set will not be disabled during deactivation of
+ECB. This variable is only set by `defecb-advice-set'.
+
+DO NOT CHANGE THIS!")
+
+(defvar ecb-adviced-functions nil
+ "A list of all advices defined with `defecb-advice'.
+This list is the set union of the values of all function-sets of
+`ecb-adviced-function-sets'.
+
+DO NOT CHANGE THIS!")
+
+(defvar ecb-advices-debug-error nil
+ "It not nil then each advice of ECB reports when it's en/disabled or called.")
+
+(defun ecb-advices-debug-error (advice class action &rest args)
+ "Run ARGS through `format' and write it to the *Messages*-buffer.
+ADVICE is the adviced-function-symbol, CLASS is the advice-class \(after,
+around or before) and ACTION is one of the symbols 'calling, 'enabling,
+'disabling or 'reporting.
+
+This will build up a message string like:
+ECB <version>: debug <ACTION> of '<CLASS>' advice ADVICE: ARGS.
+If ARGS is nil then only the message above is reported."
+ (when ecb-advices-debug-error
+ (message (concat (format "ECB %s: debug %s of '%s' advice %s "
+ ecb-version
+ action
+ class
+ advice)
+ (if args
+ (apply 'format args))))))
+
+(defmacro defecb-advice-set (advice-set docstring &optional permanent)
+ "Defines an advice-set for ECB.
+This defines a variable which will contain adviced functions defined by
+`defecb-advice-set'. This is a set of advices which can be enabled or disabled
+\"en block\" which must be done either by `ecb-enable-advices',
+`ecb-disable-advices' or `ecb-with-original-adviced-function-set'.
+
+Before defining a new advice-set it's recommended to take a look at the value
+of `ecb-adviced-function-sets' if there is already a suitable advice-set.
+
+IMPORTANT: Each advice in ECB must be defined by `defecb-advice' and must
+belong to an advice-set previously defined by `defecb-advice-set'!
+
+All advice-sets of ECB will be automatically\(!) disabled at load-time of the
+ecb-library and at deactivation-time of ECB. But: Enabling of a certain
+advice-set must be done appropriately.
+
+If optional argument PERMANENT is t then this advice-set will NOT be disabled
+at deactivation-time of ECB! Calling `ecb-disable-advices' for an advice set
+defined with permanent is t will take no effect unless the optional argument
+FORCE-PERMANENT of this function is set to not nil.
+PERMANENT can also be a function which will be called by `ecb-disable-advices'
+for this advice set \(the function gets one argument: the symbol of the
+advice-set) and have to return not nil if the advice-set should not be disable
+by `ecb-disable-advices' unless the FORCE-PERMANENT of this function is set to
+not nil.
+
+Example:
+
+\(defecb-advice-set ecb-always-disabled-advices
+ \"These advices are always disabled.\")"
+ `(eval-and-compile
+ (add-to-list 'ecb-adviced-function-sets (cons (quote ,advice-set), nil))
+ ,(if permanent
+ `(add-to-list 'ecb-adviced-permanent-function-sets
+ (cons (quote ,advice-set) ,permanent)))
+ (defvar ,advice-set nil ,docstring)))
+
+(put 'defecb-advice-set 'lisp-indent-function 1)
+
+(defmacro defecb-advice (adviced-function advice-class advice-set advice-docstring &rest body)
+ "Defines an advice for ADVICED-FUNCTION with ADVICE-CLASS for ADVICE-SET.
+ADVICED-FUNCTION must be an advicable object \(e.g. a function, a subr
+etc...). ADVICE-CLASS must be one of around, after or before. ADVICE-SET must
+ba an advice-set previously defined by `defecb-advice-set'. ADVICE-DOCSTRING
+ist the docstring for the advice. BODY is the program-code for the advice as
+it would be written with `defadvice'.
+
+Do not quote ADVICED-FUNCTION, ADVICE-CLASS and ADVICE-SET.
+
+Example:
+
+\(defecb-advice delete-frame around ecb-layout-basic-adviced-functions
+ \"If FRAME is equal to the ECB frame then...\"
+ \(let \(\(frame \(or \(ad-get-arg 0) \(selected-frame))))
+ \(if \(and ecb-minor-mode
+ \(equal frame ecb-frame))
+ \(when \(ecb-confirm \"Attempt to delete the ECB-frame....Proceed? \")
+ \(ecb-deactivate-internal)
+ ad-do-it)
+ ad-do-it)))"
+ `(progn
+ (if (assoc (quote ,advice-set) ecb-adviced-function-sets)
+ (add-to-list (quote ,advice-set)
+ (cons (quote ,adviced-function) (quote ,advice-class)))
+ (error "The advice-set %s does not exist!"
+ (symbol-name (quote ,advice-set))))
+ (if (not (member (quote ,advice-class)
+ '(around after before)))
+ (error "The advice-class %s is not allowed - only around, after and before!"
+ (symbol-name (quote ,advice-class))))
+ (add-to-list 'ecb-adviced-functions (cons (quote ,adviced-function) (quote ,advice-class)))
+ (eval-and-compile
+ (defadvice ,adviced-function (,advice-class ecb)
+ ,advice-docstring
+ (ecb-advices-debug-error (quote ,adviced-function)
+ (quote ,advice-class)
+ 'calling)
+ ,@body))))
+
+(put 'defecb-advice 'lisp-indent-function 3)
+
+;; (insert (pp (macroexpand '(defecb-advice insert around
+;; ecb-always-disabled-advices "doc"
+;; (message "test")))))
+
+
+(defun ecb-enable-ecb-advice (function-symbol advice-class arg)
+ "If ARG is greater or equal zero then enable the adviced version of
+FUNCTION-SYMBOL. Otherwise disable the adviced version. The advice must be
+defined with class ADVICE-CLASS by `defecb-advice'.
+
+IMPORTANT: Do not use the function directly. Always use `ecb-enable-advices',
+`ecb-disable-advices' or `ecb-with-original-adviced-function-set'!."
+ (if (< arg 0)
+ (progn
+ (ad-disable-advice function-symbol advice-class 'ecb)
+ (ad-activate function-symbol)
+ (ecb-advices-debug-error function-symbol advice-class 'disabling))
+ (ad-enable-advice function-symbol advice-class 'ecb)
+ (ad-activate function-symbol)
+ (ecb-advices-debug-error function-symbol advice-class 'enabling)))
+
+
+(defun ecb-enable-advices (adviced-function-set-var)
+ "Enable all advices of ADVICED-FUNCTION-SET-VAR, which must be defined by
+`defecb-advice-set'."
+ (if ecb-advices-debug-error
+ (message "ECB %s: debug enabling the advice-set: %s"
+ ecb-version adviced-function-set-var))
+ (if (eq adviced-function-set-var 'ecb-always-disabled-advices)
+ (error "The advice-set ecb-always-disabled-advices must not be enabled!"))
+ (if (not (assq adviced-function-set-var ecb-adviced-function-sets))
+ (error "The adviced function set %s is not defined by defecb-advice-set!"
+ (symbol-name adviced-function-set-var)))
+ (dolist (elem (symbol-value adviced-function-set-var))
+ (ecb-enable-ecb-advice (car elem) (cdr elem) 1)))
+
+(defun ecb-disable-advices (adviced-function-set-var &optional force-permanent)
+ "Disable all advices of ADVICED-FUNCTION-SET-VAR, which must be defined by
+`defecb-advice-set'
+
+This function tests if ADVICED-FUNCTION-SET-VAR has been defined as permanent
+by `defecb-advice-set'.
+
+Calling `ecb-disable-advices' for an advice set defined with
+permanent t will take no effect unless the optional argument
+FORCE-PERMANENT is set to not nil. If the advice set is defined as permanent
+with a permanent-disable-function then this function is called with
+ADVICED-FUNCTION-SET-VAR as argument; if this function returns not nil then
+the adviced will be treated as permanent and will not being disabled.
+
+If optional FORCE-PERMANENT is not nil then ADVICED-FUNCTION-SET-VAR will
+be disabled regardless if permanent or not."
+ (if ecb-advices-debug-error
+ (message "ECB %s: debug disabling the advice-set: %s"
+ ecb-version adviced-function-set-var))
+ (if (not (assq adviced-function-set-var ecb-adviced-function-sets))
+ (error "The adviced function set %s is not defined by defecb-advice-set!"
+ (symbol-name adviced-function-set-var)))
+ (let ((permanent (if force-permanent
+ nil
+ (cdr (assq adviced-function-set-var
+ ecb-adviced-permanent-function-sets)))))
+ (unless (or (eq permanent t)
+ (and (functionp permanent)
+ (funcall permanent adviced-function-set-var)))
+ (dolist (elem (symbol-value adviced-function-set-var))
+ (ecb-enable-ecb-advice (car elem) (cdr elem) -1)))))
+
+;; for the outmost-caller-stuff see ecb-with-original-adviced-function-set
+(defmacro ecb-with-ecb-advice (function-symbol advice-class &rest body)
+ "Evaluates BODY with the adviced version of FUNCTION-SYMBOL. The advice must
+be defined by `defecb-advice' with class ADVICE-CLASS for the advice-set
+`ecb-always-disabled-advices'. Otherwise an error occurs. The advice is only
+active during BODY.
+
+BODY is protected by `unwind-protect' so in each case the advice
+will be disabled after finishing this macro unless it is nested
+within a call to this macro for the *same* FUNCTION-SYMBOL and
+ADVICE-CLASS-combination! This means that the usage of this macro
+is save for arbitrary nested calls, so full BODY is guaranted
+being evaluated with enabled ADVICE-CLASS advice for
+FUNCTION-SYMBOL.
+
+Returns the value of BODY.
+
+Example where this macro is used for `walk-windows' within another advice:
+
+\(ecb-with-ecb-advice 'walk-windows 'around
+ ad-do-it)"
+ (let ((outmost-caller-p (make-symbol "outmost-caller-p")))
+ ;; we have to check if we are the outmost-caller of this macro for this
+ ;; adviced function AND the advice-class! different advice-classes for the
+ ;; same function have to be treated differently!!
+ `(let ((,outmost-caller-p (unless (member ,advice-class (get ,function-symbol 'ecb-with-ecb-advice))
+ (put ,function-symbol 'ecb-with-ecb-advice
+ (append (list ,advice-class) (get ,function-symbol 'ecb-with-ecb-advice)))
+ ,advice-class)))
+ (if (not (member (cons ,function-symbol ,advice-class)
+ ecb-always-disabled-advices))
+ (error "Advice for %s with class %s not registered in ecb-always-disabled-advices!"
+ (symbol-name ,function-symbol)
+ (symbol-name ,advice-class)))
+ (if ecb-advices-debug-error
+ (message "ECB %s: debug with always disabled ecb-advice: %s %s - ENTRY"
+ ecb-version ,advice-class ,function-symbol))
+ (unwind-protect
+ (progn
+ (when ,outmost-caller-p
+ (ecb-enable-ecb-advice ,function-symbol ,advice-class 1))
+ ,@body)
+ (when ,outmost-caller-p
+ ;; Only if we are the outmost caller we are allowed to disable the
+ ;; enabled advice
+ (put ,function-symbol 'ecb-with-ecb-advice
+ (delete ,advice-class (get ,function-symbol 'ecb-with-ecb-advice)))
+ (ecb-enable-ecb-advice ,function-symbol ,advice-class -1))
+ (if ecb-advices-debug-error
+ (message "ECB %s: debug with always disabled ecb-advice: %s %s - EXIT"
+ ecb-version ,advice-class ,function-symbol))))))
+
+(put 'ecb-with-ecb-advice 'lisp-indent-function 2)
+
+;; (insert (pp (macroexpand '(ecb-with-ecb-advice 'one-window-p 'around
+;; (message "")))))
+
+(defmacro ecb-with-original-adviced-function-set (adviced-function-set-var &rest body)
+ "Evaluates BODY with all adviced functions of ADVICED-FUNCTION-SET-VAR
+being disabled \(means with their original definition). Restores always \(even
+if an error occurs during evaluating BODY) the previous state of the adviced
+functions, means it depends if the call to this macro is the outermost call:
+Only if it is the outermost-call the advices of the used advice-set will be
+disabled after finishing. So full BODY is guaranted being evaluated with
+disabled advices of ADVICED-FUNCTION-SET-VAR.
+
+ADVICED-FUNCTION-SET-VAR must be defined by `defecb-advice-set' and all
+advices of this set must be defined by `defecb-advice'. Otherwise an error
+occurs.
+
+Example:
+
+\(ecb-with-original-adviced-function-set 'ecb-layout-basic-adviced-functions
+ \(do-something..))"
+ (let ((outmost-caller-p (make-symbol "outmost-caller-p")))
+ `(let ((,outmost-caller-p
+ (unless (equal (cdr (assq ,adviced-function-set-var ecb-adviced-function-sets))
+ 'outmost-caller)
+ ;; if we are the outmost caller of this macro we store this
+ ;; for
+ ;; a) following callers
+ ;; b) ourself, so we can later reset is
+ (setcdr (assq ,adviced-function-set-var ecb-adviced-function-sets) 'outmost-caller))
+ ))
+ (if ecb-advices-debug-error
+ (message "ECB %s: debug with original advice-set: %s - ENTRY"
+ ecb-version ,adviced-function-set-var))
+ (unwind-protect
+ (progn
+ (when ,outmost-caller-p
+ ;; we must force disabling permanent advice-sets too
+ (ecb-disable-advices ,adviced-function-set-var t))
+ ,@body)
+ (when ,outmost-caller-p
+ ;; Only if we are the outmost caller we are allowed to re-enable the
+ ;; disabled advice-set
+ (setcdr (assq ,adviced-function-set-var ecb-adviced-function-sets) nil)
+ (ecb-enable-advices ,adviced-function-set-var))
+ (if ecb-advices-debug-error
+ (message "ECB %s: debug with original advice-set: %s - EXIT"
+ ecb-version ,adviced-function-set-var))))))
+
+
+(put 'ecb-with-original-adviced-function-set 'lisp-indent-function 1)
+
+
+
+(defecb-advice-set ecb-always-disabled-advices
+ "These advices are always disabled.
+This advice-set can not be enabled by `ecb-enable-advices' but such an
+advice has to be activated 'on demand' by the caller. Such an advice must be
+used with the macro `ecb-with-ecb-advice'.")
+
+;; -- window stuff
+
(defun ecb-combine-ecb-button/edit-win-nr (ecb-button edit-window-nr)
"Depending on ECB-BUTTON and EDIT-WINDOW-NR return one value:
- nil if ECB-BUTTON is 1.
View
1  ecb-compatibility.el
@@ -41,6 +41,7 @@
(require 'ecb-util)
+(require 'ecb-common-browser)
(require 'ecb-layout)
;; To add compatibilty code for packages just do:
View
126 ecb-layout.el
@@ -125,6 +125,7 @@
(require 'silentcomp))
(require 'ecb-util)
+(require 'ecb-common-browser)
(require 'ecb-speedbar)
(require 'ecb-compilation)
(require 'ecb-create-layout)
@@ -1540,48 +1541,9 @@ arguments. Do never set this variable; it is only set by
;; high); point stays in the top-window.
;; 9. now call C-x 1 (delete-other-windows) --> XEmacs crashes
;; It crashes not if temp-buffer-shrink-to-fit is nil (see step 4 above)
+ ;; Solution: seems that with current shrink-window-if-larger-than-buffer
+ ;; (s.b.) the crash has been gone.......
-;; (defecb-advice show-temp-buffer-in-current-frame around ecb-layout-basic-adviced-functions
-;; "Makes the function compatible with ECB."
-;; (let ((pre-display-buffer-function nil)) ; turn it off, whatever it is
-;; ;; Here we run our display-buffer-version which in turn calls
-;; ;; `ecb-display-buffer-xemacs' which contains the shrink-to-fit
-;; ;; mechanism.
-;; (let ((window (condition-case oops
-;; ;; For this call `ecb-temp-buffer-shrink-to-fit'
-;; ;; is always nil
-;; (display-buffer (ad-get-arg 0) nil nil
-;; temp-buffer-shrink-to-fit)
-;; (wrong-number-of-arguments
-;; ;; we have a XEmacs which do not support the 4.
-;; ;; arg SHRINK-TO-FIT of `display-buffer'. So we
-;; ;; call it with only three args and simulate the
-;; ;; 4. arg by setting
-;; ;; `ecb-temp-buffer-shrink-to-fit' to the value of
-;; ;; `temp-buffer-shrink-to-fit'. The adviced
-;; ;; version of `display-buffer' calls
-;; ;; `ecb-display-buffer-xemacs' for XEmacs which in
-;; ;; turn evaluates `ecb-temp-buffer-shrink-to-fit'.
-;; ;; For details see `ecb-display-buffer-xemacs'.
-;; (let ((ecb-temp-buffer-shrink-to-fit temp-buffer-shrink-to-fit))
-;; (ecb-layout-debug-error "show-temp-buffer-in-current-frame for %s: we call a 3-arg display-buffer: %s"
-;; (ad-get-arg 0) ecb-temp-buffer-shrink-to-fit)
-;; (display-buffer (ad-get-arg 0) nil nil)))
-;; (error (signal (car oops) (cdr oops)))
-;; (quit (signal 'quit nil)))))
-;; (if (not (eq (last-nonminibuf-frame) (window-frame window)))
-;; ;; only the pre-display-buffer-function should ever do this.
-;; (error "display-buffer switched frames on its own!!"))
-;; (setq minibuffer-scroll-window window)
-;; (set-window-start window 1) ; obeys narrowing
-;; (set-window-point window 1)
-;; (ecb-layout-debug-error "show-temp-buffer-in-current-frame: buffer: %s, window: %s, shrink-to-fit: %s"
-;; (ad-get-arg 0) window temp-buffer-shrink-to-fit)
-;; nil)))
-
- ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: maybe this is the reason for the
- ;; crash... lets test
- ;; XEmacs-version
(defecb-advice shrink-window-if-larger-than-buffer around ecb-layout-basic-adviced-functions
"Makes the function compatible with ECB."
(or (ad-get-arg 0) (ad-set-arg 0 (selected-window)))
@@ -1593,6 +1555,10 @@ arguments. Do never set this variable; it is only set by
(ecb-with-original-basic-functions
ad-do-it)
+ ;; now:
+ ;; - the window to shrink is in the ecb-frame
+ ;; - this window is not a special ecb-window
+
;; we handle only the edit-windows and the compile-window of the
;; ecb-frame in a special manner.
@@ -1624,46 +1590,17 @@ arguments. Do never set this variable; it is only set by
ecb-compile-window-height-lines))
ecb-compile-window-height-lines
window-min-height))
- (n 0)
- (test-pos
- (- (point-max)
- ;; If buffer ends with a newline, ignore it when counting
- ;; height unless point is after it.
- (if (and (not (eobp))
- (eq ?\n (char-after (1- (point-max)))))
- 1 0)))
- (mini (frame-property (window-frame (ad-get-arg 0)) 'minibuffer))
- (edges (window-pixel-edges (selected-window))))
- ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: try to replace this
- ;; stuff with ecb-fit-window-to-buffer - should be possible
- (if (and (< 1 (let ((frame (selected-frame)))
- (select-frame (window-frame (ad-get-arg 0)))
- (unwind-protect
- (count-windows)
- (select-frame frame))))
- (or (equal (ad-get-arg 0) ecb-compile-window)
- (not (equal (ecb-edit-window-splitted) 'horizontal)))
- (pos-visible-in-window-p (point-min) (ad-get-arg 0))
- (not (eq mini 'only))
- (or (not mini) (eq mini t)
- (< (nth 3 edges)
- (nth 1 (window-pixel-edges mini)))
- (> (nth 1 edges)
- 0)))
- (progn
- (save-window-excursion
- (goto-char (point-min))
- (while (and (window-live-p (ad-get-arg 0))
- (pos-visible-in-window-p test-pos (ad-get-arg 0)))
- (shrink-window 1 nil (ad-get-arg 0))
- (setq n (1+ n))))
- (ecb-layout-debug-error "shrink-window-if-larger-than-buffer: n: %d" n)
- (if (> n 0)
- (shrink-window (min (1- n)
- (- (ecb-window-full-height (ad-get-arg 0))
- (1+ window-min-height)))
- nil
- (ad-get-arg 0))))))))))
+ (mini (frame-property (window-frame (ad-get-arg 0)) 'minibuffer)))
+ (when (and (let ((frame (selected-frame)))
+ (select-frame (window-frame (ad-get-arg 0)))
+ (unwind-protect
+ (not (one-window-p t))
+ (select-frame frame)))
+ (ecb-window-safely-shrinkable-p (ad-get-arg 0))
+ (pos-visible-in-window-p (point-min) (ad-get-arg 0))
+ (not (eq mini 'only)))
+ (ecb-fit-window-to-buffer (ad-get-arg 0)
+ (ecb-window-full-height (ad-get-arg 0)))))))))
(defecb-advice pop-to-buffer around ecb-layout-basic-adviced-functions
"Chooses the window with the ECB-adviced version of `display-buffer'."
@@ -1752,9 +1689,12 @@ for current layout."
ecb-compile-window-height-lines))
ecb-compile-window-height-lines
window-min-height)))
- (if (and (< 1 (count-windows))
- (or (equal (ad-get-arg 0) ecb-compile-window)
- (not (equal (ecb-edit-window-splitted) 'horizontal)))
+ (if (and (let ((frame (selected-frame)))
+ (select-frame (window-frame (ad-get-arg 0)))
+ (unwind-protect
+ (not (one-window-p t))
+ (select-frame frame)))
+ (ecb-window-safely-shrinkable-p (ad-get-arg 0))
(pos-visible-in-window-p (point-min) (ad-get-arg 0))
(not (eq mini 'only))
(or (not mini)
@@ -5572,33 +5512,29 @@ floating-point-numbers. Default referencial width rsp. height are
(defun ecb-get-edit-area-size (&optional win-list)
(let ((layout-type (ecb-get-layout-type ecb-layout-name))
(ecb-win-list (ecb-canonical-ecb-windows-list win-list))
- (comp-win-state (ecb-compile-window-state)))
+ (comp-win-height (if (equal (ecb-compile-window-state) 'visible)
+ (ecb-window-full-height ecb-compile-window)
+ 0)))
(if (null ecb-win-list)
(cons (frame-width ecb-frame)
- (frame-height ecb-frame))
+ (- (frame-height ecb-frame) comp-win-height))
(case layout-type
(top
(cons (frame-width ecb-frame)
(- (frame-height ecb-frame)
(ecb-window-full-height (ecb-first ecb-win-list))
- (if (equal comp-win-state 'visible)
- (ecb-window-full-height ecb-compile-window)
- 0))))
+ comp-win-height)))
(left-right
(cons (- (frame-width ecb-frame)
(ecb-window-full-width (ecb-first ecb-win-list))
(ecb-window-full-width (ecb-last ecb-win-list)))
(- (frame-height ecb-frame)
- (if (equal comp-win-state 'visible)
- (ecb-window-full-height ecb-compile-window)
- 0))))
+ comp-win-height)))
(otherwise
(cons (- (frame-width ecb-frame)
(ecb-window-full-width (ecb-first ecb-win-list)))
(- (frame-height ecb-frame)
- (if (equal comp-win-state 'visible)
- (ecb-window-full-height ecb-compile-window)
- 0))))))))
+ comp-win-height)))))))
;; Klaus Berndl <klaus.berndl@sdm.de>: Cause of a much better repair-mechanism
View
2  ecb-makedef.mk
@@ -38,7 +38,7 @@ ecb_LISP_EL=tree-buffer.el ecb-util.el ecb-mode-line.el ecb-help.el \
ecb-jde.el ecb-file-browser.el ecb-method-browser.el \
ecb-winman-support.el ecb-cedet-wrapper.el \
ecb-compatibility.el ecb-common-browser.el ecb-analyse.el \
- ecb-symboldef.el ecb-advice-test
+ ecb-symboldef.el ecb-advice-test.el
ecb_LISP_ELC=$(ecb_LISP_EL:.el=.elc)
View
6 ecb-upgrade.el
@@ -155,7 +155,7 @@
;; (defconst ecb-version "2.33beta1"
;; "Current ECB version.")
-(defconst ecb-version "2.33"
+(defconst ecb-version "2.40"
"Current ECB version.")
(eval-when-compile
@@ -173,7 +173,7 @@
;; Each NEWS-string should be a one-liner shorter than 70 chars
(defconst ecb-upgrade-news
- '(("2.33" . ("ECB now requires full CEDET being installed (at least 1.0pre6)."
+ '(("2.40" . ("ECB now requires full CEDET being installed (at least 1.0pre6)."
"More user-responsible buffer-parsing based on the idle-mechanism of semantic."
"ECB is able to work with indirect buffers it the base-buffer is filebased."
"The history can now be bucketized, see new `ecb-history-make-buckets'."
@@ -183,7 +183,7 @@
"New command `ecb-goto-window-edit-by-smart-selection'."
"New command `ecb-goto-window-ecb-by-smart-selection'."
"New option `ecb-ignore-pop-up-frames'."
- "Better compatibility with Emacs 22 - see NEWS file."
+ "Full compatibility with Emacs 22 and 23 - see NEWS file."
"Better compatibility with CEDET 1.0preX and semantic 2.0preX - see NEWS file."
"The internal download-feature of ECB has been completely disabled."
))
View
302 ecb-util.el
@@ -49,6 +49,7 @@
;;; ----- Silentcomp-Defs ----------------------------------
;; XEmacs
+(silentcomp-defun symbol-value-in-buffer)
(silentcomp-defun button-release-event-p)
(silentcomp-defun button-press-event-p)
(silentcomp-defun event-key)
@@ -68,6 +69,7 @@
(silentcomp-defun posn-point)
(silentcomp-defun posn-window)
(silentcomp-defun event-start)
+(silentcomp-defun set-window-vscroll)
;; XEmacs
(silentcomp-defun make-dialog-box)
(silentcomp-defun display-message)
@@ -344,288 +346,6 @@ Uses the `derived-mode-parent' property of the symbol to trace backwards."
(delete-itimer timer))
)
-;;; ----- advice stuff -------------------------------------
-
-(defvar ecb-adviced-function-sets nil
- "A list of adviced-function sets defined with `defecb-advice-set'.
-Each element is a cons-cell where car is the advice-set-var and cdr is an
-indicator if the caller of `ecb-with-original-adviced-function-set' is the
-outmost caller.
-
-DO NOT CHANGE THIS!")
-
-(defvar ecb-adviced-permanent-function-sets nil
- "A list of symbols, each of them an advice-set which should be permanent.
-Permanent means this advice set will not be disabled during deactivation of
-ECB. This variable is only set by `defecb-advice-set'.
-
-DO NOT CHANGE THIS!")
-
-(defvar ecb-adviced-functions nil
- "A list of all advices defined with `defecb-advice'.
-This list is the set union of the values of all function-sets of
-`ecb-adviced-function-sets'.
-
-DO NOT CHANGE THIS!")
-
-(defvar ecb-advices-debug-error nil)
-
-(defun ecb-advices-debug-error (advice class action &rest args)
- "Run ARGS through `format' and write it to the *Messages*-buffer.
-ADVICE is the adviced-function-symbol, CLASS is the advice-class \(after,
-around or before) and ACTION is one of the symbols 'calling, 'enabling,
-'disabling or 'reporting.
-
-This will build up a message string like:
-ECB <version>: debug <ACTION> of '<CLASS>' advice ADVICE \[<time>]: ARGS.
-If ARGS is nil then only the message above is reported."
- (when ecb-advices-debug-error
- (message (concat (format "ECB %s: debug %s of '%s' advice %s [%s] "
- ecb-version
- action
- class
- advice
- (format-time-string "%H:%M:%S"))
- (if args
- (apply 'format args))))))
-
-(defmacro defecb-advice-set (advice-set docstring &optional permanent)
- "Defines an advice-set for ECB.
-This defines a variable which will contain adviced functions defined by
-`defecb-advice-set'. This is a set of advices which can be enabled or disabled
-\"en block\" which must be done either by `ecb-enable-advices',
-`ecb-disable-advices' or `ecb-with-original-adviced-function-set'.
-
-Before defining a new advice-set it's recommended to take a look at the value
-of `ecb-adviced-function-sets' if there is already a suitable advice-set.
-
-IMPORTANT: Each advice in ECB must be defined by `defecb-advice' and must
-belong to an advice-set previously defined by `defecb-advice-set'!
-
-All advice-sets of ECB will be automatically\(!) disabled at load-time of the
-ecb-library and at deactivation-time of ECB. But: Enabling of a certain
-advice-set must be done appropriately.
-
-If optional argument PERMANENT is t then this advice-set will NOT be disabled
-at deactivation-time of ECB! Calling `ecb-disable-advices' for an advice set
-defined with permanent is t will take no effect unless the optional argument
-FORCE-PERMANENT of this function is set to not nil.
-PERMANENT can also be a function which will be called by `ecb-disable-advices'
-for this advice set \(the function gets one argument: the symbol of the
-advice-set) and have to return not nil if the advice-set should not be disable
-by `ecb-disable-advices' unless the FORCE-PERMANENT of this function is set to
-not nil.
-
-Example:
-
-\(defecb-advice-set ecb-always-disabled-advices
- \"These advices are always disabled.\")"
- `(eval-and-compile
- (add-to-list 'ecb-adviced-function-sets (cons (quote ,advice-set), nil))
- ,(if permanent
- `(add-to-list 'ecb-adviced-permanent-function-sets
- (cons (quote ,advice-set) ,permanent)))
- (defvar ,advice-set nil ,docstring)))
-
-(put 'defecb-advice-set 'lisp-indent-function 1)
-
-(defmacro defecb-advice (adviced-function advice-class advice-set advice-docstring &rest body)
- "Defines an advice for ADVICED-FUNCTION with ADVICE-CLASS for ADVICE-SET.
-ADVICED-FUNCTION must be an advicable object \(e.g. a function, a subr
-etc...). ADVICE-CLASS must be one of around, after or before. ADVICE-SET must
-ba an advice-set previously defined by `defecb-advice-set'. ADVICE-DOCSTRING
-ist the docstring for the advice. BODY is the program-code for the advice as
-it would be written with `defadvice'.
-
-Do not quote ADVICED-FUNCTION, ADVICE-CLASS and ADVICE-SET.
-
-Example:
-
-\(defecb-advice delete-frame around ecb-layout-basic-adviced-functions
- \"If FRAME is equal to the ECB frame then...\"
- \(let \(\(frame \(or \(ad-get-arg 0) \(selected-frame))))
- \(if \(and ecb-minor-mode
- \(equal frame ecb-frame))
- \(when \(ecb-confirm \"Attempt to delete the ECB-frame....Proceed? \")
- \(ecb-deactivate-internal)
- ad-do-it)
- ad-do-it)))"
- `(progn
- (if (assoc (quote ,advice-set) ecb-adviced-function-sets)
- (add-to-list (quote ,advice-set)
- (cons (quote ,adviced-function) (quote ,advice-class)))
- (error "The advice-set %s does not exist!"
- (symbol-name (quote ,advice-set))))
- (if (not (member (quote ,advice-class)
- '(around after before)))
- (error "The advice-class %s is not allowed - only around, after and before!"
- (symbol-name (quote ,advice-class))))
- (add-to-list 'ecb-adviced-functions (cons (quote ,adviced-function) (quote ,advice-class)))
- (eval-and-compile
- (defadvice ,adviced-function (,advice-class ecb)
- ,advice-docstring
- (ecb-advices-debug-error (quote ,adviced-function)
- (quote ,advice-class)
- 'calling)
- ,@body))))
-
-(put 'defecb-advice 'lisp-indent-function 3)
-
-;; (insert (pp (macroexpand '(defecb-advice insert around
-;; ecb-always-disabled-advices "doc"
-;; (message "test")))))
-
-
-(defun ecb-enable-ecb-advice (function-symbol advice-class arg)
- "If ARG is greater or equal zero then enable the adviced version of
-FUNCTION-SYMBOL. Otherwise disable the adviced version. The advice must be
-defined with class ADVICE-CLASS by `defecb-advice'.
-
-IMPORTANT: Do not use the function directly. Always use `ecb-enable-advices',
-`ecb-disable-advices' or `ecb-with-original-adviced-function-set'!."
- (if (< arg 0)
- (progn
- (ad-disable-advice function-symbol advice-class 'ecb)
- (ad-activate function-symbol)
- (ecb-advices-debug-error function-symbol advice-class 'disabling))
- (ad-enable-advice function-symbol advice-class 'ecb)
- (ad-activate function-symbol)
- (ecb-advices-debug-error function-symbol advice-class 'enabling)))
-
-
-(defun ecb-enable-advices (adviced-function-set-var)
- "Enable all advices of ADVICED-FUNCTION-SET-VAR, which must be defined by
-`defecb-advice-set'."
- (if ecb-advices-debug-error
- (message "ECB %s: debug enabling the advice-set: %s"
- ecb-version adviced-function-set-var))
- (if (eq adviced-function-set-var 'ecb-always-disabled-advices)
- (error "The advice-set ecb-always-disabled-advices must not be enabled!"))
- (if (not (assq adviced-function-set-var ecb-adviced-function-sets))
- (error "The adviced function set %s is not defined by defecb-advice-set!"
- (symbol-name adviced-function-set-var)))
- (dolist (elem (symbol-value adviced-function-set-var))
- (ecb-enable-ecb-advice (car elem) (cdr elem) 1)))
-
-(defun ecb-disable-advices (adviced-function-set-var &optional force-permanent)
- "Disable all advices of ADVICED-FUNCTION-SET-VAR, which must be defined by
-`defecb-advice-set'
-
-This function tests if ADVICED-FUNCTION-SET-VAR has been defined as permanent
-by `defecb-advice-set'.
-
-Calling `ecb-disable-advices' for an advice set defined with
-permanent t will take no effect unless the optional argument
-FORCE-PERMANENT is set to not nil. If the advice set is defined as permanent
-with a permanent-disable-function then this function is called with
-ADVICED-FUNCTION-SET-VAR as argument; if this function returns not nil then
-the adviced will be treated as permanent and will not being disabled.
-
-If optional FORCE-PERMANENT is not nil then ADVICED-FUNCTION-SET-VAR will
-be disabled regardless if permanent or not."
- (if ecb-advices-debug-error
- (message "ECB %s: debug disabling the advice-set: %s"
- ecb-version adviced-function-set-var))
- (if (not (assq adviced-function-set-var ecb-adviced-function-sets))
- (error "The adviced function set %s is not defined by defecb-advice-set!"
- (symbol-name adviced-function-set-var)))
- (let ((permanent (if force-permanent
- nil
- (cdr (assq adviced-function-set-var
- ecb-adviced-permanent-function-sets)))))
- (unless (or (eq permanent t)
- (and (functionp permanent)
- (funcall permanent adviced-function-set-var)))
- (dolist (elem (symbol-value adviced-function-set-var))
- (ecb-enable-ecb-advice (car elem) (cdr elem) -1)))))
-
-;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: Generally we have here the same
-;; problem as we had for `ecb-with-original-adviced-function-set' concerning
-;; nested calls. But for now we do nothing because...
-(defmacro ecb-with-ecb-advice (function-symbol advice-class &rest body)
- "Evaluates BODY with the adviced version of FUNCTION-SYMBOL. The advice must
-be defined by `defecb-advice' with class ADVICE-CLASS for the advice-set
-`ecb-always-disabled-advices'. Otherwise an error occurs. The advice is only
-active during BODY. BODY is protected by `unwind-protect' so in each
-case the advice will be disabled after finishing this macro.
-Returns the value of BODY.
-
-Example where this macro is used for `walk-windows' within another advice:
-
-\(ecb-with-ecb-advice 'walk-windows 'around
- ad-do-it)"
- `(progn
- (if (not (member (cons ,function-symbol ,advice-class)
- ecb-always-disabled-advices))
- (error "Advice for %s with class %s not registered in ecb-always-disabled-advices!"
- (symbol-name ,function-symbol)
- (symbol-name ,advice-class)))
- (unwind-protect
- (progn
- (ecb-enable-ecb-advice ,function-symbol ,advice-class 1)
- ,@body)
- (ecb-enable-ecb-advice ,function-symbol ,advice-class -1))))
-
-(put 'ecb-with-ecb-advice 'lisp-indent-function 2)
-
-
-(defmacro ecb-with-original-adviced-function-set (adviced-function-set-var &rest body)
- "Evaluates BODY with all adviced functions of ADVICED-FUNCTION-SET-VAR
-being disabled \(means with their original definition). Restores always \(even
-if an error occurs during evaluating BODY) the previous state of the adviced
-functions, means it depends if the call to this macro is the outermost call:
-Only if it is the outermost-call the advices of the used advice-set will be
-disabled after finishing. So full BODY is guaranted being evaluated with
-disabled advices of ADVICED-FUNCTION-SET-VAR.
-
-ADVICED-FUNCTION-SET-VAR must be defined by `defecb-advice-set' and all
-advices of this set must be defined by `defecb-advice'. Otherwise an error
-occurs.
-
-Example:
-
-\(ecb-with-original-adviced-function-set 'ecb-layout-basic-adviced-functions
- \(do-something..))"
- (let ((outmost-caller-p (make-symbol "outmost-caller-p")))
- `(let ((,outmost-caller-p
- (unless (equal (cdr (assq ,adviced-function-set-var ecb-adviced-function-sets))
- 'outmost-caller)
- ;; if we are the outmost caller of this macro we store this
- ;; for
- ;; a) following callers
- ;; b) ourself, so we can later reset is
- (setcdr (assq ,adviced-function-set-var ecb-adviced-function-sets) 'outmost-caller))
- ))
- (if ecb-advices-debug-error
- (message "ECB %s: debug with original advice-set: %s - ENTRY"
- ecb-version ,adviced-function-set-var))
- (unwind-protect
- (progn
- (when ,outmost-caller-p
- ;; we must force disabling permanent advice-sets too
- (ecb-disable-advices ,adviced-function-set-var t))
- ,@body)
- (when ,outmost-caller-p
- ;; Only if we are the outmost caller we are allowed to re-enable the
- ;; disabled advice-set
- (setcdr (assq ,adviced-function-set-var ecb-adviced-function-sets) nil)
- (ecb-enable-advices ,adviced-function-set-var))
- (if ecb-advices-debug-error
- (message "ECB %s: debug with original advice-set: %s - EXIT"
- ecb-version ,adviced-function-set-var))))))
-
-
-(put 'ecb-with-original-adviced-function-set 'lisp-indent-function 1)
-
-
-
-(defecb-advice-set ecb-always-disabled-advices
- "These advices are always disabled.
-This advice-set can not be enabled by `ecb-enable-advices' but such an
-advice has to be activated 'on demand' by the caller. Such an advice must be
-used with the macro `ecb-with-ecb-advice'.")
-
-
;;; ----- Customize stuff ----------------------------------
@@ -1969,10 +1689,12 @@ or a buffer-object."
buffer-local value in BUFFER then the global value of SYM is used."
(if (fboundp 'buffer-local-value)
(buffer-local-value sym buffer)
- (or (cdr (assoc sym (buffer-local-variables buffer)))
- (save-excursion
- (set-buffer buffer)
- (symbol-value sym)))))
+ (when ecb-running-xemacs
+ (symbol-value-in-buffer sym buffer))))
+;; (or (cdr (assoc sym (buffer-local-variables buffer)))
+;; (save-excursion
+;; (set-buffer buffer)
+;; (symbol-value sym)))))
(defun ecb-file-content-as-string (file)
@@ -2111,6 +1833,14 @@ height is that fraction of the frame."
(enlarge-window enlargement))))
(error "Window is not alive!")))
+(defun ecb-window-safely-shrinkable-p (&optional window)
+ "Non-nil if the WINDOW can be shrunk without shrinking other windows.
+If WINDOW is nil or omitted, it defaults to the currently selected window."
+ (with-selected-window (or window (selected-window))
+ (let ((edges (ecb-window-edges)))
+ (or (= (nth 2 edges) (nth 2 (ecb-window-edges (previous-window))))
+ (= (nth 0 edges) (nth 0 (ecb-window-edges (next-window))))))))
+
(defun ecb-fit-window-to-buffer (&optional window max-height min-height)
"Make WINDOW the right height to display its contents exactly.
If WINDOW is omitted or nil, it defaults to the selected window.
View
1  ecb-winman-support.el
@@ -98,6 +98,7 @@
(require 'silentcomp))
(require 'ecb-util)
+(require 'ecb-common-browser)
(silentcomp-defvar escreen-current-screen-number)
View
2  ecb.texi
@@ -46,7 +46,7 @@
@c edit the Makefile to change the version number. mechanism stolen
@c from Tramp
@macro ecbver{}
-2.33
+2.40
@end macro
View
2  html/ecb-html.el
@@ -77,7 +77,7 @@
"List of latest news displayed on the main page.")
(setq ecb-latest-news
`(
- ,(h-sub-section "ECB 2.33 released! (2009-04-??)"
+ ,(h-sub-section "ECB 2.40 released! (2009-05-??)"
"ECB now requires full CEDET being installed (at least
1.0pre6). ECB has now more user-responsible
buffer-parsing based on the idle-mechanism of
Please sign in to comment.
Something went wrong with that request. Please try again.