LoginSignup
73
69

More than 5 years have passed since last update.

Emacs Lisp を簡単にインストールするための package.el & MELPA

Last updated at Posted at 2012-12-26

package-list

1. package.el をインストールする

technomancy/package.el

以下のURLから.elをロードパスの通った場所に置くか

Emacs24 : http://bit.ly/pkg-el
Emacs23 : http://bit.ly/pkg-el23

auto-install がある場合は以下のS式を評価してインストールして下さい。

; Emacs24
(auto-install-from-url "http://repo.or.cz/w/emacs.git/blob_plain/HEAD:/lisp/emacs-lisp/package.el")

; Emacs23
(auto-install-from-url "http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el")

2. MELPAをレポジトリに追加

MELPAはgithubで管理されたパッケージレポジトリです。

まずは melpla.el をインストールします。

(progn
  (switch-to-buffer
   (url-retrieve-synchronously
    "https://raw.github.com/milkypostman/melpa/master/melpa.el"))
  (package-install-from-buffer  (package-buffer-info) 'single))

package.el経由でインストールしたパッケージは~/.emacs.d/elpa以下に置かれます。

.emacs.d/init.el に以下を追加します。

(require 'package)

; Add package-archives
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) ; ついでにmarmaladeも追加

; Initialize
(package-initialize)

; melpa.el
(require 'melpa)

3. 実際に使ってみる

M-x package-list-packages で一覧を取得します。ページ先頭のような画面が出るので後は選んでインストールしていきます。試しにyaml-modeをインストールしてみます。メニューから探してマウスクリックかENTERを押して下さい。

インストール終了後、.emacs.d/init.elに設定を書き加えて完了です。

(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml$\\|\\.yaml$" . yaml-mode))
73
69
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
73
69