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

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

[elpa] externals/dape 66fb9d7e19 1/8: Extend 'fn to take lists of functi


From: ELPA Syncer
Subject: [elpa] externals/dape 66fb9d7e19 1/8: Extend 'fn to take lists of functions as well
Date: Thu, 14 Dec 2023 15:57:40 -0500 (EST)

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

    Extend 'fn to take lists of functions as well
---
 dape.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/dape.el b/dape.el
index 92c190a63b..99cf7fc014 100644
--- a/dape.el
+++ b/dape.el
@@ -206,8 +206,9 @@ 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.
+- fn: Function or list of functions, takes config and returns config.
+  If list functions are applied in order. Used for hiding unnecessary
+  configuration details from config history.
 - ensure: Function to ensure that adapter is available.
 - command: Shell command to initiate the debug adapter.
 - command-args: List of string arguments for the command.
@@ -1836,8 +1837,13 @@ Use SKIP-COMPILE to skip compilation."
               (with-current-buffer buffer
                 (let ((inhibit-read-only t))
                   (erase-buffer)))))
-          (when-let ((fn (plist-get config 'fn)))
-            (setq config (funcall fn (copy-tree config))))
+          (when-let ((fn (plist-get config 'fn))
+                     (fns (or (and (functionp fn) (list fn))
+                              (and (listp fn) fn))))
+            (setq config
+                  (seq-reduce (lambda (config fn)
+                                (funcall fn config))
+                              fns (copy-tree config))))
           (when-let ((ensure (plist-get config 'ensure)))
             (funcall ensure (copy-tree config)))
           (cond



reply via email to

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