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

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

[elpa] externals/dape a8b810f47b 01/10: Rework dape-commands into dape-c


From: ELPA Syncer
Subject: [elpa] externals/dape a8b810f47b 01/10: Rework dape-commands into dape-command
Date: Sun, 14 Jan 2024 18:57:41 -0500 (EST)

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

    Rework dape-commands into dape-command
    
    Still not really happy about the outcome but maybe it's feasible to
    only have one command per dir local
---
 dape.el | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/dape.el b/dape.el
index 22a19fe45a..356a192f76 100644
--- a/dape.el
+++ b/dape.el
@@ -359,14 +359,14 @@
                          ((const :tag "Adapter type" :type) string)
                          ((const :tag "Request type launch/attach" :request) 
string)))))
 
-(defcustom dape-commands nil
-  "Default commands for `dape' completion.
+(defcustom dape-command nil
+  "Initial contents for `dape' completion.
 Sometimes it is useful for files or directories to supply local values
 for this variable.
 
 Example value:
-\((codelldb-cc :program \"/home/user/project/a.out\"))"
-  :type '(repeat sexp))
+\(codelldb-cc :program \"/home/user/project/a.out\")"
+  :type 'sexp)
 
 ;; TODO Add more defaults, don't know which adapters support
 ;;      sourceReference
@@ -3786,11 +3786,7 @@ Initial contents defaults to valid configuration if 
there is only one
 or last mode valid history item from this session.
 
 See `dape--config-mode-p' how \"valid\" is defined."
-  (let* ((from-dape-commands
-          (cl-loop for (key . config) in dape-commands
-                   when (dape--config-ensure config)
-                   collect (dape--config-to-string key config)))
-         (suggested-configs
+  (let* ((suggested-configs
           (cl-loop for (key . config) in dape-configs
                    when (and (dape--config-mode-p config)
                              (dape--config-ensure config))
@@ -3798,7 +3794,9 @@ See `dape--config-mode-p' how \"valid\" is defined."
          (initial-contents
           (or
            ;; Take `dape-command' if exist
-           (car from-dape-commands)
+           (when dape-command
+             (dape--config-to-string (car dape-command)
+                                     (cdr dape-command)))
            ;; Take first valid history item
            (seq-find (lambda (str)
                        (ignore-errors
@@ -3814,8 +3812,7 @@ See `dape--config-mode-p' how \"valid\" is defined."
           dape--minibuffer-cache nil)
     (minibuffer-with-setup-hook
         (lambda ()
-          (setq-local dape--minibuffer-suggestions
-                      (append from-dape-commands suggested-configs)
+          (setq-local dape--minibuffer-suggestions suggested-configs
                       comint-completion-addsuffix nil
                       resize-mini-windows t
                       max-mini-window-height 0.5



reply via email to

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