Addons for your Emacs: A quick guide to installing packages with the Emacs Package Manager

For the sake of this article, let us pretend that you are an ardent Org 1, 2 user.  One fine day you learn from a friend that the version of Org that comes with your Emacs 25.2 is 8.2.10 and that in terms of features and stability, this version is light-years behind the latest Org.   You want the newest version badly, but with the most minimal of efforts. How do you go about it? You guessed it right.  You will use the package manager.

Install one or more Package

Step 1: Start the Emacs Package Manager

Screenshot from 2018-07-27 09-10-56

Step 2:  Wait! The list of available packages may not be complete yet

Note that the packages are sorted by their installation Status.
Screenshot from 2018-07-27 09-14-42

Step 3: Optionally, order the package list by the package name

Screenshot from 2018-07-27 09-16-00

Step 4: Move the cursor to your desired package, say org, and mark it for installation

You can mark more than one package at this step.  For example, if you are interested in seeing line numbers while editing your files, you may want to mark the package named nlinum.

Note that the marked packages are tagged with the letter I, with the letter I reminding you of the operation you intend, which is installation.

Screenshot from 2018-07-27 10-00-58

Step 5:  Once you have marked the packages, go ahead with the actual installation

Now, Emacs will download the package from the archive, in this case GNU ELPA,  compile it and set up all other things for you.

screenshot-from-2018-07-27-10-02-41

Screenshot from 2018-07-27 10-04-49

Step 6:  Restart your Emacs

Before you restart your Emacs, you may want to check your .emacs.  Towards the very beginning of the file, you would see the following lines.  It is these lines, that make the  newly installed packages available to you for future sessions.

;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

Step 7:  Verify that you are indeed using the recent version of the package

Use the command locate-library to identify the version of a package.

For example, in my case M-x locate-library RET org RET returns Library is file ~/.emacs.d/elpa/org-9.1.13/org.elc.  The version that you see in this message is in agreement with what I would expect from earlier steps.

Getting Help for a Package

Step 1: Click on a package name

Screenshot from 2018-07-27 11-18-14

Step 2: In the *Help* window, click on any of the links or the buttons

Screenshot from 2018-07-27 11-18-38

Step 2.1: Where did the new package go and what are it’s component files

Screenshot from 2018-07-27 11-19-51

Screenshot from 2018-07-27 11-20-31

Step 2.2: What packages are similar to this package

Screenshot from 2018-07-27 11-20-55

Screenshot from 2018-07-27 14-13-51

Concluding Words

In the previous steps, you installed Org from the official Emacs repository.  It is named GNU ELPA, and stands for GNU Emacs Lisp Package Archive3.   As on July 2018, this archive has around 200 packages.   Remember, you aren’t just limited to these packages or the official repository.  The Emacs community maintains many more packages4 in very many  repositories5, 6.  The Emacs Package Manager can work with all of them.  How you install packages from these repositories is a topic in it’s own right and you will learn about it in one of my future articles.

Advertisements
Categories gnu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close