LoginSignup
7
8

More than 5 years have passed since last update.

distnoted が原因でEmacsが落ちるのを防ぐemacs.rb

Last updated at Posted at 2014-01-28

2014/05/09時点でのHomebrewのFormulaには、以下のパッチが取り込まれているので、
わざわざ編集する必要はないです。


MacBookPro13 lateで、Cocoa Emacsを使っているのだけど、Emacsが1日2回ほど死んでしまう。

自分の環境では、以下の操作で確実に死ぬ。

  1. M-x でhelm-M-xを起動
  2. Command+p でプリントダイアログを表示し、Escで消す
  3. 一つ上の操作を10回〜20回ほど繰り返す

「Emacs が予期しない理由で終了しました。」とダイアログが出てくるが、対応方法がわからず困っていた。

検索してみると、distnotedが原因で、その対応方法も書かれていた。

distnotedプロセスの暴走に対応するためhomebrewのemacsにパッチをあてる (OS X Mavericks‎)

anonymous / emacs24_3_inline_memleak.sh

自分は、homebrewを使ってEmacsをインストールしているので、emacs.rb を次の様に編集した。

diff --git a/Library/Formula/emacs.rb b/Library/Formula/emacs.rb
index db7c46c..f8488f8 100644
--- a/Library/Formula/emacs.rb
+++ b/Library/Formula/emacs.rb
@@ -48,6 +48,8 @@ class Emacs < Formula
     # to apply a patch from MacEmacsJP for Japanese input methods
     if build.include? "cocoa" and build.include? "japanese"
       p[:p0].push("http://sourceforge.jp/projects/macemacsjp/svn/view/inline_patch/trunk/emacs-inline.patch?view=co&revision=583&root=macemacsjp&pathrev=583")
+      # for Mavericks distnoted memory leak
+      p[:p1].push("https://gist.github.com/anonymous/8553178/raw/c0ddb67b6e92da35a815d3465c633e036df1a105/emacs.memory.leak.aka.distnoted.patch.diff")
     end
     p
   end unless build.head?

ちなみに2014/01/28時点のEmacsのtrunkでは修正済みのため24.4ではパッチは不要。

パッチを充てると別の問題が、、

メモリーリークのパッチを充てて確認ダイアログボックスを表示すると、ダイアログボックスを消すことができなくなった。

ダイアログボックスを表示するのをやめて、minibuffer上に表示するようにした。

(setq use-dialog-box nil)
7
8
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
7
8