【问题标题】:Emacs CEDET Semantic tag foldingEmacs CEDET 语义标签折叠
【发布时间】:2013-02-24 18:31:24
【问题描述】:

我希望每次打开 .cpp 文件时,语义标签折叠都会被激活。我正在使用最新版本的 cedet(正在加载 cedet-devel-load.el)。我有

(semantic-mode 1)
(require 'semantic/ia)
(require 'semantic/bovine/gcc)
(load-file "path/to/semantic/tag/folding/semantic-tag-folding.el")
(require 'semantic-tag-folding)

我添加了一个钩子

(add-hook 'c-mode-common-hook 'setupcpp)

在 'setupcpp 我只是有

(defun setupcpp ()
(interactive)
(semantic-tag-folding-mode t))

这之后在我的 .emacs 中没有发生任何与 cedet/语义相关的事情。事实上,我可以把它作为我的 .emacs 的唯一内容。

它不起作用。打开 .cpp 文件时,我收到消息文件模式规范错误:(错误“缓冲区 foo.cpp 无法按语义折叠”)。

奇怪的是,如果打开文件后,我执行 M-x semantic-tag-folding-mode,它就可以了!我只是迷路了。

【问题讨论】:

    标签: emacs lisp elisp emacs24 cedet


    【解决方案1】:

    我在使用 Emacs 24.3 和最新的 cedet bzr 版本时遇到了完全相同的错误。

    我的解决方案如下: 每当有东西被装饰时,折叠模式也会被启用。

    (load-library "~/emacs/cedet/cedet-bzr/trunk/cedet-devel-load")
    (load-library "contrib/semantic-tag-folding.el")
    
    (defun do-after-decorate () (semantic-tag-folding-mode t) )
    (add-hook 'semantic-decoration-mode-hook 'do-after-decorate) 
    ;; ... 
    (semantic-load-enable-excessive-code-helpers) ; also starts the decorate-mode when useful.
    

    为我工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-21
      • 1970-01-01
      • 2014-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-09
      相关资源
      最近更新 更多