branch: elpa/htmlize
commit a6f9f0786f494220f9ae12141fcca1a527e4335d
Author: Hrvoje Niksic <[email protected]>
Commit: Hrvoje Niksic <[email protected]>
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.