如何将 conkeror-rc 配置拆分为多个文件?

发布于 2024-09-01 03:41:44 字数 738 浏览 2 评论 0原文

简短版:你能帮我填写这个代码吗?

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);

背景

我正在尝试使用 Conkeror 进行网页浏览。它是一个类似 emacs 的浏览器,运行在 Mozilla 的渲染引擎上,使用 javascript 作为配置语言(填补了 elisp 在 emacs 中扮演的角色)。在我的 emacs 配置中,我将自定义项拆分为一系列文件,其中每个文件都是相关选项的一个单元(例如,我所有与 perl 相关的设置可能位于 perl-settings.el. 所有这些设置文件都是由我的 .emacs 中的一个函数自动加载的,该函数只是加载我的“settings”目录下的每个 elisp 文件,

我希望以相同的方式构建我的 Conkeror 配置 。我的主要 conkeror-rc 文件基本上是一个存根,它加载相对于我的主目录的某个目录下的所有 js 文件。不幸的是,我对 javascript 的了解比对 elisp 的了解要少得多,所以我什至不知道如何操作。 “源”文件。

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 related 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

养猫人 2024-09-08 03:41:44

我找到了一个合适的答案,尽管这并不是我真正想要的。如果将 conkerorrc 文件设置为某个目录,则该目录中的所有 js 文件都将被加载。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文