GNU bug report logs - #61093
Indented file names confuse compilation buffer

Previous Next

Package: emacs;

Reported by: Sascha Ziemann <ceving <at> gmail.com>

Date: Fri, 27 Jan 2023 11:12:02 UTC

Severity: normal

Full log


Message #8 received at 61093 <at> debbugs.gnu.org (full text, mbox):

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: 61093 <at> debbugs.gnu.org
Cc: Sascha Ziemann <ceving <at> gmail.com>
Subject: bug#61093: Indented file names confuse compilation buffer
Date: Fri, 27 Jan 2023 15:34:44 +0100
> I think it might be ok to ignore leading whitespace, because file
> names do not start very often with whitespace.

The story goes like this: a tool uses a modification of the GNU message format and its users then expect Emacs to conform to that variant.

The problem with doing that is that each little tweak makes the compilation message rules less robust and more likely to collide with one another and become slower. There are about 60 regexps now, most of which are used by very few people, and we keep adding. Build logs can become quite long so performance is not unimportant.

Maybe it's safe to accept and ignore not arbitrary leading whitespace but a single tab, which your tool seems to emit. Or you could ask those making it to cease emitting the tab.

You could also put your own rule in compilation-regexp-alist. It might look like this:

;; Message pattern for ancillary locations (notes) from the Go compiler
(let ((rule
       `(go-note
         ,(rx bol "\t"
              (group                    ; 1: hyperlink
               (group                    ; 2: file
                (not (in " \t\n:"))
                (* (not (in "\t\n"))))
               ":"
               (group (+ digit))         ; 3: line
               ":"
               (group (+ digit))         ; 4: column
               ":")
              " "
              (+ nonl))                ; message
          2 3 4 0 1)))
  (setq compilation-error-regexp-alist-alist
        (remq (assq 'go-note compilation-error-regexp-alist-alist)
              compilation-error-regexp-alist-alist))
  (push rule compilation-error-regexp-alist-alist)
  (setq compilation-error-regexp-alist
        (remq 'go-note compilation-error-regexp-alist))
  (push 'go-note compilation-error-regexp-alist))






This bug report was last modified 2 years and 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.