1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 11:47:59 +01:00

Replace the *.vimp file extension with config specific extensions.

This commit is contained in:
Doug Kearns
2010-10-01 02:43:02 +10:00
parent 002522c179
commit 725cf1f1f7
12 changed files with 29 additions and 18 deletions

View File

@@ -80,15 +80,21 @@ const ConfigBase = Class(ModuleBase, {
*/ */
features: [], features: [],
/**
* @property {string} The file extension used for command script files.
* This is the name string sans "dactyl".
*/
get fileExtension() this.name.slice(0, -6),
guioptions: {}, guioptions: {},
hasTabbrowser: false, hasTabbrowser: false,
/** /**
* @property {string} The name of the application that hosts the * @property {string} The name of the application that hosts the
* “liberated” application. E.g., "Firefox" or "Xulrunner". * extension. E.g., "Firefox" or "XULRunner".
*/ */
hostApplication: null, host: null,
/** /**
* @property {Object} A map between key names for key events should be ignored, * @property {Object} A map between key names for key events should be ignored,
@@ -109,7 +115,7 @@ const ConfigBase = Class(ModuleBase, {
modes: [], modes: [],
/** /**
* @property {string} The name of “liberated” application. * @property {string} The name of the extension.
* Required. * Required.
*/ */
name: null, name: null,

View File

@@ -721,12 +721,12 @@ const Dactyl = Module("dactyl", {
return; return;
} }
dactyl.echomsg('Searching for "plugins/**/*.{js,vimp}" in ' dactyl.echomsg('Searching for "plugins/**/*.{js,' + config.fileExtension + '}" in '
+ [dir.path.replace(/.plugins$/, "") for ([, dir] in Iterator(dirs))] + [dir.path.replace(/.plugins$/, "") for ([, dir] in Iterator(dirs))]
.join(",").quote(), 2); .join(",").quote(), 2);
dirs.forEach(function (dir) { dirs.forEach(function (dir) {
dactyl.echomsg("Searching for " + (dir.path + "/**/*.{js,vimp}").quote(), 3); dactyl.echomsg("Searching for " + (dir.path + "/**/*.{js," + config.fileExtension + "}").quote(), 3);
sourceDirectory(dir); sourceDirectory(dir);
}); });
}, },
@@ -1238,7 +1238,7 @@ const Dactyl = Module("dactyl", {
options.add(["loadplugins", "lpl"], options.add(["loadplugins", "lpl"],
"A regex list that defines which plugins are loaded at startup and via :loadplugins", "A regex list that defines which plugins are loaded at startup and via :loadplugins",
"regexlist", "'\\.(js|vimp)$'"); "regexlist", "'\\.(js|" + config.fileExtension + ")$'");
options.add(["titlestring"], options.add(["titlestring"],
"Change the title of the window", "Change the title of the window",

View File

@@ -86,8 +86,8 @@ const Events = Module("events", {
for (let file in dir.iterDirectory()) { for (let file in dir.iterDirectory()) {
if (file.exists() && !file.isDirectory() && file.isReadable() && if (file.exists() && !file.isDirectory() && file.isReadable() &&
/^[\w_-]+(\.vimp)?$/i.test(file.leafName)) { RegExp("^[\\w_-]+(\\." + config.fileExtension + ")?$", "i").test(file.leafName)) {
let name = file.leafName.replace(/\.vimp$/i, ""); let name = file.leafName.replace(RegExp("\\." + config.fileExtension + "$", "i"), "");
this._macros.set(name, { this._macros.set(name, {
keys: file.read().split("\n")[0], keys: file.read().split("\n")[0],
timeRecorded: file.lastModifiedTime timeRecorded: file.lastModifiedTime

View File

@@ -918,7 +918,7 @@
<tags>'noloadplugins' 'loadplugins'</tags> <tags>'noloadplugins' 'loadplugins'</tags>
<spec>'loadplugins' 'lpl'</spec> <spec>'loadplugins' 'lpl'</spec>
<type>regexlist</type> <type>regexlist</type>
<default>\.(js|vimp)$</default> <default>\.(js|&dactyl.fileExt;)$</default>
<description> <description>
<p> <p>
A regular expression list that defines which plugins are loaded at A regular expression list that defines which plugins are loaded at
@@ -937,7 +937,7 @@
omit in your <tt><t>&dactyl.name;rc</t></tt> using something like omit in your <tt><t>&dactyl.name;rc</t></tt> using something like
the below: the below:
</p> </p>
<code><ex>:set loadplugins=</ex>!<str delim="'">foo|bar</str>,<str delim="'">\.(js|vimp)$</str></code> <code><ex>:set loadplugins=</ex>!<str delim="'">foo|bar</str>,<str delim="'">\.(js|&dactyl.fileExt;)$</str></code>
<p> <p>
That will load all plugins but <em>foo</em> and <em>bar</em>. That will load all plugins but <em>foo</em> and <em>bar</em>.
</p> </p>

View File

@@ -112,9 +112,9 @@
<p> <p>
All directories in <o>runtimepath</o> are searched for a All directories in <o>runtimepath</o> are searched for a
plugins subdirectory and all yet unloaded plugins are loaded. plugins subdirectory and all yet unloaded plugins are loaded.
For each plugins directory, all <tt>*.{js,vimp}</tt> files (including For each plugins directory, all <tt>*.{js,&dactyl.fileExt;}</tt>
those in further subdirectories) are sourced alphabetically. No files (including those in further subdirectories) are sourced
plugins will be sourced if, alphabetically. No plugins will be sourced if,
</p> </p>
<ul> <ul>

View File

@@ -25,7 +25,7 @@
<description> <description>
<p> <p>
Load a color scheme. <a>name</a> is found by searching the <o>runtimepath</o> for the Load a color scheme. <a>name</a> is found by searching the <o>runtimepath</o> for the
first file matching <tt>colors/<a>name</a>.vimp</tt>. first file matching <tt>colors/<a>name</a>.&dactyl.fileExt;</tt>.
</p> </p>
<p> <p>

View File

@@ -238,7 +238,7 @@ const Highlights = Module("Highlight", {
if (scheme == "default") if (scheme == "default")
highlight.clear(); highlight.clear();
else else
dactyl.assert(modules.io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]), dactyl.assert(modules.io.sourceFromRuntimePath(["colors/" + scheme + "." + modules.config.fileExtension]),
"E185: Cannot find color scheme " + scheme); "E185: Cannot find color scheme " + scheme);
modules.autocommands.trigger("ColorScheme", { name: scheme }); modules.autocommands.trigger("ColorScheme", { name: scheme });
}, },
@@ -313,13 +313,14 @@ const Highlights = Module("Highlight", {
}, },
completion: function (dactyl, modules) { completion: function (dactyl, modules) {
const completion = modules.completion; const completion = modules.completion;
const config = modules.config;
completion.colorScheme = function colorScheme(context) { completion.colorScheme = function colorScheme(context) {
context.title = ["Color Scheme", "Runtime Path"]; context.title = ["Color Scheme", "Runtime Path"];
context.keys = { text: function (f) f.leafName.replace(/\.vimp$/, ""), description: ".parent.path" }; context.keys = { text: function (f) f.leafName.replace(RegExp("\\." + config.fileExtension + "$"), ""), description: ".parent.path" };
context.completions = array.flatten( context.completions = array.flatten(
modules.io.getRuntimeDirectories("colors").map( modules.io.getRuntimeDirectories("colors").map(
function (dir) dir.readDirectory().filter( function (dir) dir.readDirectory().filter(
function (file) /\.vimp$/.test(file.leafName)))); function (file) RegExp("\\." + config.fileExtension + "$").test(file.leafName))));
}; };

View File

@@ -18,6 +18,7 @@
- Backtracks to the first successful match after pressing - Backtracks to the first successful match after pressing
backspace. backspace.
- Supports reverse incremental search. - Supports reverse incremental search.
* Command script files now use the *.penta file extension.
* Multiple Ex commands may now be separated by | * Multiple Ex commands may now be separated by |
* Command-line is now hidden by default. Added C and M to * Command-line is now hidden by default. Added C and M to
'guioptions'. 'guioptions'.

View File

@@ -13,6 +13,7 @@
<!ENTITY dactyl.maillist "pentadactyl@googlegroups.com"> <!ENTITY dactyl.maillist "pentadactyl@googlegroups.com">
<!ENTITY dactyl.host "&brandShortName;"> <!ENTITY dactyl.host "&brandShortName;">
<!ENTITY dactyl.hostbin "firefox"> <!ENTITY dactyl.hostbin "firefox">
<!ENTITY dactyl.fileExt "penta">
<!ENTITY dactyl.statusBefore "statusbar-display"> <!ENTITY dactyl.statusBefore "statusbar-display">
<!ENTITY dactyl.statusAfter ""> <!ENTITY dactyl.statusAfter "">

View File

@@ -8,6 +8,7 @@
<!ENTITY dactyl.appName "Teledactyl"> <!ENTITY dactyl.appName "Teledactyl">
<!ENTITY dactyl.host "&brandShortName;"> <!ENTITY dactyl.host "&brandShortName;">
<!ENTITY dactyl.hostbin "thunderbird"> <!ENTITY dactyl.hostbin "thunderbird">
<!ENTITY dactyl.fileExt "tele">
<!ENTITY dactyl.statusBefore ""> <!ENTITY dactyl.statusBefore "">
<!ENTITY dactyl.statusAfter "statusTextBox"> <!ENTITY dactyl.statusAfter "statusTextBox">

View File

@@ -24,7 +24,7 @@ const Config = Module("config", ConfigBase, {
}, },
/*** required options, no checks done if they really exist, so be careful ***/ /*** required options, no checks done if they really exist, so be careful ***/
name: "Xulmus", name: "Xulmus",
hostApplication: "Songbird", host: "Songbird",
/*** optional options, there are checked for existence and a fallback provided ***/ /*** optional options, there are checked for existence and a fallback provided ***/
features: ["bookmarks", "hints", "marks", "history", "quickmarks", "session", "tabs", "player"], features: ["bookmarks", "hints", "marks", "history", "quickmarks", "session", "tabs", "player"],

View File

@@ -8,6 +8,7 @@
<!ENTITY dactyl.idName "XULMUS"> <!ENTITY dactyl.idName "XULMUS">
<!ENTITY dactyl.host "&brandShortName;"> <!ENTITY dactyl.host "&brandShortName;">
<!ENTITY dactyl.hostbin "songbird"> <!ENTITY dactyl.hostbin "songbird">
<!ENTITY dactyl.fileExt "xulmus">
<!ENTITY dactyl.statusBefore "statusbar-display"> <!ENTITY dactyl.statusBefore "statusbar-display">
<!ENTITY dactyl.statusAfter ""> <!ENTITY dactyl.statusAfter "">