New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A Useful Recipe: Interactively inspect what form
use-package
expands to under various scenarios -- minimal expansion, compilation etc.
#1056
Labels
Comments
emacksnotes
changed the title
Command to inspect what form
A Useful Recipe: Interactively inspect what form Jun 11, 2023
use-package
expands to under various scenarios -- minimal expansion, compilation etc.use-package
expands to under various scenarios -- minimal expansion, compilation etc.
Here is another variation of the above (use-package use-package
:config (advice-add 'pp-macroexpand-last-sexp :around
(defun pp-macroexpand-last-sexp--around
(orig-fun &rest orig-args)
(pcase-let*
((`(,arg)
orig-args)
(sexp (pp-last-sexp))
(env (append
(when (eq 'use-package (car sexp))
`((byte-compile-current-file ,(yes-or-no-p "Byte compilation"))
(use-package-expand-minimally ,(yes-or-no-p "Minimal")))))))
(eval `(let ,env
(if ',arg
(save-excursion
(insert "\n\n")
(apply ',orig-fun ',orig-args))
(apply ',orig-fun ',orig-args))))))))
|
emacksnotes
changed the title
A Useful Recipe: Interactively inspect what form
A Useful Recipe: Interactively inspect what form Jun 11, 2023
use-package
expands to under various scenarios -- minimal expansion, compilation etc.use-package
expands to under various scenarios -- minimal expansion, compilation etc.
emacksnotes
changed the title
A Useful Recipe: Interactively inspect what form
A Useful Recipe: Interactively inspect what Jun 11, 2023
use-package
expands to under various scenarios -- minimal expansion, compilation etc. form
use-package
expands to under various scenarios -- minimal expansion, compilation etc.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not a issue but a recipe ...
I wonder what variables apart from
byte-compile-current-file
affects the macroexpansion ofuse-package
. If there are other such variables, they can be prompted for and plugged in to theenv
bindings below.Slightly formalized the goings on in #1032
Create a quick binding for the above command
Insert the following in to
*scratch*
bufferPut the cursor after any of the above two forms and do
C-u C-c C-c
and see what happens ...For example, for
byte compilation
andminimal
scenario I getFor
no byte-compiled
, andminimal
scenario, I getThe text was updated successfully, but these errors were encountered: