How to install SLIME+SBCL+Quicklisp into Emacs

SLIME – SLIME is a Emacs mode for Common Lisp development. Inspired by existing systems such Emacs Lisp and ILISP, we are working to create an environment for hacking Common Lisp in. (

SBCL – Steel Bank Common Lisp (SBCL) is a high performance Common Lisp compiler. It is open source / free software, with a permissive license. In addition to the compiler and runtime system for ANSI Common Lisp, it provides an interactive environment including a debugger, a statistical profiler, a code coverage tool, and many other extensions. (

Quicklisp – Quicklisp is a library manager for Common Lisp. It works with your existing Common Lisp implementation to download, install, and load any of over 1,200 libraries with a few simple commands. (

This article is a simple instruction for installing SLIME, SBCL and Quicklisp into Emacs, which is the environment I recommend for learning Common Lisp.

Step 1 – Install SLIME

Firstly, you need to install the SLIME by MELPA or Git. Basically, the package in MELPA is always stable, while the files in official Git repository are newest.

If you choose to install it by MELPA, add lines below into your .emacs file.

(require 'package)
(add-to-list 'package-archives
'("melpa"     . ""))

After that, you should be able to install SLIME by M-x package-install RET slime RET. If you found that there is no package named “slime” in the list, running M-x package-refresh-contents will fix it.

By using Git, you need to run these commands in your terminal.

cd path/where/you/want/slime/installed
git clone

Then add lines below into your .emacs file.

(add-to-list 'load-path "path/of/slime")
(require 'slime-autoloads)

Step 2 – Install SBCL

Download the source archive in official site and unzip it. Run commands below in your terminal after doing that.

cd path/where/files/unzipped

SBCL should be installed right now, to make sure, run sbcl in your terminal, there should be a banner produced like this.

This is SBCL 1.2.14, an implementation of ANSI Common Lisp.
More information about SBCL is available at <;.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.

And you can install it by cloning the git repository (git:// as well.

After the steps above are done, add the line below into your .emacs file.

(setq inferior-lisp-program "path/of/sbcl")

The path of sbcl can be known by running command “which sbcl” in your terminal.

Step 3 – Install Quicklisp

Download the file for installation. (

Then run sbcl with that file loaded by this command.

sbcl --load path/of/quicklisp.lisp

After sbcl launched, type in the command below.


At this moment, Quicklisp has already been installed. If you want to load Quicklisp every time you start Lisp (which is recommended), type in command below.


Then, type in the command which will create a file you can load in Emacs that configures the right load-path for loading Quicklisp’s installation of SLIME.

(ql:quickload "quicklisp-slime-helper")

Now, you should be able to see a message looks like this.

To use, add this to your ~/.emacs:

(load (expand-file-name "~/quicklisp/slime-helper.el"))
;; Replace "sbcl" with the path to your implementation
(setq inferior-lisp-program "sbcl")

As we have already set for sbcl, you just need to copy the first line into your .emacs file.

Step 4 – Enjoy Common Lisp

The basic installation has already been done. You can enjoy that by running M-x slime in your Emacs.

How to setup GNU GLOBAL for Emacs (MAC)

GNU GLOBAL is a source code tagging system that works the same way across diverse environments, such as Emacs editor, Vi editor, Less viewer, Bash shell, various web browsers, etc. (


This article is an instruction for installing GNU GLOBAL into your Emacs with MAC OS X.

Step 1 – Install GLOBAL

Users of MAC OS X are able to install GLOBAL simply by using Macports or Homebrew.

For example, if you are using the Macports, type in the command below in terminal.

sudo port install global

Step 2 – Download gtags.el

Download the newest source archive in official site, and unzip it. You should find the file named “gtags.el” in the folder unzipped. Then you can put it wherever you like.

Step 3 – Setup .emacs file

After installing of GLOBAL, we need to setup .emacs file by adding lines below into it.

(setq load-path (cons "path of global" load-path))
(setq load-path (cons "path of gtags" load-path))
(setq load-path (cons "path of gtags.el" load-path))
(autoload 'gtags-mode "gtags" "" t)

The path of global and gtags can be known by typing in “which global” and “which gtags” in terminal.

Optionally, you can add some keybinding for gtags by adding lines below.

(setq gtags-mode-hook
'(lambda ()
(local-set-key "\M-t" 'gtags-find-tag)
(local-set-key "\M-r" 'gtags-find-rtag)
(local-set-key "\M-s" 'gtags-find-symbol)
(local-set-key "\C-t" 'gtags-pop-stack)

And by now, you are able to load GLOBAL by M-x gtags-mode in Emacs. By adding lines below, you can make emacs load gtags-mode automatically when c-mode or c++-mode is loaded.

(setq c-mode-hook
'(lambda ()
(gtags-mode 1)))
(setq c++-mode-hook
'(lambda ()
(gtags-mode 1)))

GLOBAL supports Awk, Dos batch, COBOL, C, C++, C#, Erlang, Fortran, Java, JavaScript, Lisp, Lua, Pascal, Perl, PHP, Python, Ruby, Matlab, OCaml, Scheme, Tcl, TeX, Verilog, Vhdl and Vim.

Step 4 – Enjoy yourself

Now you are done with installing and should be able to use gtags-mode in your emacs.

To use it, for example, type in the command below in your terminal.

cd path-where-you-want-to-use-gtags-mode
gtags -v

After doing this, a few files for gtags will be created under target directory. And you can use gtags-mode when you are reading the file of that directory in Emacs.