emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] New package: dape


From: Philip Kaludercic
Subject: Re: [ELPA] New package: dape
Date: Sat, 14 Oct 2023 14:54:32 +0000

Daniel Pettersson <daniel@dpettersson.net> writes:

> On Fri, Oct 13, 2023 at 2:24 PM Philip Kaludercic <philipk@posteo.net> wrote:
>> Very interesting!
> Thank you for your interest :)

I have tried to try it out right now, but because I've never used DAP
before, I am not sure how to get it running properly.  Nevertheless, I
think it would be useful to have something along these lines:

diff --git a/dape.el b/dape.el
index 3b27104..e24b0ea 100644
--- a/dape.el
+++ b/dape.el
@@ -2320,22 +2320,24 @@ If SKIP-FUNCTIONS function values are not called during 
evaluation."
 
 (defun dape--read-config ()
   "Read config name and options."
-  (let ((candidate
-         (completing-read "Dape config: "
-                          (append
-                           (mapcan
-                            (lambda (name-config)
-                              (let* ((config (cdr name-config))
-                                     (modes (plist-get config 'modes)))
-                                (when (apply 'provided-mode-derived-p 
major-mode modes)
-                                  (list (car name-config)))))
-                            dape-configs)
-                           dape--config-history)
-                          nil nil nil 'dape-history)))
-    (if-let ((config
-              (alist-get (intern candidate) dape-configs)))
-        (list (intern candidate) config)
-      (dape--config-from-string candidate))))
+  (if (null dape-configs)
+      (customize-variable 'dape-configs)
+    (let ((candidate
+           (completing-read "Dape config: "
+                            (append
+                             (mapcan
+                              (lambda (name-config)
+                               (let* ((config (cdr name-config))
+                                       (modes (plist-get config 'modes)))
+                                  (when (apply 'provided-mode-derived-p 
major-mode modes)
+                                    (list (car name-config)))))
+                              dape-configs)
+                             dape--config-history)
+                            nil nil nil 'dape-history)))
+      (if-let ((config
+               (alist-get (intern candidate) dape-configs)))
+          (list (intern candidate) config)
+       (dape--config-from-string candidate)))))
 
 ;;; Hover
 
Another interesting idea to pursue might be to have modular UIs.
Instead of splitting up the current Emacs frame, I think a minimalist,
more edebug-like interface would be nice, where variable values could be
displayed using overlays instead of having a separate buffer. 

>> Here are a few comments and suggestions I found from a brief skim over
>> the code:
> I made some updates based on your suggestions and added a todo for
> Compat. 

Note that you don't need to add Compat just for `defvar-keymap', as you
could also just use the traditional method of defining a keymap instead:

--8<---------------cut here---------------start------------->8---
(defvar dape-global-map
  (let ((map (make-sparse-keymap)))
    (define-key map "d" #'dape)
    ;; ...
    map))
--8<---------------cut here---------------end--------------->8---

>         Couldn't bring myself to fix all of the checkdoc stuff, but made
> some improvments.

It is not urgent or in any way blocking inclusion to GNU ELPA, it is
just something I think one should keep in mind in the long-term to make
maintaining and contributing to the package easier.

>> Also, sorry for bringing this up, but how married are you to the name?
> I'm not overly attached to it. What are your objections? And do you have
> any suggestions? I find it quite difficult to name things like this.

It just doesn't say that much, and I don't know if it is intended, but
the usual way I would read/pronounce it (rhyming with cape) wouldn't
immediately signal any relation to DAP.  Note that you can use (elisp)
Shorthands to avoid writing out a longer name inside the file, in case a
longer name like debuger-adapter.  It seems there is no package by the
name of "dbg"?  If we are not interested in a self-descriptive and
memorable name, and would want to create a parallel to Eglot (IIRC Emacs
polyGLOT), perhaps something like based on "Emacs Debugger" (Egger?
Ebugger?  Edebugger?) might be possible as well.

reply via email to

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