0

I install ESS following these directions, adding these to ~/.emacs:

(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/"))
(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/"))
(package-initialize)

then typing M-x package-install RET ess RET, and adding this to ~/.emacs as well:

(require 'ess-site)

Now when I open an R file in Emacs, I get this message in a buffer:

Warning (flymake): Disabling backend ess-r-flymake because (error Cannot find program ’R’)
Warning (flymake): Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)
Warning (flymake): Disabling backend ess-r-flymake because (error Cannot find program ’R’)
Warning (flymake): Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)

and typing in the buffer with the R file is slower because of warnings from Flymake.

I have also set the inferior R program as in this thread:

(setq inferior-ess-r-program "R")

But the result is the same.

How can I fix this?

  • ESS seems not to find R. Have you read an tried the comments ftom the second thread that you link to? Is R working okay from the command line? – andrej Mar 22 at 10:42
  • Yes, I read and tried those comments, which is why I added the inferior-ess-r-program command. R works OK from the command line and is at /usr/local/bin/R . – mmorin Mar 22 at 11:42
  • what does (executable-find "R") return? In your case it should be /usr/local/bin/R – andrej Mar 22 at 18:18
  • 1
    Sorry! Then I don't know what to do. On my system ess-r-flymake isn't called when I open an R file. Would suggest asking on the ESS github page. – andrej Mar 29 at 14:01
  • 1
    @andrej The problem has now disappeared and setting the inferior process was the answer, along with disabling legacy stuff from flymake, as I wrote here. I don't know why Emacs behaved differently then compared to now. Do you want to write an answer? – mmorin May 13 at 14:56
1

R executable

I confirm that flymake can now find the R executable. The line (setq inferior-ess-r-program "/usr/local/bin/R") was the problem: without the line, I (executable-find "R") returns nil and I get this warning twice:

Warning (flymake): Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)

I added that line to my ~/.emacs on March 26, so I don't understand why the changes did not take effect 4 days after, even though I turn off the computer every day.

Disabling backend flymake-proc-legacy-flymake

Now I get only this message:

Warning (flymake): Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)
Warning (flymake): Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)

I found that I could disable the legacy stuff with

(remove-hook 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)

So, although the last one is quick-and-dirty, it works for me.

Cross-posted from Github issue.

  • Please accept your own answer to mark this question as solved. – Tobias Jun 13 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.