Whenever I include a pipe (%>%
) in a ESS R buffer, I start getting the following error repeatedly, with lags that make editing almost impossible:
error in process sentinel: Not enough arguments for format string
Here is a simple example. If I create a buffer with only this function:
f <- function(x) {
x %>% sqrt
}
I get the following error backtrace when doing any edit that buffer (that's after doing M-x toggle-debug-on-error
):
Debugger entered--Lisp error: (error "Not enough arguments for format string")
format-message(" Error in cat(\"@@warning: @@\", e) : \n argument 2 (type 'list') cannot be handled by 'cat'\nCalls: esslint ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> -> cat\nIn addition: Warning message:\nIn file(con, \"r\") : cannot open file 'f <- function(x) {\n x %>% sqrt \n}': No such file or directory\nExecution halted\n")
apply(format-message " Error in cat(\"@@warning: @@\", e) : \n argument 2 (type 'list') cannot be handled by 'cat'\nCalls: esslint ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> -> cat\nIn addition: Warning message:\nIn file(con, \"r\") : cannot open file 'f <- function(x) {\n x %>% sqrt \n}': No such file or directory\nExecution halted\n" nil)
flymake--log-1(:warning ess-r-flymake " Error in cat(\"@@warning: @@\", e) : \n argument 2 (type 'list') cannot be handled by 'cat'\nCalls: esslint ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> -> cat\nIn addition: Warning message:\nIn file(con, \"r\") : cannot open file 'f <- function(x) {\n x %>% sqrt \n}': No such file or directory\nExecution halted\n")
ess-r--flymake-check-errors()
ess-r--flymake-parse-output(#<buffer *ess-r-flymake*> #<buffer dummy.R> #f(compiled-function (&rest args) #<bytecode 0x45e4a775>))
#f(compiled-function (proc event) #<bytecode 0x4307fddd>)(#<process ess-r-flymake> "exited abnormally with code 1\n")
It looks like the whole function is interpreted as a filename. Is this a bug in ESS? It seems unlikely, as this error is annoying enough that others would have reported it. Any idea on how to investigate this further?
M-x toggle-debug-on-error
get you a stack trace? If so, add it to the question. – phils Dec 12 '18 at 04:35ess-r-flymake
is actually intended to be agnostic towards those two alternatives, but is currently broken for flycheck. You should probably try it out with flymake (which was redesigned in Emacs 26.1) if you've not done so already. – phils Mar 13 '19 at 04:19