Skip to content

Commit

Permalink
Use aliases for :exordium-force-elpa use-package extension
Browse files Browse the repository at this point in the history
Seems like a shared practice, at least straight.el and Elpaca are using this
technique.
  • Loading branch information
pkryger committed Dec 12, 2024
1 parent 7b4feba commit c29b31c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modules/init-force-elpa.el
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
:autoload (use-package-only-one
use-package-process-keywords)))

(defun use-package-normalize/:exordium-force-elpa (_name keyword args)
(defun exordium--use-package-force-elpa-normalize (_name keyword args)
; checkdoc-params: (keyword args)
"Allow either a single string or a single symbol."
(use-package-only-one (symbol-name keyword) args
Expand Down Expand Up @@ -116,7 +116,7 @@
name (error-message-string err))
:error))))))

(defun use-package-handler/:exordium-force-elpa (name _keyword archive-name rest state)
(defun exordium--use-package-handler-force-elpa (name _keyword archive-name rest state)
; checkdoc-params: (rest state)
"Pin package NAME to ELPA archive ARCHIVE-NAME and install it from there.
Installation and pinning only hapens when the package is a
Expand All @@ -138,6 +138,12 @@ see Info node `(emacs) Package Installation'."
(push force-elpa-form body)) ; or else wait until runtime.
body))

(defalias 'use-package-normalize/:exordium-force-elpa
#'exordium--use-package-force-elpa-normalize)

(defalias 'use-package-handler/:exordium-force-elpa
#'exordium--use-package-handler-force-elpa)

(eval-after-load 'use-package-core
'(add-to-list 'use-package-keywords :exordium-force-elpa))

Expand Down

0 comments on commit c29b31c

Please sign in to comment.