Wilfred / ag.el

An Emacs frontend to The Silver Searcher
http://agel.readthedocs.org/en/latest/
525 stars 61 forks source link

verilog-mode breaks ag-mode jump-to-occurrence. aka sharing compilation-mode-hook is perilous #175

Open DanielG opened 11 months ago

DanielG commented 11 months ago

Hi,

I've had the problem that jump-to-occurrence from the ag-mode buffer would stop working randomly. I've finally been able to track down the offender: verilog-mode.

The failure mode is as follows: verilog-mode (after autoload) adds a compilation-mode-hook, which ag-mode seems to run as well since it's a compilation derived mode. This hook (verilog-error-regexp-add-emacs) then goes on to add regexes to compilation-error-regexp-alist and compilation-error-regexp-alist-alist.

Problem is compilation-mode-hook appears to runs in buffer local context so this gets added to ag-mode's internal regexp-alists too! These new rexexps then seem to take precedence over ag's breaking the special handling done to find the File: prefix in --group mode.

Emacs 28.2 (Debian), ag 2.2.0.

--Daniel