forked from FG42/FG42
new depends-on macro
This commit is contained in:
parent
17713d877a
commit
45ee27a35f
20
lib/fpkg.el
20
lib/fpkg.el
|
@ -76,16 +76,24 @@
|
||||||
(fpkg-initialize)))
|
(fpkg-initialize)))
|
||||||
|
|
||||||
|
|
||||||
(defun depends-on1 (pkgname)
|
(defun depends-on (pkgname)
|
||||||
"Install the given PKGNAME if it isn't installed."
|
"Install the given PKGNAME if it isn't installed."
|
||||||
(straight-use-package pkgname))
|
(straight-use-package pkgname))
|
||||||
|
|
||||||
|
(defun fg42-install-extension (name options)
|
||||||
(defmacro depends-on (pkgdesc)
|
"Install given extension NAME with given OPTIONS.")
|
||||||
`(progn
|
|
||||||
(straight-use-package ,@pkgdesc)))
|
|
||||||
|
|
||||||
|
|
||||||
(macroexpand '(depends-on 'sam))
|
(defmacro depends-on2 (name &rest options)
|
||||||
|
"Install given NAME with provided OPTIONS."
|
||||||
|
|
||||||
|
(add-to-list 'options name)
|
||||||
|
(if (string= (car (last (split-string (symbol-name name) "-"))) "extension")
|
||||||
|
`(fg42-install-extension ,options)
|
||||||
|
`(straight-use-package ,options)))
|
||||||
|
|
||||||
|
;; (macroexpand '(depends-on2 go-extension :type git :host github :repo "your-name/el-patch"))
|
||||||
|
;; (macroexpand '(depends-on2 go :type git :host github :repo "your-name/el-patch"))
|
||||||
|
|
||||||
(provide 'fpkg)
|
(provide 'fpkg)
|
||||||
;;; fpkg.el ends here
|
;;; fpkg.el ends here
|
||||||
|
|
Loading…
Reference in New Issue