How to close method window automatically after selecting a tag?

sweord <[email protected]> Wed, 09 Jun 2010 00:14:20 +0800
Newsgroups gmane.emacs.code-browser
Organization Beijing/China
Message-ID <[email protected]>
Hello:
        
I'm new to emacs and ecb. 

Usually, there's only one edit window in my emacs when editing code. 
If I want to navigate from method,  I press meta-f8, so method
window was opened and focused. I select a tag and press ENTER, cursor jump to
edit widow again, but method window is still open.

I want method window to be closed automatically after selecting a tag, so I defined
a hook as below:

(defun fj-ecb-hide-ecb-window (tag)
  "hide ecb window when select a tag"
  (setq new-point (ecb-tag-visit-smart-tag-start tag))
  (ecb-hide-ecb-windows)
  (new-point))
(setq ecb-tag-visit-post-actions '((default . (fj-ecb-hide-ecb-window))
                                       (java-mode . (ecb-tag-visit-goto-doc-start))
                                       (jde-mode . (ecb-tag-visit-goto-doc-start))))

The code does not work as expected. Could anyone tell me what's wrong?
Thanks very much!
  
-- 
T41/WinXP/cygwin/emacs/vim 


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo