From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Branislav =?UTF-8?Q?Zahradn=C3=ADk?= Newsgroups: gmane.emacs.bugs Subject: bug#74509: Feature request - smerge-mode Date: Mon, 2 Dec 2024 08:59:32 +0100 Message-ID: References: <86bjxx817w.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007800c8062844eefa" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6483"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74509@debbugs.gnu.org, Eli Zaretskii To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 02 15:56:34 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tI7qg-0001RJ-TF for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Dec 2024 15:56:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tI7qM-0006qa-Tu; Mon, 02 Dec 2024 09:56:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tI7qJ-0006pm-PV for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 09:56:07 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tI7qG-0006HW-55 for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 09:56:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=bL3lUCDGSMvLCUvjCoqlRiOoF2R58yhX0KMzWHHN4Zs=; b=NM6P4Hu54ICz43pOpujRb0oBj0eDrkzm+lIMNn3gqg6fXxZnbYnW5jlXryxSVflOMldixZIoYfhe7P+x7ygW+Fqxgd78QPsAgohns4fo3xx8tZs9iKWZyy8HeOreSO0BZDnG8vYSea+mi7UT7zzcThuCIBF1fXcegBJfS7FDNBVP5A7cT79yBg/vCW9VKpDr8uuaqL8irczKbV7VXrY4aWs+E9SyXN99sugjBCm8avATA6FH+yVISreRk7eyE21f43vKPQblmIqrUfsfBN8pQKHxzSHmUyy1DPwAB5nDRDhKodKdxB66pJvS8iaxyMu2Mkbq9uLHpaR/FYXeavuStQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tI7qF-00053r-Uo for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 09:56:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Branislav =?UTF-8?Q?Zahradn=C3=ADk?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Dec 2024 14:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74509 X-GNU-PR-Package: emacs Original-Received: via spool by 74509-submit@debbugs.gnu.org id=B74509.173315131317894 (code B ref 74509); Mon, 02 Dec 2024 14:56:03 +0000 Original-Received: (at 74509) by debbugs.gnu.org; 2 Dec 2024 14:55:13 +0000 Original-Received: from localhost ([127.0.0.1]:54885 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tI7pQ-0004dv-Gl for submit@debbugs.gnu.org; Mon, 02 Dec 2024 09:55:13 -0500 Original-Received: from mail-ej1-f44.google.com ([209.85.218.44]:44280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tI1ML-0008PJ-4s for 74509@debbugs.gnu.org; Mon, 02 Dec 2024 03:00:48 -0500 Original-Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a9f1d76dab1so710904166b.0 for <74509@debbugs.gnu.org>; Mon, 02 Dec 2024 00:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733126384; x=1733731184; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bL3lUCDGSMvLCUvjCoqlRiOoF2R58yhX0KMzWHHN4Zs=; b=R5Ap+aijIpUnSN2MzNmfOvxUkucQLVDtmQPcSXvNBFDjz1XmxmFKzC0VhVSFi/n9mI C97x1rQkkJ2e5o94OHWVerKVtUOp6oJaWKRC6PBD+XphnyeaoviptqSMAVquuYRjbZj8 /EsYSCBbnuGWzhdbBI7Fn1+HTs3W1dXIqgSbo3ZK+wrFkndXKhHxGjxCrSmqpHbdK2IZ DD9nt8BSvm/0/zxGXfCQ/7TBkN7QLNp2ALK7/aYzH81nI3b0kjZ6YocQ95FDgz6/UGRd xC0dlv2CoWnOTrgqi0ckbT+I7Rd6XpbmC7geBSmVpGv7TkVEjH+VaCxMz0vAezcHW67P A6NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733126384; x=1733731184; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bL3lUCDGSMvLCUvjCoqlRiOoF2R58yhX0KMzWHHN4Zs=; b=isWgJbj3r9GsC0wDPO8VroTjc4hthcWSFRshCI+52q973R+nGi5pUd5XdHobSfOkd2 IR1K2LGhQ7ZaKgHiCLzSPo/0CeGCh/DGFq5qCQmsB/zRwDGilpKKm6jh2L61QqMagA9j szwYCKy0un6yWPdz6bB8bg5JHZ/N8qhvlUfG6KWg9KSwRoGG3cWV7KiZUEcSefnytVjw dgr8UbOfppIEbN+/YIGF3j3g3blsehVi1KZsMjKeqXGjvj3IDsOpgmJGtWCeDB9fWibz J6u2b8KsbgcrSxXSMRCQs3m9xCZ1FP4fF+OgFQqjwmXQ74Ufqixo6I9zr0cdrRa6qh8Q ULBQ== X-Forwarded-Encrypted: i=1; AJvYcCW7ce50t63PYM95DUmAP734MwPPTgnHNFuyMa7zCR6GbImD+MTBq485290/qvIhwgrCPGwpoQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxWhDH1DBn00s7TNzlDKt6/ajtoZvyJ7fBjPyqujix4dNabccO7 gghdkLpm/EW5Pz7uY7YRSYUhAC3yhOCfz/5ETHMOHd+tSJcqAx09Hh9PFxcxx3bxaUTThbuoF1h oi2IvPTjJ0oKI4IlgwBUCG1W2mGs= X-Gm-Gg: ASbGncv6zKP7q0rvbauJ2EE4EG7Q7Tte107224xLb+s8xSSXVMymwdx/nubB716Cn34 oSvncwX/pCnSDLVhlHdPcMHkbQT5lv7E= X-Google-Smtp-Source: AGHT+IEQuVVtpqEgaMh79+sqdpR9eBr2ydvBcKphRLWVAZGj9KxtLBR3Uy05MlZfaEBes5gYX4KaA9omlKYaxF+q1Rw= X-Received: by 2002:a17:906:32ce:b0:aa5:3591:420f with SMTP id a640c23a62f3a-aa580f1b93emr2405731266b.16.1733126383990; Sun, 01 Dec 2024 23:59:43 -0800 (PST) In-Reply-To: X-Mailman-Approved-At: Mon, 02 Dec 2024 09:55:10 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296329 Archived-At: --0000000000007800c8062844eefa Content-Type: text/plain; charset="UTF-8" On Mon, 2 Dec 2024 at 00:51, Stefan Monnier wrote: > >> # keybinding > >> would be nice to provide default keybinding for smerge-swap: C-c ^ s > > Interesting. I've never found a use for that command, personally. > Could you give some hint for the situations where you found it handy? > Example: I keep my functions alphabetically ordered. When I merge two changes which added function in same alphabetical place, I often need to change their order. same goes for if/else if sequence > >> # smerge-extend > >> Helpful when user intent to keep both. > > Sorry: to keep both what? > Both = lower + upper. Using above example: when I intent to keep both functions, end of block (eg: C, Java, Perl, ...) will currently not appear twice, should be manually added. Same for empty line separating functions. On my current WIP such functions often shares more than one tailing line > > >> (defun smerge-extend () > >> "Copy the line directly following the conflict into both upper and > lower sections. > > Hmm... Why just one line and why only from the end? > One line - one can use it multiple times to add more. And yes, you are right, it should accept numeric argument (negative for preceding line). Though I still believe common use case will be to extend with following. > [ IOW, here as well, I'm curious what is the kind of scenario where you > use that command. ] > Scenario described above. > > >> This is useful when both versions need to share some common code that > follows the conflict." > > Hmm... my conflicts have usually 3 sections, so "both" isn't right. > > [ Unless you specifically chose 2-way conflicts, I recommend you > investigate how to get 3-way conflicts, because they give a lot more > information and allow for example `smerge-resolve` to "just work" in > more cases. YMMV, but personally whenever I'm faced with a 2-way > conflict, I'm frustrated. ] > Different experiences - I for example run mostly into 2-way conflicts > > > Stefan > > Brano --0000000000007800c8062844eefa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, 2 Dec 2= 024 at 00:51, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> # keybinding
>> would be nice to provide default keybinding for smerge-swap: C-c ^= s

