Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs 29.1 compatibility issues with Emacs ESS #1271

Open
parvizfarnia opened this issue Jan 12, 2024 · 11 comments
Open

Emacs 29.1 compatibility issues with Emacs ESS #1271

parvizfarnia opened this issue Jan 12, 2024 · 11 comments

Comments

@parvizfarnia
Copy link

parvizfarnia commented Jan 12, 2024

Hello everyone,

My environment:

OS: Windows 11
Emacs version: 29.1
R version: 4.2.2 (64 bit)
ESS version downloaded from Melpa: ess-20231218.1256

I have been using Emacs ESS since several years for R programming. The last time I installed ESS was in march 2023 using Emacs version 28. I installed it via M-x package-install [RET] ess [RET] which downloaded from Melpa a package named ess-20230302.2111.

However this week I installed Emacs 29.1 and so far, I have encountered serious issues with ESS which is simply not working at all.

Here is what I have in my ~/.emacs.d/init.el for ESS configuration:


(setq inferior-ess-r-program "R")

(require 'ess-r-mode)

(add-to-list 'auto-mode-alist '("\\.R\\'" . ess-r-mode))

(require 'ess-view)

(setq ess-view--spreadsheet-program "C:/Program Files/LibreOffice/program/scalc.exe")

(require 'ess-R-data-view)

(setq ess-ask-for-ess-directory nil)

(setq display-buffer-alist
      `(("*R Dired"
         (display-buffer-reuse-window display-buffer-in-side-window)
         (side . right)
         (slot . -1)
         (window-width . 0.33)
         (reusable-frames . nil))
        ("*R"
         (display-buffer-reuse-window display-buffer-at-bottom)
         (window-width . 0.5)
         (reusable-frames . nil))
        ("*Help"
         (display-buffer-reuse-window display-buffer-in-side-window)
         (side . right)
         (slot . 1)
         (window-width . 0.33)
         (reusable-frames . nil))))
(show-paren-mode)

(setq inferior-R-args "--no-restore-history --no-save")

(global-set-key (kbd "C-;")  (lambda () (interactive) (insert " <- ")))

(setq ess-use-flymake nil)
(require 'flycheck)
(add-hook 'ess-r-mode-hook
          (lambda () (flycheck-mode t))
)

Using the above-mentioned configuration, when I run M-x R [RET] to open a new R session, I get the following error message:

Error (ess): Rterm could not be found on the system. Try running 'run-ess-r-newest' instead, which searches your system for R.

Now, this is strange given that I haven't changed anything since last year on my R installation, and I never got this message using previous versions of ESS with Emacs 28. I have already the absolute path to R executable in my PATH environment variable. After adding also the x64 directory to my path, which is the directory in the bin directory of R including Rterm.exe, finally I managed to start a new R session using Emacs 29. However, it seems that starting R in this way, my Emacs init file is either not read at all or not completely:

  • First of all, each time I start R, it asks me to define a project directory which is very annoying and normally based on my Emacs init file, the statement (setq ess-ask-for-ess-directory nil) should normally stop that.

  • (setq display-buffer-alist . . .) is not executed and I don't get frame organization as in RStudio (R session on the bottom and code buffer above it)

  • As indicated in the above-mentioned init file, the statement (global-set-key (kbd "C-;") (lambda () (interactive) (insert " <- "))) allows me to use C-; as a shortcut for assignment operator. After starting R session, this keyboard shortcut is not recognized despite the fact that it is in my init file. So each time I have to open once again my init file and run this statement manually via C-c C-e to be able to use my key mapping for <- in my programs. The same goes for disabling flymake and using flycheck instead as indicated in the above-mentioned init file. Besides, when I start coding, I have the following warning message in *Flymake log* buffer:

Warning [flymake Test.R]: Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)

I would like to know whether there is a compatibility issue between ESS and Emacs 29 or its just me who doesn't know how to configure it properly with this new version of Emacs.

Thanks in advance.

@pwaltman
Copy link

Are you running this via WSL2? I'm getting an error after recently upgrading my Ubuntu instance to v.23.10.

My setup is:
windows 11
WSL2
Ubuntu 23.10 (upgraded from 22.10 -> 23.04 -> 23.10, if that matters at all)
emacs v.29.1
elpa-ess (Ubuntu maintained package) v.18.10.2, I believe (18.10.2+git20230419.5c4ae91-1)

my .emacs only has the following in it:
(require 'ess-site)

and I get the following error:
Wrong type argument: stringp, nil

@parvizfarnia
Copy link
Author

No I don't use WSL2. As I indicated in my original post I use Windows 11. But it is rather reassuring that others have encountered compatibility issues and I'm not the only one dealing with this. Personally I installed only once WSL2 and it took me less than five minutes to remove it. I stick for now to virtual machines with VirtualBox although even that has sometimes its own stability problems.

@rsparapa
Copy link
Contributor

Can you try with the most recent ESS release? 24.01.0?

@parvizfarnia
Copy link
Author

The version you're talking about is available on MELPA ?

@mmaechler
Copy link
Member

Yes, and even ELPA (which is the standard package repos). So, everybody with an emacs version that is not older than say 5 years, should be able to do M-x package-install and then type ess at the Install package: prompt

@mmaechler
Copy link
Member

mmaechler commented Jan 31, 2024

... well, we have been told (and I have experienced once, ~ 0.5 years ago) that Emacs on the Mac does not support
the whole emacs packaging, because it does not support the TLS communication protocol which emacs somehow seems to assume working.. If there's a web page / video / ... helping people to fix their emacs such that this hurdle can be taken,
we'd be very grateful if you can post a link here.

@rsparapa
Copy link
Contributor

Emacs 29.1 for macOS from https://emacs-modified.gitlab.io/ has TLS support but it is a little flaky.
M-x package-install does NOT work in my experience. However,
M-x package-list-packages does work and you can install ESS that way
(but then you will have two versions of ESS installed so beware).

@mmaechler
Copy link
Member

.. well so the web access and installation then does work; very strange that M-x package-install would not work when interactive installation via package list does work.. as I' 99.9% confident that they both use the same underlying functionality..

@parvizfarnia
Copy link
Author

Can you try with the most recent ESS release? 24.01.0?

So here is how I proceeded:

  • I removed manually ESS from ~/.emacs.d/elpa
  • then I run M-x package-refresh-contents
  • and finally I installed the package from MELPA by running M-x package-install [RET] ess [RET].

This didn't change anything and all the problems described in my original post persist.

Also here is what M-x describe-package [RET] ess [RET] returns (in the case where it might be helpful to see what possibly went wrong) :


Package ess is installed.

     Status: Installed in ‘ess-20240131.1037/’ (unsigned).
    Version: 20240131.1037
     Commit: d8472e00da8fde3224d4512641093b526601af39
    Summary: Emacs Speaks Statistics
   Requires: emacs-25.1
Required by: ess-view-data-20230503.643, ess-view-20181001.1730, ess-smart-underscore-20190309.101, ess-smart-equals-20210411.1333, ess-r-insert-obj-20220610.1406, ess-R-data-view-20130509.1158
    Website: https://ess.r-project.org/
 Maintainer: ESS Core Team <[email protected]>
    Authors: David Smith <[email protected]>
             A.J. Rossini <[email protected]>
             Richard M. Heiberger <[email protected]>
             Kurt Hornik <[email protected]>
             Martin Maechler <[email protected]>
             Rodney A. Sparapani <[email protected]>
             Stephen Eglen <[email protected]>
             Sebastian P. Luque <[email protected]>
             Henning Redestig <[email protected]>
             Vitalie Spinu <[email protected]>
             Lionel Henry <[email protected]>
             J. Alexander Branham <[email protected]>
Other versions: 20240131.1037 (melpa), 24.1.1 (gnu).


Emacs Speaks Statistics (ESS) is a package designed to support editing of
scripts and interaction with various statistical analysis programs such as R,
S-Plus, SAS, Stata and OpenBUGS/JAGS. For more details please visit ESS home
page at https://ess.r-project.org/

@mihamn
Copy link

mihamn commented Apr 26, 2024

I had similar version upgrade issues (Mac OSX but to the same Emacs & ESS versions) - see below.

Do (ess-send-string ...) and (ess-command ...) work in your set-up? This is my issue, and these are the functions which most justify using ESS over the Posit offer, because you can work with the command-history in Elisp.

#1287

@rsparapa
Copy link
Contributor

Well, now that Emacs 29.4 is out, can you try that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants