reddit / emacs

Why do only _some_ fields get highlighted in my `*compile*` buffer?

TomSwirly · 2022-09-30 10:06
Hello. Very long time emacs user here with a bunch of elisp under my belt - but this simple problem just eludes me. For years, I've done all my testing and running in a compile window. Emacs knows error messages that appear in that window, and I can use either `M-x next-error` to get to the error, or hit return on that line. This works pretty well flawlessly for me... but now I have a new tool and only _a few_ of its errors get highlighted this way and I cannot see the difference! For example, in the run below, only the _second_ error (fasteners.py) is highlighted and can be reached through `next-error` or carriage return: see https://imgur.com/a/I6P3egg -*- mode: compilation; default-directory: "/code/engora-search/" -*- Compilation started at Thu Sep 29 23:34:35 $ TERM=dumb d engora test --refurb engora/network/request/url_request.py:37:13 [FURB126]: Replace `else: return x` with `return x` engora/parser/fasteners.py:107:9 [FURB126]: Replace `else: return x` with `return x` engora/server/search.py:26:13 [FURB126]: Replace `else: return x` with `return x` engora/server/server.py:39:13 [FURB126]: Replace `else: return x` with `return x` Run `refurb --explain ERR` to further explain an error. Use `--quiet` to silence this message Why? My only theory was that `fasteners.py:107:9` had three digits, the others two, but no: https://imgur.com/a/zgZ85M4 The output is already going through my own Python program, so I could easily rewrite it a bit without having to touch the `refurb` source - _if_ I knew what was wrong. ---- Any ideas? This isn't a game blocker for me at all, but it's weirdly frustrating because I can't work it out. :-D
shandelf · 2022-09-30 12:22
Could check out `compilation-error-regexp-alist` and `compilation-error-regexp-alist-alist`. One strategy could be to turn them all off, then on again selectively to try to find which one is responsible for your highlights and debug from there. (progn (setq compilation-error-regexp-alist '(gnu)) (recompile))
big_lentil · 2022-09-30 15:09
I'm always surprised that the compilation regexes even work as well as they do
TomSwirly · 2022-09-30 15:53
DOH! Me strikes head. Yes of course, there will be somewhere that there's a regex that is doing this, and I can look at it.