From a6896676ea0d4f969629597eeee518003c02e883 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Mon, 30 Oct 2023 23:38:47 +0100 Subject: Solve old Emacs todos, enable pixel-scroll-precision-mode --- tw/home/files/emacs-init.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tw') diff --git a/tw/home/files/emacs-init.el b/tw/home/files/emacs-init.el index 0e8d2049..9fecfab7 100644 --- a/tw/home/files/emacs-init.el +++ b/tw/home/files/emacs-init.el @@ -6,8 +6,6 @@ (expand-file-name "emacs/eln" (or (getenv "XDG_CACHE_HOME") "~/.cache/"))) (add-hook 'after-init-hook #'native-compile-prune-cache) -;; TODO: try new `pixel-scroll-precision-mode' - ;; Load settings set through Custom. ;; (setq custom-file (locate-user-emacs-file "custom.el")) ;; (when (file-readable-p custom-file) @@ -42,6 +40,7 @@ If CREATE is true and the resulting directory does not exist, create it." (max-mini-window-height 3 "Let the echo area grow to a maximum of 3 lines, e.g. when using `eldoc-mode'.") (scroll-up-aggressively 0.0 "Don't recenter the window if the point moves off the page.") (scroll-down-aggressively 0.0 "Don't recenter the window if the point moves off the page.") + (pixel-scroll-precision-mode t "Enable pixel-by-pixel scrolling, e.g. to handle inline images.") ;; Niceties. (tramp-default-method "scpx" "ssh and scp hang forever. scpx is faster than sshx for large files.") (global-hl-line-mode t "Highlight the current line in all buffers.") @@ -297,7 +296,6 @@ If CREATE is true and the resulting directory does not exist, create it." ("ev" . flymake-running-backends) ("eV" . flymake-disabled-backends)) :custom - ;; TODO: what does `flymake-mode-line-lighter' do? (flymake-suppress-zero-counters nil "Show severity counters even when they are zero.")) (use-package flymake-collection @@ -311,18 +309,19 @@ If CREATE is true and the resulting directory does not exist, create it." ;; Language Server Protocol. (defun tw/help-is-eldoc (&rest _) "Set up `evil-lookup-func' to display the `eldoc' buffer." - (setq-local evil-lookup-func #'eldoc-doc-buffer)) + (when (eglot-managed-p) + (setq-local evil-lookup-func #'eldoc-doc-buffer))) (use-package eglot ;; I have clang (for clangd) and python-lsp-server installed. ;; `:hook' adds `-mode' to the package name, but `eglot-mode' doesn't exist. :hook ((python-mode python-ts-mode c-mode c++-mode c-or-c++-ts-mode) . eglot-ensure) :commands (eglot) + :functions (eglot-managed-p) :custom (eglot-autoshutdown t "Shut down language servers after deleting their last associated buffer.") (eglot-sync-connect 0.1 "Wait for the language server in the background if it takes longer than 100ms.") :config - ;; TODO: only run `tw/help-is-eldoc' if `eglot-managed-p' is true. (add-hook 'eglot-managed-mode-hook #'tw/help-is-eldoc)) ;; Tree-sitter -- cgit v1.2.3