From: Eshel Yaron Date: Sun, 16 Mar 2025 16:45:51 +0000 (+0100) Subject: Update Emacs config X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=13e0c33cf20928968bf233425b37334d5a372d6e;p=dotfiles.git Update Emacs config --- diff --git a/.emacs.d/early-init.el b/.emacs.d/early-init.el index 1598597..9d6803c 100644 --- a/.emacs.d/early-init.el +++ b/.emacs.d/early-init.el @@ -6,8 +6,6 @@ (tool-bar-mode -1) (set-scroll-bar-mode nil) -(setq package-enable-at-startup nil) - (pcase system-type ('gnu/linux (menu-bar-mode -1) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index b3ef28a..eac94d7 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -67,13 +67,13 @@ ;;; Set up Elpaca -(defvar elpaca-installer-version 0.8) +(defvar elpaca-installer-version 0.9) (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) (defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) (defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" - :ref nil - :files (:defaults (:exclude "extensions")) + :ref nil :depth 1 :inherit ignore + :files (:defaults "elpaca-test.el" (:exclude "extensions")) :build (:not elpaca--activate-package))) (let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) (build (expand-file-name "elpaca/" elpaca-builds-directory)) @@ -82,10 +82,13 @@ (add-to-list 'load-path (if (file-exists-p build) build repo)) (unless (file-exists-p repo) (make-directory repo t) + (when (< emacs-major-version 28) (require 'subr-x)) (condition-case-unless-debug err (if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) - ((zerop (call-process "git" nil buffer t "clone" - (plist-get order :repo) repo))) + ((zerop (apply #'call-process `("git" nil ,buffer t "clone" + ,@(when-let* ((depth (plist-get order :depth))) + (list (format "--depth=%d" depth) "--no-single-branch")) + ,(plist-get order :repo) ,repo)))) ((zerop (call-process "git" nil buffer t "checkout" (or (plist-get order :ref) "--")))) (emacs (concat invocation-directory invocation-name)) @@ -114,11 +117,6 @@ ("./configure") ("make")))) (elpaca debbugs) -(elpaca (devdocs - :pre-build (("emacs" "--batch" "-l" "ox-texinfo" "README.org" - "--eval" "(setq org-babel-confirm-evaluate-answer-no t)" - "-f" "org-texinfo-export-to-texinfo") - ("mv" "README.texi" "devdocs.texi")))) (elpaca diff-hl) (elpaca (eat :pre-build (("make" "terminfo") @@ -143,7 +141,6 @@ :pre-build (("emacs" "--batch" "-l" "ox-texinfo" "README.org" "--eval" "(setq org-babel-confirm-evaluate-answer-no t)" "-f" "org-texinfo-export-to-texinfo")))) -(elpaca paredit) (elpaca sqlformat) (elpaca (auctex :repo "git@git.sr.ht:~eshel/auctex" @@ -163,8 +160,9 @@ ("mv" "README.texi" "pdf-tools.texi")))) (elpaca ob-prolog) (elpaca (kubed :repo "~/checkouts/kubed")) -(elpaca (lean4-mode :repo "https://github.com/leanprover-community/lean4-mode" - :files ("*"))) +;; (elpaca (combobulate :repo "~/checkouts/combobulate")) +;; (elpaca (lean4-mode :repo "https://github.com/leanprover-community/lean4-mode" +;; :files ("*"))) (elpaca (ultra-scroll :repo "git@github.com:jdtsmith/ultra-scroll.git")) ;; (elpaca kubed) @@ -459,7 +457,6 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t)) savehist-additional-variables '(log-edit-comment-ring) eldoc-minor-mode-string nil flyspell-mode-line-string nil - paredit-lighter nil eglot-confirm-server-edits 'diff ;; use my custom project-prompting function project-prompter #'esy/read-project-by-name @@ -491,7 +488,7 @@ DEADLINE: %(format-time-string \"<%Y-%m-%d %H:%M>\" (org-read-date t t)) checkdoc-verb-check-experimental-flag nil prefix-help-command #'help-complete-keys help-enable-variable-value-editing t - pcomplete-termination-string "" + ;; pcomplete-termination-string "" See `comint-completion-addsuffix'. imenu-flatten t imenu-auto-rescan t scroll-conservatively 101 ; For `ultra-scroll' @@ -790,6 +787,8 @@ Interactively, POINT is point and KILL is the prefix argument." (add-hook 'completion-at-point-functions #'tags-completion-at-point-function 90 t)) +(add-hook 'completion-at-point-functions #'dabbrev-capf) + (dolist (mode '(bug-reference-prog-mode display-fill-column-indicator-mode display-line-numbers-mode @@ -799,7 +798,7 @@ Interactively, POINT is point and KILL is the prefix argument." )) (add-hook 'prog-mode-hook mode)) -(add-hook 'lisp-data-mode-hook #'paredit-mode) +;; (add-hook 'lisp-data-mode-hook #'electric-pair-mode) (add-hook 'lisp-data-mode-hook #'rainbow-delimiters-mode) ;;; Extend standard text mode hooks @@ -901,10 +900,8 @@ Interactively, POINT is point and KILL is the prefix argument." ;;; Configure project management commands (with-eval-after-load 'project - (add-to-list 'project-switch-commands '(project-compile "Compile")) - (add-to-list 'project-switch-commands '(magit-project-status "Magit")) - (add-to-list 'project-switch-commands '(project-shell "Shell")) - (add-to-list 'project-switch-commands '(project-go-to-diagnostic "Flymake")) + (alist-set ?\` project-switch-commands '("flymake" nil project-go-to-diagnostic)) + (alist-set ?m project-switch-commands '("magit" nil magit-project-status)) (define-key project-prefix-map "w" #'project-copy-relative-file-name-as-kill) (define-key project-prefix-map "m" #'magit-project-status) @@ -919,12 +916,10 @@ If no known project matches the selected name, prompt for a sub-directory of `esy/projects-directory' using the selected name as the initial input for completion, and return that directory." (let* ((name-dir-alist - (delete - nil - (mapcar (lambda (dir) - (when-let ((proj (project-current nil dir))) - (cons (project-name proj) dir))) - (project-known-project-roots)))) + (seq-keep (lambda (dir) + (when-let ((proj (project-current nil dir))) + (cons (project-name proj) dir))) + (project-known-project-roots))) (current (project-current)) (default (and current (project-name current))) (name (completing-read (format-prompt "Project" default) @@ -1111,14 +1106,6 @@ as the initial input for completion, and return that directory." (add-to-list 'revert-without-query "\\.pdf\\'") -;;; Remove some over-intrusive keybindings in `paredit' - -(with-eval-after-load 'paredit - (keymap-unset paredit-mode-map "M-s" t) - (keymap-unset paredit-mode-map "M-?" t) - (with-eval-after-load 'eldoc - (eldoc-add-command 'paredit-RET))) - ;;; Configure Prolog integration via `sweeprolog' (setq-default prolog-system 'swi) @@ -1289,7 +1276,7 @@ as the initial input for completion, and return that directory." (with-eval-after-load 'completion-preview (add-to-list 'completion-preview-commands 'org-self-insert-command) - (add-to-list 'completion-preview-commands 'paredit-backward-delete) + (add-to-list 'completion-preview-commands #'lisp-delete-backward) (setq completion-preview-minimum-symbol-length 2) (keymap-set completion-preview-active-mode-map "M-n" #'completion-preview-next-candidate) (keymap-set completion-preview-active-mode-map "M-p" #'completion-preview-prev-candidate) @@ -1297,7 +1284,7 @@ as the initial input for completion, and return that directory." (add-hook 'read-shell-command-minibuffer-setup-hook #'completion-preview-mode) (add-hook 'eval-expression-minibuffer-setup-hook #'completion-preview-mode) -(add-hook 'eval-expression-minibuffer-setup-hook #'electric-pair-local-mode) +(add-hook 'eval-expression-minibuffer-setup-hook #'electric-pair-mode) ;; (load-file "/usr/local/opt/agda/libexec/ghc-9.10.1-inplace/Agd-2.6.4.3-7d670049/share/emacs-mode/agda2.el") @@ -1410,8 +1397,6 @@ as the initial input for completion, and return that directory." (add-hook 'find-function-after-hook #'esy/pulse-line) -(with-eval-after-load 'package (backtrace)) - (defun esy/update-forks () (interactive) (require 'with-editor) diff --git a/.emacs.d/theme/esy-theme.el b/.emacs.d/theme/esy-theme.el index 949911e..a8e753e 100644 --- a/.emacs.d/theme/esy-theme.el +++ b/.emacs.d/theme/esy-theme.el @@ -60,7 +60,6 @@ mode-name mode-line-process minor-mode-alist (:eval (when (window-dedicated-p) " Dedicated")) - (eglot--managed-mode (" " (:eval (eglot--mode-line-format)))) "%n%])" (vc-mode vc-mode) (which-func-mode (" " which-func-format))