开发者

How can I split my conkeror-rc config over multiple files?

开发者 https://www.devze.com 2022-12-30 10:30 出处:网络
Short version: can you help me fill in this code? var conkeror_settings_dir = ".conkeror.mozdev.org/settings";

Short version: can you help me fill in this code?

var conkeror_settings_dir = ".conkeror.mozdev.org/settings";
function load_all_js_files_in_dir (dir) {
    var full_path = get_home_directory().appendRelativePath(dir);
    // YOUR CODE HERE
}
load_all_js_files_in_dir(conkeror_settings_dir);

Background

I'm trying out Conkeror for web browsing. It's an emacs-like browser running on Mozilla's rendering engine, using javascript as configuration language (filling the role that elisp plays for emacs). In my emacs config, I have split my customizations into a series of files, where each file is a single unit of relat开发者_高级运维ed options (for example, all my perl-related settings might be in perl-settings.el. All these settings files are loaded automatically by a function in my .emacs that simply loads every elisp file under my "settings" directory.

I am looking to structure my Conkeror config in the same way, with my main conkeror-rc file basically being a stub that loads all the js files under a certain directory relative to my home directory. Unfortunately, I am much less literate in javascript than I am in elisp, so I don't even know how to "source" a file.


I found a suitable answer, though it isn't really what I was looking for. If you set your conkerorrc file to a directory, then all the js files in that dir will be loaded.

0

精彩评论

暂无评论...
验证码 换一张
取 消