Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent infinite recursion when displaying a warning. #1089

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

phst
Copy link
Contributor

@phst phst commented Jan 7, 2021

If the Warnings buffer has auto-fill enabled and we're about to print the
warning, display-warning' would loop back here through newline' and
`self-insert-command', causing infinite recursion.

I haven't been able to reproduce this in a noninteractive unit test,
unfortunately, but the issue happens in interactive mode whenever
yas--original-auto-fill-function' is nil and auto-fill-mode' is enabled in
the Warnings buffer.

  • yasnippet.el (yas--auto-fill): Disable `auto-fill-mode' in the Warnings
    buffer as well.

If the *Warnings* buffer has auto-fill enabled and we're about to print the
warning, `display-warning' would loop back here through `newline' and
`self-insert-command', causing infinite recursion.

I haven't been able to reproduce this in a noninteractive unit test,
unfortunately, but the issue happens in interactive mode whenever
`yas--original-auto-fill-function' is nil and `auto-fill-mode' is enabled in
the *Warnings* buffer.

* yasnippet.el (yas--auto-fill): Disable `auto-fill-mode' in the *Warnings*
buffer as well.
@joaotavora
Copy link
Owner

Hi @phst , I'm running a little short on maintainership here. As such, I don't understand the problem. I did take a look at the patch and it looks kind of strange. Wouldn't a let binding solve the problem? Anyway, I don't have more info for you, sorry. @npostavs would be the person to ask.

@phst
Copy link
Contributor Author

phst commented Feb 28, 2021

Wouldn't a let binding solve the problem?

What kind of let binding would you suggest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants