wbolster / emacs-python-pytest

run pytest inside emacs
BSD 3-Clause "New" or "Revised" License
147 stars 25 forks source link

Common shortcuts in run buffer #47

Closed flub closed 2 years ago

flub commented 3 years ago

Hi Wouter,

Really nice package!

It would be nice to have some common keyboard bindings in the test buffer. The mains ones I'm missing are:

If you're not against this for some reason I could even try and see if i can learn some elisp myself to add this in a PR, it doesn't sound like it should be overly complicated but who knows.

wbolster commented 3 years ago

hi,

i have similar shortcuts in my personal config for exactly those operations (though i use evil-mode) so i certainly see the value of having these!

i think this should do the trick?

doesn't sound like too much work to add those, so please let me know what you think!

wbolster commented 3 years ago

(btw ‘de vork’ reminds me of a ‘frietkot’ of the same name from when i was a small kid 😁)

flub commented 3 years ago

Looking through e.g. deadgrep's code I see they derive from special-mode which binds q to quit-window rather than bury-buffer. I think this has the benefit of accepting the prefix argument which kills the window.

I likewise looked tried to look at how e.g. cargo-process-mode binds g and it seems to end up with a function (recompile) taking &optional edit-command which allows you to edit the command before re-running if you use C-u g. I realise this is now also a feature request to python-pytest-repeat and am not fully sure it makes sense, but would it make sense to add prefix-support to python-pytest-repeat as well?

(heh, I never thought of "de vork". not bad :) )

wbolster commented 3 years ago

i think python-pytest-repeat already does that?

Signature
(python-pytest-repeat)

Documentation
Run pytest with the same argument as the most recent invocation.

With a prefix ARG, allow editing.

or do you mean something else?

flub commented 3 years ago

oh, indeed. no that is exactly what i had in mind but didn't read correctly. apologies.

juergenhoetzel commented 2 years ago
  • mapping q to bury-buffer

  • mapping g to python-pytest-repeat

Also started with this setup but this will break pdb if you start the debugger.

62 Also makes the other useful features of compilation mode available, like:

M-p (compilation-previous-error N) M-n (compilation-next-error N)