|
1 | | -;;; srecode/insert.el --- Insert srecode templates to an output stream. |
| 1 | +;;; srecode/insert.el --- Insert srecode templates to an output stream -*- lexical-binding:t -*- |
2 | 2 |
|
3 | 3 | ;; Copyright (C) 2005, 2007-2019 Free Software Foundation, Inc. |
4 | 4 |
|
|
26 | 26 | ;; Manage the insertion process for a template. |
27 | 27 | ;; |
28 | 28 |
|
29 | | -(eval-when-compile |
30 | | - (require 'cl)) ;; for `lexical-let' |
31 | | - |
32 | 29 | (require 'srecode/compile) |
33 | 30 | (require 'srecode/find) |
34 | 31 | (require 'srecode/dictionary) |
@@ -1049,21 +1046,20 @@ template where a ^ inserter occurs." |
1049 | 1046 | ;; which implements the wrap insertion behavior in FUNCTION. The |
1050 | 1047 | ;; maximum valid nesting depth is just the current depth + 1. |
1051 | 1048 | (let ((srecode-template-inserter-point-override |
1052 | | - (lexical-let ((inserter1 sti)) |
1053 | | - (cons |
1054 | | - ;; DEPTH |
1055 | | - (+ (length (oref-default 'srecode-template active)) 1) |
1056 | | - ;; FUNCTION |
1057 | | - (lambda (dict) |
1058 | | - (let ((srecode-template-inserter-point-override nil)) |
1059 | | - (if (srecode-dictionary-lookup-name |
1060 | | - dict (oref inserter1 :object-name)) |
1061 | | - ;; Insert our sectional part with looping. |
1062 | | - (srecode-insert-method-helper |
1063 | | - inserter1 dict 'template) |
1064 | | - ;; Insert our sectional part just once. |
1065 | | - (srecode-insert-subtemplate |
1066 | | - inserter1 dict 'template)))))))) |
| 1049 | + (cons |
| 1050 | + ;; DEPTH |
| 1051 | + (+ (length (oref-default 'srecode-template active)) 1) |
| 1052 | + ;; FUNCTION |
| 1053 | + (lambda (dict) |
| 1054 | + (let ((srecode-template-inserter-point-override nil)) |
| 1055 | + (if (srecode-dictionary-lookup-name |
| 1056 | + dict (oref sti :object-name)) |
| 1057 | + ;; Insert our sectional part with looping. |
| 1058 | + (srecode-insert-method-helper |
| 1059 | + sti dict 'template) |
| 1060 | + ;; Insert our sectional part just once. |
| 1061 | + (srecode-insert-subtemplate |
| 1062 | + sti dict 'template))))))) |
1067 | 1063 | ;; Do a regular insertion for an include, but with our override in |
1068 | 1064 | ;; place. |
1069 | 1065 | (cl-call-next-method))) |
|
0 commit comments