Skip to content

Emacs 25+, scan-sexp with standard syntax table causes infloop in syntax propertize #1315

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

Closed
npostavs opened this issue May 4, 2016 · 5 comments

Comments

@npostavs
Copy link

npostavs commented May 4, 2016

This is a minimal example reduced from joaotavora/yasnippet#687.

In a git checkout of lates master (5d58314) emacs -Q -L . -l haskell-autoloads -l synprop-bug.el causes an infinite loop. After hitting C-g, *Messages* contains Error during redisplay: (internal--syntax-propertize 6) signaled (quit). synprop-bug.el contains:

(switch-to-buffer "hh")
(haskell-mode)
(erase-buffer)
(insert "{-# foo #-}")
(with-syntax-table (standard-syntax-table)
  (scan-sexps 5 1))

This doesn't happen in Emacs 24.5, so it may be a bug in Emacs.

@gracjan
Copy link
Contributor

gracjan commented May 4, 2016

Hmm, even if haskell-propertize would not hang I do not see it producing correct result when syntax-table is not the one it expects.

Then I do not see why yasnippets try to use different syntax table than is defined in the buffer. What is the point of messing with syntax table?

@npostavs
Copy link
Author

npostavs commented May 4, 2016

Because it's parsing yasnippet syntax, which is independent of the major mode's syntax. So it looks like the question is why does yasnippet's temporary syntax-table manipulation affect the syntax propertize function in Emacs 25, but not earlier? I will open an Emacs bug.

EDIT: Emacs bug #23443

@gracjan
Copy link
Contributor

gracjan commented May 4, 2016

Great. Thanks.

@npostavs
Copy link
Author

The conclusion from the Emacs bug discussion is that it's expected behaviour, I will fix this in yasnippet (joaotavora/yasnippet#695)

@gracjan
Copy link
Contributor

gracjan commented May 12, 2016

Good, thanks.

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

No branches or pull requests

2 participants