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--idle-timer-function issue and time-out errors for ess-command, ess-send-string, ess-eval-line-visibly-and-step #1287

Open mihamn opened 7 months ago

mihamn commented 7 months ago

System: Max OSX Sonoma 14.4 Emacs: 29.1 ESS: 24.01.1

Sending 2+2 to the inferior ess-r process with Ctrl-n gets the right output, but this message appears in the Messages buffer:

Error running timer ‘ess--idle-timer-function’: (wrong-number-of-arguments (lambda (&optional process timeout) "Wait for an ESS process to be ready. Optionally specify PROCESS and TIMEOUT." (let ((proc (or process (ess-get-process))) (wait-time 0) (delay 0.1) (timeout (or timeout 10))) (while (and (process-live-p proc) (not (process-get proc 'ready)) (< wait-time timeout)) (sleep-for delay) (setq wait-time (+ wait-time delay))) (if (>= wait-time timeout) (error "Timeout waiting for process") (message "Process is ready")))) 5)

I tried deleting the binaries but had trouble instrumenting ess--idle-timer-function to see how 5 is being supplied and from where.

I think the following are related to this issue, as they are timeouts:

  1. (ess-command "2+2\n") from the inferior-R process buffer gives the message: user-error: ESS process not ready. Finish your command before trying again

  2. (ess-send-string "2+2" (ess-get-process (current-buffer))) gives the message:

Process *R:AdvancedR* is not running, but others are. Switch? (y or n) y
Using process ‘*R:AdvancedR*’
Entering debugger...

The R process is not hanging prior to issuing these commands. The .R text file is run from inside a folder called "Advanced R".

Thanks for any help!

rsparapa commented 6 months ago

I have exactly the same setup with Vincent Goulet's emacs 29.1 binaries. I installed ESS from git (just checked in a Makeconf/Makefile that smooths over sed/makeinfo issues). But I'm not seeing this problem. Of course, you ran M-x ess-version, right?

mihamn commented 6 months ago

Thanks for the pointers! Yes - that command gave me 24.01.1 for ESS version (from melpa repository originally).

I've cloned the latest ess github repo you committed to and ran make, make install, deleted the melpa ess, & restarted. I still get the same error for ess-command, but my emacs was from https://emacsformacosx.com, so maybe your Vincent Goulet's emacs suggestion will work, as he seems to be addressing ess issues specifically - I'll try that and let you know!

Edit: 27.4.2024 I downloaded the Vincent Goulet binary, added ess from melpa stable, and somehow it works, so thanks very much for that. I don't follow how, because it remains a .dmg which is a folder, that would normally prompt to be installed as an app, but doesn't. And I see emacs is actually a removable volume co-ranking with MacIntosh HD, so I'd like to understand that plumbing at some point.

Meanwhile ess-command works, which is everything I need. Thanks again!