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.