muffinmad / emacs-pdb-capf

Completion-at-point function for pdb (Python debugger)
GNU General Public License v3.0
12 stars 2 forks source link

testing with corfu #1

Open jgarte opened 2 years ago

jgarte commented 2 years ago

Hi,

Have you tried using this package with corfu?

https://github.com/minad/corfu/issues/207

muffinmad commented 2 years ago

Hi,

Yes, it works fine in Emacs 28.

Screenshot 2022-08-02 at 10 18 03

But in nearly recent master Emacs version I'm experiencing issues with pdb-capf itself:

Making completion list...
Error in post-command-hook (completion-in-region--postch): (wrong-type-argument integer-or-marker-p nil)
python-shell-completion-at-point: Wrong type argument: integer-or-marker-p, nil
muffinmad commented 2 years ago

But in nearly recent master Emacs version I'm experiencing issues with pdb-capf itself:

Making completion list...
Error in post-command-hook (completion-in-region--postch): (wrong-type-argument integer-or-marker-p nil)
python-shell-completion-at-point: Wrong type argument: integer-or-marker-p, nil

Nevermind. Somehow pdb-capf hook was not set up for inferior python buffer.

Can confirm, pdb-capf and corfu are working fine together :)

jgarte commented 2 years ago

@muffinmad That's great to hear! Now I just have to debug my setup further to understand what is not working. I'll report back once I'm able to do that.

Question:

Do you have an idea for how we could hook running pytest test-foo.py -k "some_test" --pdb from eshell into gud?

muffinmad commented 2 years ago

Do you have an idea for how we could hook running pytest test-foo.py -k "some_test" --pdb from eshell into gud?

Not sure about eshell, but you can try to use pytest test-foo.py -k "some_test" --pdb as the command to run for M-x pdb

jgarte commented 2 years ago

I can confirm that the above pytest command works for me. Thanks!

Trying to figure out now how to get eglot to complete for me in a gud buffer.

jgarte commented 1 year ago

@muffinmad I still haven't been able to figure this out ;(

Here's my latest config:

https://git.sr.ht/~whereiseveryone/confetti/tree/gnome/item/emacs.el

Would you like to meet up over jitsi to debug this some time?

https://meet.jit.si/help-jgart-debug-emacs-pdb-capf

muffinmad commented 1 year ago

@jgarte Do you use realgud of just M-x pdb from gud?

jgarte commented 1 year ago

I've tried both and they both are not completing for me.

jgarte commented 1 year ago

@muffinmad

Would you be able to share your emacs config to see if I have something (un)set in mine compared to yours?

muffinmad commented 1 year ago

To find out if the pdb-capf is added to completion functions do the following: once in the buffer with pdb prompt, look at the completion-at-point-functions variable (C-h v completion-at-point-functions)

For me the help shows the following:

completion-at-point-functions is a variable defined in ‘minibuffer.el’.

Its value is (pdb-capf comint-completion-at-point t)
Local in buffer *django-commands-server: eddie*; global value is 
jgarte commented 1 year ago

I get this:

image

Its value is (comint-completion-at-point t)
Local in buffer *pdb hello.py shell*; global value is 
(cape-file tags-completion-at-point-function)
jgarte commented 1 year ago

It looks like pdb-capf is not being set when the hook gets run. Any idea why?

My elisp code looks correct like you had recommended:

https://git.sr.ht/~whereiseveryone/confetti/tree/gnome/item/emacs.el#L288

jgarte commented 1 year ago

I'm also adding to completion-at-point-functions here:

https://git.sr.ht/~whereiseveryone/confetti/tree/gnome/item/emacs.el#L227

muffinmad commented 1 year ago

What is the major mode of the *pdb hello.py shell* buffer?

jgarte commented 1 year ago

@muffinmad

image

Looks like comint-mode.

jgarte commented 1 year ago

Its value is ‘comint-mode’

muffinmad commented 1 year ago

In your config the pdb-capf is added to the completion-at-point-functions only in pdb-mode-hook. And it is not added for comint-mode.