我正在使用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
指令?