From d5bbd1dc27e9b75e0092bee3f8bb0ff8a4167b5e Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 5 Nov 2023 13:56:14 +0100 Subject: [PATCH] Update emacs.el for 29.1 Also update plan, I don't plan to use mu4e, added TODO about package signatures --- emacs/emacs.el | 86 ++++++++++++++++++++------------------------------ emacs/plan.org | 3 +- 2 files changed, 35 insertions(+), 54 deletions(-) diff --git a/emacs/emacs.el b/emacs/emacs.el index 70311ab..992a708 100644 --- a/emacs/emacs.el +++ b/emacs/emacs.el @@ -1,25 +1,5 @@ ;; symlink this file to ~/.emacs -;; if you get "End of file during parsing", refer to: -;; -;; https://github.com/radian-software/straight.el#debugging -;; -;; , particularly the note "Sometimes, in a corporate environment"... you -;; might need to clone straight.el into ~/.emacs.d manually - -(defvar bootstrap-version) -(let ((bootstrap-file - (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) - (bootstrap-version 6)) - (unless (file-exists-p bootstrap-file) - (with-current-buffer - (url-retrieve-synchronously - "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) - (load bootstrap-file nil 'nomessage)) - ;; Nicer defaults (setq compilation-scroll-output t) @@ -32,20 +12,25 @@ (setq auto-window-vscroll nil) ;; Colorblind friendly theme. -;; Emacs 28 has modus themes, but EL9 only has emacs 27 - -(straight-use-package 'modus-themes) -(require 'modus-themes) +(require-theme 'modus-themes) (load-theme 'modus-operandi :no-confirm) +(require 'use-package-ensure) +(setq use-package-always-ensure t) +(setq package-check-signature nil) ;; TODO: superconfigure lacks keyring? + +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) + ;; Install xclip so cutting/copying in Emacs on a terminal affects the graphical clipboard -(straight-use-package 'xclip) +(use-package xclip) (xclip-mode 1) ;; Fancy undo -(straight-use-package 'undo-tree) +(use-package undo-tree) (global-undo-tree-mode) (setq undo-tree-visualizer-diff t) (setq undo-tree-visualizer-timestamp t) @@ -64,7 +49,7 @@ ;; nicer completion UI -(straight-use-package 'helm) +(use-package helm) (global-set-key (kbd "M-x") #'helm-M-x) (global-set-key (kbd "C-x C-f") #'helm-find-files) @@ -72,21 +57,12 @@ (setq helm-ff-skip-boring-files t) -;; nicer project support - -(straight-use-package 'projectile) -(straight-use-package 'helm-projectile) - -(projectile-mode +1) -(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map) -(helm-projectile-on) - ;; LSP base for Rust and Java -(straight-use-package 'lsp-mode) -(straight-use-package 'company-mode) -(straight-use-package 'lsp-ui) -(straight-use-package 'yasnippet) +(use-package lsp-mode) +(use-package company) +(use-package lsp-ui) +(use-package yasnippet) (add-hook 'java-mode-hook (lambda () (setq c-basic-offset 2 @@ -96,7 +72,7 @@ ;; Rust support -(straight-use-package 'rust-mode) +(use-package rust-mode) (add-hook 'rust-mode-hook #'lsp) (add-hook 'rust-mode-hook (lambda () (setq indent-tabs-mode nil))) @@ -104,27 +80,27 @@ ;; Python support -(straight-use-package 'elpy) +(use-package elpy) (elpy-enable) ;;; Java Support -(straight-use-package 'lsp-java) +(use-package lsp-java) (add-hook 'java-mode-hook 'lsp) ;; YAML support -(straight-use-package 'yaml-mode) +(use-package yaml-mode) ;; lsp-mode seems unusably slow, so don't install the Ansible language server ;; if you want to get it working, try https://www.reddit.com/r/emacs/comments/ybbkks/how_to_properly_set_up_lsp_ansible_language/itfxoaa/ -(straight-use-package 'ansible) +(use-package ansible) (add-hook 'yaml-mode-hook 'ansible) ;; Puppet support; mostly for syntax highlighting -(straight-use-package 'puppet-mode) +(use-package puppet-mode) ;; ==== WORK ==== @@ -140,22 +116,28 @@ ("oomit" "_...output omitted..._") ))) -(set-default 'abbrev-mode t) - (setq save-abbrevs nil) ;; AsciiDoc + Vale + Aspell support for work -(straight-use-package 'adoc-mode) +(use-package adoc-mode) +(add-hook 'adoc-mode-hook #'abbrev-mode) + +(cl-defun slot/vc-install (&key (fetcher "github") repo name rev backend) + (let* ((url (format "https://www.%s.com/%s" fetcher repo)) + (iname (when name (intern name))) + (pac-name (or iname (intern (file-name-base repo))))) + (unless (package-installed-p pac-name) + (package-vc-install url iname rev backend)))) -(straight-use-package - '(flymake-vale :type git :host github :repo "tpeacock19/flymake-vale")) +(use-package flymake-vale + :init (slot/vc-install :fetcher "github" :repo "tpeacock19/flymake-vale")) (add-hook 'adoc-mode-hook #'flymake-vale-load) (add-hook 'find-file-hook 'flymake-vale-maybe-load) (add-hook 'adoc-mode-hook 'flymake-mode) -(straight-use-package 'flymake-aspell) +(use-package flymake-aspell) (add-hook 'adoc-mode-hook #'flymake-aspell-setup) (setq ispell-dictionary "en_US-RH") diff --git a/emacs/plan.org b/emacs/plan.org index 2edcc74..75d6213 100644 --- a/emacs/plan.org +++ b/emacs/plan.org @@ -1,4 +1,3 @@ -* https://www.reddit.com/r/emacs/comments/10nmcus/dont_fear_the_emacs/ +* Reenable package-check-signature * Magit -* mu4e * Elfeed + elfeed-protocol/fever -- 2.47.3