how to know which archive an emacs ELPA package is from

The buffer from M-x list-packages doesn’t display which archive each package is from. M-x describe-package doesn’t either. But there is a function for it. The function is package-archive-base.

For example, I use two additional ELPA archives:

(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)

So I get packages from three archives: GNU ELPA (default), Marmalade, and Org ELPA. Suppose I wonder where the package htmlize is from. When I run

(require 'htmlize)

in my Emacs, it doesn’t report error, which means that the htmlize package is installed in my Emacs. But when Alice runs that in her Emacs, it reports error. Alice asks me which archive she should add to install htmlize via M-x list-packages. To find out, I just have to run:

(package-archive-base "htmlize") ; => "http://marmalade-repo.org/packages/"

htmlize is available in Marmalade.

This entry was posted in Emacs and tagged , , . Bookmark the permalink.

2 Responses to how to know which archive an emacs ELPA package is from

  1. Hmm. What I’d really love to see is for this to be displayed when I run package-list-packages, and then potentially for it to use that info when upgrading packages. Hate it when a package installed with Marmalade is “upgraded” to a package on MELPA because they use different versioning schemes.

    Not that I know enough to write patches for those things 🙂 Or even where to make the suggestion.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s