Next: , Previous: Updating Methods-window, Up: The Methods window


6.6.5 Updating Methods for indirect buffers

ECB works out of the box with indirect buffers, especially with indirect buffer clones created with the command clone-indirect-buffer (only available with GNU Emacs >= 21). They will be handled as all other buffers and you can work with them with no difference to “normal” buffers. With one exception:

Please note: Cause of a bug in Emacs 22 (and maybe also in Emacs 23) the propagation of parsing informations from one buffer to all others which are in an indirect-buffer relation to the same base-buffer does currently not work.

What does this mean: If you modify a buffer then Emacs propagates this change to all buffers with the same base-buffer. ECB/semantic recognize this change and do all necessary to automatically reparse the changed buffer (at least if you have customized semantic/ECB to do this). So far so good, but: If you switch to another buffer with the same base-buffer then you will notice that the methods-window of ECB still displays the contents before the change, ie. the need for a reparse has not been propagated to these other buffers. This is a bug in Emacs.

What can you do: As long as this bug is not fixed there is no chance that all other affected “indirect-related” buffers will be reparsed automatically after modifying one of them. So you have to do this reparse “by hand” after switching to such an indirect-related buffer, but this is very simple: Just call the command ecb-rebuild-methods-buffer with prefix arg or hit <C-u C-c . r> (key this command is bound to).

Lets make an example:

  1. Suppose we have a sourcefile test.java loaded as a buffer into Emacs and suppose further we have created two indirect-buffer clones test-clone1.java and test-clone2.java - all of these buffers point to the same file: test.java.
  2. Now lets be the buffer test-clone1.java the current buffer and let us modify it (e.g. adding a new method). If you have enabled the idle-reparse mechanism of semantic (see Setting up CEDET/semantic) then this buffer will be reparsed automatically and ECBs methods-window will be updated in turn too.
  3. So far so good. But if you now switch to one of the two other buffers, lets say to test.java, then you will notice that the change done in test-clone1.java is also visible in the buffer test.java but the ECB-methods-window for test.java will display the contents before the change. This is cause of the Emacs-bug described above.
  4. To update the methods-window for test.java to the new contents you have to call ecb-rebuild-methods-buffer with prefix argument (ie. clear-cache is true) or hitting <C-u C-c . r>. Note: Calling this command without prefix argument is not enough!