emacs semantic qt自动补全问题(解决)

Vim、Emacs配置和使用
回复
werther0331
帖子: 99
注册时间: 2010-10-29 15:20

emacs semantic qt自动补全问题(解决)

#1

帖子 werther0331 » 2011-04-10 12:50

semantic已经包含qt路径。
emacs 中包含qt头文件时(例如:#include <QtGui>),报该头文件Unparsed,但可以找到。直接跳转到该头文件时,发现其开头无-*- C++ -*-,使用的模式不是C++-mode,而是文本,故而semantic无法获取tags。
请问各位大大,如何使qt头文件使用C++-mode?从而被semantic语法分析。
上次由 werther0331 在 2011-04-11 17:36,总共编辑 1 次。
werther0331
帖子: 99
注册时间: 2010-10-29 15:20

Re: emacs semantic qt自动补全问题

#2

帖子 werther0331 » 2011-04-11 16:20

顶上……
没人知道吗?
或者有人能够添加semantic对文件开头#ifndef或者#include识别为C++-mode, 就像识别-*-C++-*-一样?
werther0331
帖子: 99
注册时间: 2010-10-29 15:20

Re: emacs semantic qt自动补全问题

#3

帖子 werther0331 » 2011-04-11 17:35

自己解决……

解决方法:
使用magic-mode-alist

配置如下:
;;设置自动模式
(add-to-list 'magic-mode-alist'("#include" . c++-mode))
(add-to-list 'magic-mode-alist'("#ifndef" . c++-mode))
pbe_sedm
帖子: 4
注册时间: 2009-08-17 13:54

Re: emacs semantic qt自动补全问题(解决)

#4

帖子 pbe_sedm » 2011-08-25 16:21

能问下楼主是怎么配置semantic包含qt的吗?
回复