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

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

[elpa] externals/tempel 20589b8a6a 18/82: Simplify


From: ELPA Syncer
Subject: [elpa] externals/tempel 20589b8a6a 18/82: Simplify
Date: Sun, 9 Jan 2022 20:58:42 -0500 (EST)

branch: externals/tempel
commit 20589b8a6a18a68ed52326f0db0f0d0d1deac495
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Simplify
---
 tempel.el | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/tempel.el b/tempel.el
index 4d4d2bc7e1..1c0b308642 100644
--- a/tempel.el
+++ b/tempel.el
@@ -74,11 +74,7 @@
     (goto-char (point-max))
     (insert "\n)")
     (goto-char (point-min))
-    (let ((templates (read (current-buffer))) result)
-      (while (and templates (symbolp (car templates)))
-        (push (cons (car templates) (seq-take-while #'consp (cdr templates))) 
result)
-        (setq templates (seq-drop-while #'consp (cdr templates))))
-      result)))
+    (read (current-buffer))))
 
 (defun tempel--annotate (templates sep name)
   "Annotate template NAME given the list of TEMPLATES and SEP."
@@ -232,9 +228,12 @@ BEG and END are the boundaries of the modification."
     (unless (equal tempel--modified mod)
       (setq tempel--templates (tempel--load tempel-file)
             tempel--modified mod)))
-  (apply #'append (mapcar #'cdr
-                          (seq-filter (lambda (x) (derived-mode-p (car x)))
-                                      tempel--templates))))
+  (let (result (templates tempel--templates))
+    (while (and templates (symbolp (car templates)))
+      (when (derived-mode-p (car templates))
+        (push (seq-take-while #'consp (cdr templates)) result))
+      (setq templates (seq-drop-while #'consp (cdr templates))))
+    (apply #'append result)))
 
 (defun tempel--region ()
   "Return region bounds."



reply via email to

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