all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gary Oberbrunner <garyo@genarts.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Andrew Hyatt <ahyatt@gmail.com>, 3418@debbugs.gnu.org
Subject: bug#3418: Issue with compile.el and compilation-parse-errors-filename-function
Date: Tue, 26 Jan 2016 10:15:27 -0500 (EST)	[thread overview]
Message-ID: <799658909.580977.1453821327904.JavaMail.zimbra@genarts.com> (raw)
In-Reply-To: <83vb6g1jwt.fsf@gnu.org>

Wow, a blast from the past! 

I am totally happy with soln 1. For all I know, since I added that hook I might be the only one using it. :-) But I'm also usually a stickler for backward compatibility, so that's why I brought it up.

As for how to make it happen, I'm not sure what triggers the absolute vs. relative names getting passed around in compilation-parse-errors; it probably depends on what it finds in the *compilation* buffer. But Andrew, in order for this to matter at all, the emacs user has to have added their own compilation-parse-errors-filename-function, so "normal" users wouldn't be affected by this at all.

The use case is a build system that copies/symlinks the sources to a build dir and compiles them there rather than in their original location. Compilation errors will be given relative to that build dir, not the original source. A user with such a build system would make a compilation-parse-errors-filename-function that would string-replace the build dir to the source dir, so next-error would jump to the proper source file (not the build dir copy).

----- Original Message -----
> From: "Eli Zaretskii" <eliz@gnu.org>
> To: "Andrew Hyatt" <ahyatt@gmail.com>
> Cc: "Gary Oberbrunner" <garyo@genarts.com>, 3418@debbugs.gnu.org
> Sent: Tuesday, January 26, 2016 9:42:58 AM
> Subject: Re: bug#3418: Issue with compile.el and	compilation-parse-errors-filename-function

>> From: Andrew Hyatt <ahyatt@gmail.com>
>> Date: Tue, 26 Jan 2016 00:21:51 -0500
>> Cc: 3418@debbugs.gnu.org
>> 
>> Gary Oberbrunner <garyo@genarts.com> writes:
>> 
>> > Hi emacs folks.  I submitted a patch to compilation-get-file-structure in
>> > compile.el in 2001, introducing this stanza:
>> >
>> > 	;; If compilation-parse-errors-filename-function is
>> > 	;; defined, use it to process the filename.
>> > 	(when compilation-parse-errors-filename-function
>> > 	  (setq filename
>> > 		(funcall
>> > 			 filename)))
>> >
>> > At some point since then, the filename was changed to not always be absolute;
>> > there's now a variable spec-directory in that function.  This means that
>> > implementations of compilation-parse-errors-filename-function can't always work
>> > correctly since it doesn't know the full path of the file.
>> >
>> > I'm happy to work on a fix, but I see a few issues.
>> >
>> > Solution 1: add 2nd arg SPEC-DIRECTORY to
>> > compilation-parse-errors-filename-function.
>> > Problem: existing implementations will get an incorrect number of args error and
>> > will have to change.
>> >
>> > Solution 2: make filename absolute before passing to
>> > compilation-parse-errors-filename-function.
>> > Problem: the rest of the code is pretty careful not to absolutize the filename;
>> > this would change the behavior in ways I don't completely understand.
>> >
>> > Of course I am personally happy with solution 1, but since it affects
>> > compatibility I thought I should bring it up on this list.  I am not on the
>> > list, so please cc me with any replies, thanks!
>> 
>> Sadly, this bug hasn't been responded to.  Your description is pretty
>> code-intensive, for those of us not familiar with the internals, can you
>> give instructions on how to reproduce a user-visible issue?
> 
> FWIW, I don't see why not adopt Soution 1, just make the second
> argument optional.  That would be backward-compatible, IIUC.

-- 
Gary Oberbrunner





  reply	other threads:[~2016-01-26 15:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-29 14:46 bug#3418: Issue with compile.el and compilation-parse-errors-filename-function Gary Oberbrunner
2016-01-26  5:21 ` Andrew Hyatt
2016-01-26 14:42   ` Eli Zaretskii
2016-01-26 15:15     ` Gary Oberbrunner [this message]
2016-01-26 16:08       ` Eli Zaretskii
2016-01-26 16:19         ` Gary Oberbrunner
2017-08-11  0:50           ` npostavs
2017-08-11  1:04             ` Gary Oberbrunner
2017-08-11  6:34             ` Eli Zaretskii
2017-08-12 15:42               ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=799658909.580977.1453821327904.JavaMail.zimbra@genarts.com \
    --to=garyo@genarts.com \
    --cc=3418@debbugs.gnu.org \
    --cc=ahyatt@gmail.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.