LoginSignup
10
9

More than 5 years have passed since last update.

新しくリリースされたemacs-25.1とemacs-24.5を共存させる

Last updated at Posted at 2016-07-25

はじめに

emacs25.1のRC版が昨日(7/24)リリースされたようです。
まだRC版なので、どの程度動作するか分かりませんが、とりあえず使ってみます。
今回は、何かあったときに環境をすぐに戻せるよう、evmを使ってemacsのバージョンを管理します。

  • 環境 : MacOSX ElCaptain 10.11.5

バージョン25の変更点

emacs-25のNEWSを見れば変更点がわかります。

1.evmのインストール

evmはemacsをバージョン管理するパッケージです。
まだevmにversion25.1のバージョンが登録されていないため、ソースコードから持ってきて、ソースをいじります。

※ 2016/8/18追記
ビルドにはXcode Command Line Toolが必要です。
xcode-select --installを実行すると、Command Line Toolのインストールダイアログが出るので、インストールしましょう。

また、evmを利用するには、rbenvのインストールも必要なので、事前にインストールしておきます。

今回、evm経由でインストールしたプログラムは、/usr/local/evm内に置くものとしています。

$ git clone https://github.com/rejeep/evm.git ~/.evm
$ export PATH="$HOME/.evm/bin:$PATH"
$ sudo mkdir /usr/local/evm
$ sudo chown $USER:admin /usr/local/evm


$ evm list # 動作確認
rbenv: version `2.2.0' is not installed (set by /Users/amachi/.evm/.ruby-version)
$ rbenv install 2.2.0
$ rbenv global 2.2.0
$ evm list
emacs-23.4-bin
...<中略>...
emacs-24.5
emacs-25-pre-travis
emacs-git-snapshot-travis
emacs-git-snapshot

2. evmに25.1用のパッケージを追加

.evm/recipesに25.1用のパッケージを追加します。

evm/recipes/emacs-25.1.rb
recipe 'emacs-25.1' do
  tar_xz 'http://alpha.gnu.org/gnu/emacs/pretest/emacs-25.1-rc1.tar.xz'

  osx do
    option '--with-ns'
    option '--without-x'
    option '--without-dbus'
  end

  linux do
    option '--prefix', installation_path
    option '--without-gif'
  end

  install do
    configure
    make 'install'

    osx do
      copy File.join(build_path, 'nextstep', 'Emacs.app'), installation_path
    end
  end
end

パッケージが追加されたか確認。

$ evm list
...<中略>...
emacs-25-pre-travis
emacs-25-pre
emacs-25.1 ← 追加

3. emacs-25.1をインストールし、起動

問題なくすすめば、以下の手順で起動できます。

$ evm install emacs-25.1
...<中略>...
$ evm list
emacs-24.5-bin
emacs-24.5-travis
emacs-24.5 [I]  # installしたものには[I]が表示される
emacs-25-pre-travis
emacs-25-pre
emacs-25.1 [I]

$ evm use emacs-25.1 # 25.1を利用する
$ evm list
...<中略>...
* emacs-25.1 [I] # 使用中のものには * が表示される

$ which Emacs
/Users/amachi/.evm/bin/Emacs
$ Emacs # emacsを起動

試してみる

起動したemacsで、ためしにバージョン25で新しく追加されたcomment-lineを試します。
起動されたemacsで適当なファイルを開き、C-x C-;を打つと、
そのポインタがあった行がすべてコメントアウトされます。
地味に便利そうです。

バージョン25以前だと、C-x C-; is undefinedになります。
すでに他のキーバインドにしている人は、M-x comment-lineで試してみてください。

試してみた雑感

まだほとんど動かしてないのですが、とりあえずv24.5で動作していたものは、すべて動作しているようです。
とりあえず、明日以降はv25.1を使って開発をしていきます。

10
9
0

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
10
9