免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8118 | 回复: 0
打印 上一主题 下一主题

emacs 自动补全问题. [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-27 18:10 |只看该作者 |倒序浏览
对于自定义的结构体成员, 能很好的补全, 可是对于系统的结构体成员, 则每次弹出的补全选项都是一样的.如图.




.emacs 中的配置完全照这里写的http://www.caole.net/diary/emacs_write_cpp.html

  1. ;;---------------------------------------------------
  2. ;;cedet 安装
  3. (add-hook 'texinfo-mode-hook (lambda () (require 'sb-texinfo)))
  4.      (load-file "~/.myemacs/cedet-1.0pre4/common/cedet.el")
  5.      (semantic-load-enable-code-helpers)
  6.      (autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
  7.      (autoload 'speedbar-get-focus "speedbar" "Jump to speedbar frame" t)
  8.      (define-key-after (lookup-key global-map [menu-bar tools])
  9.                 [speedbar]
  10.                 '("Speedbar" .
  11.                 speedbar-frame-mode)
  12.                 [calendar])
  13. ;----------------------------------------------------------
  14. ;;ecb
  15. (add-to-list 'load-path "~/.myemacs/ecb-2.32")
  16. (load-file "~/.myemacs/ecb-2.32/ecb.el")
  17. (require 'ecb)
  18. (setq ecb-auto-activate t
  19.           ecb-tip-of-the-day nil
  20.           ecb-tree-indent 4
  21.           ecb-windows-height 0.5
  22.           ecb-windows-width 0.13)
  23.           ecb-auto-compatibility-check nil
  24.           ecb-version-check nil
  25.           inhibit-startup-message t
  26. ;--------------------------------------------
  27. (custom-set-variables
  28.   ;; custom-set-variables was added by Custom.
  29.   ;; If you edit it by hand, you could mess it up, so be careful.
  30.   ;; Your init file should contain only one such instance.
  31.   ;; If there is more than one, they won't work right.
  32. '(column-number-mode t)
  33. '(display-time-mode t)
  34. '(ecb-options-version "2.32")
  35. '(ecb-source-path (quote ("/a/src" "/home/pro21ms4")))
  36. '(show-paren-mode t)
  37. '(tabbar-buffer-groups-function (quote tabbar-buffer-ignore-groups))
  38. '(tabbar-buffer-list-function (quote tabbar-buffer-list))
  39. '(tabbar-cycling-scope nil)
  40. '(tabbar-mode t)
  41. '(transient-mark-mode t))
  42. (custom-set-faces
  43.   ;; custom-set-faces was added by Custom.
  44.   ;; If you edit it by hand, you could mess it up, so be careful.
  45.   ;; Your init file should contain only one such instance.
  46.   ;; If there is more than one, they won't work right.
  47. )
  48. ;----------------------------------------------
  49. (setq semanticdb-project-roots
  50.           (list
  51.         (expand-file-name "/")))


  52. (defun my-indent-or-complete ()
  53.    (interactive)
  54.    (if (looking-at "\\>")
  55.           (hippie-expand nil)
  56.           (indent-for-tab-command))
  57. )

  58. (global-set-key [(control tab)] 'my-indent-or-complete)


  59. (autoload 'senator-try-expand-semantic "senator")

  60. (setq hippie-expand-try-functions-list
  61.           '(
  62.                 senator-try-expand-semantic
  63.                 try-expand-dabbrev
  64.                 try-expand-dabbrev-visible
  65.                 try-expand-dabbrev-all-buffers
  66.                 try-expand-dabbrev-from-kill
  67.                 try-expand-list
  68.                 try-expand-list-all-buffers
  69.                 try-expand-line
  70.         try-expand-line-all-buffers
  71.         try-complete-file-name-partially
  72.         try-complete-file-name
  73.         try-expand-whole-kill
  74.         )
  75. )

复制代码

[ 本帖最后由 pro21ms4 于 2007-7-27 18:16 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP