0

I want to understand the different ways for installing a package, leading to readily using the package.

I compared Emacs: How to Install Packages Using ELPA, MELPA and How to Install Emacs Package Manually.

In the second link, if I understand correctly, the steps to install a package manually are

  • (optional) byte-compilation of the package's elisp code,
  • loading the package's files, and
  • auto-activating the mode defined in the package, when opening files which the package is supposed to handle.

In the first link for installing a package using ELPA or MELPA, I don't find any of the three steps for installing a package manually in the first link.

  1. So does the way for installing a package using ELPA or MELPA in the first link already do the things that are done by the three steps for installing a package manually in the second link? Or does the way for installing a package using ELPA or MELPA in the first link need additional steps that appear in the way for installing a package manually in the second link?
  2. In the way for installing a package using ELPA or MELPA in the first link, is it necessary to add something to ~/.emacs.d/init.el?

Thanks.

2

When using ELPA, the package is automatically byte-compiled for you, and it is also automatically activated for you.

The only thing you might want to add to your ~/.emacs.d/init.el file when using ELPA is (package-initialize) so you can control when the installed packages get activated (in case you want to perform some setups before/after).

  • thanks. 1) When does (package-initialize) determine the installed packages get activated? 2) What about using MELPA ? – Tim Jul 11 '16 at 4:07
  • @Tim Packages distributed by MELPA are of the same format as those distributed by ELPA, so they work the same way. (package-initialize) runs code that operates on your local ELPA packages repository, which, in turn, will set up paths for downloaded packages and load their autoloads (thus making them available for interactive use). They won't be fully loaded though until you require them directly or by means of calling the autoloaded functions. – wvxvw Jul 11 '16 at 10:10
  • MELPA is just one of the ELPA archives, like GNU ELPA. – Stefan Jul 11 '16 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.