From ae3aaa9ade4f2ed37797d9e282a4d0e5c613bc7c Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Mon, 24 Jul 2023 01:21:52 +0200 Subject: [PATCH] Add a "nogui" option to the inset-edit lfun (bug 11956). --- src/LyXAction.cpp | 6 ++++-- src/insets/InsetCollapsible.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 9ebf307d6e..3391e228d2 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -2134,9 +2134,11 @@ void LyXAction::init() the inset is locked, and the temporary file is edited. In this case, #LFUN_INSET_END_EDIT must be called to overtake the changes and unlock the inset after editing is finished. - * \li Syntax: inset-edit [] + * \li Syntax: inset-edit [nogui] [] * \li Params: : Parameters for the inset. \n - Currently only the filename will be considered. + Currently only the filename will be considered.\n + nogui: does not launch external editor, only returns filename + to be processed. * \li Origin: spitz, 27 Apr 2006 * \endvar */ diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp index 56d8ce8087..eb04ca8527 100644 --- a/src/insets/InsetCollapsible.cpp +++ b/src/insets/InsetCollapsible.cpp @@ -626,7 +626,12 @@ void InsetCollapsible::doDispatch(Cursor & cur, FuncRequest & cmd) cur.clearSelection(); cur.pop(); cur.leaveInset(*this); - theFormats().edit(buffer(), tempfilename, format); + + if (cmd.argument() == "nogui") + cur.message(from_utf8(name)); + else + theFormats().edit(buffer(), tempfilename, format); + break; } case LFUN_INSET_END_EDIT: { -- 2.39.5