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

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

[elpa] externals/dape bb54d57fc6 088/123: Change dape--debug to macro to


From: ELPA Syncer
Subject: [elpa] externals/dape bb54d57fc6 088/123: Change dape--debug to macro to remove arg evaluation
Date: Tue, 5 Dec 2023 03:58:03 -0500 (EST)

branch: externals/dape
commit bb54d57fc694ed67f06c95c4e68655b5c9bb1b25
Author: Daniel Pettersson <daniel@dpettersson.net>
Commit: Daniel Pettersson <daniel@dpettersson.net>

    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.



reply via email to

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