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

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

[elpa] externals/dape 8e855d804f 2/2: Actually remove dep on plistp


From: ELPA Syncer
Subject: [elpa] externals/dape 8e855d804f 2/2: Actually remove dep on plistp
Date: Wed, 13 Dec 2023 06:57:41 -0500 (EST)

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

    Actually remove dep on plistp
---
 dape.el | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/dape.el b/dape.el
index 2bc6f659a9..92c190a63b 100644
--- a/dape.el
+++ b/dape.el
@@ -3142,6 +3142,12 @@ Used to derive initial-contents in `dape--read-config'.")
 (defvar dape--minibuffer-suggested-configs nil
   "Suggested configurations in minibuffer.")
 
+(defun dape--plistp (object)
+  "Non-nil if and only if OBJECT is a valid plist."
+  (and-let* (((listp object))
+             (len (length object))
+             ((zerop (% len 2))))))
+
 (defun dape--config-eval-value (value &optional skip-function for-adapter)
   "Evaluate dape config VALUE.
 If SKIP-FUNCTION and VALUE is an function it is not invoked.
@@ -3150,10 +3156,7 @@ apply."
   (cond
    ((functionp value) (or (and skip-function value)
                           (funcall-interactively value)))
-   ;; plist
-   ((and-let* (((listp value))
-               (len (length value))
-               ((zerop (% len 2)))))
+   ((dape--plistp value)
     (dape--config-eval-1 value skip-function for-adapter))
    ((vectorp value) (cl-map 'vector
                             (lambda (value)
@@ -3204,7 +3207,7 @@ arrays [%S ...], if meant as an object replace (%S ...) 
with (:%s ...)"
           str (substring str (length (symbol-name name))))
     (unless (string-empty-p str)
       (setq read-config (read (format "(%s)" str))))
-    (unless (plistp read-config)
+    (unless (dape--plistp read-config)
       (user-error "Bad options format, see `dape-configs'"))
     (cl-loop for (key value) on read-config by 'cddr
              do (setq base-config (plist-put base-config key value)))
@@ -3262,9 +3265,9 @@ arrays [%S ...], if meant as an object replace (%S ...) 
with (:%s ...)"
                     dape--minibuffer-suggested-configs))))
      ;; Complete config args
      ((and (alist-get key dape-configs)
-           (or (and (not (plistp args))
+           (or (and (not (dape--plistp args))
                     symbol-bounds)
-               (and (plistp args)
+               (and (dape--plistp args)
                     whitespace-bounds)))
       (let ((args (if symbol-bounds
                       (nreverse (cdr (nreverse args)))



reply via email to

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