emacs-devel
[Top][All Lists]
Advanced

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

A new command to apply changes to lines referenced in compilation buffer


From: Daniel Martín
Subject: A new command to apply changes to lines referenced in compilation buffers
Date: Tue, 22 Dec 2020 00:43:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin)

Today I thought about the following use case: Imagine a user that is
working in a C codebase and wants to rename some function without using
a TAGS file (or maybe the language is not C and there's no good TAGS
support for it).  One possible way to do that in a more or less reliable
way (ie, without changing unrelated matches in documentation files, for
example) is to simply change the definition and compile the code so that
the compiler will refer to each callsite that needs to be renamed.

Compilation-mode already knows about the location (file and line number,
at least) of each error message, so I wonder if we could add a command
to compilation-mode that performs a search and replace over each error
line in a compilation buffer.  The command would be similar to
xref-query-replace-in-results, which does this for results produced by
TAGS or any other Xref backend.

Before I think more about the design of this command, is there potential
interest in having it in Emacs? Is there something available in Emacs
that already implements this use case in a simple way?

Thanks.


reply via email to

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