auctex: use ARGV.value

master
Adam Vandenberg 2013-07-07 11:51:33 -07:00
parent e01fcc1794
commit 5956e28251
1 changed files with 4 additions and 10 deletions

View File

@ -11,18 +11,12 @@ class Auctex < Formula
depends_on :tex
depends_on :autoconf if build.head?
def options
[['--with-emacs=</full/path/to/emacs>', "Force a different emacs"]]
end
option "with-emacs=", "Path to an emacs binary"
def which_emacs
# check arguments for a different emacs
ARGV.each do |a|
if a.index('--with-emacs')
return a.sub('--with-emacs=', '')
end
end
which('emacs').to_s
emacs = ARGV.value('with-emacs') || which('emacs').to_s
raise "#{emacs} not found" if not File.exists? emacs
return emacs
end
def install