From 0938403561504eea8a62a78079fb21824b6e4258 Mon Sep 17 00:00:00 2001 From: xiliuya Date: Fri, 22 Sep 2023 00:02:31 +0800 Subject: [PATCH 1/4] - set darwin's eglot config dir --- gdscript-eglot.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdscript-eglot.el b/gdscript-eglot.el index d07a1d3..3d49e57 100644 --- a/gdscript-eglot.el +++ b/gdscript-eglot.el @@ -52,7 +52,10 @@ definitions of HOST, PORT, and INTERACTIVE. For more context, see https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-04/msg01070.html." (save-excursion - (let* ((cfg-dir (or (getenv "XDG_CONFIG_HOME") "~/.config")) + (let* ((cfg-dir (or (getenv "XDG_CONFIG_HOME") + (pcase system-type + ('darwin "~/Library/Application Support/Godot/") + ('gnu/linux "~/.config/")))) (cfg-buffer (find-file-noselect (expand-file-name From bcb50cfe2ca5785ea5081d844a7b3bbba22a763f Mon Sep 17 00:00:00 2001 From: xiliuya Date: Fri, 22 Sep 2023 00:30:30 +0800 Subject: [PATCH 2/4] - add Windows-nt eglot config dir --- gdscript-eglot.el | 1 + 1 file changed, 1 insertion(+) diff --git a/gdscript-eglot.el b/gdscript-eglot.el index 3d49e57..1a1549e 100644 --- a/gdscript-eglot.el +++ b/gdscript-eglot.el @@ -55,6 +55,7 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-04/msg01070.html." (let* ((cfg-dir (or (getenv "XDG_CONFIG_HOME") (pcase system-type ('darwin "~/Library/Application Support/Godot/") + ('windows-nt "%APPDATA%\\Godot\\") ('gnu/linux "~/.config/")))) (cfg-buffer (find-file-noselect From 9b26d25aa345d158ce930f99a8411c5f893cf178 Mon Sep 17 00:00:00 2001 From: xiliuya Date: Sat, 23 Sep 2023 12:21:05 +0800 Subject: [PATCH 3/4] - Make sure `eglot-server-programs only have one 'gdscript-mode key --- gdscript-mode.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gdscript-mode.el b/gdscript-mode.el index df5b683..dc18085 100644 --- a/gdscript-mode.el +++ b/gdscript-mode.el @@ -56,6 +56,8 @@ ;;;###autoload (with-eval-after-load 'eglot (defvar eglot-server-programs) + (setq eglot-server-programs + (assq-delete-all 'gdscript-mode eglot-server-programs)) (push (cons 'gdscript-mode #'gdscript-eglot-contact) eglot-server-programs)) From a6efb8713dac49d194982614335acf806fd14319 Mon Sep 17 00:00:00 2001 From: xiliuya Date: Sun, 24 Sep 2023 11:56:49 +0800 Subject: [PATCH 4/4] - Using unless to change eglot-server-program --- gdscript-mode.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdscript-mode.el b/gdscript-mode.el index dc18085..9067fa4 100644 --- a/gdscript-mode.el +++ b/gdscript-mode.el @@ -56,10 +56,10 @@ ;;;###autoload (with-eval-after-load 'eglot (defvar eglot-server-programs) - (setq eglot-server-programs - (assq-delete-all 'gdscript-mode eglot-server-programs)) - (push (cons 'gdscript-mode #'gdscript-eglot-contact) - eglot-server-programs)) + (unless (equal (alist-get 'gdscript-mode eglot-server-programs) + #'gdscript-eglot-contact) + (push (cons 'gdscript-mode #'gdscript-eglot-contact) + eglot-server-programs))) (defvar gdscript-mode-map (let ((map (make-sparse-keymap))) ;; Movement