new fancy config

This commit is contained in:
Grigory Shipunov 2023-05-01 11:02:23 +02:00
parent b9188d14cc
commit b45712de26
Signed by: 0xa
GPG key ID: 91FA5E5BF9AA901C
7 changed files with 254 additions and 457 deletions

20
lisp/oxa/utils.el Normal file
View file

@ -0,0 +1,20 @@
;;; 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)))
(provide 'oxa/utils)