[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dape 5d03bc1212 103/123: Add fn symbol to dape-config f
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dape 5d03bc1212 103/123: Add fn symbol to dape-config for ergonomics of multiple key vals |
Date: |
Tue, 5 Dec 2023 03:58:05 -0500 (EST) |
branch: externals/dape
commit 5d03bc1212c630bc7e04af95178d611804afe3f2
Author: Daniel Pettersson <daniel@dpettersson.net>
Commit: Daniel Pettersson <daniel@dpettersson.net>
Add fn symbol to dape-config for ergonomics of multiple key vals
---
dape.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dape.el b/dape.el
index 71e1913ff3..b82d6a367f 100644
--- a/dape.el
+++ b/dape.el
@@ -60,6 +60,8 @@ configuration. Each configuration, in turn, is a property
list (plist)
where keys can be symbols or keywords.
Symbol Keys (Used by Dape):
+- fn: Function takes config and returns config, used to apply changes
+ to config at runtime.
- command: Shell command to initiate the debug adapter.
- command-args: List of string arguments for the command.
- command-cwd: Working directory for the command.
@@ -2619,7 +2621,7 @@ apply."
"Helper for `dape--config-eval'."
(cl-loop for (key value) on config by 'cddr
append (cond
- ((eq key 'modes) (list key value))
+ ((memql key '(modes fn)) (list key value))
((and for-adapter (not (keywordp key)))
(user-error "Unexpected key %S; lists of things needs be \
arrays [%S ...], if meant as an object replace (%S ...) with (:%s ...)"
@@ -2662,7 +2664,7 @@ arrays [%S ...], if meant as an object replace (%S ...)
with (:%s ...)"
"Create a diff of config KEY and POST-EVAL config."
(let ((base-config (alist-get key dape-configs)))
(cl-loop for (key value) on post-eval by 'cddr
- unless (or (eq key 'modes) ;; Skip modes
+ unless (or (memql key '(modes fn)) ;; Skip modes
(and
;; Does the key exist in `base-config'?
(plist-member base-config key)
@@ -2764,6 +2766,9 @@ See `dape--config-mode-p' how \"valid\" is defined."
nil 'dape-history
initial-contents))
(`(,key ,config) (dape--config-from-string
(substring-no-properties str)))
+ (config (if-let ((fn (plist-get config 'fn)))
+ (funcall fn config)
+ config))
(evaled-config (dape--config-eval key config)))
(setq dape-session-history
(cons (dape--config-to-string key evaled-config)
- [elpa] externals/dape ff3a27dbbd 099/123: Fix a typo, (continued)
- [elpa] externals/dape ff3a27dbbd 099/123: Fix a typo, ELPA Syncer, 2023/12/05
- [elpa] externals/dape ee2ecae446 122/123: Bump version and add FSF copyright line, ELPA Syncer, 2023/12/05
- [elpa] externals/dape b52882f627 123/123: Fix dape-key-prefix type #28, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 5499b7d3d1 114/123: Add fringe breakpoint icon, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 2e8202ad9a 006/123: Small doc fixups, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 73150fca55 063/123: Add paging to dape info variables to reduce UI locking, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 1bef80cf37 068/123: Remove confusing default for dape-main-functions, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 2a4462d36a 073/123: Fix nil-ed plist props in config diff, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 0c6f5513ae 082/123: Fix build warnings, ELPA Syncer, 2023/12/05
- [elpa] externals/dape e5545bbc6f 100/123: Merge pull request #20 from tromey/fix-typo, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 5d03bc1212 103/123: Add fn symbol to dape-config for ergonomics of multiple key vals,
ELPA Syncer <=
- [elpa] externals/dape d68bfebc08 104/123: Workaround for thread :status nil, ELPA Syncer, 2023/12/05
- [elpa] externals/dape bf91567e5e 105/123: Move dape-config `fn' evaluation into none interactive part of dape, ELPA Syncer, 2023/12/05
- [elpa] externals/dape 2bfa7ddaa5 119/123: Add breakpoints mode for fring/margin breakpoint toggling, ELPA Syncer, 2023/12/05
- [elpa] externals/dape de97f32725 061/123: Improve/fix parsing #9, ELPA Syncer, 2023/12/05