aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/caveats.rb7
-rw-r--r--Library/Homebrew/formula_cellar_checks.rb26
-rw-r--r--Library/Homebrew/keg.rb2
3 files changed, 23 insertions, 12 deletions
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb
index e4e880fa2..c1da2c4ea 100644
--- a/Library/Homebrew/caveats.rb
+++ b/Library/Homebrew/caveats.rb
@@ -143,12 +143,7 @@ class Caveats
if keg && keg.elisp_installed?
<<-EOS.undent
Emacs Lisp files have been installed to:
- #{HOMEBREW_PREFIX}/share/emacs/site-lisp/
-
- Add the following to your init file to have packages installed by
- Homebrew added to your load-path:
- (let ((default-directory "#{HOMEBREW_PREFIX}/share/emacs/site-lisp/"))
- (normal-top-level-add-subdirs-to-load-path))
+ #{HOMEBREW_PREFIX}/share/emacs/site-lisp/#{f.name}
EOS
end
end
diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb
index 071b3f4dd..9622c98e6 100644
--- a/Library/Homebrew/formula_cellar_checks.rb
+++ b/Library/Homebrew/formula_cellar_checks.rb
@@ -173,19 +173,34 @@ module FormulaCellarChecks
EOS
end
- def check_emacs_lisp(share, name)
+ def check_elisp_dirname(share, name)
return unless (share/"emacs/site-lisp").directory?
+ # Emacs itself can do what it wants
+ return if name == "emacs"
+
+ bad_dir_name = (share/"emacs/site-lisp").children.any? do |child|
+ child.directory? && child.basename.to_s != name
+ end
+ return unless bad_dir_name
+ <<-EOS
+ Emacs Lisp files were installed into the wrong site-lisp subdirectory.
+ They should be installed into:
+ #{share}/emacs/site-lisp/#{name}
+ EOS
+ end
+
+ def check_elisp_root(share, name)
+ return unless (share/"emacs/site-lisp").directory?
# Emacs itself can do what it wants
return if name == "emacs"
elisps = (share/"emacs/site-lisp").children.select { |file| %w[.el .elc].include? file.extname }
return if elisps.empty?
-
<<-EOS.undent
Emacs Lisp files were linked directly to #{HOMEBREW_PREFIX}/share/emacs/site-lisp
-
- This may cause conflicts with other packages; install to a subdirectory instead, such as
+ This may cause conflicts with other packages.
+ They should instead be installed into:
#{share}/emacs/site-lisp/#{name}
The offending files are:
@@ -206,7 +221,8 @@ module FormulaCellarChecks
audit_check_output(check_easy_install_pth(formula.lib))
audit_check_output(check_openssl_links)
audit_check_output(check_python_framework_links(formula.lib))
- audit_check_output(check_emacs_lisp(formula.share, formula.name))
+ audit_check_output(check_elisp_dirname(formula.share, formula.name))
+ audit_check_output(check_elisp_root(formula.share, formula.name))
end
private
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index 9b548b83a..4151895bc 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -263,7 +263,7 @@ class Keg
end
def elisp_installed?
- Dir["#{path}/share/emacs/site-lisp/**/*.el"].any?
+ (path/"share/emacs/site-lisp"/name).children.any? { |f| %w[.el .elc].include? f.extname }
end
def version