]> git.eshelyaron.com Git - emacs.git/commit
Eglot: revamp confirmation model for server-proposed edits
authorJoão Távora <joaotavora@gmail.com>
Thu, 31 Aug 2023 23:48:25 +0000 (00:48 +0100)
committerJoão Távora <joaotavora@gmail.com>
Fri, 1 Sep 2023 00:00:19 +0000 (01:00 +0100)
commited5ccf9da227d0a9f22ce45eff6382feb8979912
tree9b52f771b31f012fcf163e85fd4e0b7940014755
parentfad48a20e665e6b5b51c417e9c04946517a2aa2f
Eglot: revamp confirmation model for server-proposed edits

bug#60338

The variable 'eglot-confirm-server-edits' replaces the obsolete
'eglot-confirm-server-initiated-edits' and brings about a new
confirmation model, making it possible to have only certain commands
require user confirmation.  This was achieved careful usage of the
'this-command' and 'last-command' variables.

There are now two types of confirmation: the usual
minibuffer summary and a temporary 'diff-mode' buffer to display the
proposed changes, so the user can apply them one by one.

Thanks to Philip Kaludercic for the diff-mode idea and implementation.

Co-authored-by: Philip Kaludercic <philipk@posteo.net>
* doc/misc/eglot.texi (Eglot Variables): Describe
'eglot-confirm-server-edits'.

* etc/EGLOT-NEWS (latest): Mention change.

* lisp/progmodes/eglot.el (diff-mode): Require it.
(eglot-confirm-server-initiated-edits): Obsolete it.
(eglot-confirm-server-edits): New variable.
(eglot-handle-request workspace/applyEdit): Use 'last-command'
(eglot-execute t t): Use 'this-command'.
(eglot--apply-workspace-edit): Rework.
(eglot-rename): Use 'this-command'.
doc/misc/eglot.texi
etc/EGLOT-NEWS
lisp/progmodes/eglot.el