branch: externals/dape
commit bb54d57fc694ed67f06c95c4e68655b5c9bb1b25
Author: Daniel Pettersson <[email protected]>
Commit: Daniel Pettersson <[email protected]>
Change dape--debug to macro to remove arg evaluation
---
dape.el | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/dape.el b/dape.el
index 63a81bca3b..39e573800f 100644
--- a/dape.el
+++ b/dape.el
@@ -527,21 +527,20 @@ Content-Length: \\([[:digit:]]+\\)\r?\n\
\r?\n"
"Matches debug adapter protocol header.")
-(defun dape--debug (type string &rest objects)
+(defmacro dape--debug (type string &rest objects)
"Prints STRING of TYPE to *dape-debug*.
See `format' for STRING and OBJECTS usage.
See `dape-debug-on' for TYPE information."
- (when (memq type dape--debug-on)
- (with-current-buffer (get-buffer-create "*dape-debug*")
- (setq buffer-read-only t)
- (goto-char (point-max))
- (let ((inhibit-read-only t))
- (insert (concat (propertize (format "[%s]"
- (symbol-name type))
- 'face 'match)
- " "
- (apply 'format string objects))
- "\n")))))
+ `(when (memq ,type dape--debug-on)
+ (let ((objects (list ,@objects)))
+ (with-current-buffer (get-buffer-create "*dape-debug*")
+ (setq buffer-read-only t)
+ (goto-char (point-max))
+ (let ((inhibit-read-only t))
+ (insert (concat (propertize (format "[%s]" (symbol-name ,type))
'face 'match)
+ " "
+ (apply 'format ,string objects))
+ "\n"))))))
(defun dape--live-process (&optional nowarn)
"Get current live process.