emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/setup 4137cd0 05/10: Give an example of setup-based mac


From: Stefan Monnier
Subject: [elpa] externals/setup 4137cd0 05/10: Give an example of setup-based macros
Date: Wed, 12 May 2021 18:45:55 -0400 (EDT)

branch: externals/setup
commit 4137cd074ac84312e777141353dbc3701472e954
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>

    Give an example of setup-based macros
---
 README.md | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/README.md b/README.md
index 458f6b2..93ae38d 100644
--- a/README.md
+++ b/README.md
@@ -63,6 +63,21 @@ The `setup` macro is autoloaded, and can be used directly.  
The code
 generated by `setup` does not depend on `setup.el`, meaning that your
 initialization file can be byte-compiled more efficiently.
 
+Tip
+---
+
+The first element of a `setup` body can but does not have to be a
+name. That can be exploited to use `setup` in your own macros. I have
+this macro in my personal configuration, when I'm only interested in
+modifying user options:
+
+~~~elisp
+(defmacro setc (&rest args)
+  "Customize user options using ARGS like `setq'."
+  (declare (debug setq))
+  `(setup (:option ,@args)))
+~~~
+
 Bugs
 ----
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]