我已经从源代码成功构建并安装了 gccsense 和 gcc-code-assist。
我已验证它们已正确安装。
但是,emacs 现在对 c 和 c++ 文件的行为方式没有变化(仍然没有智能感知!)
我该如何解决这个问题?
我用这些instructions正确构建和安装 gccsense 和 gcc-code-assist
PS:在阅读了更多有关该问题的信息后,我发现要测试一切是否已正确安装,我们必须运行命令 M-x gccsense-diagnose
并显示一条消息“Everything OK!”将出现在迷你缓冲区中。
我尝试了上述命令,但我在新缓冲区中收到以下错误消息,而不是消息“一切正常”:-
Cannot obtain completions for std::string
You may not use code-completion
PPS:这是我的“.emacs”`文件:-
(add-to-list 'load-path "~/.emacs.d/")
(load "gccsense.el")
(load "auto-complete.el")
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "black" :foreground "gainsboro" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 128 :width normal :foundry "unknown" :family "Ubuntu Mono")))))
(defun switch-fullscreen nil
(interactive)
(let* ((modes '(nil fullboth fullwidth fullheight))
(cm (cdr (assoc 'fullscreen (frame-parameters) ) ) )
(next (cadr (member cm modes) ) ) )
(modify-frame-parameters
(selected-frame)
(list (cons 'fullscreen next)))))
(define-key global-map [f11] 'switch-fullscreen)
; (global-auto-complete-mode t)
最佳答案
你做到了吗? 将以下代码写入~/.emacs
(require 'gccsense)
关于c++ - 如何在 emacs 中使用 gcc-code-assist?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25017111/