在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
先看段我演示: 怎么样? 是不是有IDE的感觉? 进入配置过程.其实配置不复杂. 首先需要Makefile的支持(这里只拿C/C++作例子). 在Makefile中添加下面两行: check-syntax: gcc -o nul -S ${CHK_SOURCES} 然后 进入要编写的代码启用flymake-mode即可 flymake目前支持一下语言:
当然这里有一些有用的函数(ahei编写),可以把错误显示在minibuffer上: ;Code by ahei(defun flymake-display-current-error ()
"Display errors/warnings under cursor."
(interactive)
(let ((ovs (overlays-in (point) (1+ (point)))))
(catch 'found
(dolist (ov ovs)
(when (flymake-overlay-p ov)
(message (overlay-get ov 'help-echo))
(throw 'found t))))))
(defun flymake-goto-next-error-disp ()
"Go to next error in err ring, then display error/warning."
(interactive)
(flymake-goto-next-error)
(flymake-display-current-error))
(defun flymake-goto-prev-error-disp ()
"Go to previous error in err ring, then display error/warning."
(interactive)
(flymake-goto-prev-error)
(flymake-display-current-error)) flymake-display-current-error是显示当前的光标所在错误! flymake-goto-next-error-disp显示下一个错误! flymake-goto-prev-error-disp显示上一个错误! 是不是很给力? 当然这里有个性能问题,因为flymake是调用gcc的 大工程的话 会相对比较慢. 看你选择了! |
请发表评论