tpeacock19 / flymake-vale

GNU General Public License v3.0
29 stars 4 forks source link

Getting "Disabling backend flymake-vale--checker because (void-function when-let)" when trying to use flymake-vale #10

Closed rouilj closed 6 months ago

rouilj commented 6 months ago

Hello:

I hope you can help me get flymake-vale working for a file when in rst-mode. Flymake log reports:

Warning [flymake features.txt]: Disabling backend flymake-vale--checker because (void-function when-let)

and the status line shows (ReST Flymake:! Fill).

This is how I installed it:

I did a raw download from GitHub of flymake-vale.el and placed it on my load-path. I then added:

(require 'flymake-vale)
(add-hook 'text-mode-hook #'flymake-vale-load)
(add-hook 'rst-mode-hook #'flymake-vale-load)
(add-hook 'find-file-hook 'flymake-vale-maybe-load)

to my .emacs.

I loaded the file I wanted to edit, changed to rst-mode and ran M-x flymake-mode and got the status line shown above.

This may be a more basic flymake issue as the flymake log buffer shows additional errors:

Warning [flymake features.txt]: Disabling backend flymake-vale--checker because(void-function when-let)
Warning [flymake features.txt]: Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)

This is with emacs:

GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu)
 of 2020-03-26, modified by Debian

Any ideas? Thanks.

tpeacock19 commented 6 months ago

Oh yes, I need to update some dependencies to address this. Will do so today, thank you for the report.

I am going to update this to depend on Compat. I would suggest adding this to your load-path & requiring it early in your init.el given you are using an older version of emacs.

rouilj commented 6 months ago

I have all of compat installed and called from my .emacs.

Since you still have to do some updates, flymake-vale is still not working, but I do have a change in errors.

Flymake log reports:

Warning [flymake features.txt]: Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)
Warning [flymake reference.txt]: Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)

and the mode line shows: (ReST Flymake:Wait[0 0] Fill). So progress of a sort I guess 8-).

Thanks again for your help.

clarkf commented 6 months ago

Edit: Oops, this seems to be a slightly different issue with a similar manifestation. when-let isn't void, but forward-sentence-function is for me.

I believe the issue is the use of the forward-sentence-function variable, which was added after the current release (37d93975, bug 60623): https://github.com/tpeacock19/flymake-vale/blob/3481d30223a113d2af2f329b7758915811f4ad84/flymake-vale.el#L226-L234

As of emacs 29.3, forward-sentence-function is void, and checking a document with more than one sentence seems to "crash" the backend.

Edit: A workaround seems to be to define forward-sentence-function to point to forward-sentence (i.e. (setq forward-sentence-function #'forward-sentence)), which seems to get everything working.

tpeacock19 commented 6 months ago

I have pushed a commit to require compat as a dependency, and to add a check for forward-sentence-function.

@rouilj flymake-proc-legacy-flymake seems to be what is causing that error. I'm not familiar with what that backend, but this is the closest thing I could find that may help: https://help-gnu-emacs.gnu.narkive.com/ZILQYVL5/disable-flymake-log-about-proc-legacy-flymake

In the meantime, I'm going to bump the minimum emacs version supported by this to 27.1 and close this issue, As I was able to test it with that version and think it's reasonable to support at least 3 major releases. However, if you are unable to upgrade and still have issue feel free to respond here, and I will help as I can.