emacs-devel
[Top][All Lists]
Advanced

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

RE: [External] : Re: Adding refactoring capabilities to Emacs


From: Drew Adams
Subject: RE: [External] : Re: Adding refactoring capabilities to Emacs
Date: Tue, 26 Sep 2023 15:01:59 +0000

(Caveat: I'm not following this thread much.)

Diff output follows any of several formats,
OK.  But it's nevertheless plain text, no?  As
such, it makes sense to be able to use all of
the general text-editing commands/keys on it,
if you want to change it in arbitrary/whatever
ways.

Is this whole discussion, or even much of it,
really about whether to keep diff-mode buffers
read-only by default, and whether to provide
refactoring commands/keys that let you change
the content in special ways when the buffer is
read-only?

I don't really see a fundamental difference
between a diff buffer and, say, a grep or an
occur buffer.  (But yes, you often _apply_ the
diff content, so you want to ensure it keeps to
a proper formatting.)

We already have, and are used to, the universal
idiom of `C-x C-q' to toggle a buffer read-only.
I use that in grep and occur buffers without a
second thought.  Why isn't that "sufficient" for
diff buffers as well?

I can see that some might want commands/keys that
act on the buffer content, including to change it
in structured/"legitimate"/refactoring ways, while
keeping it read-only.

But for that, why not just add a new minor mode?

That way, by default, diff buffers would still be
read-only by default, quitable with `q', but also
modifiable in all the usual ways after `C-x C-q'.

And anyone who wants to could toggle the minor
mode ON, to act only in special, allowed ways
while in read-only mode, using keys defined for
that mode.  The minor mode could ensure read-only.

(Maybe this or similar has already been proposed
in this thread?  If so, mille excuses...)

reply via email to

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