[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding refactoring capabilities to Emacs
From: |
Alfred M. Szmidt |
Subject: |
Re: Adding refactoring capabilities to Emacs |
Date: |
Mon, 04 Sep 2023 13:53:05 -0400 |
>> Note: Files are not saved automatically, because this is a different
>> concern.
>
> "Not saving files automatically" is a power-user approach too.
>
> We have that in query-replace and naturally in
> xref-query-replace-in-results too, but having a large refactoring across
> many files end up in a not-synced-to-disk condition is a complication. Not
> everyone knows about save-some-buffers and auto-revert-mode.
This is a real problem. Diff mode requires typing a long sequence of
'C-c C-a C-c C-a C-c C-a C-c C-a ...' to apply the whole diff.
Can't that be solved using something like,
(goto-char (point-min))
(while (not (eobp))
(diff-apply-hunk))
Or some such and have it bound to something sensible, maybe collecting
the files it touched for a later save.
A possible solution would be to support a region by 'C-c C-a'.
A region might not be a valid thing to apply -- it is better to work
with hunks.
Then it will be possible to activate the region on the whole buffer
or on a few hunks, and type a single 'C-c C-a'.
Another problem that the changes are not saved automatically
on multiple files. This limitation forces to use tricks like
'M-| git apply RET' after selecting the whole diff buffer with 'C-x h'
or a region of the diff buffer. A "poor man's auto-save".
- Re: Adding refactoring capabilities to Emacs, (continued)
Re: Adding refactoring capabilities to Emacs, Juri Linkov, 2023/09/04
- Re: Adding refactoring capabilities to Emacs,
Alfred M. Szmidt <=
Re: Adding refactoring capabilities to Emacs, Dmitry Gutov, 2023/09/04
Re: Adding refactoring capabilities to Emacs, Philip Kaludercic, 2023/09/04
Re: Adding refactoring capabilities to Emacs, João Távora, 2023/09/07