0

I'd like flycheck to catch elementary coding issues while I'm writing a program in R.

With a .emacs containing

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

(setq load-path (cons "~/elisp" load-path))
(require 'dash)
(require 'let-alist)
(require 'pkg-info)
(require 'seq)
(require 'epl)
(require 'flycheck)
(add-hook 'after-init-hook #'global-flycheck-mode)

(setq exec-path
      (append exec-path
              '("c:/Program Files/R/R-3.4.3/bin")))
(setenv "PATH"
        (concat "c:/Program Files/R/R-3.4.3/bin;"))

I can M-x R and get the ESS console. In that console, I run install.packages("lintr") since flycheck uses lintr for R files.

But if I now run M-x flycheck-verify-setup, I get

let: Searching for program: No such file or directory, R

R.exe is duly available in c:/Program Files/R/R-3.4.3/bin, or at least ESS can find it just fine.

How do I initialize Emacs to run flycheck with lintr? I run flycheck with several other languages with no issues.

Vrokipal
  • 784
  • 5
  • 18
  • did you try the configration from the [lintr page?](https://www.r-project.org/nosvn/pandoc/lintr.html) – manandearth Feb 28 '18 at 15:51
  • The link to lintr in the page you point to is stale. In any case, `lintr.el` is apparently now integrated into flycheck (https://github.com/jimhester/lintr/issues/66). A separate install is unnecessary. – Vrokipal Feb 28 '18 at 16:11
  • you've set your `PATH` to only contain the R directory – Rorschach Feb 28 '18 at 20:43
  • @jenesaisquoi I did not set the path to point to R's root directory, but to R/bin, the directory where R.exe can be found. I don't see your point. – Vrokipal Feb 28 '18 at 21:21
  • I was just pointing out that you set that to be your entire path, which is probably not what you want – Rorschach Feb 28 '18 at 21:23
  • Can R be found with executable-find? If not, there is issue with your path, Ess is smart about finding R – Rorschach Feb 28 '18 at 21:27

0 Answers0