summaryrefslogtreecommitdiff
path: root/.config/emacs
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-10-23 02:35:41 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-10-23 02:35:41 +0200
commit1bcb630f3f734b9d5d325ddfcd5dcc6a7a2b578c (patch)
treea77bf271577584f48d9c1397c32382b6ed1cb34f /.config/emacs
parent650145999dc5937c0f047c21493cd955811d2d6a (diff)
emacs: Add ‘mm-package-sync’
Diffstat (limited to '.config/emacs')
-rw-r--r--.config/emacs/init.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index 07f6149..645aad6 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -108,9 +108,22 @@ buffer suppressed."
package-archive-priorities '(("gnu" . 3)
("nongnu" . 2)
("melpa" . 1)))
-(package-initialize)
(setopt use-package-always-defer t)
+(package-initialize)
+
+(defun mm-package-sync ()
+ "Remove unused packages and install missing ones."
+ (interactive)
+ (let ((window-configuration (current-window-configuration)))
+ (package-autoremove)
+ (package-install-selected-packages)
+ (package-upgrade-all)
+ (package-vc-install-selected-packages)
+ (package-vc-upgrade-all)
+ (set-window-configuration window-configuration))
+ (message "Done syncing packages."))
+
;;; Generic Emacs Configuration