emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#57883: closed (compilation-get-file-structure mishandles buffers)


From: GNU bug Tracking System
Subject: bug#57883: closed (compilation-get-file-structure mishandles buffers)
Date: Wed, 10 Jan 2024 10:56:01 +0000

Your message dated Wed, 10 Jan 2024 02:55:41 -0800
with message-id 
<CADwFkm=J47kLaYTTOQyPbwRAa7Z9sEvrBgcy=PETK-aV68SsUA@mail.gmail.com>
and subject line Re: bug#57883: compilation-get-file-structure mishandles 
buffers
has caused the debbugs.gnu.org bug report #57883,
regarding compilation-get-file-structure mishandles buffers
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
57883: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57883
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: compilation-get-file-structure mishandles buffers Date: Sat, 17 Sep 2022 10:25:25 -0400

As reported on emacs-devel, a bug is present in `compilation-get-file-structure’ when the “file” matched by the `compilation-parse-errors’ is not a file, but a buffer name.  Both filenames and buffer names are explicitly allowed in errors.  From the `compilation-error-regexp-alist’ docstring (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.

Note that this is useful for modes which report errors in text from open buffers, which may have no associated file.   The issue is this line in `compilation-get-file-structure’:

(if (file-name-absolute-p filename)
   (setq filename (concat comint-file-name-prefix filename)))

which signals an 

--- End Message ---
--- Begin Message --- Subject: Re: bug#57883: compilation-get-file-structure mishandles buffers Date: Wed, 10 Jan 2024 02:55:41 -0800
Stefan Kangas <stefankangas@gmail.com> writes:

> reopen 57883
> thanks
>
> JD Smith <jdtsmith@gmail.com> writes:
>
>> Thanks for the query.  This is still an issue in Emacs 29 with emacs -Q.
>
> Thanks, reopened.
>
>> Reproducer: The reproduction recipe was in the linked emacs-devel
>> <https://lists.gnu.org/archive/html/emacs-devel/2022-02/msg00496.html>
>> thread.  Here it is again (with Emacs 29 updates in [brackets]):
>
> I've tried editing your recipe down into something that's a little bit
> easier for me to work with.
>
> All of this is pasted into an emacs -Q "*scratch*" buffer:
>
> (progn
>   (require 'compile)
>   (defun my/filename-function () (list (get-buffer (match-string 1))))
>   (defvar my/compilation-error-regexp
>     `((,(rx line-start
>           "Buffer \"" (group (+ (not "\""))) "\", " ; 1: buffer name
>           "line" (+ space) (group (+ digit))      ; 2: line
>           (* nonl) ?\n)
>        my/filename-function
>        2
>        nil nil 1)))
>   (progn (compilation-setup)
>          (setq compilation-error-regexp-alist my/compilation-error-regexp)
>          (compilation-parse-errors (point-min) (point-max)))
>   (compilation-parse-errors (point-min) (point-max)))
>
> But this doesn't give me any error when evaluating it either Emacs 29.1
> or current master.  Did I miss something?  Perhaps there is some step
> missing in my edited recipe?

More information was requested, but none was given within 4 months, so
I'm closing this bug.

If this is still an issue, please reply to this email (use "Reply to
all" in your email client) and we can reopen the bug report.


--- End Message ---

reply via email to

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