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

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

[nongnu] elpa/htmlize a6f9f07 066/134: Decide at each macroexpansion whe


From: ELPA Syncer
Subject: [nongnu] elpa/htmlize a6f9f07 066/134: Decide at each macroexpansion whether to use `lexical-let' or `let'.
Date: Sat, 7 Aug 2021 09:17:08 -0400 (EDT)

branch: elpa/htmlize
commit a6f9f0786f494220f9ae12141fcca1a527e4335d
Author: Hrvoje Niksic <hniksic@gmail.com>
Commit: Hrvoje Niksic <hniksic@gmail.com>

    Decide at each macroexpansion whether to use `lexical-let' or `let'.
    
    This removes the need for explicit eval-and-compile.
---
 htmlize.el | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/htmlize.el b/htmlize.el
index 529fd79..248d59d 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -331,16 +331,13 @@ output.")
   (error "htmlize requires next-single-property-change or \
 next-single-char-property-change")))
 
-(eval-and-compile
-  (if (and (>= emacs-major-version 24)
-           (not running-xemacs)
+(defmacro htmlize-lexlet (&rest letforms)
+  (if (and (boundp 'lexical-binding)
            lexical-binding)
-      (defmacro htmlize-lexlet (&rest stuff)
-        `(let ,@stuff))
-    ;; cl extensions have a lexical-let macro
-    (defmacro htmlize-lexlet (&rest stuff)
-      `(lexical-let ,@stuff)))
-  (put 'htmlize-lexlet 'lisp-indent-function 1))
+      `(let ,@letforms)
+    ;; cl extensions have a macro implementing lexical let
+    `(lexical-let ,@letforms)))
+(put 'htmlize-lexlet 'lisp-indent-function 1)
 
 
 ;;; Transformation of buffer text: HTML escapes, untabification, etc.



reply via email to

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