1. (setq-default make-backup-files nil) 
  2. ;;;;自动补齐策略 
  3.  
  4. (defun my-indent-or-complete () 
  5.  
  6.    (interactive) 
  7.  
  8.    (if (looking-at "//>"
  9.  
  10.           (hippie-expand nil) 
  11.  
  12.           (indent-for-tab-command)) 
  13.  
  14.  
  15.   
  16.  
  17. (global-set-key [(control tab)] 'my-indent-or-complete) 
  18.  
  19.   
  20.  
  21. (autoload 'senator-try-expand-semantic "senator"
  22.  
  23. (setq hippie-expand-try-functions-list 
  24.  
  25.           '( 
  26.  
  27.               senator-try-expand-semantic 
  28.  
  29.                    try-expand-dabbrev 
  30.  
  31.                    try-expand-dabbrev-visible 
  32.  
  33.                    try-expand-dabbrev-all-buffers 
  34.  
  35.                    try-expand-dabbrev-from-kill 
  36.  
  37.                    try-expand-list 
  38.  
  39.                    try-expand-list-all-buffers 
  40.  
  41.                    try-expand-line 
  42.  
  43.         try-expand-line-all-buffers 
  44.  
  45.         try-complete-file-name-partially 
  46.  
  47.         try-complete-file-name 
  48.  
  49.         try-expand-whole-kill 
  50.  
  51.         ) 
  52.  
  53. (load-file "~/.emacs.d/site-lisp/cedet-1.0/common/cedet.el"
  54. ;;;; 具体说明可参考源码包下的INSTALL文件,或《A Gentle introduction to Cedet》 
  55.  
  56. ;; Enabling Semantic (code-parsing, smart completion) features 
  57.  
  58. ;; Select one of the following: 
  59.  
  60. ;;(semantic-load-enable-minimum-features) 
  61.  
  62. ;;(semantic-load-enable-code-helpers) 
  63.  
  64. ;;(semantic-load-enable-gaudy-code-helpers) 
  65.  
  66. (semantic-load-enable-excessive-code-helpers) 
  67.  
  68. ;;(semantic-load-enable-semantic-debugging-helpers) 
  69.  
  70.   
  71.  
  72. ;;;; 使函数体能够折叠或展开 
  73.  
  74. ;; Enable source code folding 
  75.  
  76. (global-semantic-tag-folding-mode 1) 
  77.  
  78.   
  79.  
  80. ;; Key bindings 
  81.  
  82. (defun my-cedet-hook () 
  83.  
  84.   (local-set-key [(control return)] 'semantic-ia-complete-symbol) 
  85.  
  86.   (local-set-key "/C-c?" 'semantic-ia-complete-symbol-menu) 
  87.  
  88.   (local-set-key "/C-cd" 'semantic-ia-fast-jump) 
  89.  
  90.   (local-set-key "/C-cr" 'semantic-symref-symbol) 
  91.  
  92.   (local-set-key "/C-cR" 'semantic-symref)) 
  93.  
  94. (add-hook 'c-mode-common-hook 'my-cedet-hook) 
  95.  
  96.   
  97.  
  98. ;;;; 当输入"."">"时,在另一个窗口中列出结构体或类的成员 
  99.  
  100. (defun my-c-mode-cedet-hook () 
  101.  
  102.   (local-set-key "." 'semantic-complete-self-insert
  103.  
  104.   (local-set-key ">" 'semantic-complete-self-insert)) 
  105.  
  106. (add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook) 

    参考文献:

    http://blog.csdn.net/intrepyd/article/details/4331877

    http://docs.huihoo.com/homepage/shredderyin/emacs_elisp.html