From 3c01060c02359e5b813979b7b950bf904c87dcfa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 9 Jun 2023 02:11:38 +0100 Subject: [PATCH] ; Eglot: simplify last change to eglot-unregister-capability * lisp/progmodes/eglot.el (eglot-unregister-capability): Simplify. --- lisp/progmodes/eglot.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index c5a58d7ace6..7d5d786dea3 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3586,11 +3586,10 @@ at point. With prefix argument, prompt for ACTION-KIND." (server (_method (eql workspace/didChangeWatchedFiles)) id) "Handle dynamic unregistration of workspace/didChangeWatchedFiles." (maphash (lambda (dir watch-and-ids) - (when (member id (cdr watch-and-ids)) - (setcdr watch-and-ids (delete id (cdr watch-and-ids))) - (when (null (cdr watch-and-ids)) - (file-notify-rm-watch (car watch-and-ids)) - (remhash dir (eglot--file-watches server))))) + (setcdr watch-and-ids (delete id (cdr watch-and-ids))) + (when (null (cdr watch-and-ids)) + (file-notify-rm-watch (car watch-and-ids)) + (remhash dir (eglot--file-watches server)))) (eglot--file-watches server)) (list t "OK")) -- 2.39.2