Commit 924b6647 authored by Konrad Hinsen's avatar Konrad Hinsen

Installation Emacs unifié

parent f199058e
...@@ -36,14 +36,23 @@ The next section provides information on how to install emacs. ...@@ -36,14 +36,23 @@ The next section provides information on how to install emacs.
- [[#additional-useful-emacs-packages][Additional useful emacs packages]] - [[#additional-useful-emacs-packages][Additional useful emacs packages]]
- [[#other-resources][Other resources]] - [[#other-resources][Other resources]]
* Installing emacs, org-mode, ess, and auctex. * Installing Emacs
The [[https://www.gnu.org/software/emacs/download.html][Emacs Web site]] explains various methods to install Emacs on your computer. Any of them will be fine for our purposes. In the following we describe the method that we consider most convenient for each platform, but feel free to use another one.
For this MOOC, you need one of
1. Emacs 26 (the latest version)
2. Emacs 25 plus Org-Mode 9
Emacs 25 comes with Org-Mode 8, which is not compatible with our examples. So if you use Emacs 25, you must separately install Org-Mode 9.
Our MOOC also requires a few extra Emacs packages: [[https://ess.r-project.org/][ESS]] (for working with the R language) and [[https://www.gnu.org/software/auctex/][AUCTeX]] (for editing LaTeX). They will be installed automatically the first time you start Emacs if you use the configuration described under [[#a-simple-reproducible-research-emacs-configuration][A simple "reproducible research" emacs configuration]].
** Linux (Debian, Ubuntu) ** Linux (Debian, Ubuntu)
We provide here only instructions for Debian-based distributions. Feel We provide here only instructions for Debian-based distributions. Feel
free to contribute to this document to provide up-to-date information free to contribute to this document to provide up-to-date information
for other distributions (e.g.n redhat, fedora). for other distributions (e.g.n redhat, fedora).
Today, the stable versions of the most common distributions provide These are the versions of Emacs that various distributions provide:
recent enough versions of emacs and org-mode:
- Debian (stretch) ships with [[https://packages.debian.org/stretch/emacs25][emacs 25.1]] and [[https://packages.debian.org/stretch/org-mode][org-mode 9.0.3]] - Debian (stretch) ships with [[https://packages.debian.org/stretch/emacs25][emacs 25.1]] and [[https://packages.debian.org/stretch/org-mode][org-mode 9.0.3]]
- Ubuntu (bionic 18.04) ships with [[https://packages.ubuntu.com/bionic/emacs25][emacs 25.2]] and [[https://packages.ubuntu.com/bionic/org-mode][org-mode 9.1.6]] - Ubuntu (bionic 18.04) ships with [[https://packages.ubuntu.com/bionic/emacs25][emacs 25.2]] and [[https://packages.ubuntu.com/bionic/org-mode][org-mode 9.1.6]]
- Ubuntu (artful 17.04) ships with [[https://packages.ubuntu.com/artful/emacs25][emacs 25.2]] and [[https://packages.ubuntu.com/artful/org-mode][org-mode 9.0.9]] - Ubuntu (artful 17.04) ships with [[https://packages.ubuntu.com/artful/emacs25][emacs 25.2]] and [[https://packages.ubuntu.com/artful/org-mode][org-mode 9.0.9]]
...@@ -55,7 +64,7 @@ Simply run (as root): ...@@ -55,7 +64,7 @@ Simply run (as root):
apt-get update ; apt-get install emacs25 org-mode apt-get update ; apt-get install emacs25 org-mode
#+end_src #+end_src
Then make sure you have a sufficiently recent version of emacs. Then verify that you have a sufficiently recent version of Emacs.
#+begin_src sh :results output :exports both #+begin_src sh :results output :exports both
emacs --version 2>&1 | head -n 1 emacs --version 2>&1 | head -n 1
#+end_src #+end_src
...@@ -63,7 +72,7 @@ emacs --version 2>&1 | head -n 1 ...@@ -63,7 +72,7 @@ emacs --version 2>&1 | head -n 1
#+RESULTS: #+RESULTS:
: GNU Emacs 25.2.2 : GNU Emacs 25.2.2
Likewise, you'll want to check you have a recent version of org-mode: Likewise, you'll want to check you have a recent version of Org-Mode:
#+begin_src sh :results output :exports both #+begin_src sh :results output :exports both
emacs -batch --funcall "org-version" 2>&1 | grep version emacs -batch --funcall "org-version" 2>&1 | grep version
#+end_src #+end_src
...@@ -75,24 +84,15 @@ The version numbers you get will depend on the distribution you are ...@@ -75,24 +84,15 @@ The version numbers you get will depend on the distribution you are
running. _You really want to make sure you do not rely on org-mode 8_, running. _You really want to make sure you do not rely on org-mode 8_,
which is now deprecated. which is now deprecated.
The packages [[https://ess.r-project.org/][ESS]] (for working with the R language) and [[https://www.gnu.org/software/auctex/][AUCTeX]] (for editing LaTeX) will be installed automatically the first time you start Emacs if you use the configuration described under [[#a-simple-reproducible-research-emacs-configuration][A simple "reproducible research" emacs configuration]].
** macOS ** macOS
*Note:* macOS comes with a prehistoric command-line-only version of Emacs located at =/usr/bin/emacs=. It's best to forget about it. *Note:* macOS comes with a prehistoric command-line-only version of Emacs located at =/usr/bin/emacs=. It's best to forget about it.
The Web site https://emacsformacosx.com/ proposes precompiled Emacs versions for macOS. Download the latest version (the one that figures prominently on the page) and install it like you would install any other macOS application, by copying =Emacs.app= from the downloaded disk image to a convenient location on your computer. The Web site https://emacsformacosx.com/ proposes precompiled Emacs versions for macOS. Download the latest version (the one that figures prominently on the page) and install it like you would install any other macOS application, by copying =Emacs.app= from the downloaded disk image to a convenient location on your computer.
This Emacs version contains everything used in the MOOC except the packages [[https://ess.r-project.org/][ESS]] (for working with the R language) and [[https://www.gnu.org/software/auctex/][AUCTeX]] (for editing LaTeX). If you use the configuration described under [[#a-simple-reproducible-research-emacs-configuration][A simple "reproducible research" emacs configuration]], these packages will be installed automatically the first time you start Emacs.
In case you need to run Emacs from the command line (note: this is not required in the MOOC), you have to enter the full path to the executable. Assuming that you have copied =Emacs.app= to =/path/to/emacs=, this is =/path/to/emacs/Emacs.app/Contents/MacOS/Emacs=. Note that if you just type =emacs=, you will use the prehistoric command-line-only version at =/usr/bin/emacs= provided by Apple. In case you need to run Emacs from the command line (note: this is not required in the MOOC), you have to enter the full path to the executable. Assuming that you have copied =Emacs.app= to =/path/to/emacs=, this is =/path/to/emacs/Emacs.app/Contents/MacOS/Emacs=. Note that if you just type =emacs=, you will use the prehistoric command-line-only version at =/usr/bin/emacs= provided by Apple.
** Windows ** Windows
Install the =.exe= file from [[http://vgoulet.act.ulaval.ca/][Vincent Goulet]]: Download the [[https://ftp.gnu.org/gnu/emacs/windows/emacs-26/emacs-26.1-i686.zip][precompiled Emacs 26.1]] and unzip the zip file preserving the directory structure, and run bin\runemacs.exe. Alternatively, create a desktop shortcut to bin\runemacs.exe, and start Emacs by double-clicking on that shortcut's icon.
[[https://vigou3.gitlab.io/emacs-modified-windows/][https://vigou3.gitlab.io/emacs-modified-windows/]]. It ships with recent
versions:
- Emacs 26.1
- Org-mode 9.1.13
- ESS 17.11
*** Directory naming conventions *** Directory naming conventions
In the following instructions, we refer to your home In the following instructions, we refer to your home
directory through the (UNIX) =~/= notation. On Windows, your home directory through the (UNIX) =~/= notation. On Windows, your home
......
...@@ -59,19 +59,14 @@ ...@@ -59,19 +59,14 @@
(setq package-archive-priorities '(("gnu" . 100) (setq package-archive-priorities '(("gnu" . 100)
("melpa-stable" . 10))) ("melpa-stable" . 10)))
(when (equal system-type 'darwin) (dolist (pkg '(ess
(unless (package-installed-p 'exec-path-from-shell) auctex
(package-install 'exec-path-from-shell))) exec-path-from-shell))
(when (not (package-installed-p pkg))
(unless (package-installed-p 'ess) (package-install pkg)))
(package-install 'ess))
(exec-path-from-shell-initialize)
(unless (package-installed-p 'auctex) (exec-path-from-shell-copy-env "PYTHONPATH")
(package-install 'auctex))
(when (equal system-type 'darwin)
(exec-path-from-shell-initialize)
(exec-path-from-shell-copy-env "PYTHONPATH"))
(require 'org) (require 'org)
......
...@@ -6,13 +6,9 @@ ...@@ -6,13 +6,9 @@
#+LANGUAGE: en #+LANGUAGE: en
This is a "minimal" =.emacs= configuration file. For this configuration This is a "minimal" =.emacs= configuration file. For this configuration
to work, you'll need: to work, you'll need one of:
- emacs25 (>25.2) (this way installing through elpa will save you some - Emacs 26 (preferred)
time) and emacs-goodies (e.g., for color themes) - Emacs 25 plus Org-Mode 9
- org-mode > 9.0 (there has been several major compatibility breakage
so need to stay away from old versions)
- ess and R
- texlive and auctex
* Installation Instructions * Installation Instructions
Backup you own =.emacs= if you have one and replace it with [[file:init.el][the content Backup you own =.emacs= if you have one and replace it with [[file:init.el][the content
...@@ -75,7 +71,7 @@ document, simply =M-x org-babel-tangle=. ...@@ -75,7 +71,7 @@ document, simply =M-x org-babel-tangle=.
#+end_src #+end_src
* Package sources * Package sources
** Use melpa-stable (preferred) and melpa ** Use melpa-stable (preferred) and melpa in addition to the default GNU archive
#+BEGIN_SRC emacs-lisp :tangle init.el #+BEGIN_SRC emacs-lisp :tangle init.el
(package-initialize) (package-initialize)
(add-to-list 'package-archives (add-to-list 'package-archives
...@@ -87,27 +83,17 @@ document, simply =M-x org-babel-tangle=. ...@@ -87,27 +83,17 @@ document, simply =M-x org-babel-tangle=.
("melpa-stable" . 10))) ("melpa-stable" . 10)))
#+END_SRC #+END_SRC
* Install missing packages * Install missing packages
** For macOS:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(when (equal system-type 'darwin) (dolist (pkg '(ess
(unless (package-installed-p 'exec-path-from-shell) auctex
(package-install 'exec-path-from-shell))) exec-path-from-shell))
(when (not (package-installed-p pkg))
(package-install pkg)))
#+end_src #+end_src
** ESS * Import environment variables
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless (package-installed-p 'ess) (exec-path-from-shell-initialize)
(package-install 'ess)) (exec-path-from-shell-copy-env "PYTHONPATH")
#+end_src
** AucTeX
#+begin_src emacs-lisp
(unless (package-installed-p 'auctex)
(package-install 'auctex))
#+end_src
* Import environment variables (macOS)
#+begin_src emacs-lisp
(when (equal system-type 'darwin)
(exec-path-from-shell-initialize)
(exec-path-from-shell-copy-env "PYTHONPATH"))
#+end_src #+end_src
* Loading files: * Loading files:
** Loading babel: :ARNAUD: ** Loading babel: :ARNAUD:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment