]> git.eshelyaron.com Git - emacs.git/commitdiff
; Eglot: simplify last change to eglot-unregister-capability
authorJoão Távora <joaotavora@gmail.com>
Fri, 9 Jun 2023 01:11:38 +0000 (02:11 +0100)
committerJoão Távora <joaotavora@gmail.com>
Fri, 9 Jun 2023 01:12:19 +0000 (02:12 +0100)
* lisp/progmodes/eglot.el (eglot-unregister-capability): Simplify.

lisp/progmodes/eglot.el

index c5a58d7ace643dc0db436653edb52e1a89b254c8..7d5d786dea330ece30249f0742ba73e4f4579b08 100644 (file)
@@ -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"))