all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Replace filename from compilation buffer errors
@ 2024-11-29 11:01 Filippo Argiolas
  2024-11-29 11:14 ` Robert Pluim
  0 siblings, 1 reply; 4+ messages in thread
From: Filippo Argiolas @ 2024-11-29 11:01 UTC (permalink / raw)
  To: help-gnu-emacs

Hi I am working on a project that builds in a temporary workspace.
I'd like to take advantage of Emacs compilation mode, especially jumping
from an error to the locus inside the file.

Problem is it jumps in the file inside the temp workspace instead of the
one in the source tree.

Is there a way to achieve a simple string substitution in the file name
before jumping while keeping existing compilation regexps?

Thanks,
Filippo



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Replace filename from compilation buffer errors
  2024-11-29 11:01 Replace filename from compilation buffer errors Filippo Argiolas
@ 2024-11-29 11:14 ` Robert Pluim
  2024-11-29 11:26   ` Filippo Argiolas
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Pluim @ 2024-11-29 11:14 UTC (permalink / raw)
  To: Filippo Argiolas; +Cc: help-gnu-emacs

>>>>> On Fri, 29 Nov 2024 12:01:51 +0100, Filippo Argiolas <filippo.argiolas@gmail.com> said:

    Filippo> Hi I am working on a project that builds in a temporary workspace.
    Filippo> I'd like to take advantage of Emacs compilation mode, especially jumping
    Filippo> from an error to the locus inside the file.

    Filippo> Problem is it jumps in the file inside the temp workspace instead of the
    Filippo> one in the source tree.

    Filippo> Is there a way to achieve a simple string substitution in the file name
    Filippo> before jumping while keeping existing compilation regexps?

The following perhaps:

    compilation-transform-file-match-alist is a variable defined in `compile.el'.

    Its value is (("/bin/[a-z]*sh\\'" nil))

    Alist of regexp/replacements to alter file names in compilation errors.
    If the replacement is nil, the file will not be considered an
    error after all.  If not nil, it should be a regexp replacement
    string.

Robert
-- 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Replace filename from compilation buffer errors
  2024-11-29 11:14 ` Robert Pluim
@ 2024-11-29 11:26   ` Filippo Argiolas
  2024-11-29 12:45     ` Robert Pluim
  0 siblings, 1 reply; 4+ messages in thread
From: Filippo Argiolas @ 2024-11-29 11:26 UTC (permalink / raw)
  To: Robert Pluim; +Cc: help-gnu-emacs

Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Fri, 29 Nov 2024 12:01:51 +0100, Filippo Argiolas <filippo.argiolas@gmail.com> said:
>
>     Filippo> Hi I am working on a project that builds in a temporary workspace.
>     Filippo> I'd like to take advantage of Emacs compilation mode, especially jumping
>     Filippo> from an error to the locus inside the file.
>
>     Filippo> Problem is it jumps in the file inside the temp workspace instead of the
>     Filippo> one in the source tree.
>
>     Filippo> Is there a way to achieve a simple string substitution in the file name
>     Filippo> before jumping while keeping existing compilation regexps?
>
> The following perhaps:
>
>     compilation-transform-file-match-alist is a variable defined in `compile.el'.
>
>     Its value is (("/bin/[a-z]*sh\\'" nil))
>
>     Alist of regexp/replacements to alter file names in compilation errors.
>     If the replacement is nil, the file will not be considered an
>     error after all.  If not nil, it should be a regexp replacement
>     string.
>

Thank you! seems perfect, no idea how I missed that!

Filippo



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Replace filename from compilation buffer errors
  2024-11-29 11:26   ` Filippo Argiolas
@ 2024-11-29 12:45     ` Robert Pluim
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Pluim @ 2024-11-29 12:45 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> On Fri, 29 Nov 2024 12:26:06 +0100, Filippo Argiolas
>>>>> <filippo.argiolas@gmail.com> said:

    Filippo> Thank you! seems perfect, no idea how I missed that!

One cannot accuse the docstring of `compilation-error-regexp-alist' of
being too short 😀

Robert
-- 




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-29 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-29 11:01 Replace filename from compilation buffer errors Filippo Argiolas
2024-11-29 11:14 ` Robert Pluim
2024-11-29 11:26   ` Filippo Argiolas
2024-11-29 12:45     ` Robert Pluim

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.