]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/tempo.el: Remove left over uses of the dynbind dialect
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 8 Sep 2023 23:22:16 +0000 (19:22 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 8 Sep 2023 23:23:08 +0000 (19:23 -0400)
* lisp/tempo.el (tempo-define-template): Use a real closure.
(tempo-insert, tempo-build-collection): Use lexical scoping.

lisp/tempo.el

index 7e4f5e50e470cd42faabb2f037643bbb9e67bff2..7d8d17cfebc540c58fce82bb9f8d7d8ea8b81771 100644 (file)
@@ -271,14 +271,13 @@ The elements in ELEMENTS can be of several types:
                                       name)))
         (command-name template-name))
     (set template-name elements)
-    (fset command-name (list 'lambda (list '&optional 'arg)
-                            (or documentation
-                                (concat "Insert a " name "."))
-                            (list 'interactive "*P")
-                            (list 'tempo-insert-template (list 'quote
-                                                               template-name)
-                                  (list 'if 'tempo-insert-region
-                                        (list 'not 'arg) 'arg))))
+    (fset command-name (lambda (&optional arg)
+                        (:documentation
+                         (or documentation (concat "Insert a " name ".")))
+                        (interactive "*P")
+                        (tempo-insert-template template-name
+                                               (if tempo-insert-region
+                                                   (not arg) arg))))
     (and tag
         (tempo-add-tag tag template-name taglist))
     command-name))
@@ -386,7 +385,7 @@ possible."
                             (open-line 1)))
        ((null element))
        (t (tempo-insert (or (tempo-is-user-element element)
-                            (eval element))
+                            (eval element t))
                         on-region))))
 
 ;;;
@@ -632,7 +631,7 @@ If `tempo-dirty-collection' is nil, the old collection is reused."
                                        ; If the format for
                                        ; tempo-local-tags changes,
                                        ; change this
-                                 (eval (car tag-list)))
+                                 (eval (car tag-list) t))
                               tempo-local-tags))))
     (setq tempo-dirty-collection nil)))