use straight.el for package management

This commit is contained in:
Grigory Shipunov 2023-05-04 15:31:50 +02:00
parent 220f79481a
commit 0336e986eb
Signed by: 0xa
GPG key ID: 91FA5E5BF9AA901C
5 changed files with 34 additions and 35 deletions

View file

@ -1,18 +1,3 @@
;;; Package management
(require 'package)
(defvar oxa/package-archive-refreshed nil)
(defun oxa/refresh-archive ()
(when (not oxa/package-archive-refreshed)
(package-refresh-contents)
(setq oxa/package-archive-refreshed t)))
;; ensure package
(defun oxa/insure (package)
(when (not (package-installed-p package))
(oxa/refresh-archive)
(package-install package)))
;; Macro to simplify setting mode-local vars
(defmacro oxa/hook (hook-name &rest body)
`(add-hook ',hook-name '(lambda nil ,@body)))