Status of CEDET and ECB in Emacs 24.2

I am a bit confused of what I need to do to run CEDET and ECB in Emacs 24.2.1.

The Emacswiki has the following text:

How to enable the CEDET tools which were merged with Emacs

In Emacs 23.2, CEDET was merged into the main Emacs distribution. The configuration code which is explained in CEDET tutorials doesn't work anymore. For instance you cannot use (semantic-load-enable-gaudy-code-helpers) to enable the useful features.

TODO: please explain what code you need to load the most useful IDE tools provided by CEDET

I got a basic configuration to work with the following in my .emacs:

(global-ede-mode 1)
(require 'semantic/sb)
(semantic-mode 1)
  • Q1: Are CEDET and ECB now bundled with Emacs? If so, why is there a separate Sourceforge project for it?
  • Q2: How can I enable CEDET and ECB in Emacs 24.2? Do I still need to download the source code from the respective websites and install them separately?

  • You need to take into account several things:

  • CEDET is bundled with GNU Emacs 24.2, but it's slightly outdated... CEDET 1.1 or CEDET from bzr is better from functional point of view. I hope, that Emacs 24.3 will have fresh version of CEDET
  • I have a fork of ECB, that works with fresh CEDET (1.1 or bzr) & with CEDET bundled with Emacs - but you need to install it manually
  • You can enable CEDET bundled with GNU Emacs or CEDET from bzr with following config, for CEDET 1.1 you can use following config.
  • PS I'll try to answer to more questions here, or you can write to me directly via e-mail


    Q1: Yes and no: CEDET is bundled, but ECB is not. While CEDET is bundled, the main development keeps happening outside of Emacs's repository for partly historical and partly technical reasons.

    Q2: (semantic-mode 1) and (global-ede-mode 1) should be sufficient to enable CEDET (no need to (require 'semantic/sb) ). As for ECB, since it's not bundled, ...


    Emacs Code Browser rocks, but it took me a few days to figure out how to set it up to my satisfaction on my current Emacs 24.5.1. Hopefully, the following instructions will help make it more popular going forwards.

    Step 1: on Ubuntu: install texinfo via:

    sudo apt-get install texinfo
    

    This actually installs makeinfo which is needed in order to install ecb. Macs may already have makeinfo installed -- I don't think I had to install texinfo on my Mac.

    Step 2: Use el-get to install ecb. Do a web search on 'el-get emacs' to find out more about el-get. The advantage of using el-get is that it will automagically take care of adding ecb to your emacs load path.

    BTW, it seems to take a good 15 or so minutes to install ecb using el-get. Be patient and don't exit emacs if it tells you it has an active process running..

    When el-get has finished, it will show a message : ecb has been installed successfully (or something to that effect)

    Step 3: Add the following to your emacs init file (either ~/.emacs.d/init.el or ~/.emacs -- make the edits to whichever of these two files is already present)

    ;; start of ecb configuration/customization:
    ;;
    (require 'ecb)
    
    
    (setq stack-trace-on-error t)
    (setq ecb-version-check nil)
    (setq ecb-layout-name "left15")
    (setq ecb-tip-of-the-day nil)
    (setq ecb-primary-secondary-mouse-buttons 'mouse-1--mouse-2)
    
    
    (setq ecb-source-file-regexps
      '((".*" .     (("(^(.|#)|(~$|.(pyc|elc|obj|o|class|lib|dll|a|so|cache)$))")
                 ("^.(emacs|gnus)$")))))
    
    
    
    ;;
    ;; disable global semantic idle scheduler.
    ;; it doesn't really seem to work all that well in automatically
    ;; reparsing buffers and it's actually intrusive when i'm typing:
    
    (add-hook 'ecb-activate-hook
              '(lambda()
                 (semantic-mode t)
                 (ecb-maximize-window-methods)
                 (setq global-semantic-idle-scheduler-mode nil)
                 ))
    
    
    
    (add-hook 'after-save-hook
              '(lambda()
                 (when (bound-and-true-p ecb-minor-mode)
                   ;; this is to get the methods buffer to refresh correctly.
                   ;; semantic idle mode refresh doesn't seem to work all that     well.
                   (run-at-time 1 nil 'semantic-force-refresh)
                   )
                 ))
    
    
    (set-face-attribute 'ecb-default-general-face nil
                        :inherit 'default)
    
    (set-face-attribute 'ecb-default-highlight-face nil
                        :background "#464646")
    
    (set-face-attribute 'ecb-tag-header-face nil
                        :background "#464646")
    ;;
    ;; end of ecb configuration/customization
    

    Step 4: Restart emacs, open a python source file (as a test example) in emacs and then type: Mx ecb-activate

    If you get a methods list window on the left and the source file view on the right, you've got it working.

    链接地址: http://www.djcxy.com/p/44854.html

    上一篇: emacs中的CEDET(命令行模式)

    下一篇: CEDET和ECB在Emacs中的状态24.2