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

Lisp nesting exceeds ‘max-lisp-eval-depth’ error #169

Open
galeo opened this issue Oct 17, 2020 · 3 comments
Open

Lisp nesting exceeds ‘max-lisp-eval-depth’ error #169

galeo opened this issue Oct 17, 2020 · 3 comments

Comments

@galeo
Copy link

galeo commented Oct 17, 2020

When trying to call functionjit-lock-fontify-now, this errror will occur.

Here is the backtrace log:
Debugger entered--Lisp error: (error "Lisp nesting exceeds ‘max-lisp-eval-depth’")
  #f(compiled-function (matched names) #)(nil #)
  #f(compiled-function (elt) #)(#)
  mapc(#f(compiled-function (elt) #) (# #))
  seq-do(#f(compiled-function (elt) #) (# #))
  seq-reduce(#f(compiled-function (matched names) #) (# #) nil)
  #f(compiled-function (pos limit) #)(7758 18354)
  swift-mode:font-lock-match-expr(18354 #f(compiled-function (pos limit) #))
  swift-mode:font-lock-match-expr(18354 #f(compiled-function (pos limit) #))
  swift-mode:font-lock-match-expr(18354 #f(compiled-function (pos limit) #))
  swift-mode:font-lock-match-expr(18354 #f(compiled-function (pos limit) #))
  ...
  ....[lots of same lines]...
  ....
  swift-mode:font-lock-match-expr(18354 #f(compiled-function (pos limit) #))
  swift-mode:font-lock-match-expr(18354 #f(compiled-function (pos limit) #))
  swift-mode:font-lock-match-expr(18354 #f(compiled-function (pos limit) #))
  swift-mode:font-lock-match-builtin-enum-case-names(18354)
  font-lock-fontify-keywords-region(1519 18354 nil)
  font-lock-default-fontify-region(1519 18354 nil)
  font-lock-fontify-region(1519 18354)
  #f(compiled-function (fun) #)(font-lock-fontify-region)
  run-hook-wrapped(#f(compiled-function (fun) #) font-lock-fontify-region)
  jit-lock--run-functions(1519 18354)
  jit-lock-fontify-now()

Restart emacs, and when it tries to restore the previously opened swift file, it will freeze. By executing the C-g key serveral times, it will return to normal, and there will be the following output in *Messages* buffer:

Error during redisplay: (internal--syntax-propertize 1442) signaled (quit)
Error during redisplay: (internal--syntax-propertize 4000) signaled (quit)
Error during redisplay: (internal--syntax-propertize 6042) signaled (quit)
Error during redisplay: (internal--syntax-propertize 8248) signaled (quit)
Error during redisplay: (internal--syntax-propertize 10546) signaled (quit)
Error during redisplay: (internal--syntax-propertize 12685) signaled (quit)
Error during redisplay: (internal--syntax-propertize 14710) signaled (quit)
Error during redisplay: (internal--syntax-propertize 16795) signaled (quit)
@taku0
Copy link
Member

taku0 commented Oct 17, 2020

Thank you for reporting. Fixed by 5597eaf, hopefully.
The fix will soon be deployed to MELPA in few days. Could you try it from MELPA or master branch?

@galeo
Copy link
Author

galeo commented Oct 17, 2020

Thanks for the fix. It works well when trying to call jit-lock-fontify-now. However, emacs still freezes when trying to restore the previously opened swift file at startup. Act as before, the *Messages* buffer will have a slight difference in output:

Error during redisplay: (internal--syntax-propertize 1437) signaled (quit)
Error during redisplay: (internal--syntax-propertize 3799) signaled (quit)
Error during redisplay: (internal--syntax-propertize 5863) signaled (quit)
Error during redisplay: (internal--syntax-propertize 7962) signaled (quit)
Error during redisplay: (internal--syntax-propertize 10068) signaled (quit)
Error during redisplay: (internal--syntax-propertize 12188) signaled (quit)
Error during redisplay: (internal--syntax-propertize 14213) signaled (quit)
Error during redisplay: (internal--syntax-propertize 16298) signaled (quit)

The swift file used for testing is the same. I don't know how to debug this problem.

@taku0
Copy link
Member

taku0 commented Oct 17, 2020

I guess font-locking is just slow. I have no idea how to improve it.

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