mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 13:06:38 +00:00
refactor: use site-start.el instead of abusing subdirs.el
Set source-directory in site-start.el instead of subdirs.el which we were basically abusing to execute Elisp before the user config is loaded.
This commit is contained in:
@@ -803,7 +803,10 @@ class CLIHelperEmbedder < AbstractEmbedder
|
||||
end
|
||||
|
||||
class CSourcesEmbedder < AbstractEmbedder
|
||||
PATH_PATCH = '(setq source-directory (expand-file-name ".."))'
|
||||
PATH_PATCH = <<~ELISP
|
||||
;; Allow Emacs to find bundled C sources.
|
||||
(setq source-directory (expand-file-name ".."))
|
||||
ELISP
|
||||
|
||||
attr_reader :source_dir
|
||||
|
||||
@@ -824,17 +827,18 @@ class CSourcesEmbedder < AbstractEmbedder
|
||||
FileUtils.cp(f, target)
|
||||
end
|
||||
|
||||
return if File.read(subdirs_el_file).include?(PATH_PATCH)
|
||||
return if File.exist?(site_start_el_file) &&
|
||||
File.read(site_start_el_file).include?(PATH_PATCH)
|
||||
|
||||
File.open(subdirs_el_file, 'a') do |f|
|
||||
File.open(site_start_el_file, 'a') do |f|
|
||||
f.puts("\n#{PATH_PATCH}")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def subdirs_el_file
|
||||
@subdirs_el_file ||= File.join(resources_dir, 'lisp', 'subdirs.el')
|
||||
def site_start_el_file
|
||||
@site_start_el_file ||= File.join(resources_dir, 'lisp', 'site-start.el')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user