Skip to content

Commit 0c08964

Browse files
committed
README.md: update
1 parent 4ca646e commit 0c08964

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,19 @@ pressing the wrong prefix.
250250
Note that it does not make sense to define a single amaranth head, so this color can only
251251
be assigned to the body. An amaranth body will always have some amaranth heads and some
252252
blue heads (otherwise, it's impossible to exit), no reds.
253+
254+
## Generate simple lambdas in-place:
255+
256+
Since version `0.9.0` it's possible to pass a single sexp instead of a function name or a lambda
257+
to a head. This sexp will be wrapped in an interactive lambda. Here's an example:
258+
259+
```cl
260+
(defhydra hydra-launcher (:color blue)
261+
"Launch"
262+
("h" man "man")
263+
("r" (browse-url "http://www.reddit.com/r/emacs/") "reddit")
264+
("w" (browse-url "http://www.emacswiki.org/") "emacswiki")
265+
("s" shell "shell")
266+
("q" nil "cancel"))
267+
(global-set-key (kbd "C-c r") 'hydra-launcher/body)
268+
```

0 commit comments

Comments
 (0)