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: João Távora
Subject: Re: Adding refactoring capabilities to Emacs
Date: Fri, 8 Sep 2023 19:57:16 +0100

On Fri, Sep 8, 2023 at 7:46 PM Dmitry Gutov <dmitry@gutov.dev> wrote:
>
> (This one arrived in private, BTW)

Thanks for noticing, hoping it's fine to re-add emacs-devel

> On 08/09/2023 21:39, João Távora wrote:
> > On Fri, Sep 8, 2023 at 7:35 PM Dmitry Gutov<dmitry@gutov.dev>  wrote:
> >> On 08/09/2023 19:05, João Távora wrote:
> >>>>>> diff-apply-everything could work with "someone's patches" just as well.
> >>>>>> That's actually a reason to just add it to diff-mode.
> >>>>> I never said there wasn't.  But don't touch C-c C-c please.
> >>>> Maybe we should start by removing that `C-c C-c` binding from
> >>>> `diff-mode` (users like you who really like it can re-add it easily).
> >>> Strongly object to this.  Remove a 20yo binding?  Aren't there
> >>> really other alternatives??
> >> Obviously there are some, but can you suggest a good one?
> > Just proposed C-c RET.  C-c M-c is also good IMO, so many
> > good shortcuts.
> >
> >> Following the semantics of 'C-c C-c' of others modes can make the new
> >> feature easier to use and discover too.
> > It's not following any such "semantics", unless you bend them really
> > hard.
>
> When I finish a commit, I press 'C-c C-c'. Seems quite logical to me.
>
> Especially if we consider the case where the user edits the diff (e.g.
> with C-k) first.
>
> > C-c C-c means "compile current function" for all SLIME users
> > (and I suspect CIDER users too).
>
> But note that this also has the meaning of "I've updated a piece of
> work, proceed with it", conveyed to the compiler. Not too far off.

I guess, but in effect, nothing's "too far off" if you squint hard
enough.

> > If it has any semantics at all,
> > it's vaguely DWIM.  And the longstanding "Meaning" in the DWIM here
> > is "goto source for this hunk".
>
> There's also change-log-mode which does this. And I think that's it.
>
> Ah, and there's also cc-mode which uses the same binding for
> comment-region. *shrug*

Yeah, it's a DWIM shortcut with "What I Mean" being determined by
historical usage.

> >>> Especially in a mode that's read only
> >>> much more often than not?
> >> When I simply visit a patch (which I might want to apply), it doesn't
> >> open in read-only. Still, to visit the source I've always switched to
> >> read-only and pressed RET too.
> > Wow, that's so much easier than typing C-c C-c which has existed
> > forever.
>
> It's not. But the switch to read-only is a one-time thing and jumping to
> different hunks is often done repeatedly anyways. So I'm probably saving
> on keys, at least in some cases.

OK.  I'm not against that workflow, but it's not my workflow.



reply via email to

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