waymondo / frog-jump-buffer

The fastest buffer-jumping Emacs lisp package around
157 stars 5 forks source link

Gracefully handle ESC (aka Quit signal) #21

Closed whyfarer closed 3 years ago

whyfarer commented 4 years ago

I just start using frog-jump-buffer and I'm quite enjoying it. Thanks!

Issue:

If I invoke frog-jump-buffer and then ESC out of it, I trigger the following error:


  signal(error ("Quit"))
  error("Quit")
  frog-jump-buffer()
  funcall-interactively(frog-jump-buffer)
  call-interactively(frog-jump-buffer nil nil)
  command-execute(frog-jump-buffer)``` 

It would be nice if hitting ESC didn't trigger the debugger and instead gracefully exitted the buffer menu (without any buffer change).
waymondo commented 3 years ago

Sorry for not looking at this for so long. I'm not opposed to adding support for ESC to be bound to dismiss the menu by default, as C-g does.

I'm not sure why pressing ESC would trigger the debugger for you however. Do you have (toggle-debug-on-error) enabled? Is there any other relevant config you can share?

whyfarer commented 3 years ago

Unfortunately, looks like I deleted frog-jump-buffer from my config since hitting this error all the time was too painful for me. I no longer have any idea how I had it setup. I don't think any other parts of my config would have contributed to unusual esc behavior though

waymondo commented 3 years ago

If you never set debug-on-error, which is not enabled in Emacs by default, the fallback of (error "Quit") will end up dismissing the menu like you were desiring.

Ideally this would be gracefully handled even if you are opting into the debugger behavior though.

waymondo commented 3 years ago

Just to follow up, I pushed a commit to bypass triggering the debugger when it is enabled on pressing ESC.