diff --git a/gdscript-eglot.el b/gdscript-eglot.el index d07a1d3..1a1549e 100644 --- a/gdscript-eglot.el +++ b/gdscript-eglot.el @@ -52,7 +52,11 @@ 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/") + ('windows-nt "%APPDATA%\\Godot\\") + ('gnu/linux "~/.config/")))) (cfg-buffer (find-file-noselect (expand-file-name diff --git a/gdscript-mode.el b/gdscript-mode.el index df3f094..ccccfa8 100644 --- a/gdscript-mode.el +++ b/gdscript-mode.el @@ -56,8 +56,10 @@ ;;;###autoload (with-eval-after-load 'eglot (defvar 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