Add the ->cube macro as a shortcut for single package cubes

This commit is contained in:
Sameer Rahmani 2023-06-01 00:25:05 +01:00
parent 6846577281
commit dbb7415d3e
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
4 changed files with 25 additions and 3 deletions

View File

@ -51,6 +51,18 @@ For more info checkout [[https://github.com/gregsexton/origami.el]]"
(global-origami-mode t)))
(->cube helpful
"Helpful is an alternative to the built-in Emacs help that provides much more contextual information."
:init
(require 'helpful)
:config
(global-set-key (kbd "C-h f") #'helpful-callable)
(global-set-key (kbd "C-h v") #'helpful-variable)
(global-set-key (kbd "C-h k") #'helpful-key)
(global-set-key (kbd "C-h x") #'helpful-command)
(global-set-key (kbd "C-c C-d") #'helpful-at-point))
(defcube fg42/pinentry-cube
"Pinentry cube with setup the =pinentry= program to be used within FG42."
(:title "Pinentry cube"

View File

@ -33,8 +33,6 @@ For more info checkout [[https://github.com/wentasah/meson-mode]]"
:flag mesonbuild
:flag-default t)
(fpkg/use meson-mode
:bind
(("C-c TAB" . origami-toggle-node))
:config
(progn
(when-flag company

View File

@ -44,7 +44,7 @@
(defun fg42/build-docs-for-cube (build-dir cube)
"Build the given CUBE's doc in BUILD-DIR"
"Build the given CUBE's doc in BUILD-DIR."
(let* ((cubes-dir (expand-file-name "site/cubes/" build-dir))
(props (symbol-plist cube))
(docs (plist-get props :docs))

View File

@ -165,5 +165,17 @@ it is to use `fg42/after-cubes' macro.")
,@body)))
(defmacro ->cube (pkg docs &rest body)
"A wrapper to create a cube that use only a PKG.
It passes the BODY to `fpkg/use'."
(declare (indent defun) (doc-string 2))
`(defcube ,(intern (format "fg42/%s-cube" pkg))
,docs
(:title ,(format "%s cube" pkg)
:flag pkg
:flag-default t)
(fpkg/use ,pkg ,@body)))
(provide 'fg42/cube)
;;; cube.el ends here