Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/acfea193e763a6f1f45b54bb0b5607e02f7cd392
>---------------------------------------------------------------
commit acfea193e763a6f1f45b54bb0b5607e02f7cd392
Author: Shmuel Zeigerman <
solo...@gmail.com>
Date: Thu Jul 23 00:24:21 2026 +0300
1. LuaFAR: added functions far.GetErrorMode and far.SetErrorMode.
2. LuaFAR: added button "Mute" in LF_Error message box.
3. LuaMacro: far.SetErrorMode(0) is called on reloading macros
(it enables event error messages if they were disabled).
>---------------------------------------------------------------
acfea193e763a6f1f45b54bb0b5607e02f7cd392
enc/enc_lua/luafar_manual.tsi | 30 ++++++++++++++++++++++++++++++
plugins/luamacro/_globalinfo.lua | 4 ++--
plugins/luamacro/changelog | 9 +++++++++
plugins/luamacro/luafar/lf_luafar.h | 3 ++-
plugins/luamacro/luafar/lf_service.c | 33 +++++++++++++++++++++++++++++++--
plugins/luamacro/luafar/lf_version.h | 2 +-
plugins/luamacro/utils.lua | 1 +
7 files changed, 76 insertions(+), 6 deletions(-)
diff --git a/enc/enc_lua/luafar_manual.tsi b/enc/enc_lua/luafar_manual.tsi
index 4084ce511..16c92845d 100644
--- a/enc/enc_lua/luafar_manual.tsi
+++ b/enc/enc_lua/luafar_manual.tsi
@@ -368,11 +368,13 @@ node lv=2 id=557 art=557 nm=far.Host.SetDirectory
node lv=1 id=83 art=83 nm=Other functions
node lv=2 id=185 art=185 nm=far.CPluginStartupInfo
node lv=2 id=544 art=544 nm=far.FileTimeResolution
+node lv=2 id=666 art=666 nm=far.GetErrorMode
node lv=2 id=549 art=549 nm=far.GetLuafarVersion
node lv=2 id=597 art=597 nm=far.GetPluginId
node lv=2 id=280 art=280 nm=far.MakeMenuItems
node lv=2 id=68 art=68 nm=far.PluginStartupInfo
node lv=2 id=527 art=527 nm=far.RunDefaultScript
+node lv=2 id=667 art=667 nm=far.SetErrorMode
node lv=2 id=282 art=282 nm=far.Show
node lv=2 id=346 art=346 nm=far.Timer
node lv=3 id=352 art=352 nm=Properties
@@ -10862,3 +10864,31 @@ article id=665 dt=Text ctime=3990099408 mtime=3990099456 nm=far.Flavor
#_It is intended for use in scripts portable between far3/far2l/far2m.
#_
+article id=666 dt=Text ctime=3993926414 mtime=3993927097 nm=far.GetErrorMode
+#_Mode = far.GetErrorMode()
+#_
+#_**Parameters:**
+#_ none
+#_
+#_**Returns:**
+#_ Mode: integer
+#_
+#_**See also:**
+#_ `far.SetErrorMode`
+#_
+
+article id=667 dt=Text ctime=3993926441 mtime=3993927212 nm=far.SetErrorMode
+#_PrevMode = far.SetErrorMode(Mode)
+#_
+#_**Parameters:**
+#_ Mode : integer
+#_ bit0 = 0: enable event handlers error output
+#_ bit0 = 1: disable event handlers error output
+#_
+#_**Returns:**
+#_ PrevMode : integer, previous mode
+#_
+#_**See also:**
+#_ `far.GetErrorMode`
+#_
+
diff --git a/plugins/luamacro/_globalinfo.lua b/plugins/luamacro/_globalinfo.lua
index f8bf76f5e..02d57fb20 100644
--- a/plugins/luamacro/_globalinfo.lua
+++ b/plugins/luamacro/_globalinfo.lua
@@ -1,7 +1,7 @@
function export.GetGlobalInfo()
return {
- Version = { 3, 0, 0, 931 },
- MinFarVersion = { 3, 0, 0, 6678 },
+ Version = { 3, 0, 0, 932 },
+ MinFarVersion = { 3, 0, 0, 6723 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
Description = "Far macros in Lua",
diff --git a/plugins/luamacro/changelog b/plugins/luamacro/changelog
index 519ef586a..a5a04775c 100644
--- a/plugins/luamacro/changelog
+++ b/plugins/luamacro/changelog
@@ -1,3 +1,12 @@
+shmuel 2026-07-23 00:14:45+03:00 - build 932
+
+1. LuaFAR: added functions far.GetErrorMode and far.SetErrorMode.
+
+2. LuaFAR: added button "Mute" in LF_Error message box.
+
+3. LuaMacro: far.SetErrorMode(0) is called on reloading macros
+ (it enables event error messages if they were disabled).
+
shmuel 2026-07-12 18:12:46+03:00 - build 931
1. LuaFAR: refactoring.
diff --git a/plugins/luamacro/luafar/lf_luafar.h b/plugins/luamacro/luafar/lf_luafar.h
index 61d3988c1..630b5dd98 100644
--- a/plugins/luamacro/luafar/lf_luafar.h
+++ b/plugins/luamacro/luafar/lf_luafar.h
@@ -22,7 +22,8 @@ typedef intptr_t PLUGINDATAFLAGS;
static const PLUGINDATAFLAGS
PDF_DIALOGEVENTDRAWENABLE = 0x00000001,
PDF_PROCESSINGERROR = 0x00000002,
- PDF_FULL_TIME_RESOLUTION = 0x00000004;
+ PDF_FULL_TIME_RESOLUTION = 0x00000004,
+ PDF_MUTE_ERRORS_1 = 0x00000008;
typedef struct
{
diff --git a/plugins/luamacro/luafar/lf_service.c b/plugins/luamacro/luafar/lf_service.c
index 8c4203535..65c1bd42c 100644
--- a/plugins/luamacro/luafar/lf_service.c
+++ b/plugins/luamacro/luafar/lf_service.c
@@ -2130,8 +2130,11 @@ int LF_Message(lua_State* L,
void LF_Error(lua_State *L, const wchar_t* aMsg)
{
- PSInfo *Info = GetPluginData(L)->Info;
+ TPluginData *pd = GetPluginData(L);
+ if (pd->Flags & PDF_MUTE_ERRORS_1)
+ return;
+ PSInfo *Info = pd->Info;
if (Info == NULL)
return;
@@ -2141,7 +2144,9 @@ void LF_Error(lua_State *L, const wchar_t* aMsg)
lua_pushlstring(L, (const char*)L":\n", 4);
LF_Gsub(L, aMsg, L"\n\t", L"\n ");
lua_concat(L, 3);
- LF_Message(L, (const wchar_t*)lua_tostring(L,-1), L"Error", L"OK", "wl", NULL, NULL);
+ if (1 == LF_Message(L, (const wchar_t*)lua_tostring(L,-1), L"Error", L"OK;Mute", "wl", NULL, NULL))
+ pd->Flags |= PDF_MUTE_ERRORS_1;
+
lua_pop(L, 1);
}
@@ -6199,6 +6204,28 @@ static int far_GetPluginId(lua_State *L)
return 1;
}
+static int far_GetErrorMode(lua_State *L)
+{
+ TPluginData *pd = GetPluginData(L);
+ lua_Integer Mode = (pd->Flags & PDF_MUTE_ERRORS_1) ? 0x01 : 0x00;
+ lua_pushinteger(L, Mode);
+ return 1;
+}
+
+static int far_SetErrorMode(lua_State *L)
+{
+ TPluginData *pd = GetPluginData(L);
+ lua_Integer PrevMode = (pd->Flags & PDF_MUTE_ERRORS_1) ? 0x01 : 0x00;
+ lua_Integer NewMode = luaL_checkinteger(L, 1);
+ if (NewMode & 0x01)
+ pd->Flags |= PDF_MUTE_ERRORS_1;
+ else
+ pd->Flags &= ~PDF_MUTE_ERRORS_1;
+
+ lua_pushinteger(L, PrevMode);
+ return 1;
+}
+
#define PAIR(prefix,txt) {#txt, prefix ## _ ## txt}
const luaL_Reg timer_methods[] =
@@ -6464,6 +6491,7 @@ const luaL_Reg far_funcs[] =
PAIR( far, GetCurrentDirectory),
PAIR( far, GetDirList),
PAIR( far, GetDlgItem),
+ PAIR( far, GetErrorMode),
PAIR( far, GetFileOwner),
PAIR( far, GetLuafarVersion),
PAIR( far, GetMsg),
@@ -6511,6 +6539,7 @@ const luaL_Reg far_funcs[] =
PAIR( far, SaveScreen),
PAIR( far, SendDlgMessage),
PAIR( far, SetDlgItem),
+ PAIR( far, SetErrorMode),
PAIR( far, Show),
PAIR( far, ShowHelp),
PAIR( far, SubscribeDialogDrawEvents),
diff --git a/plugins/luamacro/luafar/lf_version.h b/plugins/luamacro/luafar/lf_version.h
index 5ab051993..dc88eda3b 100644
--- a/plugins/luamacro/luafar/lf_version.h
+++ b/plugins/luamacro/luafar/lf_version.h
@@ -1,3 +1,3 @@
#include <farversion.hpp>
-#define PLUGIN_BUILD 931
+#define PLUGIN_BUILD 932
diff --git a/plugins/luamacro/utils.lua b/plugins/luamacro/utils.lua
index 581059e7f..001deace9 100644
--- a/plugins/luamacro/utils.lua
+++ b/plugins/luamacro/utils.lua
@@ -861,6 +861,7 @@ local function LoadMacros (unload, paths)
export.GetContentData = export_GetContentData
end
+ far.SetErrorMode(0x00)
LoadMacrosDone = true
end