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

max-lisp-eval-depth problem #138

Open
hajovonta opened this issue Mar 5, 2020 · 9 comments
Open

max-lisp-eval-depth problem #138

hajovonta opened this issue Mar 5, 2020 · 9 comments

Comments

@hajovonta
Copy link

Emacs version: 28.0.50

Sometimes when I open a groovy file, I get "File mode specification error: (error Lisp nesting exceeds 'max-lisp-eval-depth')" error in minibuffer.
Increased the max-lisp-eval-depth to 10000, but that didn't solve the problem.

Tried to debug, and the last function executed before the error was normal-mode, with something like "couldn't load files.el".

Due to the error, I don't get syntax coloring in groovy-mode. But if I M-x normal-mode after the error, I get my file colored (and another error message).

Please help investigating the problem.

@Wilfred
Copy link
Contributor

Wilfred commented Mar 8, 2020

Could you share an example file that has this problem?

@hajovonta
Copy link
Author

This file below produces the error for me if I save it as 'test.groovy' and open it in Emacs.
Sensitive data redacted.

import com.company.ci.common.Context
import static com.company.ci.common.Params.*
import com.company.ci.common.jobname.CommonJobs
import groovy.transform.Field


@Field
Context ctx = new Context(sourceRepo: SourceRepo.REPO,
        buildType: BuildType.RELEASE,
        jenkinsSlave: JenkinsSlave.MY_LABEL,
        scriptName: this.class.name)


freeStyleJob(CommonJobs.SERVER_DEPLOYMENT.name) {
    with ctx.jobSetup()
    parameters ctx.gerritRefspecParam()
    scm ctx.sourceScm(ctx.scm_Gerrit_This_Patchset() + [clean: true])
    publishers {
        with ctx.postBuildSteps(RunPostBuildWhen.ALWAYS) {
            conditionalSteps {
                condition {
                    status('FAILURE','UNSTABLE')
                }
                runner('DontRun')
                steps {
                    with ctx.getDetectedAt()
                }
            }
        }
    }
}

@hajovonta
Copy link
Author

The problem is that the error prevents the mode to run properly, e.g. some hooks and minor modes are not loaded

@hajovonta
Copy link
Author

Strange, but I could make a workaround by evaluating these:

(add-hook 'groovy-mode-hook #'company-mode-hook)
(add-hook 'groovy-mode-hook #'company-mode)

This way it complains about company-mode-hook, but then loads company-mode fine, and I also get syntax coloring. If I leave the company-mode-hook out, then I get neither.

@Wilfred
Copy link
Contributor

Wilfred commented Mar 10, 2020

I'm unable to get an error with that file. Could you try M-x toggle-debug-on-error before opening the file, to get a traceback?

If you can get a traceback, please post it here.

@hajovonta
Copy link
Author

I tried this, but I don't get a Backtrace window. The error is shown in the minibuffer and in the Messages but that's it.

@Wilfred
Copy link
Contributor

Wilfred commented Mar 12, 2020

What else is in your groovy-mode-hook and prog-mode-hook? Can you replicate the issue with emacs -q, loading groovy-mode.el and opening the test file you've shared?

@hajovonta
Copy link
Author

groovy-mode-hook contains:
(inf-groovy-keys company-mode company-mode-hook groovy-mode)
and prog-mode-hook is nil.

I tried the procedure you insisted, but got the following error when trying to load groovy-mode.el:
*** Eval error *** Cannot open load file: No such file or directory, s
I'm sure it's some blatant but I'm not skilled in debugging emacs.

@Wilfred
Copy link
Contributor

Wilfred commented Mar 19, 2020

*** Eval error *** Cannot open load file: No such file or directory, s

Sorry, I should have mentioned. When you start with emacs -q, qou'll need to run M-x eval-buffer on dash.el and s.el first so you have the necessary dependencies.

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