1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 09:17:59 +01:00

Normalise naming of module initializer functions.

This commit is contained in:
Doug Kearns
2012-10-11 01:08:36 +11:00
parent 50597cc80a
commit 53f3ea342c
22 changed files with 84 additions and 84 deletions

View File

@@ -299,7 +299,7 @@ var Abbreviations = Module("abbreviations", {
user: contexts.hives.abbrevs.user
});
},
completion: function () {
completion: function initCompletion() {
completion.abbreviation = function abbreviation(context, modes, group) {
group = group || abbreviations.user;
let fn = modes ? function (abbr) abbr.inModes(modes) : util.identity;
@@ -307,7 +307,7 @@ var Abbreviations = Module("abbreviations", {
context.completions = group.merged.filter(fn);
};
},
commands: function () {
commands: function initCommands() {
function addAbbreviationCommands(modes, ch, modeDescription) {
modes.sort();
modeDescription = modeDescription ? " in " + modeDescription + " mode" : "";

View File

@@ -168,7 +168,7 @@ var AutoCommands = Module("autocommands", {
}
}, {
}, {
contexts: function () {
contexts: function initContexts() {
update(AutoCommands.prototype, {
hives: contexts.Hives("autocmd", AutoCmdHive),
user: contexts.hives.autocmd.user,
@@ -176,7 +176,7 @@ var AutoCommands = Module("autocommands", {
matchingHives: function matchingHives(uri, doc) contexts.matchingGroups(uri, doc).autocmd
});
},
commands: function () {
commands: function initCommands() {
commands.add(["au[tocmd]"],
"Execute commands automatically on events",
function (args) {
@@ -280,15 +280,15 @@ var AutoCommands = Module("autocommands", {
});
});
},
completion: function () {
completion: function initCompletion() {
completion.autocmdEvent = function autocmdEvent(context) {
context.completions = Iterator(config.autocommands);
};
},
javascript: function () {
javascript: function initJavascript() {
JavaScript.setCompleter(AutoCmdHive.prototype.get, [function () Iterator(config.autocommands)]);
},
options: function () {
options: function initOptions() {
options.add(["eventignore", "ei"],
"List of autocommand event names which should be ignored",
"stringlist", "",

View File

@@ -402,7 +402,7 @@ var Bookmarks = Module("bookmarks", {
}
}, {
}, {
commands: function () {
commands: function initCommands() {
// TODO: Clean this up.
const tags = {
names: ["-tags", "-T"],
@@ -565,7 +565,7 @@ var Bookmarks = Module("bookmarks", {
privateData: true
});
},
mappings: function () {
mappings: function initMappings() {
var myModes = config.browserModes;
mappings.add(myModes, ["a"],
@@ -605,7 +605,7 @@ var Bookmarks = Module("bookmarks", {
"Toggle bookmarked state of current URL",
function () { bookmarks.toggle(buffer.uri.spec); });
},
options: function () {
options: function initOptions() {
options.add(["defsearch", "ds"],
"The default search engine",
"string", "google",
@@ -622,7 +622,7 @@ var Bookmarks = Module("bookmarks", {
{ completer: function completer(context) completion.searchEngine(context, true), });
},
completion: function () {
completion: function initCompletion() {
completion.bookmark = function bookmark(context, tags, extra) {
context.title = ["Bookmark", "Title"];
context.format = bookmarks.format;

View File

@@ -1593,7 +1593,7 @@ var CommandLine = Module("commandline", {
return arg;
}
}, {
commands: function init_commands() {
commands: function initCommands() {
[
{
name: "ec[ho]",
@@ -1679,7 +1679,7 @@ var CommandLine = Module("commandline", {
bases: [modes.INSERT]
});
},
mappings: function init_mappings() {
mappings: function initMappings() {
mappings.add([modes.COMMAND],
[":"], "Enter Command Line mode",
@@ -1809,7 +1809,7 @@ var CommandLine = Module("commandline", {
bind(["<C-]>", "<C-5>"], "Expand command line abbreviation",
function () { editor.expandAbbreviation(modes.COMMAND_LINE); });
},
options: function init_options() {
options: function initOptions() {
options.add(["history", "hi"],
"Number of Ex commands and search patterns to store in the command-line history",
"number", 500,
@@ -1825,7 +1825,7 @@ var CommandLine = Module("commandline", {
"number", 100,
{ validator: function (value) value >= 0 });
},
sanitizer: function init_sanitizer() {
sanitizer: function initSanitizer() {
sanitizer.addItem("commandline", {
description: "Command-line and search history",
persistent: true,

View File

@@ -1234,7 +1234,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
}, {
toolbarHidden: function hidden(elem) (elem.getAttribute("autohide") || elem.getAttribute("collapsed")) == "true"
}, {
cache: function () {
cache: function initCache() {
cache.register("help/plugins.xml", function () {
// Process plugin help entries.
XML.ignoreWhiteSpace = XML.prettyPrinting = false;
@@ -1315,11 +1315,11 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
</overlay>;
});
},
events: function () {
events: function initEvents() {
events.listen(window, dactyl, "events", true);
},
// Only general options are added here, which are valid for all Dactyl extensions
options: function () {
options: function initOptions() {
options.add(["errorbells", "eb"],
"Ring the bell when an error message is displayed",
"boolean", false);
@@ -1494,7 +1494,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
});
},
mappings: function () {
mappings: function initMappings() {
if (dactyl.has("session"))
mappings.add([modes.NORMAL], ["ZQ"],
"Quit and don't save the session",
@@ -1505,7 +1505,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
function () { dactyl.quit(true); });
},
commands: function () {
commands: function initCommands() {
commands.add(["dia[log]"],
"Open a " + config.appName + " dialog",
function (args) {
@@ -1838,7 +1838,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
},
completion: function () {
completion: function initCompletion() {
completion.dialog = function dialog(context) {
context.title = ["Dialog"];
context.filters.push(function ({ item }) !item[2] || item[2]());
@@ -1869,7 +1869,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
context.completions = dactyl.windows;
};
},
load: function () {
load: function initLoad() {
dactyl.triggerObserver("load");
dactyl.log(_("dactyl.modulesLoaded"), 3);

View File

@@ -688,7 +688,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
return DOM(elem).editor;
}
}, {
modes: function init_modes() {
modes: function initModes() {
modes.addMode("OPERATOR", {
char: "o",
description: "Mappings which move the cursor",
@@ -745,7 +745,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
bases: [modes.INSERT]
});
},
commands: function init_commands() {
commands: function initCommands() {
commands.add(["reg[isters]"],
"List the contents of known registers",
function (args) {
@@ -753,7 +753,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
},
{ argCount: "*" });
},
completion: function init_completion() {
completion: function initCompletion() {
completion.register = function complete_register(context) {
context = context.fork("registers");
context.keys = { text: util.identity, description: editor.closure.getRegister };
@@ -777,7 +777,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
});
};
},
mappings: function init_mappings() {
mappings: function initMappings() {
Map.types["editor"] = {
preExecute: function preExecute(args) {
@@ -1346,7 +1346,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
bind(["<C-n>"], "Select the next autocomplete result",
function () { events.feedkeys("<Down>", { skipmap: true }); });
},
options: function init_options() {
options: function initOptions() {
options.add(["editor"],
"The external text editor",
"string", 'gvim -f +<line> +"sil! call cursor(0, <column>)" <file>', {
@@ -1391,7 +1391,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
}
});
},
sanitizer: function () {
sanitizer: function initSanitizer() {
sanitizer.addItem("registers", {
description: "Register values",
persistent: true,

View File

@@ -983,7 +983,7 @@ var Events = Module("events", {
});
},
commands: function () {
commands: function initCommands() {
commands.add(["delmac[ros]"],
"Delete macros",
function (args) {
@@ -1009,13 +1009,13 @@ var Events = Module("events", {
completer: function (context) completion.macro(context)
});
},
completion: function () {
completion: function initCompletion() {
completion.macro = function macro(context) {
context.title = ["Macro", "Keys"];
context.completions = [item for (item in events.getMacros())];
};
},
mappings: function () {
mappings: function initMappings() {
mappings.add([modes.MAIN],
["<A-b>", "<pass-next-key-builtin>"], "Process the next key as a builtin mapping",
@@ -1097,7 +1097,7 @@ var Events = Module("events", {
},
{ count: true });
},
options: function () {
options: function initOptions() {
const Hive = Class("Hive", {
init: function init(values, map) {
this.name = "passkeys:" + map;

View File

@@ -175,7 +175,7 @@ var History = Module("history", {
}
}, {
}, {
commands: function () {
commands: function initCommands() {
commands.add(["ba[ck]"],
"Go back in the browser history",
function (args) {
@@ -321,7 +321,7 @@ var History = Module("history", {
{ argCount: "0" });
},
completion: function () {
completion: function initCompletion() {
completion.domain = function (context) {
context.anchored = false;
context.compare = function (a, b) String.localeCompare(a.key, b.key);
@@ -351,7 +351,7 @@ var History = Module("history", {
completion.addUrlCompleter("history", "History", completion.history);
},
mappings: function () {
mappings: function initMappings() {
function bind() mappings.add.apply(mappings, [config.browserModes].concat(Array.slice(arguments)));
bind(["<C-o>"], "Go to an older position in the jump list",

View File

@@ -332,7 +332,7 @@ var Marks = Module("marks", {
{ arg: true });
},
commands: function () {
commands: function initCommands() {
commands.add(["delm[arks]"],
"Delete the specified marks",
function (args) {
@@ -372,7 +372,7 @@ var Marks = Module("marks", {
});
},
completion: function () {
completion: function initCompletion() {
completion.mark = function mark(context) {
function percent(i) Math.round(i * 100);
@@ -383,7 +383,7 @@ var Marks = Module("marks", {
context.completions = marks.all;
};
},
sanitizer: function () {
sanitizer: function initSanitizer() {
sanitizer.addItem("marks", {
description: "Local and URL marks",
persistent: true,

View File

@@ -118,7 +118,7 @@ var QuickMarks = Module("quickmarks", {
}
}, {
}, {
commands: function () {
commands: function initCommands() {
commands.add(["delqm[arks]"],
"Delete the specified QuickMarks",
function (args) {
@@ -175,13 +175,13 @@ var QuickMarks = Module("quickmarks", {
completer: function (context) completion.quickmark(context),
});
},
completion: function () {
completion: function initCompletion() {
completion.quickmark = function (context) {
context.title = ["QuickMark", "URL"];
context.generate = function () Iterator(quickmarks._qmarks);
};
},
mappings: function () {
mappings: function initMappings() {
var myModes = config.browserModes;
mappings.add(myModes,

View File

@@ -596,10 +596,10 @@ var Tabs = Module("tabs", {
services.sessionStore.setTabState(to, tabState);
}
}, {
load: function init_load() {
load: function initLoad() {
tabs.updateTabCount();
},
commands: function init_commands() {
commands: function initCommands() {
[
{
name: ["bd[elete]"],
@@ -1015,7 +1015,7 @@ var Tabs = Module("tabs", {
{ argCount: "0" });
}
},
completion: function init_completion() {
completion: function initCompletion() {
completion.buffer = function buffer(context, visible) {
let { tabs } = modules;
@@ -1096,7 +1096,7 @@ var Tabs = Module("tabs", {
};
};
},
events: function init_events() {
events: function initEvents() {
let tabContainer = config.tabbrowser.mTabContainer;
function callback() {
tabs.timeout(function () { this.updateTabCount(); });
@@ -1105,7 +1105,7 @@ var Tabs = Module("tabs", {
events.listen(tabContainer, event, callback, false);
events.listen(tabContainer, "TabSelect", tabs.closure._onTabSelect, false);
},
mappings: function init_mappings() {
mappings: function initMappings() {
mappings.add([modes.COMMAND], ["<C-t>", "<new-tab-next>"],
"Execute the next mapping in a new tab",
@@ -1199,7 +1199,7 @@ var Tabs = Module("tabs", {
{ count: true });
}
},
options: function init_options() {
options: function initOptions() {
options.add(["showtabline", "stal"],
"Define when the tab bar is visible",
"string", true,

View File

@@ -357,7 +357,7 @@ var Addons = Module("addons", {
.toObject())
}, {
}, {
commands: function (dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { CommandOption, commands, completion, io } = modules;
commands.add(["addo[ns]", "ao"],
@@ -458,7 +458,7 @@ var Addons = Module("addons", {
});
});
},
completion: function (dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
completion.addonType = function addonType(context) {
let base = ["extension", "theme"];
function update(types) {

View File

@@ -1114,7 +1114,7 @@ var Completion = Module("completion", {
get options() this.modules.options
});
},
commands: function (dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands, completion } = modules;
commands.add(["contexts"],
"List the completion contexts used during completion of an Ex command",
@@ -1135,7 +1135,7 @@ var Completion = Module("completion", {
literal: 0
});
},
options: function (dactyl, modules, window) {
options: function initOptions(dactyl, modules, window) {
const { completion, options } = modules;
let wildmode = {
values: {

View File

@@ -261,7 +261,7 @@ var RangeFinder = Module("rangefinder", {
get onSubmit() modules.rangefinder.closure.onSubmit
});
},
mappings: function (dactyl, modules, window) {
mappings: function initMappings(dactyl, modules, window) {
const { Buffer, buffer, config, mappings, modes, rangefinder } = modules;
var myModes = config.browserModes.concat([modes.CARET]);
@@ -296,7 +296,7 @@ var RangeFinder = Module("rangefinder", {
});
},
options: function (dactyl, modules, window) {
options: function initOptions(dactyl, modules, window) {
const { options, rangefinder } = modules;
options.add(["hlfind", "hlf"],

View File

@@ -413,7 +413,7 @@ var Help = Module("Help", {
})
}, {
}, {
commands: function init_commands(dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands, completion, help } = modules;
[
@@ -440,7 +440,7 @@ var Help = Module("Help", {
});
});
},
completion: function init_completion(dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
const { completion } = modules;
completion.help = function completion_help(context, consolidated) {
@@ -452,7 +452,7 @@ var Help = Module("Help", {
context.keys = { text: 0, description: function () "all" };
};
},
mappings: function init_mappings(dactyl, modules, window) {
mappings: function initMappings(dactyl, modules, window) {
const { help, mappings, modes } = modules;
mappings.add([modes.MAIN], ["<open-help>", "<F1>"],
@@ -463,7 +463,7 @@ var Help = Module("Help", {
"Open the single, consolidated help page",
function () { modules.ex.helpall(); });
},
javascript: function init_javascript(dactyl, modules, window) {
javascript: function initJavascript(dactyl, modules, window) {
modules.JavaScript.setCompleter([modules.help.exportHelp],
[function (context, args) overlay.activeModules.completion.file(context)]);
}

View File

@@ -575,7 +575,7 @@ var IO = Module("io", {
*/
PATH_SEP: deprecated("File.PATH_SEP", { get: function PATH_SEP() File.PATH_SEP })
}, {
commands: function init_commands(dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands, completion, io } = modules;
commands.add(["cd", "chd[ir]"],
@@ -929,7 +929,7 @@ unlet s:cpo_save
literal: 0
});
},
completion: function init_completion(dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
const { completion, io } = modules;
completion.charset = function (context) {
@@ -1077,7 +1077,7 @@ unlet s:cpo_save
completion.file(context, full);
});
},
javascript: function init_javascript(dactyl, modules, window) {
javascript: function initJavascript(dactyl, modules, window) {
modules.JavaScript.setCompleter([File, File.expandPath],
[function (context, obj, args) {
context.quote[2] = "";
@@ -1096,7 +1096,7 @@ unlet s:cpo_save
input: true
});
},
options: function init_options(dactyl, modules, window) {
options: function initOptions(dactyl, modules, window) {
const { completion, options } = modules;
var shell, shellcmdflag;

View File

@@ -879,7 +879,7 @@ var JavaScript = Module("javascript", {
bind(["<C-b>", "<PageUp>"], "Scroll up half a page",
function ({ self }) { self.repl.scrollVertical("pages", -1); });
},
options: function (dactyl, modules, window) {
options: function initOptions(dactyl, modules, window) {
modules.options.add(["jsdebugger", "jsd"],
"Enable the JavaScript debugger service for use in JavaScript completion",
"boolean", false, {

View File

@@ -386,12 +386,12 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
yield p;
}
}, {
load: function (dactyl, modules, window) {
load: function initLoad(dactyl, modules, window) {
if (!sanitizer.firstRun++ && sanitizer.runAtShutdown && !sanitizer.ranAtShutdown)
sanitizer.sanitizeItems(null, Range(), null, "shutdown");
sanitizer.ranAtShutdown = false;
},
autocommands: function (dactyl, modules, window) {
autocommands: function initAutocommands(dactyl, modules, window) {
const { autocommands } = modules;
storage.addObserver("private-mode",
@@ -406,7 +406,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
autocommands.trigger("Sanitize", { name: event.substr("clear-".length), domain: value[1] });
}, window);
},
commands: function (dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands } = modules;
commands.add(["sa[nitize]"],
"Clear private data",
@@ -565,7 +565,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
},
});
},
completion: function (dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
modules.completion.visibleHosts = function completeHosts(context) {
let res = util.visibleHosts(window.content);
if (context.filter && !res.some(function (host) host.indexOf(context.filter) >= 0))
@@ -578,7 +578,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
context.completions = res;
};
},
options: function (dactyl, modules) {
options: function initOptions(dactyl, modules) {
const options = modules.options;
if (services.has("privateBrowsing"))
options.add(["private", "pornmode"],

View File

@@ -547,7 +547,7 @@ var Styles = Module("Styles", {
return '"' + str.replace(/([\\"])/g, "\\$1").replace(/\n/g, "\\00000a") + '"';
},
}, {
commands: function (dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands, contexts, styles } = modules;
function sheets(context, args, filter) {
@@ -696,7 +696,7 @@ var Styles = Module("Styles", {
});
});
},
contexts: function (dactyl, modules, window) {
contexts: function initContexts(dactyl, modules, window) {
modules.contexts.Hives("styles",
Class("LocalHive", Contexts.Hive, {
init: function init(group) {
@@ -717,7 +717,7 @@ var Styles = Module("Styles", {
}
}));
},
completion: function (dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
const names = Array.slice(DOM(<div/>, window.document).style);
modules.completion.css = function (context) {
context.title = ["CSS Property"];
@@ -732,7 +732,7 @@ var Styles = Module("Styles", {
}
};
},
javascript: function (dactyl, modules, window) {
javascript: function initJavascript(dactyl, modules, window) {
modules.JavaScript.setCompleter(["get", "add", "remove", "find"].map(function (m) Hive.prototype[m]),
[ // Prototype: (name, filter, css, index)
function (context, obj, args) this.names,
@@ -741,7 +741,7 @@ var Styles = Module("Styles", {
function (context, obj, args) this.sheets
]);
},
template: function () {
template: function initTemplate() {
let patterns = Styles.patterns;
template.highlightCSS = function highlightCSS(css) {
@@ -769,7 +769,7 @@ var Styles = Module("Styles", {
}{ match.postSpace }</>
})
}
},
}
});
endModule();

View File

@@ -456,7 +456,7 @@ const Player = Module("player", {
});
},
commandline: function () {
commandline: function initCommandline() {
player.CommandMode = Class("CommandSearchViewMode", modules.CommandMode, {
init: function init(mode) {
this.mode = mode;
@@ -472,7 +472,7 @@ const Player = Module("player", {
get onSubmit() player.closure.onSearchSubmit
});
},
commands: function () {
commands: function initCommands() {
commands.add(["f[ilter]"],
"Filter tracks based on keywords {genre/artist/album/track}",
function (args) {
@@ -672,7 +672,7 @@ const Player = Module("player", {
},
{ argCount: "1" });
},
completion: function () {
completion: function initCompletion() {
completion.album = function album(context, artist) {
context.title = ["Album"];
context.completions = [[v, ""] for ([, v] in Iterator(library.getAlbums(artist)))];
@@ -708,7 +708,7 @@ const Player = Module("player", {
context.completions = [[v, ""] for ([, v] in Iterator(library.getTracks(artist, album)))];
};
},
mappings: function () {
mappings: function initMappings() {
mappings.add([modes.PLAYER],
["x"], "Play track",
function () { ex.playerplay(); });
@@ -806,7 +806,7 @@ const Player = Module("player", {
};
}
},
options: function () {
options: function initOptions() {
options.add(["repeat"],
"Set the playback repeat mode",
"number", 0,

View File

@@ -94,7 +94,7 @@ var Config = Module("config", ConfigBase, {
}, {
}, {
commands: function (dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands, completion, config } = modules;
const { document } = window;
@@ -205,7 +205,7 @@ var Config = Module("config", ConfigBase, {
privateData: true
});
},
completion: function (dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
const { CompletionContext, bookmarkcache, completion } = modules;
const { document } = window;
@@ -224,7 +224,7 @@ var Config = Module("config", ConfigBase, {
context.completions = Array.map(menu.childNodes, function (n) [n.getAttribute("label"), ""]);
};
},
events: function (dactyl, modules, window) {
events: function initEvents(dactyl, modules, window) {
modules.events.listen(window, "SidebarFocused", function (event) {
modules.config.lastSidebar = window.document.getElementById("sidebar-box")
.getAttribute("sidebarcommand");
@@ -237,7 +237,7 @@ var Config = Module("config", ConfigBase, {
"Handled by " + config.host,
function () Events.PASS_THROUGH);
},
options: function (dactyl, modules, window) {
options: function initOptions(dactyl, modules, window) {
modules.options.add(["online"],
"Enables or disables offline mode",
"boolean", true,

View File

@@ -88,7 +88,7 @@ var Addressbook = Module("addressbook", {
}
}, {
}, {
commands: function () {
commands: function initCommands() {
commands.add(["con[tact]"],
"Add an address book entry",
function (args) {
@@ -117,7 +117,7 @@ var Addressbook = Module("addressbook", {
function (args) { addressbook.list(args.string, args.bang); },
{ bang: true });
},
mappings: function () {
mappings: function initMappings() {
var myModes = config.mailModes;
mappings.add(myModes, ["a"],