emacsess

How to get emacs to load ess


I installed emacs 26 via flatpak and ess using sudo apt-get.

Currently my ess exists at /usr/share/emacs/site-lisp/elpa-src/ess-17.11 and I put in my .emacs file (load "/usr/share/emacs/site-lisp/elpa-src/ess-17.11/"). When I run emacs, I get the following warning:

Warning (initialization): An error occurred while loading ‘/home/yannik/.emacs’:

File is missing: Cannot open load file, No such file or directory, /usr/share/emacs/site-lisp/elpa-src/ess-17.11/

However, this directory clearly exists. How do I get emacs to detect ess? I've tried everything, '(require ess-site) didn't work either.


Solution

  • The function load loads a single Emacs Lisp file. What you want to do here is make an entire directory accessible, which you'd do by adding it to the load path:

    (add-to-list 'load-path "/usr/share/emacs/site-lisp/elpa-src/ess-17.11/")
    

    After that, you should find that (require 'ess-site) works - it will find the ess-site module in that directory.


    That said, you might find it easier to install ESS using Emacs' package manager. Follow the instructions for activating the MELPA package archive, and then type M-x list-packages and install ess from the list. Emacs will download the package, copy it to ~/.emacs.d/elpa, and arrange to load it.