branch: externals/tempel
commit 48712530f894a9d948d46e1a36eed7b941113234
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    README: Improve tempel-include
---
 README.org | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 7863de7f3e..4fa80e2636 100644
--- a/README.org
+++ b/README.org
@@ -362,11 +362,10 @@ include templates by name in another template.
 
 #+begin_src emacs-lisp
 (defun tempel-include (elt)
-  (when (eq (car-safe elt) 'i)
-    (if-let* ((template (alist-get (cadr elt) (tempel--templates))))
-        (cons 'l template)
-      (message "Template %s not found" (cadr elt))
-      nil)))
+  (pcase elt
+    (`(i ,inc)
+     (cons 'l (or (alist-get inc (tempel--templates))
+                  (error "Template %s not found" inc))))))
 (add-to-list 'tempel-user-elements #'tempel-include)
 #+end_src
 

Reply via email to