Emacs LispパッケージのFormulaをつくるとき、depends_on "emacs"
の他
system "./configure", "--prefix=#{prefix}", "--with-emacs=/usr/local/bin/emacs"
の
"--with-emacs=/usr/local/bin/emacs"
を忘れないようにしましょう。
example.rb
require 'formula'
class Example < Formula
# ...
depends_on "emacs"
# ...
def install
system "./configure", "--prefix=#{prefix}", "--with-emacs=/usr/local/bin/emacs"
# ...
end
# ...
end
忘れてしまうと、/usr/bin/emacs、すなわち以前のバージョンのEmacsでバイトコンパイルされます。
たいていのEmacs Lispパッケージでは問題が露見しないのですが、Mew-6.6で問題が発生しました。
Mew-6.6で登場したmew-called-interactively-p
は、(>= emacs-major-version 24)
のときにマクロで、それ以外のときにエイリアスで実装されているのですが、バイトコンパイルされるとこの箇所がEmacs 24(Homebrewのemacs)に合ったコードとしてではなくEmacs 22に合ったコードとしてコンパイルされてしまいます。
mew-env.el
;;; ...
(cond
((>= emacs-major-version 24)
;; this must be macro. If implemented as a function, its behavior
;; is changed.
(defmacro mew-called-interactively-p ()
'(called-interactively-p 'interactive)))
(t
(defalias 'mew-called-interactively-p 'called-interactively-p)))
;;; ...