From 2260c14a8d1ecddfabb1f956fa5952d859c291f2 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 14 Nov 2023 10:16:49 +0000 Subject: [PATCH] Cleanup Eglot settings, remove pdf-tools --- flake.nix | 11 +++-------- home/emacs/default.nix | 1 - home/emacs/init.el | 35 +++-------------------------------- home/emacs/init.org | 35 +++-------------------------------- 4 files changed, 9 insertions(+), 73 deletions(-) diff --git a/flake.nix b/flake.nix index 566fbf0a..36dca87b 100644 --- a/flake.nix +++ b/flake.nix @@ -23,14 +23,10 @@ url = "github:Kirottu/anyrun"; inputs.nixpkgs.follows = "nixpkgs"; }; - # watershot = { - # url = "github:Kirottu/watershot"; - # inputs.nixpkgs.follows = "nixpkgs"; - # }; }; - outputs = { self, nixpkgs, home-manager, nix-index-database, stylix, kmonad - , anyrun, ... }@inputs: + outputs = + { nixpkgs, home-manager, nix-index-database, stylix, kmonad, anyrun, ... }: let default = { hostName = "Atlas"; @@ -269,8 +265,7 @@ ./services/sshd/default.nix ./services/syncthing/default.nix ]; - homeModules = - [ ./home/default.nix ./home/media.nix ./home/emacs/default.nix ]; + homeModules = [ ./home/default.nix ]; }; Northstar = let diff --git a/home/emacs/default.nix b/home/emacs/default.nix index 74984cf8..080f053e 100644 --- a/home/emacs/default.nix +++ b/home/emacs/default.nix @@ -81,7 +81,6 @@ darkroom # writing-packages - pdf-tools markdown-mode pandoc-mode auctex diff --git a/home/emacs/init.el b/home/emacs/init.el index 9c6b3141..909c925d 100644 --- a/home/emacs/init.el +++ b/home/emacs/init.el @@ -405,40 +405,11 @@ :ensure t :config (direnv-mode +1)) +(setq eglot-extend-to-xref t + eglot-autoshutdown t + eglot-autoreconnect nil) (when (require 'eglot nil :noerror) - ;; Currently just using prog-mode - ;; Should probably use individual language modes - ;; One day... (add-hook 'prog-mode-hook #'eglot-ensure)) -;;; Eglot -(defun crafted-ide--add-eglot-hooks (mode-list) - "Add `eglot-ensure' to modes in MODE-LIST. - -The mode must be loaded, i.e. found with `fboundp'. A mode which -is not loaded will not have a hook added, in which case add it -manually with something like this: - -`(add-hook 'some-mode-hook #'eglot-ensure)'" - (dolist (mode-def mode-list) - (let ((mode (if (listp mode-def) (car mode-def) mode-def))) - (cond - ((listp mode) (crafted-ide--add-eglot-hooks mode)) - (t - (when (and (fboundp mode) - (not (eq 'clojure-mode mode)) ; prefer cider - (not (eq 'lisp-mode mode)) ; prefer sly/slime - (not (eq 'scheme-mode mode)) ; prefer geiser - ) - (let ((hook-name (format "%s-hook" (symbol-name mode)))) - (message "adding eglot to %s" hook-name) - (add-hook (intern hook-name) #'eglot-ensure)))))))) - -;; add eglot to existing programming modes when eglot is loaded. -(with-eval-after-load "eglot" - (crafted-ide--add-eglot-hooks eglot-server-programs)) - -;; Shutdown server when last managed buffer is killed -(customize-set-variable 'eglot-autoshutdown t) (setq project-switch-use-entire-map t project-switch-commands diff --git a/home/emacs/init.org b/home/emacs/init.org index 498fe66d..d725fe0d 100644 --- a/home/emacs/init.org +++ b/home/emacs/init.org @@ -476,40 +476,11 @@ For reference information, see [[https://orgmode.com][Org-mode website]] ** Eglot LSP #+BEGIN_SRC emacs-lisp + (setq eglot-extend-to-xref t + eglot-autoshutdown t + eglot-autoreconnect nil) (when (require 'eglot nil :noerror) - ;; Currently just using prog-mode - ;; Should probably use individual language modes - ;; One day... (add-hook 'prog-mode-hook #'eglot-ensure)) - ;;; Eglot - (defun crafted-ide--add-eglot-hooks (mode-list) - "Add `eglot-ensure' to modes in MODE-LIST. - - The mode must be loaded, i.e. found with `fboundp'. A mode which - is not loaded will not have a hook added, in which case add it - manually with something like this: - - `(add-hook 'some-mode-hook #'eglot-ensure)'" - (dolist (mode-def mode-list) - (let ((mode (if (listp mode-def) (car mode-def) mode-def))) - (cond - ((listp mode) (crafted-ide--add-eglot-hooks mode)) - (t - (when (and (fboundp mode) - (not (eq 'clojure-mode mode)) ; prefer cider - (not (eq 'lisp-mode mode)) ; prefer sly/slime - (not (eq 'scheme-mode mode)) ; prefer geiser - ) - (let ((hook-name (format "%s-hook" (symbol-name mode)))) - (message "adding eglot to %s" hook-name) - (add-hook (intern hook-name) #'eglot-ensure)))))))) - - ;; add eglot to existing programming modes when eglot is loaded. - (with-eval-after-load "eglot" - (crafted-ide--add-eglot-hooks eglot-server-programs)) - - ;; Shutdown server when last managed buffer is killed - (customize-set-variable 'eglot-autoshutdown t) #+END_SRC ** Project #+BEGIN_SRC emacs-lisp