【问题标题】:Emacs VHDL jump to errorEmacs VHDL 跳转到错误
【发布时间】:2012-02-02 10:18:54
【问题描述】:

我无法让 emacs 在 vhdl 模式下跳转到下一个错误、上一个错误、第一个错误。

我在 ubuntu 下使用 FSF Emacs 23.3.1 和最近的 vhdl-mode 3.33.28。 我可以用 Modelsim 编译,我得到编译器错误列表:

-- Loading package standard
-- ...
-- Compiling entity foo
** Error: path/foo.vhd(22): (vcom-1136) Unknown identifier "std_olgic".

我尝试将错误正则表达式(在编译器设置中)调整为最简单的:

 \*\* Error: \([a-zA-Z\/_.]*\)(\([0-9]*\)).*

当我以这种方式使用它时,我可以看到它正确解析错误:

 sed "s/\*\* Error: \([a-zA-Z\/_.]*\)(\([0-9]*\)).*/\1 \2/"  ...
 path/foo.vhd 22

我将“文件子表达式索引”和“行子表达式索引”分别更改为 1 和 2,但仍然无法跳过错误。

【问题讨论】:

  • 我认为 emacs23 中不支持此功能,但仅在现在已经很旧的 emacs21 中支持。

标签: emacs vhdl


【解决方案1】:

以下配置为我解决了这个错误

'(vhdl-compile-use-local-error-regexp t)
(add-to-list 'compilation-error-regexp-alist '("** Error: \\(.+\\)(\\([0-9]*\\)):" 1 2))

【讨论】:

    【解决方案2】:

    在 Emacs 正则表达式中,您需要对字符串 (explanation) 中的括号进行双重转义。试试这样的:\*\* Error: \\([a-zA-Z0-9/_.]+\\)(\\([0-9]+\\)).*

    【讨论】:

    • 感谢回复,但仍然无法正常工作。无论我在正则表达式中输入什么,它看起来都完全禁用。
    【解决方案3】:

    很抱歉碰到了一个老话题,但我刚刚遇到了这个问题,并为我解决了一些问题。

    这是我用来让它工作的设置:

    正则表达式:

    \(ERROR\|WARNING\|\*\* Error\|\*\* Warning\)[^:]*:\( *[[0-9]+]\)? \(.+\)(\([0-9]+\)): 
    

    文件子表达式索引:3

    行子表达式索引:4

    Vhdl 编译使用本地错误正则表达式(在 Vhdl 编译组下):关闭

    这是我的故事: http://www.velocityreviews.com/forums/t957495-emacs-vhdl-mode-next-error-previous-error-and-first-error-are-not-working.html

    :P

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多