add load_paths

This commit is contained in:
marshmallow 2023-06-30 14:54:59 +10:00
parent dd473593d5
commit d38c691151
No known key found for this signature in database
GPG key ID: 767B8880F5AAEB9C
2 changed files with 49 additions and 0 deletions

View file

@ -6,6 +6,7 @@ function M.setup(opts)
opts = opts or opts
M.langs = opts.langs and opts.langs or {}
M.load_paths = opts.load_paths and opts.load_paths or {}
M._here = vim.fn.fnamemodify(debug.getinfo(1).source:sub(2), ":p:h")
M._run_by_name = M._here .. "/run_by_name.el"
@ -26,6 +27,17 @@ function M.setup(opts)
"(setq make-backup-files nil)",
}
vim.list_extend(
M._base_cmd,
vim.fn.reduce(M.load_paths, function(acc, value)
vim.list_extend(acc, {
"--eval",
[[(add-to-list 'load-path "]] .. value .. [[")]],
})
return acc
end, {})
)
vim.list_extend(M._base_cmd, {
"--eval",
"(org-babel-do-load-languages 'org-babel-load-languages '(" .. vim.fn.reduce(M.langs, function(acc, value)