LoginSignup
9
9

More than 5 years have passed since last update.

Homebrewのemacsをeditしてインラインパッチなどを当てる(Emacs-24.2)

Last updated at Posted at 2013-01-27

インサイドフラッギング - HomebrewでCocoa Emacs 24.2をインストールした
を参考に、2013年1月26日現在のemacs.rbに対し「brew edit emacs」をかけて、
いわゆるインラインパッチと
ポップアップダイアログが出ると暫くして落ちてしまう件に対するパッチ
追加したemacsのFormulaを作成しました。

差分を記しておきます。2012年10月とはFormulaが違うようで、
インサイドフラッギングのパッチはそのままではうまく当たらなかったので、
いわゆる手パッチを試みました。

diff --git a/Library/Formula/emacs.rb b/Library/Formula/emacs.rb
index 3e0cd5b..d17afad 100644
--- a/Library/Formula/emacs.rb
+++ b/Library/Formula/emacs.rb
@@ -28,7 +28,8 @@ class Emacs < Formula
   def patches
     # Fullscreen patch works against 24.2; already included in HEAD
     if build.include? "cocoa" and not build.head?
-      "https://raw.github.com/gist/1746342/702dfe9e2dd79fddd536aa90d561efdeec2ba716"
+       { :p1 => "https://raw.github.com/gist/1746342/702dfe9e2dd79fddd536aa90d561efdeec2ba716",
+         :p0 => ["http://sourceforge.jp/projects/macemacsjp/svn/view/inline_patch/trunk/emacs-inline.patch?view=co&root=macemacsjp", DATA] }
     end
   end

@@ -141,3 +142,15 @@ class Emacs < Formula
     return s
   end
 end
+__END__
+--- src/nsterm.m.orig
++++ src/nsterm.m
+@@ -4263,6 +4263,8 @@
+ 
+ - (void)changeInputMethod: (NSNotification *)notification
+ {
++  if (!emacs_event)
++    return;
+ 
+   struct frame *emacsframe = SELECTED_FRAME ();
+ 

なお、このパッチを適用したEmacsをビルドする際、/usr/local/bin/autoconfと/usr/local/bin/automakeを必要としますが、最近のHomebrewではSuperenvという仕組みが導入されていることから/usr/local/binにPATHを通すことができません。

そこで、PATHに/usr/local/binを加えるだけでなく、「--env=std」を加えてSuperenvを無効化する必要があります。

h12o@Exegesis:~$ brew install emacs --cocoa --env=std

なお、OS X 10.8.2とGoogle日本語入力の環境で、このEmacsは特に問題なく動作しています。

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