如何在Emacs中仅为自定义编译命令设置自定义错误处理?

3

我正在使用scons构建我的C++项目。
我正在使用下面的脚本来正确处理Scons的错误:

34;;; SCons builds into a 'build' subdir, but we want to find the errors
35;;; in the regular source dir.  So we remove build/XXX/YYY/{dbg,final}/ from the
36;;; filenames.
37(defun process-error-filename (filename)
38  (let ((case-fold-search t))
39    (setq f (replace-regexp-in-string
40             "[Ss]?[Bb]uild[\\/].*\\(final\\|dbg\\)[^\\/]*[\\/]" "" filename))
41    (cond ((file-exists-p f)
42           f)
43          (t filename))))
44
45(setq compilation-parse-errors-filename-function 'process-error-filename)  

我想不仅在C++和Scons中使用Emacs,还想在Java和其他语言中使用它。
如何设置Emacs,使其仅在运行“process-error-filename”函数时使用。
M-x compile   
scons  

指令?


我不明白你的问题 - 你的意思是,你想让它变得交互式吗? - alinsoar
1个回答

4

谢谢。看起来这是一个解决方案。 - denys

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接