aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAlex Dunn2015-07-05 14:45:26 -0700
committerAlex Dunn2015-08-01 14:48:54 -0700
commit81eedecc5aad951f445e6e5d813890b36c9ac679 (patch)
tree3e7301aa9cb890bd5aa7c142f49fdfaedb02b07e /Library
parent607be5e711006c3b0747ec2b9ef29dd03f53a959 (diff)
downloadbrew-81eedecc5aad951f445e6e5d813890b36c9ac679.tar.bz2
Automatic caveats for emacs lisp files
- The name of the subdirectory under site-lisp may not be exactly the same as the name of the package - `(normal-top-level-add-subdirs-to-load-path)` adds every subdirectory of `default-directory` to the load-path, so users don't have to update their load-path for every package they install. Closes Homebrew/homebrew#42309.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/caveats.rb14
-rw-r--r--Library/Homebrew/keg.rb4
2 files changed, 18 insertions, 0 deletions
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb
index 7d0d3d0de..53cdd155c 100644
--- a/Library/Homebrew/caveats.rb
+++ b/Library/Homebrew/caveats.rb
@@ -16,6 +16,7 @@ class Caveats
caveats << plist_caveats
caveats << python_caveats
caveats << app_caveats
+ caveats << elisp_caveats
caveats.compact.join("\n")
end
@@ -132,6 +133,19 @@ class Caveats
end
end
+ def elisp_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))
+ EOS
+ end
+ end
+
def plist_caveats
s = []
if f.plist or (keg and keg.plist_installed?)
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index cf4be6cc0..dbcf613e4 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -243,6 +243,10 @@ class Keg
Dir["#{path}/{,libexec/}*.app"].any?
end
+ def elisp_installed?
+ Dir["#{path}/share/emacs/site-lisp/**/*.el"].any?
+ end
+
def version
require 'pkg_version'
PkgVersion.parse(path.basename.to_s)