I have seen progn
being used quite a lot as I browse the configuration files of experienced Emacs users. I found this nice explanation of progn
, but what I am really curious about is, what is the benefit of using this function? Take for example this snippet (taken from Sacha Chua's configuration):
(use-package undo-tree
:defer t
:ensure t
:diminish undo-tree-mode
:config
(progn
(global-undo-tree-mode)
(setq undo-tree-visualizer-timestamps t)
(setq undo-tree-visualizer-diff t)))
Is there any major difference between the above configuration and this?
(use-package undo-tree
:defer t
:ensure t
:diminish undo-tree-mode
:config
(global-undo-tree-mode)
(setq undo-tree-visualizer-timestamps t)
(setq undo-tree-visualizer-diff t))
I feel like the first example is somehow cleaner, even though it has more syntax, and my intuition is that there might be some kind of performance boost from using progn
, but I am not sure. Thank you for any insights!
use-package
will wrap aprogn
around your :config forms if it is missing. Try it out: you can put point at the end of a(use-package ...)
and callM-x pp-macroexpand-last-sexp
to see how the macro is expanded. You'll see that it is identical for these two examples.progn
is needed: emacs.stackexchange.com/questions/39172/…