emacs-ess / ESS

Emacs Speaks Statistics: ESS
https://ess.r-project.org/
GNU General Public License v3.0
623 stars 162 forks source link

ess-rdired throws an `args-out-of-range` error #1258

Open maikol-solis opened 1 year ago

maikol-solis commented 1 year ago

Hi

I have the same issue as #1122, when I start ess-rdired right after the ess-process.

Debugger entered--Lisp error: (args-out-of-range #<buffer  *ess-rdired-output*> 1 22)
  ess-rdired-refresh()
  ess-rdired()
  funcall-interactively(ess-rdired)
  command-execute(ess-rdired record)
  execute-extended-command(nil "ess-rdired" nil)
  funcall-interactively(execute-extended-command nil "ess-rdired" nil)
  command-execute(execute-extended-command)

I think the problem is that the mapcar is iterating over an empty list because there isn't any object created at the moment.

https://github.com/emacs-ess/ESS/blob/d3e1a54020bbb96e15376aa3e7099b2f3650f79f/lisp/ess-rdired.el#L161

The root of the problem I assume is in this line

https://github.com/emacs-ess/ESS/blob/d3e1a54020bbb96e15376aa3e7099b2f3650f79f/lisp/ess-rdired.el#L157

where I guess that ESS should ensure that it has something inside before continuing the function.

If I create any object (say a<-1), ess-rdired works as expected.

Thanks

mmaechler commented 1 year ago

I can reproduce; thank you. Indeed, this a bug that should be fixed.

... only weakly related .. but puzzling: For me, ess-rdired is not autoloaded even though it is marked to do so in

https://github.com/emacs-ess/ESS/blob/master/lisp/ess-rdired.el#L127

So I need to manually load the *.el/*.elc file before I can even try. ???

maikol-solis commented 1 year ago

For me, ess-rdired is correctly loaded after entering ess-mode. I'm using doom-emacs, though.