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.
This commit is contained in:
parent
607be5e711
commit
81eedecc5a
@ -16,6 +16,7 @@ class Caveats
|
|||||||
caveats << plist_caveats
|
caveats << plist_caveats
|
||||||
caveats << python_caveats
|
caveats << python_caveats
|
||||||
caveats << app_caveats
|
caveats << app_caveats
|
||||||
|
caveats << elisp_caveats
|
||||||
caveats.compact.join("\n")
|
caveats.compact.join("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -132,6 +133,19 @@ class Caveats
|
|||||||
end
|
end
|
||||||
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
|
def plist_caveats
|
||||||
s = []
|
s = []
|
||||||
if f.plist or (keg and keg.plist_installed?)
|
if f.plist or (keg and keg.plist_installed?)
|
||||||
|
@ -243,6 +243,10 @@ class Keg
|
|||||||
Dir["#{path}/{,libexec/}*.app"].any?
|
Dir["#{path}/{,libexec/}*.app"].any?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def elisp_installed?
|
||||||
|
Dir["#{path}/share/emacs/site-lisp/**/*.el"].any?
|
||||||
|
end
|
||||||
|
|
||||||
def version
|
def version
|
||||||
require 'pkg_version'
|
require 'pkg_version'
|
||||||
PkgVersion.parse(path.basename.to_s)
|
PkgVersion.parse(path.basename.to_s)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user