[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dape d91fb1ad85 2/6: Extending support for zap notation
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dape d91fb1ad85 2/6: Extending support for zap notation to create zap history |
Date: |
Sun, 10 Nov 2024 09:57:50 -0500 (EST) |
branch: externals/dape
commit d91fb1ad8529b4b1aac15e27c434b0dd7528ae89
Author: Daniel Pettersson <daniel@dpettersson.net>
Commit: Daniel Pettersson <daniel@dpettersson.net>
Extending support for zap notation to create zap history
---
dape.el | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/dape.el b/dape.el
index 83f642d8d0..f9768f34bd 100644
--- a/dape.el
+++ b/dape.el
@@ -528,6 +528,10 @@ Functions and symbols:
((const :tag "Adapter type" :type) string)
((const :tag "Request type launch/attach" :request)
string)))))
+(defcustom dape-config-dash-form-p nil
+ "If ENV PROGRAM ARGS sh like string format is preferred."
+ :type 'boolean)
+
(defcustom dape-default-config-functions
'(dape-config-autoport dape-config-tramp)
"Functions applied on config before starting debugging session.
@@ -5105,12 +5109,26 @@ Where ALIST-KEY exists in `dape-configs'."
(defun dape--config-to-string (key post-eval-config)
"Create string from KEY and POST-EVAL-CONFIG."
- (let ((config-diff (dape--config-diff key post-eval-config)))
+ (pcase-let* ((config-diff (dape--config-diff key post-eval-config))
+ ((map :env :program :args) config-diff)
+ (zap-form-p (and dape-config-dash-form-p
+ (or program (and env (not args))))))
+ (when zap-form-p
+ (cl-loop for key in '(:program :env :args) do
+ (setq config-diff (map-delete config-diff key))))
(concat (when key (format "%s" key))
- (and-let* ((config-diff)
+ (when-let ((config-diff)
(config-str (prin1-to-string config-diff)))
- (format " %s"
- (substring config-str 1 (1- (length config-str))))))))
+ (format " %s" (substring config-str 1 (1- (length config-str)))))
+ (when zap-form-p
+ (concat " -"
+ (cl-loop for (symbol value) on env by #'cddr
+ for name = (substring (symbol-name symbol) 1)
+ concat (format " %s=%s"
+ (shell-quote-argument name)
+ (shell-quote-argument value)))
+ (cl-loop for arg in (cons program (append args nil))
concat
+ (format " %s" (shell-quote-argument arg))))))))
(defun dape--config-ensure (config &optional signal)
"Ensure that CONFIG is executable.
- [elpa] externals/dape updated (5ce71a4cf3 -> 1c84eb81ad), ELPA Syncer, 2024/11/10
- [elpa] externals/dape d91fb1ad85 2/6: Extending support for zap notation to create zap history,
ELPA Syncer <=
- [elpa] externals/dape 42d640ec3a 4/6: Using eval shorthand in dape-config, ELPA Syncer, 2024/11/10
- [elpa] externals/dape 1ec9e76d64 5/6: Bind threads info parallel fetch buffer workaround to local variable, ELPA Syncer, 2024/11/10
- [elpa] externals/dape 313b90e15c 1/6: Improve completion of adapter name in minibuffer, ELPA Syncer, 2024/11/10
- [elpa] externals/dape 3966902cbc 3/6: Remove un-evaluated history, ELPA Syncer, 2024/11/10
- [elpa] externals/dape 1c84eb81ad 6/6: Fix mode-line-misc-info suffix space separator, ELPA Syncer, 2024/11/10