Re: [CEDET-devel] Is Semantic able to work with indirect buffers? - some more findings and a soluti
Brought to you by:
zappo
From: <kla...@ca...> - 2009-04-16 12:10:25
|
After playing a little bit i found other very mysterious behaviors: 1. Start Emacs with semantic activated and load a elisp file X 2. Go to a tag T (e.g. a defun) 3. Do M-: (semantic-current-tag) --> this will return the tag T with buffer object X 4. Call M-x clone-indirect-buffer RET --> this will popup a new indirect buffer X<2> 5. Go to the same tag T as in step 2 6. Do M-: (semantic-current-tag) --> this will return the tag T with buffer object X well, we know already this failure, but now lets go further 7. Switch back to buffer X (the base-buffer) and edit tag T (e.g. add a new argument to the defun, if T is a defun) 8. Do M-: (semantic-current-tag) --> semantic returns the repares tag T with the new informations, fine! 9. Switch to buffer X<2> (the indirect buffer) and do M-: (semantic-current-tag) --> you get the reparsed tag T with new informations but still the wrong buffer X Well, same failure as after 6, but now it gets crazy 10. Now edit tag T in the indirect-buffer X<2>!! (e.g. remove the newly added argument from step 7) - do not save! 11. do M-: (semantic-current-tag) --> you get the reparsed tag T with again new informations but still the wrong buffer X 12. Switch back to buffer X (the base buffer) and move point to tag T 13: do M-: (semantic-current-tag) --> you get.................................... nil!! No tag T anymore in the base buffer after editing tag T in the indirect buffer..... Again: With current semantic working with indirect buffers yields to unpredictable side-effects. So either the users should get a warning not to work with indirect buffers and semantic or semantic should be fixed with that respect... Ciao, Klaus -----Ursprüngliche Nachricht----- Von: Lennart Borgman [mailto:len...@gm...] Gesendet: Donnerstag, 16. April 2009 12:33 An: Berndl, Klaus Cc: er...@si...; ced...@li... Betreff: Re: [CEDET-devel] Is Semantic able to work with indirect buffers? - some more findings and a solution idea On Thu, Apr 16, 2009 at 10:29 AM, <kla...@ca...> wrote: > A) Ensure that the overlays (at least the semantic related) of an indirect-buffer contain the buffer-object of the indirect-buffer and not the base-buffer... If Emacs does this not automatically (which could be a bug) then maybe semantic could do this itself, e.g. by advicing make-indirect-buffer and rebuilding all semantic-overlays so afterwards the correct buffer is returned by overlay-buffer... Maybe this needs more digging... I have no idea how this work, but it sounds that there are some properties on the overlays that points to position in a buffer. I guess these are markers. Then maybe a check if the marker points to the base buffer could be made just before use? Or perhaps that will be too slow? |