[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/inspector f059ce9ae3 3/4: tree-inspector-tests: New mac
From: |
ELPA Syncer |
Subject: |
[elpa] externals/inspector f059ce9ae3 3/4: tree-inspector-tests: New macro doesn't work |
Date: |
Fri, 16 Sep 2022 17:57:49 -0400 (EDT) |
branch: externals/inspector
commit f059ce9ae31a20f5e2dabfaaffd8158e99842113
Author: Mariano Montone <marianomontone@gmail.com>
Commit: Mariano Montone <marianomontone@gmail.com>
tree-inspector-tests: New macro doesn't work
---
tree-inspector-tests.el | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/tree-inspector-tests.el b/tree-inspector-tests.el
index 2103db949b..38b4efeada 100644
--- a/tree-inspector-tests.el
+++ b/tree-inspector-tests.el
@@ -47,17 +47,13 @@
(defmacro tree-inspector-tests--with-tree-inspector-contents
(var-and-object &rest body)
- "Bind VAR to the inspector's description of EXP then run BODY.
-
-\(fn (VAR EXP) BODY...)"
- (declare (indent 1) (debug ((sexp form) body)))
- ;; FIXME: Maybe instead of a macro, you just want to define
- ;; a `tree-inspector--to-string' function.
- `(let ((,(car var-and-object)
- (with-current-buffer (tree-inspector-inspect ,(cadr var-and-object))
- (buffer-string)
- (kill-current-buffer))))
- ,@body))
+ "Bind VAR to the contents of the buffer, resulting of inspecting OBJECT with
the tree-inspector."
+ (let ((buffer (gensym "buffer")))
+ `(let ((,buffer (tree-inspector-inspect ,(car (last var-and-object)))))
+ (with-current-buffer ,buffer
+ (let ((,(car var-and-object) (buffer-string)))
+ (kill-current-buffer)
+ ,@body)))))
(defun tree-inspector-tests-run ()
"Run tree-inspector tests."