Interesting.=C2=A0 I've never found a use for that command, personally.=
Could you give some hint for the situations where you found it handy?

Example:
I keep my functions alpha= betically ordered.
When I merge two changes which added function = in same alphabetical place,
I often need to change their order.

same goes for if/else if sequence


>> # smerge-extend
>> Helpful when user intent to keep both.

Sorry: to keep both what?

Both =3D lowe= r + upper.

Using above example:
when I i= ntent to keep both functions, end of block (eg: C, Java, Perl, ...) will cu= rrently not appear twice,
should be manually added. Same for empt= y line separating functions.

On my current WIP= such functions often shares more than one tailing line
=C2= =A0

>> (defun smerge-extend ()
>>=C2=A0 =C2=A0"Copy the line directly following the conflict in= to both upper and lower sections.

Hmm... Why just one line and why only from the end?
One line - one can use it multiple times to add more.

And yes, you are right, it should accept numeric argument = (negative for preceding line).
Though I still believe common use = case will be to extend with following.

=C2=A0<= /div>
[ IOW, here as well, I'm curious what is the kind of scenario where you=
=C2=A0 use that command.=C2=A0 ]

Scenar= io described above.

=C2=A0

>> This is useful when both versions need to share some common code t= hat follows the conflict."

Hmm... my conflicts have usually 3 sections, so "both" isn't = right.

[ Unless you specifically chose 2-way conflicts, I recommend you
=C2=A0 investigate how to get 3-way conflicts, because they give a lot more=
=C2=A0 information and allow for example `smerge-resolve` to "just wor= k" in
=C2=A0 more cases.=C2=A0 YMMV, but personally whenever I'm faced with a= 2-way
=C2=A0 conflict, I'm frustrated.=C2=A0 ]

Different experiences - I for example run mostly into 2-way conflicts=
=C2=A0


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan


Brano
--0000000000007800c8062844eefa--