Emacs 24 ide configuration (yasnippet, ECB, cedet, auto-complete)

Source: Internet
Author: User
1. Reference Links:

A. http://www.cnblogs.com/karotte/archive/2012/06/06/2537670.html

B. http://www.emacswiki.org/CollectionOfEmacsDevelopmentEnvironmentTools

C. http://guweigang.com/2010/09/gnu/%E4%BB%8A%E5%A4%A9%E5%9F%BA%E6%9C%AC%E9%85%8D%E5%A5%BD%E4%BA%86emacs%E4%BA%86%EF%BC%81.html

D. http://jovesky.sinaapp.com/2012/07/29/the-the-emacs24-configuration-cedet-and-ecb/

E. http://jianghao19890829.iteye.com/blog/1850791

F. http://blog.csdn.net/cnsword/article/details/7474119

G. http://jianghao19890829.iteye.com/

PS: If you encounter problems during the installation process, you can find them in the troubleshooting section after this article. I listed some problems I encountered during the anzung process. However, you may not encounter any problems during the installation process.

2. Software Download:

Yasnippet: http://code.google.com/p/yasnippet/

Auto-complete: http://cx4a.org/software/auto-complete/index.html

Cedet installation: http://cedet.sourceforge.net/

ECB installation: http://ecb.sourceforge.net/

3. Software Installation: A. Configure cedet

Because Emacs comes with cedet 1.0 and cannot be used with ECB, we can download the latest version of cedet1.1 here. It is no problem to make it directly. Add:

; Cedet

(Add-to-list 'Load-Path

"~ /. Emacs. d/plugins // cedet-1.1/common ")

(Load-file "~ /. Emacs. d/plugins // cedet-1.1/common/cedet. El ")

(Global-Ede-mode 1); enable the Project Management System

(Semantic-load-enable-code-helpers); Enable prototype help and smart completion

(Global-srecode-minor-mode 1); Enable template insertion menu

Here ~ /. Emacs. d/plugins // cedet-1.1/common Please modify according to your own path

B. Configure ECB

This is the most troublesome and always goes wrong. during compilation, the system prompts that the cedet cannot be found. Here we write this during compilation.

Make cedet = ~ /. Emacs. d/plugins // cedet-1.1/

(Change the path based on your cedet storage)

So we find the path of cedet, And then he prompts the cedet version is wrong, because ECB does not support cedet1.1, here we modify the ecb-upgrade.el in

