mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-23 23:35:45 +01:00
replace some echo() calls with echomsg()
This commit is contained in:
@@ -836,7 +836,7 @@ function Commands() //{{{
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
liberator.echo("No user-defined commands found");
|
liberator.echomsg("No user-defined commands found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -128,7 +128,10 @@ function AutoCommands() //{{{
|
|||||||
{
|
{
|
||||||
args = args.string;
|
args = args.string;
|
||||||
if (/^\s*$/.test(args))
|
if (/^\s*$/.test(args))
|
||||||
return liberator.echo("No matching autocommands");
|
{
|
||||||
|
liberator.echomsg("No matching autocommands");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let [, event, url] = args.match(/^(\S+)(?:\s+(\S+))?$/);
|
let [, event, url] = args.match(/^(\S+)(?:\s+(\S+))?$/);
|
||||||
url = url || buffer.URL;
|
url = url || buffer.URL;
|
||||||
@@ -148,7 +151,7 @@ function AutoCommands() //{{{
|
|||||||
// TODO: perhaps trigger could return the number of autocmds triggered
|
// TODO: perhaps trigger could return the number of autocmds triggered
|
||||||
// TODO: Perhaps this should take -args to pass to the command?
|
// TODO: Perhaps this should take -args to pass to the command?
|
||||||
if (!autocommands.get(event).some(function (c) c.pattern.test(url)))
|
if (!autocommands.get(event).some(function (c) c.pattern.test(url)))
|
||||||
liberator.echo("No matching autocommands");
|
liberator.echomsg("No matching autocommands");
|
||||||
else
|
else
|
||||||
autocommands.trigger(event, { url: url });
|
autocommands.trigger(event, { url: url });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ function IO() //{{{
|
|||||||
if (isAbsolutePath(args))
|
if (isAbsolutePath(args))
|
||||||
{
|
{
|
||||||
if (io.setCurrentDirectory(args))
|
if (io.setCurrentDirectory(args))
|
||||||
liberator.echo(io.getCurrentDirectory().path);
|
liberator.echomsg(io.getCurrentDirectory().path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -233,7 +233,7 @@ function IO() //{{{
|
|||||||
if (dir.exists() && dir.isDirectory() && dir.isReadable())
|
if (dir.exists() && dir.isDirectory() && dir.isReadable())
|
||||||
{
|
{
|
||||||
io.setCurrentDirectory(dir.path);
|
io.setCurrentDirectory(dir.path);
|
||||||
liberator.echo(io.getCurrentDirectory().path);
|
liberator.echomsg(io.getCurrentDirectory().path);
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -260,7 +260,7 @@ function IO() //{{{
|
|||||||
|
|
||||||
commands.add(["pw[d]"],
|
commands.add(["pw[d]"],
|
||||||
"Print the current directory name",
|
"Print the current directory name",
|
||||||
function () { liberator.echo(io.getCurrentDirectory().path); },
|
function () { liberator.echomsg(io.getCurrentDirectory().path); },
|
||||||
{ argCount: "0" });
|
{ argCount: "0" });
|
||||||
|
|
||||||
// "mkv[imperatorrc]" or "mkm[uttatorrc]"
|
// "mkv[imperatorrc]" or "mkm[uttatorrc]"
|
||||||
|
|||||||
@@ -919,7 +919,7 @@ const liberator = (function () //{{{
|
|||||||
if (config.helpFiles.indexOf(helpFile) != -1)
|
if (config.helpFiles.indexOf(helpFile) != -1)
|
||||||
liberator.open("chrome://liberator/locale/" + helpFile, where);
|
liberator.open("chrome://liberator/locale/" + helpFile, where);
|
||||||
else
|
else
|
||||||
liberator.echo("Sorry, help file " + helpFile.quote() + " not found");
|
liberator.echomsg("Sorry, help file " + helpFile.quote() + " not found");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ function Mappings() //{{{
|
|||||||
// TODO: Move this to an ItemList to show this automatically
|
// TODO: Move this to an ItemList to show this automatically
|
||||||
if (list.*.length() == list.text().length())
|
if (list.*.length() == list.text().length())
|
||||||
{
|
{
|
||||||
liberator.echo("No mapping found");
|
liberator.echomsg("No mapping found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ function Options() //{{{
|
|||||||
if (str.*.length())
|
if (str.*.length())
|
||||||
liberator.echo(str, commandline.FORCE_MULTILINE);
|
liberator.echo(str, commandline.FORCE_MULTILINE);
|
||||||
else
|
else
|
||||||
liberator.echo("No variables found");
|
liberator.echomsg("No variables found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ function Tabs() //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (removed > 0)
|
if (removed > 0)
|
||||||
liberator.echo(removed + " fewer tab(s)");
|
liberator.echomsg(removed + " fewer tab(s)", 9);
|
||||||
else
|
else
|
||||||
liberator.echoerr("E94: No matching tab for " + args);
|
liberator.echoerr("E94: No matching tab for " + args);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ function Addressbook() //{{{
|
|||||||
displayName = generateDisplayName(firstName, lastName);
|
displayName = generateDisplayName(firstName, lastName);
|
||||||
|
|
||||||
if (addressbook.add(mailAddr, firstName, lastName, displayName))
|
if (addressbook.add(mailAddr, firstName, lastName, displayName))
|
||||||
liberator.echo("Added address: " + displayName + " <" + mailAddr + ">", commandline.FORCE_SINGLELINE);
|
liberator.echomsg("Added address: " + displayName + " <" + mailAddr + ">", 1, commandline.FORCE_SINGLELINE);
|
||||||
else
|
else
|
||||||
liberator.echoerr("Exxx: Could not add bookmark `" + mailAddr + "'", commandline.FORCE_SINGLELINE);
|
liberator.echoerr("Exxx: Could not add bookmark `" + mailAddr + "'", commandline.FORCE_SINGLELINE);
|
||||||
|
|
||||||
|
|||||||
@@ -138,12 +138,12 @@ function Mail() //{{{
|
|||||||
if (copy)
|
if (copy)
|
||||||
{
|
{
|
||||||
MsgCopyMessage(folders[0]);
|
MsgCopyMessage(folders[0]);
|
||||||
setTimeout(function () { liberator.echo(count + " message(s) copied to " + folders[0].prettyName); }, 100);
|
setTimeout(function () { liberator.echomsg(count + " message(s) copied to " + folders[0].prettyName, 1); }, 100);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MsgMoveMessage(folders[0]);
|
MsgMoveMessage(folders[0]);
|
||||||
setTimeout(function () { liberator.echo(count + " message(s) moved to " + folders[0].prettyName); }, 100);
|
setTimeout(function () { liberator.echomsg(count + " message(s) moved to " + folders[0].prettyName, 1); }, 100);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ function Bookmarks() //{{{
|
|||||||
if (bookmarks.add(false, title, url, keyword, tags, args.bang))
|
if (bookmarks.add(false, title, url, keyword, tags, args.bang))
|
||||||
{
|
{
|
||||||
let extra = (title == url) ? "" : " (" + title + ")";
|
let extra = (title == url) ? "" : " (" + title + ")";
|
||||||
liberator.echo("Added bookmark: " + url + extra, commandline.FORCE_SINGLELINE);
|
liberator.echomsg("Added bookmark: " + url + extra, 1, commandline.FORCE_SINGLELINE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
liberator.echoerr("Exxx: Could not add bookmark `" + title + "'", commandline.FORCE_SINGLELINE);
|
liberator.echoerr("Exxx: Could not add bookmark `" + title + "'", commandline.FORCE_SINGLELINE);
|
||||||
@@ -368,7 +368,7 @@ function Bookmarks() //{{{
|
|||||||
let url = args.string || buffer.URL;
|
let url = args.string || buffer.URL;
|
||||||
let deletedCount = bookmarks.remove(url);
|
let deletedCount = bookmarks.remove(url);
|
||||||
|
|
||||||
liberator.echo(deletedCount + " bookmark(s) with url `" + url + "' deleted", commandline.FORCE_SINGLELINE);
|
liberator.echomsg(deletedCount + " bookmark(s) with url `" + url + "' deleted", 1, commandline.FORCE_SINGLELINE);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
argCount: "?",
|
argCount: "?",
|
||||||
|
|||||||
Reference in New Issue
Block a user