emacs-devel
[Top][All Lists]
Advanced

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

Re: Adding refactoring capabilities to Emacs


From: Dmitry Gutov
Subject: Re: Adding refactoring capabilities to Emacs
Date: Fri, 8 Sep 2023 01:43:24 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 08/09/2023 01:03, Stefan Monnier wrote:
but that's already taken in diff-mode.
I don't think the current `C-c C-c` binding in `diff-mode` should get in
the way.  That command is available via different bindings already, and
diff-apply-everything is a little destructive, though (there is no 'undo'
across multiple files), so maybe a warning could help. Or make it an
initially-disabled command, for example.
But in the context of a refactoring operation, it wouldn't make sense to
disable it.

We would if we keep the same major mode. And if we decide that it's dangerous to set off accidentally.

this is a specific use of diff-mode where `diff-apply-everything` makes
a lot of sense (as opposed to `C-x v =` where the changes are usually
already applied anyway so `diff-apply-everything` is rarely what we want).
So... the binding wouldn't be used in "regular" Diff buffers,
That's indeed a possible option (e.g. use a mode that's derived from
`diff-mode` but with a different `C-c C-c` binding, or activate
a special "refactoring minor mode" to provide that binding).

But it would have to look different from diff-mode somehow, I suppose? Or is having a different buffer name good enough?

Anyway, the same command would probably be useful when applying patches received from others as well. So perhaps we should just always have it available in diff-mode.



reply via email to

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