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-packagewill wrap aprognaround 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-sexpto see how the macro is expanded. You'll see that it is identical for these two examples. – glucas Dec 03 '15 at 04:23prognis needed: https://emacs.stackexchange.com/questions/39172/emacs-lisp-let-with-while – npostavs Mar 03 '18 at 23:58