Skip to content

Fix error if god-execute-with-current-bindings deletes buffer#118

Merged
darth10 merged 1 commit intoemacsorphanage:masterfrom
fullmera:dead_buffer_fix
Jul 6, 2020
Merged

Fix error if god-execute-with-current-bindings deletes buffer#118
darth10 merged 1 commit intoemacsorphanage:masterfrom
fullmera:dead_buffer_fix

Conversation

@fullmera
Copy link
Contributor

@fullmera fullmera commented Jul 6, 2020

Currently if a command executed via god-execute-with-current-bindings results in the deletion of the current buffer, an error message is spat out in the minibuffer. This commit updates the cleanup process of god-execute-with-current-bindings to check if the buffer exists and is alive before disabling god-local-mode.

Fixes #117

@darth10 darth10 added the bug label Jul 6, 2020
@darth10
Copy link
Collaborator

darth10 commented Jul 6, 2020

Thanks for reporting and fixing this bug @Drainful!
Would it be possible for you to add a test for this fix?

@fullmera
Copy link
Contributor Author

fullmera commented Jul 6, 2020

I'm not sure how to write a test since the error isn't caught by debug-on-error. It seems like the only artifact of the error is the annoying message in the minibuffer as it goes unhandled. I'm not sure why this is the case; it may have something to do with the error being raised during the function passed as the on-exit parameter of set-transient-map which ultimately ends up added to pre-command-hook.

@darth10
Copy link
Collaborator

darth10 commented Jul 6, 2020

This might be easier to test with ert than with feature-based testing through ecukes.
For now, I'll go ahead and merge it 👍

@darth10 darth10 merged commit 7122a1a into emacsorphanage:master Jul 6, 2020
@darth10
Copy link
Collaborator

darth10 commented Jul 6, 2020

Thanks for the contribution @Drainful! 💯

@fullmera
Copy link
Contributor Author

fullmera commented Jul 6, 2020

NP! thanks for your work on this awesome package. I feel like god-mode has filled a massive hole in my emacs config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

Error message when god-execute-with-current-bindings deletes the current buffer

2 participants