Build Emacs

February 12, 2019

Install some required packages

sudo apt-get update
sudo apt-get install -y build-essential libncurses-dev

if need graphics UI

sudo apt-get install -y libgtk-3-dev libxpm-dev libjpeg-dev libgif-dev libtiff-dev libgnutls28-dev

Download source and unpack it

可以到这里查看最新版本号

wget https://mirrors.tuna.tsinghua.edu.cn/gnu/emacs/emacs-26.3.tar.xz -O emacs.tar.xz
tar xf emacs.tar.xz

Generate makefile and then build it

cd emacs
./configure
make -j 4
sudo make install

You can find some flag in INSTALL file to generate custome make file.

Optional. install spacemacs

git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d

If you have a file named .emacs under your home folder, you need remove it