From: Theodor Thornhill Date: Thu, 26 Dec 2019 08:39:33 +0000 (+0100) Subject: New eglot-confirm-server-initiated-edits defcustom X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~263 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=be17d1824fe1f6cfd863c2ac7ddad224f7d251cb;p=emacs.git New eglot-confirm-server-initiated-edits defcustom * eglot.el (eglot-confirm-server-initiated-edits): New defcustom. Copyright-paperwork-exempt: yes Co-authored-by: João Távora GitHub-reference: close https://github.com/joaotavora/eglot/issues/382 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4c0160a5705..df8df13410a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -193,6 +193,11 @@ let the buffer grow forever." :type '(choice (const :tag "No limit" nil) (integer :tag "Number of characters"))) +(defcustom eglot-confirm-server-initiated-edits 'confirm + "Non-nil if server-initiated edits should be confirmed with user." + :type '(choice (const :tag "Don't show confirmation prompt" nil) + (symbol :tag "Show confirmation prompt" 'confirm))) + ;;; Constants ;;; @@ -1547,7 +1552,7 @@ THINGS are either registrations or unregisterations (sic)." (cl-defmethod eglot-handle-request (_server (_method (eql workspace/applyEdit)) &key _label edit) "Handle server request workspace/applyEdit" - (eglot--apply-workspace-edit edit 'confirm)) + (eglot--apply-workspace-edit edit eglot-confirm-server-initiated-edits)) (defun eglot--TextDocumentIdentifier () "Compute TextDocumentIdentifier object for current buffer."