GNU bug report logs - #69220
[PATCH] smerge-mode: add a function to resolve all conflicts in a file

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>

Date: Sun, 18 Feb 2024 18:24:03 UTC

Severity: wishlist

Tags: patch

Full log


Message #47 received at 69220 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 69220 <at> debbugs.gnu.org
Subject: Re: bug#69220: [PATCH] smerge-mode: add a function to resolve all
 conflicts in a file
Date: Mon, 19 Feb 2024 21:24:53 -0500
>> It would be easy enough to provide a kind of prefix command
>> `smerge-apply-all-conflicts` which reads the next key and calls the
>> corresponding command in every conflict in the file.
>> It would generalize `smerge-resolve-all`.
>
> Sorry, I'm not sure I understand… đŸ˜… You want a function `smerge-apply-
> all-conflicts` that would accept a prefix command

No: `smerge-apply-all-conflicts` would *be* the prefix command.
Instead of a prefix `C-u 8` which causes the next command to be executed
8 times, your use `M-x smerge-apply-all-conflicts` to cause the next
command to be applied to every conflict in the buffer.

> If so, that would be almost the same as what I did,

I think so, yes.

>> I have needed such a thing in the past, but there are several ways to
>> do
>> that already: beside telling Git beforehand how to resolve the
>> conflicts, you can also use things like
>> 
>>     C-x ( C-c ^ n C-c ^ u C-x e e e e e e e e e
>
> I fear to even try to decypher that combination.

`C-x (` starts a keyboard macro
`C-x ^ n` is `smerge-next`
`C-x ^ u` is `smerge-keep-upper`
`C-x e` terminates the keyboard macro and repeats it immediately.
Every `e` after that repeats the keyboard macro.

> For the record, I have lots of commands that I use situationally, but
> I do not care to remember their bindings because it's easier to just
> call `M-x` ...

I like `M-x` too :-)


        Stefan





This bug report was last modified 122 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.