Remove melpa, only use melpa-stable

This commit is contained in:
Evie Litherland-Smith 2024-08-07 17:54:38 +01:00
parent 7b2e687b4b
commit 2ffd455abf

View file

@ -5,43 +5,20 @@
Personal Emacs configuration. Clone to =~/.config/emacs/= (or Personal Emacs configuration. Clone to =~/.config/emacs/= (or
=~/.emacs.d/=) and install specified plugins. =~/.emacs.d/=) and install specified plugins.
* Config * Config
Customise =use-package= first, configuration must be set before first
time it's used.
#+begin_src emacs-lisp
;; Configure packages archives with priority
(setopt use-package-check-before-init t
use-package-enable-imenu-support t)
(use-package package
:custom
(package-archive-priorities '(("melpa" . 4) ("stable" . 3) ("nongnu" . 2) ("gnu" . 1)))
:config
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
(package-initialize))
;; Plugins that still need adding / configuring: `auctex' `htmlize'
;; `password-store'
#+end_src
Load =custom.el= if file exists in default location.
#+begin_src emacs-lisp
(setq custom-file (locate-user-emacs-file "custom.el"))
(when (and custom-file (file-exists-p custom-file))
(load custom-file nil 'nomessage))
#+end_src
** Defaults ** Defaults
Set some useful defaults. Some of these should be moved to relevant Set some useful defaults. Some of these should be moved to relevant
section of config. section of configuration.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq user-full-name "Evie Litherland-Smith" (setq user-full-name "Evie Litherland-Smith"
user-mail-address "evie@xenia.me.uk" user-mail-address "evie@xenia.me.uk"
custom-file (locate-user-emacs-file "custom.el")
use-short-answers t use-short-answers t
kill-do-not-save-duplicates t) kill-do-not-save-duplicates t)
(when (and custom-file (file-exists-p custom-file))
(load custom-file nil 'nomessage))
(set-default-coding-systems 'utf-8) (set-default-coding-systems 'utf-8)
(global-auto-revert-mode +1) (global-auto-revert-mode +1)
(delete-selection-mode +1) (delete-selection-mode +1)
@ -50,6 +27,35 @@ section of config.
(keymap-global-set "<mouse-8>" #'previous-buffer) (keymap-global-set "<mouse-8>" #'previous-buffer)
(keymap-global-set "<mouse-9>" #'next-buffer) (keymap-global-set "<mouse-9>" #'next-buffer)
#+end_src #+end_src
Customise =use-package= separately as configuration must be set before
first time it's used.
#+begin_src emacs-lisp
(setopt use-package-check-before-init t
use-package-enable-imenu-support t)
#+end_src
Filter warning messages from causing popups. Keep in log, but only
show for error or emergency.
#+begin_src emacs-lisp
(setq warning-minimum-level :error)
#+end_src
Configure package archives and initialise.
#+begin_src emacs-lisp
(use-package package
:custom
(package-install-upgrade-built-in t)
:config
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize))
;; Plugins that still need adding / configuring: `auctex' `htmlize'
;; `password-store'
#+end_src
** UI and Appearance ** UI and Appearance
Configure the look and feel of Emacs Configure the look and feel of Emacs
@ -97,34 +103,29 @@ Configure the look and feel of Emacs
:foreground :foreground
(plist-get base16-one-light-theme-colors (cdr pairing))))) (plist-get base16-one-light-theme-colors (cdr pairing)))))
(when (display-graphic-p) (require 'server)
;; (add-hook server-after-make-frame-hook #'my/load-theme-and-configure) (add-hook 'after-init-hook
(my/load-theme-and-configure)) (lambda () (when (display-graphic-p) (my/load-theme-and-configure))))
(add-hook 'server-after-make-frame-hook
(lambda () (when (display-graphic-p) (my/load-theme-and-configure))))
(use-package nerd-icons (use-package all-the-icons
:ensure t :ensure t)
:functions (nerd-icons-octicon))
(use-package nerd-icons-dired (use-package all-the-icons-dired
:ensure t :ensure t
:requires nerd-icons :after all-the-icons
:hook (dired-mode)) :hook (dired-mode))
(use-package nerd-icons-ibuffer (use-package all-the-icons-ibuffer
:ensure t :ensure t
:requires nerd-icons :after all-the-icons
:hook (ibuffer-mode)) :hook (ibuffer-mode))
(use-package nerd-icons-completion (use-package all-the-icons-completion
:ensure t :ensure t
:requires nerd-icons :after (all-the-icons marginalia-mode)
:functions nerd-icons-completion-mode :hook (marginalia-mode . all-the-icons-completion-marginalia-setup))
:hook (after-init . (lambda () (nerd-icons-completion-mode +1))))
(use-package nerd-icons-corfu
:ensure t
:requires nerd-icons
:functions nerd-icons-corfu-formatter)
#+end_src #+end_src
*** Modeline *** Modeline
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -168,6 +169,7 @@ Configure the look and feel of Emacs
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ligature (use-package ligature
:ensure t :ensure t
:disabled t
:functions (ligature-set-ligatures :functions (ligature-set-ligatures
global-ligature-mode) global-ligature-mode)
:config :config
@ -659,7 +661,7 @@ Configure email with iCalendar event support, to integrate with
(auth-sources '("secrets:Login"))) (auth-sources '("secrets:Login")))
(use-package auth-source-pass (use-package auth-source-pass
:requires auth-source :after auth-source
:config :config
(auth-source-pass-enable)) (auth-source-pass-enable))
@ -913,7 +915,8 @@ Configure email with iCalendar event support, to integrate with
(file+olp "calendar/email.org.gpg" "Inbox") (file+olp "calendar/email.org.gpg" "Inbox")
"%i" :immediate-finish t)))) "%i" :immediate-finish t))))
(if (executable-find "sqlite3") (when (or (package-installed-p 'emacsql-sqlite)
(package-installed-p 'emacsql-sqlite-builtin))
(use-package org-roam (use-package org-roam
:ensure t :ensure t
:after org :after org
@ -1006,6 +1009,7 @@ Configure email with iCalendar event support, to integrate with
(use-package org-noter (use-package org-noter
:ensure t :ensure t
:disabled t
:after (org doc-view citar) :after (org doc-view citar)
:commands org-noter :commands org-noter
:custom :custom
@ -1043,7 +1047,7 @@ Configure email with iCalendar event support, to integrate with
(expand-file-name "~/Documents/library/"))) (expand-file-name "~/Documents/library/")))
:config :config
(require 'org) (require 'org)
(require 'nerd-icons) (require 'all-the-icons)
(setopt org-cite-insert-processor 'citar (setopt org-cite-insert-processor 'citar
org-cite-follow-processor 'citar org-cite-follow-processor 'citar
org-cite-activate-processor 'citar) org-cite-activate-processor 'citar)
@ -1051,36 +1055,25 @@ Configure email with iCalendar event support, to integrate with
(add-to-list 'org-cite-global-bibliography bibfile)) (add-to-list 'org-cite-global-bibliography bibfile))
(defvar citar-indicator-files-icons (defvar citar-indicator-files-icons
(citar-indicator-create (citar-indicator-create
:symbol (nerd-icons-octicon :symbol (all-the-icons-octicon "file-pdf")
"nf-oct-file"
:face 'nerd-icons-green
:v-adjust -0.1)
:function #'citar-has-files :function #'citar-has-files
:padding " " ; need this because the default padding is too low for these icons :padding " " ; need this because the default padding is too low for these icons
:tag "has:files")) :tag "has:files"))
(defvar citar-indicator-links-icons (defvar citar-indicator-links-icons
(citar-indicator-create (citar-indicator-create
:symbol (nerd-icons-octicon :symbol (all-the-icons-octicon "link")
"nf-oct-link"
:face 'nerd-icons-orange
:v-adjust 0.01)
:function #'citar-has-links :function #'citar-has-links
:padding " " ; need this because the default padding is too low for these icons :padding " " ; need this because the default padding is too low for these icons
:tag "has:links")) :tag "has:links"))
(defvar citar-indicator-notes-icons (defvar citar-indicator-notes-icons
(citar-indicator-create (citar-indicator-create
:symbol (nerd-icons-octicon :symbol (all-the-icons-octicon "file-text")
"nf-oct-note"
:face 'nerd-icons-blue
:v-adjust -0.3)
:function #'citar-has-notes :function #'citar-has-notes
:padding " " ; need this because the default padding is too low for these icons :padding " " ; need this because the default padding is too low for these icons
:tag "has:notes")) :tag "has:notes"))
(defvar citar-indicator-cited-icons (defvar citar-indicator-cited-icons
(citar-indicator-create (citar-indicator-create
:symbol (nerd-icons-octicon :symbol (all-the-icons-octicon "file-binary")
"nf-oct-circle"
:face 'nerd-icon-green)
:function #'citar-is-cited :function #'citar-is-cited
:padding " " ; need this because the default padding is too low for these icons :padding " " ; need this because the default padding is too low for these icons
:tag "is:cited")) :tag "is:cited"))
@ -1144,8 +1137,6 @@ Configure email with iCalendar event support, to integrate with
(corfu-preselect 'directory) (corfu-preselect 'directory)
:config :config
(require 'corfu-history) (require 'corfu-history)
(when (require 'nerd-icons-corfu nil :noerror)
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
(when (require 'corfu-popupinfo nil :noerror) (when (require 'corfu-popupinfo nil :noerror)
(corfu-popupinfo-mode +1)) (corfu-popupinfo-mode +1))
(when (and (require 'corfu-terminal nil :noerror) (when (and (require 'corfu-terminal nil :noerror)
@ -1153,13 +1144,13 @@ Configure email with iCalendar event support, to integrate with
(corfu-terminal-mode +1))) (corfu-terminal-mode +1)))
(use-package corfu-history (use-package corfu-history
:requires (corfu savehist) :after (corfu savehist)
:functions corfu-history :functions corfu-history
:config :config
(add-to-list 'savehist-additional-variables #'corfu-history)) (add-to-list 'savehist-additional-variables #'corfu-history))
(use-package corfu-popupinfo (use-package corfu-popupinfo
:requires corfu :after corfu
:defines corfu-popupinfo-map :defines corfu-popupinfo-map
:functions corfu-popupinfo-mode :functions corfu-popupinfo-mode
:bind ( :map corfu-popupinfo-map :bind ( :map corfu-popupinfo-map
@ -1171,7 +1162,7 @@ Configure email with iCalendar event support, to integrate with
(use-package corfu-terminal (use-package corfu-terminal
:ensure t :ensure t
:requires corfu :after corfu
:functions corfu-terminal-mode) :functions corfu-terminal-mode)
(use-package cape (use-package cape
@ -1264,7 +1255,7 @@ Configure email with iCalendar event support, to integrate with
(use-package treesit-auto (use-package treesit-auto
:ensure t :ensure t
:requires treesit :after treesit
:functions (treesit-auto-add-to-auto-mode-alist :functions (treesit-auto-add-to-auto-mode-alist
global-treesit-auto-mode) global-treesit-auto-mode)
:hook (after-init . (lambda () (global-treesit-auto-mode +1))) :hook (after-init . (lambda () (global-treesit-auto-mode +1)))
@ -1356,29 +1347,31 @@ Configure email with iCalendar event support, to integrate with
(use-package flymake-shellcheck (use-package flymake-shellcheck
:ensure t :ensure t
:disabled t
:functions flymake-shellcheck-load :functions flymake-shellcheck-load
:requires flymake :after flymake
:hook (sh-mode . (lambda () (if (executable-find "shellcheck" t) :hook (sh-mode . (lambda () (if (executable-find "shellcheck" t)
(flymake-shellcheck-load))))) (flymake-shellcheck-load)))))
(use-package flymake-yamllint (use-package flymake-yamllint
:ensure t :ensure t
:functions flymake-yamllint-setup :functions flymake-yamllint-setup
:requires flymake :after flymake
:hook (yaml-ts-mode . (lambda () (if (executable-find "yamllint" t) :hook (yaml-ts-mode . (lambda () (if (executable-find "yamllint" t)
(flymake-yamllint-setup))))) (flymake-yamllint-setup)))))
(use-package flymake-clippy (use-package flymake-clippy
:ensure t :ensure t
:disabled t
:functions flymake-clippy-setup-backend :functions flymake-clippy-setup-backend
:requires flymake :after flymake
:hook (rust-mode . (lambda () (if (executable-find "clippy" t) :hook (rust-mode . (lambda () (if (executable-find "clippy" t)
(flymake-clippy-setup-backend))))) (flymake-clippy-setup-backend)))))
(use-package flymake-eslint (use-package flymake-eslint
:ensure t :ensure t
:functions flymake-eslint-enable :functions flymake-eslint-enable
:requires flymake :after flymake
:hook ((js-base-mode typescript-ts-base-mode) . (lambda () (if (executable-find "eslint" t) :hook ((js-base-mode typescript-ts-base-mode) . (lambda () (if (executable-find "eslint" t)
(flymake-eslint-enable))))) (flymake-eslint-enable)))))
@ -1478,6 +1471,7 @@ Configure email with iCalendar event support, to integrate with
(use-package python-docstring (use-package python-docstring
:ensure t :ensure t
:disabled t
:hook python-base-mode) :hook python-base-mode)
(use-package files (use-package files