(Defconst ECB-required-cedet-version-Max '(1 0 4 9 ))

Is

(Defconst ECB-required-cedet-version-Max '(1 1 4 9 ))

And comment

; (When (or (not (boundp 'cedet-version ))

; (ECB-package-version-list <

; (Ecb-package-version-str2list cedet-Version)

; ECB-required-cedet-version-min)

; (ECB-package-version-list <

; ECB-required-cedet-version-max

; (Ecb-package-version-str2list cedet-version )))

; (Setq version-error (Concat "cedet ["

; Cedet-required-version-str-min

;;","

; Cedet-required-version-str-max

; "]")

In this way, you can compile and use it normally.

Finally, we add

; ECB

(Add-to-list 'Load-Path

"~ // Emacs. d/plugins // ecb-2.40 ")

(Require 'ecb)

(Require 'ecb-autoloads)

(Setq stack-trace-on-error nil)

(Setq ECB-auto-activate T

ECB-tip-of-the-day nil)

Similarly, you can modify it based on your own path.

PS: one of them is really disgusting to me, that is, the cedet configuration must be before the ECB, or the ECB will call the built-in cedt!

C. Configure yasnippet

Download and decompress the package ~ /. Emacs. d/Plugins directory, and then add

; Yasnippet

(Add-to-list 'Load-Path

"~ /. Emacs. d/plugins/yasnippet-0.6.1c ")

(Require 'yasnippet); not yasnippet-bundle

(YAS/initialize)

(YAS/load-directory "~ /. Emacs. d/plugins/yasnippet-0.6.1c/snippets ")

D. Configure auto-complete

Download and decompress the package ~ /. Emacs. d/Plugins directory, and then open Emacs, follow these steps:

Type M-x load-file RET in the running Emacs or newly launched Emacs. note that if you want to upgrade auto-complete-mode, you have to install in a newly launched Emacs with-Q option. then input a file name to load which is a path string with adding/etc/install. el to the package directory. for example, if the package directory is ~ /Tmp/auto-complete-1.2, the file name will be ~ /Tmp/auto-complete- 1.2/etc/install. El.

(Press M-X, input load-file, and press Enter. Follow the prompts to enter the configuration file name of auto-complete. For example :~ /Tmp/auto-complete-1.2/etc/install. El .)

Then input a directory where auto complete will be installed. You need to add a directory to load-path later if load-path doesn't include the directory. The directory is to be ~ /. Emacs. d by default.

Finally type ret to start installation. After installation, you may see the following buffer and follow instructions to edit. emacs.

Add the following code to your. emacs file:

; Auto-complete

(Add-to-list 'Load-path "~ /. Emacs. d /")

(Require 'auto-complete-config)

(Add-to-list 'ac-dictionary-directories "~ /. Emacs. d // AC-dict ")

(Ac-config-default)

4. Problem Solving:

A. Warning: cedet-called-interactively-P called with 0 arguments, but requires 1

Question: "WARNING: cedet-called-interactively-P called with 0 arguments, but requires 1"

Solution: can be suppressed by adding (setq byte-compile-warnings nil) in your. emacs file before cedet is loaded

B. symbol's value as variable is void: Stack-trace-on-Error

Problem: "symbol's value as variable is void: Stack-trace-on-error"

Solution: add (setq stack-trace-on-error T) to your Emacs configuration)

C. Void-function make-local-hook

Problem: (void-function make-local-hook)

Solution: You can use this:

(Defalias 'make-local-hook

(If (featurep 'xemacs)

'Make-local-hook

'Ignore ))

Add the above to your. emacs file. (It should be blocked make-local-hook, refer to the link http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-03/msg00806.html)

PS: You are welcome to add and improve it.

5. Result Display:

After completing the preceding steps, the generated. emacs is as follows:

(My plug-ins are all placed in ~ /. Emacs. d/plugins/directory)

(Setq byte-compile-warnings nil)

(Setq stack-trace-on-error T)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Cedet 1.1

;;

(Load-file "~ /. Emacs. d/plugins/cedet-1.1/common/cedet. El ")

(Global-Ede-mode 1); enable the Project Management System

(Semantic-load-enable-code-helpers); Enable prototype help and smart completion

(Global-srecode-minor-mode 1); Enable template insertion menu

;

;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; ECB 2.40

;;

(Add-to-list 'Load-Path

"~ /. Emacs. d/plugins/ecb-2.40 ")

(Require 'ecb)

(Require 'ecb-autoloads)

; Switch between windows

(Global-set-Key [M-Left] 'windmove-left)

(Global-set-Key [M-right] 'windmove-right)

(Global-set-Key [M-Up] 'windmove-up)

(Global-set-Key [M-Down] 'windmove-down)

; Show & hide window

(Global-set-Key [C-f1] 'ecb-hide-ECB-Windows)

(Global-set-Key [C-f2] 'ecb-show-ECB-Windows)

; Maximize a ECB window

(Global-set-Key (KBD "c-c 1") 'ecb-maximize-window-Directories)

(Global-set-Key (KBD "C-C 2") 'ecb-maximize-window-sources)

(Global-set-Key (KBD "c-c 3") 'ecb-maximize-window-methods)

(Global-set-Key (KBD "C-C 4") 'ecb-maximize-window-History)

; Restore the original window layout

(Global-set-Key (KBD "c-c 0") 'ecb-restore-default-window-sizes)

;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Yasnippet

(Add-to-list 'Load-Path

"~ /. Emacs. d/plugins/yasnippet-0.6.1c ")

(Require 'yasnippet); not yasnippet-bundle

(YAS/initialize)

(YAS/load-directory "~ /. Emacs. d/plugins/yasnippet-0.6.1c/snippets ")

; Auto-complete

(Add-to-list 'Load-path "~ /. Emacs. d /")

(Require 'auto-complete-config)

(Add-to-list 'ac-dictionary-directories "~ /. Emacs. d // AC-dict ")

(Ac-config-default)

6. Overall configuration.

After some of the above plug-ins are installed, they will not be so handy if no further configuration is available. So I refer to the configuration of the great god of http://www.cnblogs.com/karotte/archive/2012/06/06/2537670.html (his version is emacs23 I am 24, completely according to his configuration does not work, there will be a lot of errors. So I will refer to his repair and modification, and finally it will be successfully transplanted to my Emacs)

This is my configuration: my plug-ins are all placed in ~ /. Emacs. d/Plugins directory. The compressed package contains a _ Emacs folder, which is placed in ~ Directory.

Here is my link: http://download.csdn.net/detail/a593796769/5488405

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.