emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

compile.el error properties: buffer as filename not working


From: JD Smith
Subject: compile.el error properties: buffer as filename not working
Date: Mon, 31 Jan 2022 23:07:19 -0500


`compilation-parse-errors’ uses a regex matcher which includes support for a file matching function returning a buffer (emphasis added):

Or FILE can also be a function that returns (FILENAME) or (RELATIVE-FILENAME . DIRNAME).
In the former case, FILENAME may be relative or absolute, or it may be a buffer.

But unfortunately compile.el (v27.2) doesn’t actually seem to fully support the (BUFFER) style of return, despite mentioning, in the docs of `compilation-internal-error-properties':

FILE should be (FILENAME) or (RELATIVE-FILENAME . DIRNAME) or (BUFFER) or
nil.

I have discovered two issues (there may be more):

1. In `compilation-error-properties’, `compilation-transform-file-match-alist’ is matched against a nil filename, since the definition of that filename looks like (note the bufferp):

(let ((file-name
             (and (consp file)
                  (not (bufferp (car file)))
                  (if (cdr file)
                      (expand-file-name (car file) (cdr file))
                    (car file)))))

This seems to have been fixed using a when-let in the Emacs 28 branch (unconfirmed).

2. `compilation-get-file-structure’ is called with the file list, but this function does not expect a (buffer), and calls (e.g.) file-name-absolute-p(#<buffer boo.py>), resulting in an error.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]