From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#60338: [PATCH] Add option to present server changes as diffs Date: Fri, 1 Sep 2023 22:19:50 +0100 Message-ID: References: <87ilhy1dub.fsf@posteo.net> <877cs97kgb.fsf@posteo.net> <83jzw8yjv5.fsf@gnu.org> <877cs8g8oy.fsf@posteo.net> <83fs6wyhak.fsf@gnu.org> <87y1koerm6.fsf@posteo.net> <83bkhkyeze.fsf@gnu.org> <87v8fr6o86.fsf@posteo.net> <87zg52e12n.fsf@posteo.net> <871qi9q9uc.fsf@posteo.net> <87a5ww7qa3.fsf@gmail.com> <87jzvsdco1.fsf@posteo.net> <87zg2669kk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4930"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, Philip Kaludercic , 60338@debbugs.gnu.org, Eli Zaretskii To: Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 01 23:18:06 2023 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 1qcBWo-000183-8f for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Sep 2023 23:18:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcBWe-0006p2-Qw; Fri, 01 Sep 2023 17:17:58 -0400 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 1qcBWa-0006ok-TF for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 17:17:53 -0400 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 1qcBWa-00063J-I8 for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 17:17:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcBWj-00035q-T5 for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 17:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Sep 2023 21:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60338 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60338-submit@debbugs.gnu.org id=B60338.169360305611859 (code B ref 60338); Fri, 01 Sep 2023 21:18:01 +0000 Original-Received: (at 60338) by debbugs.gnu.org; 1 Sep 2023 21:17:36 +0000 Original-Received: from localhost ([127.0.0.1]:34272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcBWJ-00035D-UJ for submit@debbugs.gnu.org; Fri, 01 Sep 2023 17:17:36 -0400 Original-Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]:54404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcBWI-000350-3r for 60338@debbugs.gnu.org; Fri, 01 Sep 2023 17:17:34 -0400 Original-Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2bd0a5a5abbso40144371fa.0 for <60338@debbugs.gnu.org>; Fri, 01 Sep 2023 14:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693603039; x=1694207839; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Q/6AUDkOI+pNTtebLs9INU7mjuSlZzr8U26b11M+qMY=; b=E0K+m204rqWhpJTcjCA+cnxVGtBHVT5BudpFsklsQSlpwhVVMbmGanRNJTmBVB2yfR oKc4v9TjhSz93PnAXWCAlDfZGz2Bvjzz6cX0wnYsVyyAL4mIKQnhHsjUjT6pojn/oczV Zu37v491l/BrQ+CH0/8W6TH4qC8vSSyEfQtPj4duAmkM6A+sNSRuFgcof7FEP2w7DyXx Pcy8tftvt99J1cifKWWya0aFmF/1/OqtlEbvKK3EaHVyfsaMmEiaiuf6O/TaGOpFrcWN ctNYzJJHCq9oQ7uyciwtrzKE+euW2DjBbm3ObfCLjt92xOotXZIA+o4+h6pY5+hKun3P yzKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693603039; x=1694207839; h=content-transfer-encoding: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=Q/6AUDkOI+pNTtebLs9INU7mjuSlZzr8U26b11M+qMY=; b=jEBsZWDXJmvNhf/UztigzacnUpoRtNMdik3px2OVlESEIj2h4MQgOkmEwf8ZddWldy Ks1ARt1ElEC+r4MOzXCHHchptSVX3gaOYHIGdN37Vh6q/y23fQXHmhwDEmrZM7sLO37q 1kXykv8wB8147vwiGEEP0t5J3vU72bwIAEQjPuExzNHMqlL0dquWc5+opSZihwFvIvXZ KEMTSD83yvxB7lUcznXopBFFM0y/goPq6vlNLN6B1nYBfoz6Fn4o4E0EmuB5NRHPNwoG z18hjuGGVTpDoc6MAk6b2lfIiHml00lnZPOt9Li4XyLgmyxqqh+D0vnZtDnWzDSv8O1G p4ZA== X-Gm-Message-State: AOJu0YwJr3zrRB5wK7qxjeTrs57GBGGGG29OwxBfUrs5Ude+lH08LoT4 vml6K+D0bWcMkhFdlcYaY933LlD0Xcv0ElyI5MM= X-Google-Smtp-Source: AGHT+IEApwizwAqwqkWLR6efTX1j0B4Ke+XMORuG9AdAa/GFjuaPNu149yMo206Dlqsj6qndWpqvbE/3furyQqsWdSs= X-Received: by 2002:a2e:b6c5:0:b0:2bb:9781:1a4c with SMTP id m5-20020a2eb6c5000000b002bb97811a4cmr2451116ljo.27.1693603038468; Fri, 01 Sep 2023 14:17:18 -0700 (PDT) In-Reply-To: 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:268933 Archived-At: On Fri, Sep 1, 2023 at 10:13=E2=80=AFPM Eshel Yaron wro= te: > > Jo=C3=A3o T=C3=A1vora writes: > > > I've finally pushed this to master, after working on mostly on the user > > confirmation logic. I deprecated `eglot-confirm-server-initiated-edits= ' > > (had crap semantics anyway) and replaced it with a shiny new > > 'eglot-confirm-server-edits', with a simpler name but much more powerfu= l > > (see its docstring). > > > [...] > > > > Please have a look, give it some testing, and tell me if I missed > > anything. > > Great stuff! One issue I came across is with unsaved buffers. I'm fixing that as we speak. I'll read your recipe later, but I'm 90% sure it's the same stuff I've been trying to fix for most of today. > Lastly, I have an improvement suggestion for the `:type` of > `eglot-confirm-server-edits` to make it nicer to deal with via Custom: > > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el > index 8d95019c3ed..afb99e4b9ca 100644 > --- a/lisp/progmodes/eglot.el > +++ b/lisp/progmodes/eglot.el > @@ -413,12 +413,17 @@ eglot-confirm-server-edits > `eglot-code-actions', `eglot-code-action-quickfix', etc. ACTION > is one of the symbols described above. The value `t' for COMMAND > is accepted and its ACTION is the default value." > - :type '(choice (const :tag "Use diff" diff) > + :type (let ((basic-choices > + '((const :tag "Use diff" diff) > (const :tag "Summarize and prompt" summary) > (const :tag "Maybe use diff" maybe-diff) > (const :tag "Maybe summarize and prompt" maybe-summary) > - (const :tag "Don't confirm" nil) > - (alist :tag "Per-command alist"))) > + (const :tag "Don't confirm" nil)))) > + `(choice ,@basic-choices > + (alist :tag "Per-command alist" > + :key-type (choice (function :tag "Command") > + (const :tag "Default" t)) > + :value-type (choice . ,basic-choices))))) > > (defcustom eglot-extend-to-xref nil > "If non-nil, activate Eglot in cross-referenced non-project files." I'll look at this bit, too. I looks sane, and I'm glad I found a custom.e= l expert to call on :-) Jo=C3=A3o