Dear list,
Following the discussions in <http://www.lyx.org/trac/ticket/9794>, here are a series of patches meant to address #9794 (inset-modify tabular commands are incorrectly disabled) and #4189 (Edit->Rows&Columns not shown when in mathed insert).
What I still don't like is that the cursor is truncated after applying table commands (issue mentioned in the first patch). If somebody can point me to an example where one does restore the full cursor after a dispatch, or tell me how to do that, then I will be able to fix this as well in the near future.
Uwe, do not worry about the changes in the docs. Eventually, only Shortcut.lyx has to be changed, and if the patch is not pushed in time this can be done later in the translations, automatically.
Sincerely, Guillaume
>From d490d7d4693c3cd2198e3dd96904f19b47f2b3be Mon Sep 17 00:00:00 2001 From: Guillaume Munch <g...@lyx.org> Date: Fri, 11 Dec 2015 02:15:52 +0000 Subject: [PATCH 1/3] New LFUN table-modify (#9794) The tabular-features LFUN was merged with "inset-modify tabular" when simplifying the tabular dialog at b5049e7. This choice later indirectly caused a few regressions (#7308, #9794). I introduce a separate LFUN table-modify to allow more flexibility for user commands, whereas "inset-modify tabular" is now reserved for the tabular dialog. In particular, inset-modify tabular is no longer caught by math grid insets. Known issues: * After successfully applying a tabular command, the cursor is truncated to the table. * Note that the tabular dialog still has similar issues that are inherited from the achitecture of the dialog menu. For instance the pref change can be mis-dispatched to an inset inside a cell and cause an error, for instance: Lexer.cpp (934): Missing 'Note'-tag in InsetNote::string2params. Got tabular instead. Line: 0 Maybe the inset-modify LFUN should treat commands coming from the wrong dialog as unknown and undispatched so that the parent can get it. --- src/FuncCode.h | 1 + src/LyXAction.cpp | 25 ++++++++----- src/frontends/qt4/GuiApplication.cpp | 17 +++++---- src/frontends/qt4/GuiTabular.cpp | 7 ++-- src/insets/Inset.cpp | 2 -- src/insets/InsetTabular.cpp | 70 +++++++++++++++++++++--------------- src/insets/InsetTabular.h | 3 ++ src/mathed/InsetMathAMSArray.cpp | 9 ++--- src/mathed/InsetMathCases.cpp | 20 +++-------- src/mathed/InsetMathGrid.cpp | 27 +++++--------- src/mathed/InsetMathHull.cpp | 9 ++--- src/mathed/InsetMathSplit.cpp | 12 +++---- src/mathed/InsetMathSubstack.cpp | 16 +++------ 13 files changed, 101 insertions(+), 117 deletions(-) diff --git a/src/FuncCode.h b/src/FuncCode.h index 66f57c0..e8a524b 100644 --- a/src/FuncCode.h +++ b/src/FuncCode.h @@ -464,6 +464,7 @@ enum FuncCode LFUN_BUFFER_MOVE_NEXT, // skostysh 20150408 // 340 LFUN_BUFFER_MOVE_PREVIOUS, // skostysh 20150408 + LFUN_TABLE_MODIFY, // gm, 20151210 LFUN_LASTACTION // end of the table }; diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 4467219..b4cb5f4 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -2167,7 +2167,7 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_TABULAR_INSERT * \li Action: Inserts table into the document. - * \li Notion: See #LFUN_INSET_MODIFY for some more details + * \li Notion: See #LFUN_TABLE_MODIFY for some more details about tabular modifications. * \li Syntax: tabular-insert [<ROWS> <COLUMNS>] * \li Params: In case no arguments are given show insert dialog. @@ -2462,11 +2462,17 @@ void LyXAction::init() ref, space, tabular, vspace, wrap insets. * \li Syntax: inset-modify <INSET> <ARGS> * \li Syntax: inset-modify changetype <TYPE> - * \li Syntax: inset-modify tabular <FEATURE> [<ARG>] + * \li Sample: inset-modify note Note Comment \n + inset-modify changetype Ovalbox + * \endvar + */ + { LFUN_INSET_MODIFY, "inset-modify", AtPoint, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_TABLE_MODIFY + * \li Action: Modify properties of tabulars and table-like math environments. + * \li Syntax: table-modify <FEATURE> [<ARG>] * \li Params: Generally see #LFUN_INSET_INSERT for further details.\n - In case that <INSET> is "tabular" various math-environment features - are handled as well, e.g. add-vline-left/right for the Grid/Array environment.\n - <FEATURE>: append-row|append-column|delete-row|delete-column|copy-row|\n + * <FEATURE>: append-row|append-column|delete-row|delete-column|copy-row|\n copy-column|move-column-right|move-column-left|move-row-down|move-row-up|\n toggle-line-top|toggle-line-bottom|toggle-line-left|toggle-line-right|\n align-left|align-right|align-center|align-block|align-decimal|set-decimal-point|\n @@ -2481,13 +2487,14 @@ void LyXAction::init() set-special-column|set-special-multicolumn|set-special-multirow|\n toggle-booktabs|set-booktabs|unset-booktabs|set-top-space|set-bottom-space|\n set-interline-space|set-border-lines|tabular-valign-top|\n - tabular-valign-middle|tabular-valign-bottom|set-tabular-width + tabular-valign-middle|tabular-valign-bottom|set-tabular-width\n + Various math-environment features are handled as well, e.g. add-vline-left/right for\n + the Grid/Array environment.\n <ARG>: additional argument for some commands, use debug mode to explore its values. - * \li Sample: inset-modify note Note Comment \n - inset-modify changetype Ovalbox + * \li Origin: gm, 10 Dec 2015 * \endvar */ - { LFUN_INSET_MODIFY, "inset-modify", AtPoint, Edit }, + { LFUN_TABLE_MODIFY, "table-modify", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_INSET_DIALOG_UPDATE * \li Action: Updates the values inside the dialog from the inset. diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 8a5377f..1034904 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -486,26 +486,29 @@ QString iconName(FuncRequest const & f, bool unknown) docstring firstcom; docstring dummy = split(f.argument(), firstcom, ';'); name1 = toqstr(firstcom); - // FIXME: we should rename the icons to tabular-xxx instead of - // "tabular-feature-xxx" + // trick introduced at b5049e76 to avoid renaming icons + // now we also avoid duplication name1.replace("inset-modify tabular", "tabular-feature"); + name1.replace("table-modify", "tabular-feature"); name1.replace(' ', '_'); break; } case LFUN_INSET_MODIFY: { - // FIXME: we should rename the icons to tabular-xxx instead of - // "tabular-feature-xxx" and generalize this naming to all - // insets, not to tabular using ones. + // avoid renaming and duplicating icon files as above string inset_name; string const command = split(to_utf8(f.argument()), inset_name, ' '); - if (insetCode(inset_name) == TABULAR_CODE) { + if (inset_name == "tabular") { name1 = "tabular-feature "+ toqstr(command); name1.replace(' ', '_'); break; } } default: - name2 = toqstr(lyxaction.getActionName(f.action())); + // avoid renaming and duplicating icon files as above + if (f.action() == LFUN_TABLE_MODIFY) + name2 = QString("tabular-feature"); + else + name2 = toqstr(lyxaction.getActionName(f.action())); name1 = name2; if (!f.argument().empty()) { diff --git a/src/frontends/qt4/GuiTabular.cpp b/src/frontends/qt4/GuiTabular.cpp index 495b2c6..fde382b 100644 --- a/src/frontends/qt4/GuiTabular.cpp +++ b/src/frontends/qt4/GuiTabular.cpp @@ -447,8 +447,7 @@ void GuiTabular::setTableAlignment(string & param_str) const docstring GuiTabular::dialogToParams() const { - // FIXME: We should use Tabular directly. - string param_str = "tabular from-dialog"; + string param_str = "tabular"; // table width string tabwidth = widgetsToLength(tabularWidthED, tabularWidthUnitLC); @@ -1070,8 +1069,8 @@ bool GuiTabular::checkWidgets(bool readonly) const bool GuiTabular::funcEnabled(Tabular::Feature f) const { - string cmd = "tabular " + featureAsString(f); - return getStatus(FuncRequest(LFUN_INSET_MODIFY, cmd)).enabled(); + FuncRequest r(LFUN_INSET_MODIFY, "tabular for-dialog" + featureAsString(f)); + return getStatus(r).enabled(); } diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp index 0fce648..f85b1a9 100644 --- a/src/insets/Inset.cpp +++ b/src/insets/Inset.cpp @@ -391,8 +391,6 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd, // FIXME: Why don't we let the insets determine whether this // should be enabled or not ? Now we need this check for // the tabular features. (vfr) - if (cmd.getArg(0) == "tabular") - return false; flag.setEnabled(true); return true; diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 437ac7e..4d44ef7 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -110,6 +110,8 @@ TabularFeature tabularFeature[] = { // the SET/UNSET actions are used by the table dialog, // the TOGGLE actions by the table toolbar buttons + // FIXME: these values have been hardcoded in InsetMathGrid and other + // math insets. { Tabular::APPEND_ROW, "append-row", false }, { Tabular::APPEND_COLUMN, "append-column", false }, { Tabular::DELETE_ROW, "delete-row", false }, @@ -4299,11 +4301,16 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) break; case LFUN_INSET_MODIFY: { + // we come from the dialog string arg; - if (cmd.getArg(1) == "from-dialog") - arg = cmd.getArg(0) + to_utf8(cmd.argument().substr(19)); - else - arg = to_utf8(cmd.argument()); + if (cmd.getArg(0) != "tabular" + || !tabularFeatures(cur, arg = cmd.getLongArg(1))) + cur.undispatched(); + break; + } + + case LFUN_TABLE_MODIFY: { + string arg = to_utf8(cmd.argument()); if (!tabularFeatures(cur, arg)) cur.undispatched(); break; @@ -4474,25 +4481,9 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) } -// function sets an object as defined in func_status.h: -// states OK, Unknown, Disabled, On, Off. -bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, - FuncStatus & status) const +bool InsetTabular::getActionStatus(Cursor & cur, string const & s, + string const & argument, FuncStatus & status) const { - switch (cmd.action()) { - case LFUN_INSET_MODIFY: { - if (&cur.inset() != this || cmd.getArg(0) != "tabular") - break; - - // FIXME: We only check for the very first argument... - string const s = cmd.getArg(1); - // We always enable the lfun if it is coming from the dialog - // because the dialog makes sure all the settings are valid, - // even though the first argument might not be valid now. - if (s == "from-dialog") { - status.setEnabled(true); - return true; - } int action = Tabular::LAST_ACTION; int i = 0; @@ -4508,8 +4499,6 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, return true; } - string const argument = cmd.getLongArg(2); - row_type sel_row_start = 0; row_type sel_row_end = 0; col_type sel_col_start = 0; @@ -4884,6 +4873,35 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, break; } return true; +} + + +// function sets an object as defined in func_status.h: +// states OK, Unknown, Disabled, On, Off. +bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, + FuncStatus & status) const +{ + switch (cmd.action()) { + case LFUN_INSET_MODIFY: + if (cmd.getArg(0) == "tabular") { + if (cmd.getArg(1) == "for-dialog") { + if (&cur.inset() != this) + break; + string action = cmd.getArg(2); + string arg = cmd.getLongArg(3); + return getActionStatus(cur, action, arg, status); + } else { + status.setEnabled(true); + return true; + } + } + + case LFUN_TABLE_MODIFY: { + if (&cur.inset() != this) + break; + string action = cmd.getArg(0); + string arg = cmd.getLongArg(1); + return getActionStatus(cur, action, arg, status); } case LFUN_CAPTION_INSERT: { @@ -5315,10 +5333,6 @@ bool InsetTabular::tabularFeatures(Cursor & cur, string const & argument) { istringstream is(argument); string s; - is >> s; - if (insetCode(s) != TABULAR_CODE) - return false; - // Safe guard. size_t safe_guard = 0; for (;;) { diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index d9b7fa4..511d929 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -996,6 +996,9 @@ private: /// void doDispatch(Cursor & cur, FuncRequest & cmd); /// + bool getActionStatus(Cursor & cur, std::string const & s, + std::string const & argument, FuncStatus & status) const; + /// bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; /// Inset * clone() const { return new InsetTabular(*this); } diff --git a/src/mathed/InsetMathAMSArray.cpp b/src/mathed/InsetMathAMSArray.cpp index 12a92da..4e4ec59 100644 --- a/src/mathed/InsetMathAMSArray.cpp +++ b/src/mathed/InsetMathAMSArray.cpp @@ -107,13 +107,8 @@ bool InsetMathAMSArray::getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { switch (cmd.action()) { - case LFUN_INSET_MODIFY: { - istringstream is(to_utf8(cmd.argument())); - string s; - is >> s; - if (s != "tabular") - break; - is >> s; + case LFUN_TABLE_MODIFY: { + string s = cmd.getArg(0); if (s == "add-vline-left" || s == "add-vline-right") { flag.message(bformat( from_utf8(N_("Can't add vertical grid lines in '%1$s'")), diff --git a/src/mathed/InsetMathCases.cpp b/src/mathed/InsetMathCases.cpp index 17b4fb1..c5c16da 100644 --- a/src/mathed/InsetMathCases.cpp +++ b/src/mathed/InsetMathCases.cpp @@ -71,13 +71,8 @@ void InsetMathCases::doDispatch(Cursor & cur, FuncRequest & cmd) { //lyxerr << "*** InsetMathCases: request: " << cmd << endl; switch (cmd.action()) { - case LFUN_INSET_MODIFY: { - istringstream is(to_utf8(cmd.argument())); - string s; - is >> s; - if (s != "tabular") - break; - is >> s; + case LFUN_TABLE_MODIFY: { + string s = cmd.getArg(0); // vertical lines and adding/deleting columns is not allowed for \cases if (s == "append-column" || s == "delete-column" || s == "add-vline-left" || s == "add-vline-right") { @@ -97,13 +92,8 @@ bool InsetMathCases::getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { switch (cmd.action()) { - case LFUN_INSET_MODIFY: { - istringstream is(to_utf8(cmd.argument())); - string s; - is >> s; - if (s != "tabular") - break; - is >> s; + case LFUN_TABLE_MODIFY: { + string s = cmd.getArg(0); if (s == "add-vline-left" || s == "add-vline-right") { flag.setEnabled(false); flag.message(bformat( @@ -115,7 +105,7 @@ bool InsetMathCases::getStatus(Cursor & cur, FuncRequest const & cmd, flag.setEnabled(false); flag.message(bformat( from_utf8(N_("Changing number of columns not allowed in " - "'cases': feature %1$s")), from_utf8(s))); + "'cases': feature %1$s")), from_utf8(s))); return true; } break; diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index 8ea3940..bbde296 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -181,7 +181,7 @@ void InsetMathGrid::setDefaults() bool InsetMathGrid::interpretString(Cursor & cur, docstring const & str) { if (str == "\\hline") { - FuncRequest fr = FuncRequest(LFUN_INSET_MODIFY, "tabular add-hline-above"); + FuncRequest fr = FuncRequest(LFUN_TABLE_MODIFY, "add-hline-above"); FuncStatus status; if (getStatus(cur, fr, status)) { if (status.enabled()) { @@ -1449,17 +1449,12 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) break; } - case LFUN_INSET_MODIFY: { + case LFUN_TABLE_MODIFY: { cur.recordUndoInset(); - //lyxerr << "handling tabular-feature " << to_utf8(cmd.argument()) << endl; + //lyxerr << "handling table-modify " << to_utf8(cmd.argument()) << endl; istringstream is(to_utf8(cmd.argument())); string s; is >> s; - if (s != "tabular") { - InsetMathNest::doDispatch(cur, cmd); - return; - } - is >> s; if (s == "valign-top") setVerticalAlignment('t'); else if (s == "valign-middle") @@ -1596,7 +1591,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) } bool hline_enabled = false; - FuncRequest fr = FuncRequest(LFUN_INSET_MODIFY, "tabular add-hline-above"); + FuncRequest fr = FuncRequest(LFUN_TABLE_MODIFY, "add-hline-above"); FuncStatus status; if (getStatus(cur, fr, status)) hline_enabled = status.enabled(); @@ -1726,14 +1721,8 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const { switch (cmd.action()) { - case LFUN_INSET_MODIFY: { - istringstream is(to_utf8(cmd.argument())); - string s; - is >> s; - if (s != "tabular") { - // We only now about table actions here. - break; - } + case LFUN_TABLE_MODIFY: { + string s = cmd.getArg(0); if (&cur.inset() != this) { // Table actions requires that the cursor is _inside_ the // table. @@ -1741,7 +1730,6 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd, status.message(from_utf8(N_("Cursor not in table"))); return true; } - is >> s; if (nrows() <= 1 && (s == "delete-row" || s == "swap-row")) { status.setEnabled(false); status.message(from_utf8(N_("Only one row"))); @@ -1796,7 +1784,8 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd, } else { status.setEnabled(false); status.message(bformat( - from_utf8(N_("Unknown tabular feature '%1$s'")), lyx::from_ascii(s))); + from_utf8(N_("Unknown tabular feature '%1$s'")), + from_utf8(s))); } #if 0 diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 097a344..27be697 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -1816,13 +1816,8 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd, } return InsetMathGrid::getStatus(cur, cmd, status); - case LFUN_INSET_MODIFY: { - istringstream is(to_utf8(cmd.argument())); - string s; - is >> s; - if (s != "tabular") - return InsetMathGrid::getStatus(cur, cmd, status); - is >> s; + case LFUN_TABLE_MODIFY: { + string s = cmd.getArg(0); if (!rowChangeOK() && (s == "append-row" || s == "delete-row" diff --git a/src/mathed/InsetMathSplit.cpp b/src/mathed/InsetMathSplit.cpp index 5c425fb..f5c9cdc 100644 --- a/src/mathed/InsetMathSplit.cpp +++ b/src/mathed/InsetMathSplit.cpp @@ -73,16 +73,12 @@ bool InsetMathSplit::getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { switch (cmd.action()) { - case LFUN_INSET_MODIFY: { - istringstream is(to_utf8(cmd.argument())); - string s; - is >> s; - if (s != "tabular") - break; - is >> s; + case LFUN_TABLE_MODIFY: { + string s = cmd.getArg(0); if (s == "add-vline-left" || s == "add-vline-right") { flag.message(bformat( - from_utf8(N_("Can't add vertical grid lines in '%1$s'")), name_)); + from_utf8(N_("Can't add vertical grid lines in '%1$s'")), + name_)); flag.setEnabled(false); return true; } diff --git a/src/mathed/InsetMathSubstack.cpp b/src/mathed/InsetMathSubstack.cpp index 7810ff4..37e3b98 100644 --- a/src/mathed/InsetMathSubstack.cpp +++ b/src/mathed/InsetMathSubstack.cpp @@ -63,27 +63,21 @@ bool InsetMathSubstack::getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { switch (cmd.action()) { - case LFUN_INSET_MODIFY: { - istringstream is(to_utf8(cmd.argument())); - string s; - is >> s; - if (s != "tabular") - break; - is >> s; - string const name = "substack"; + case LFUN_TABLE_MODIFY: { + string s = cmd.getArg(0); if (s == "add-vline-left" || s == "add-vline-right") { flag.message(bformat( from_utf8(N_("Can't add vertical grid lines in '%1$s'")), - from_utf8(name))); + from_utf8("substack"))); flag.setEnabled(false); return true; } - // in contrary to \subaray, the columns in \substack + // in contrary to \subarray, the columns in \substack // are always centered and this cannot be changed if (s == "align-left" || s == "align-right") { flag.message(bformat( from_utf8(N_("Can't change horizontal alignment in '%1$s'")), - from_utf8(name))); + from_utf8("substack"))); flag.setEnabled(false); return true; } -- 2.1.4
>From d8597db3e2507dda41e07e3f2d40eda25f59103f Mon Sep 17 00:00:00 2001 From: Guillaume Munch <g...@lyx.org> Date: Fri, 11 Dec 2015 03:08:33 +0000 Subject: [PATCH 2/3] Add table-modify to prefs and docs * Replace "inset-modify tabular" with "table-modify" in bind and ui files. * Update prefs2prefs.py * Regenerate LFUNs.lyx * Update Shortcut.lyx in all langages using replace-string. --- lib/bind/aqua.bind | 50 +++++------ lib/bind/cua.bind | 8 +- lib/bind/emacs.bind | 8 +- lib/bind/mac.bind | 8 +- lib/bind/math.bind | 44 +++++----- lib/bind/sciword.bind | 8 +- lib/bind/xemacs.bind | 8 +- lib/doc/LFUNs.lyx | 176 ++++++++++++++++++++++----------------- lib/doc/Shortcuts.lyx | 10 +-- lib/doc/de/Shortcuts.lyx | 6 +- lib/doc/es/Shortcuts.lyx | 12 +-- lib/doc/fr/Shortcuts.lyx | 12 +-- lib/doc/id/Shortcuts.lyx | 12 +-- lib/doc/ja/Shortcuts.lyx | 12 +-- lib/doc/sv/Shortcuts.lyx | 12 +-- lib/scripts/prefs2prefs_lfuns.py | 7 +- lib/ui/stdcontext.inc | 72 ++++++++-------- lib/ui/stdmenus.inc | 80 +++++++++--------- lib/ui/stdtoolbars.inc | 60 ++++++------- 19 files changed, 317 insertions(+), 288 deletions(-) diff --git a/lib/bind/aqua.bind b/lib/bind/aqua.bind index 8ce7945..e345a58 100644 --- a/lib/bind/aqua.bind +++ b/lib/bind/aqua.bind @@ -91,28 +91,28 @@ Format 3 \bind "M-~S-e x l" "primary-selection-paste" \bind "M-~S-e x p" "primary-selection-paste paragraph" -\bind "M-~S-e t m" "inset-modify tabular multicolumn" -\bind "M-~S-e t t" "inset-modify tabular toggle-line-top" -\bind "M-~S-e t b" "inset-modify tabular toggle-line-bottom" -\bind "M-~S-e t l" "inset-modify tabular toggle-line-left" -\bind "M-~S-e t r" "inset-modify tabular toggle-line-right" -\bind "M-~S-e t e" "inset-modify tabular align-left" -\bind "M-~S-e t c" "inset-modify tabular align-center" -\bind "M-~S-e t i" "inset-modify tabular align-right" -\bind "M-~S-e t o" "inset-modify tabular valign-top" -\bind "M-~S-e t n" "inset-modify tabular valign-center" -\bind "M-~S-e t v" "inset-modify tabular valign-bottom" -\bind "M-~S-e t a" "inset-modify tabular append-row" -\bind "M-~S-e t w" "inset-modify tabular delete-row" -\bind "M-~S-e t u" "inset-modify tabular append-column" -\bind "M-~S-e t d" "inset-modify tabular delete-column" +\bind "M-~S-e t m" "table-modify multicolumn" +\bind "M-~S-e t t" "table-modify toggle-line-top" +\bind "M-~S-e t b" "table-modify toggle-line-bottom" +\bind "M-~S-e t l" "table-modify toggle-line-left" +\bind "M-~S-e t r" "table-modify toggle-line-right" +\bind "M-~S-e t e" "table-modify align-left" +\bind "M-~S-e t c" "table-modify align-center" +\bind "M-~S-e t i" "table-modify align-right" +\bind "M-~S-e t o" "table-modify valign-top" +\bind "M-~S-e t n" "table-modify valign-center" +\bind "M-~S-e t v" "table-modify valign-bottom" +\bind "M-~S-e t a" "table-modify append-row" +\bind "M-~S-e t w" "table-modify delete-row" +\bind "M-~S-e t u" "table-modify append-column" +\bind "M-~S-e t d" "table-modify delete-column" \bind "M-~S-e m n" "math-number-toggle" \bind "M-~S-e m u" "math-number-line-toggle" -\bind "M-~S-e m r" "inset-modify tabular append-row" -\bind "M-~S-e m d" "inset-modify tabular delete-row" -\bind "M-~S-e m c" "inset-modify tabular append-column" -\bind "M-~S-e m e" "inset-modify tabular delete-column" +\bind "M-~S-e m r" "table-modify append-row" +\bind "M-~S-e m d" "table-modify delete-row" +\bind "M-~S-e m c" "table-modify append-column" +\bind "M-~S-e m e" "table-modify delete-column" \bind "M-~S-e m l t" "math-limits empty" \bind "M-~S-e m l d" "math-limits limits" @@ -124,12 +124,12 @@ Format 3 \bind "M-~S-e m f a" "math-mutate align" \bind "M-~S-e m f f" "math-mutate flalign" -\bind "M-~S-e m a l" "inset-modify tabular align-left" -\bind "M-~S-e m a c" "inset-modify tabular align-center" -\bind "M-~S-e m a r" "inset-modify tabular align-right" -\bind "M-~S-e m a t" "inset-modify tabular valign-top" -\bind "M-~S-e m a e" "inset-modify tabular valign-center" -\bind "M-~S-e m a b" "inset-modify tabular valign-bottom" +\bind "M-~S-e m a l" "table-modify align-left" +\bind "M-~S-e m a c" "table-modify align-center" +\bind "M-~S-e m a r" "table-modify align-right" +\bind "M-~S-e m a t" "table-modify valign-top" +\bind "M-~S-e m a e" "table-modify valign-center" +\bind "M-~S-e m a b" "table-modify valign-bottom" \bind "M-~S-v l" "latex-view-log" \bind "M-~S-v t" "toc-view" diff --git a/lib/bind/cua.bind b/lib/bind/cua.bind index ff92336..32278a0 100644 --- a/lib/bind/cua.bind +++ b/lib/bind/cua.bind @@ -131,10 +131,10 @@ Format 3 # Motion group # -\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; inset-modify tabular move-row-up" -\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; inset-modify tabular move-row-down" -\bind "M-Right" "inset-modify tabular move-column-right" -\bind "M-Left" "inset-modify tabular move-column-left" +\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; table-modify move-row-up" +\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; table-modify move-row-down" +\bind "M-Right" "table-modify move-column-right" +\bind "M-Left" "table-modify move-column-left" \bind "C-Right" "word-right" \bind "C-Left" "word-left" \bind "C-Up" "paragraph-up" diff --git a/lib/bind/emacs.bind b/lib/bind/emacs.bind index 8c8421d..abc447c 100644 --- a/lib/bind/emacs.bind +++ b/lib/bind/emacs.bind @@ -154,10 +154,10 @@ Format 3 # Motion group # -\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; inset-modify tabular move-row-up" -\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; inset-modify tabular move-row-down" -\bind "M-Right" "inset-modify tabular move-column-right" -\bind "M-Left" "inset-modify tabular move-column-left" +\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; table-modify move-row-up" +\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; table-modify move-row-down" +\bind "M-Right" "table-modify move-column-right" +\bind "M-Left" "table-modify move-column-left" \bind "C-Right" "word-right" \bind "C-Left" "word-left" \bind "C-Up" "paragraph-up" diff --git a/lib/bind/mac.bind b/lib/bind/mac.bind index 5354dd8..e91099f 100644 --- a/lib/bind/mac.bind +++ b/lib/bind/mac.bind @@ -358,10 +358,10 @@ Format 3 \bind "C-period" "specialchar-insert end-of-sentence" \bind "M-period" "specialchar-insert dots" \bind "Escape" "cancel" -\bind "C-M-Up" "command-alternatives outline-up; paragraph-move-up; inset-modify tabular move-row-up" -\bind "C-M-Down" "command-alternatives outline-down; paragraph-move-down; inset-modify tabular move-row-down" -\bind "C-M-Right" "inset-modify tabular move-column-right" -\bind "C-M-Left" "inset-modify tabular move-column-left" +\bind "C-M-Up" "command-alternatives outline-up; paragraph-move-up; table-modify move-row-up" +\bind "C-M-Down" "command-alternatives outline-down; paragraph-move-down; table-modify move-row-down" +\bind "C-M-Right" "table-modify move-column-right" +\bind "C-M-Left" "table-modify move-column-left" #\bind "F9" "meta-prefix" \bind "C-M-F" "ui-toggle fullscreen" diff --git a/lib/bind/math.bind b/lib/bind/math.bind index 6d6c390..fc7a2cc 100644 --- a/lib/bind/math.bind +++ b/lib/bind/math.bind @@ -75,30 +75,30 @@ Format 3 \bind "M-m t e" "math-mutate eqnarray" \bind "M-m t m" "math-mutate multline" -\bind "M-m c i" "inset-modify tabular append-column" -\bind "M-m c d" "inset-modify tabular delete-column" -\bind "M-m c c" "inset-modify tabular copy-column" -\bind "M-m c s" "inset-modify tabular swap-column" -\bind "M-m c a" "inset-modify tabular add-vline-left" -\bind "M-m c e" "inset-modify tabular delete-vline-left" -\bind "M-m c z" "inset-modify tabular add-vline-right" -\bind "M-m c x" "inset-modify tabular delete-vline-right" +\bind "M-m c i" "table-modify append-column" +\bind "M-m c d" "table-modify delete-column" +\bind "M-m c c" "table-modify copy-column" +\bind "M-m c s" "table-modify swap-column" +\bind "M-m c a" "table-modify add-vline-left" +\bind "M-m c e" "table-modify delete-vline-left" +\bind "M-m c z" "table-modify add-vline-right" +\bind "M-m c x" "table-modify delete-vline-right" -\bind "M-m w i" "inset-modify tabular append-row" -\bind "M-m w d" "inset-modify tabular delete-row" -\bind "M-m w c" "inset-modify tabular copy-row" -\bind "M-m w s" "inset-modify tabular swap-row" -\bind "M-m w a" "inset-modify tabular add-hline-above" -\bind "M-m w e" "inset-modify tabular delete-hline-above" -\bind "M-m w z" "inset-modify tabular add-hline-below" -\bind "M-m w x" "inset-modify tabular delete-hline-below" +\bind "M-m w i" "table-modify append-row" +\bind "M-m w d" "table-modify delete-row" +\bind "M-m w c" "table-modify copy-row" +\bind "M-m w s" "table-modify swap-row" +\bind "M-m w a" "table-modify add-hline-above" +\bind "M-m w e" "table-modify delete-hline-above" +\bind "M-m w z" "table-modify add-hline-below" +\bind "M-m w x" "table-modify delete-hline-below" -\bind "M-m w t" "inset-modify tabular valign-top" -\bind "M-m w m" "inset-modify tabular valign-middle" -\bind "M-m w b" "inset-modify tabular valign-bottom" -\bind "M-m c l" "inset-modify tabular align-left" -\bind "M-m c m" "inset-modify tabular align-center" -\bind "M-m c r" "inset-modify tabular align-right" +\bind "M-m w t" "table-modify valign-top" +\bind "M-m w m" "table-modify valign-middle" +\bind "M-m w b" "table-modify valign-bottom" +\bind "M-m c l" "table-modify align-left" +\bind "M-m c m" "table-modify align-center" +\bind "M-m c r" "table-modify align-right" # Decoration accents diff --git a/lib/bind/sciword.bind b/lib/bind/sciword.bind index cf6a853..fa64db6 100644 --- a/lib/bind/sciword.bind +++ b/lib/bind/sciword.bind @@ -232,10 +232,10 @@ Format 3 \bind_file greekkeys.bind -\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; inset-modify tabular move-row-up" -\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; inset-modify tabular move-row-down" -\bind "M-Right" "inset-modify tabular move-column-right" -\bind "M-Left" "inset-modify tabular move-column-left" +\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; table-modify move-row-up" +\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; table-modify move-row-down" +\bind "M-Right" "table-modify move-column-right" +\bind "M-Left" "table-modify move-column-left" \bind "S-KP_Right" "char-right-select" \bind "S-KP_Left" "char-left-select" \bind "S-KP_Up" "up-select" diff --git a/lib/bind/xemacs.bind b/lib/bind/xemacs.bind index c8dfa98..7befb80 100644 --- a/lib/bind/xemacs.bind +++ b/lib/bind/xemacs.bind @@ -147,10 +147,10 @@ Format 3 # Motion group # -\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; inset-modify tabular move-row-up" -\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; inset-modify tabular move-row-down" -\bind "M-Right" "inset-modify tabular move-column-right" -\bind "M-Left" "inset-modify tabular move-column-left" +\bind "M-Up" "command-alternatives outline-up; paragraph-move-up; table-modify move-row-up" +\bind "M-Down" "command-alternatives outline-down; paragraph-move-down; table-modify move-row-down" +\bind "M-Right" "table-modify move-column-right" +\bind "M-Left" "table-modify move-column-left" \bind "C-Right" "word-right" \bind "C-Left" "word-left" \bind "C-Up" "paragraph-up" diff --git a/lib/doc/LFUNs.lyx b/lib/doc/LFUNs.lyx index d48f7ed..2d8c38d 100644 --- a/lib/doc/LFUNs.lyx +++ b/lib/doc/LFUNs.lyx @@ -37,7 +37,7 @@ End \font_sf_scale 100 100 \font_tt_scale 100 100 \graphics default -\default_output_format pdf2 +\default_output_format default \output_sync 0 \bibtex_command default \index_command default @@ -101,7 +101,7 @@ The \SpecialChar LyX \end_layout \begin_layout Date -2015-11-17 +2015-12-11 \end_layout \begin_layout Section* @@ -2512,79 +2512,7 @@ Notion Used for bibitem, bibtex, box, branch, command, ert, external, floats, gr \end_layout \begin_layout Description -Syntax inset-modify <INSET> <ARGS>inset-modify changetype <TYPE>inset-modify tabular <FEATURE> [<ARG>] -\end_layout - -\begin_layout Description -Params Generally see LFUN_INSET_INSERT for further details. -\begin_inset Newline newline -\end_inset - -In case that <INSET> is "tabular" various math-environment features are handled as well, e.g. add-vline-left/right for the Grid/Array environment. -\begin_inset Newline newline -\end_inset - -<FEATURE>: append-row|append-column|delete-row|delete-column|copy-row| -\begin_inset Newline newline -\end_inset - -copy-column|move-column-right|move-column-left|move-row-down|move-row-up| -\begin_inset Newline newline -\end_inset - -toggle-line-top|toggle-line-bottom|toggle-line-left|toggle-line-right| -\begin_inset Newline newline -\end_inset - -align-left|align-right|align-center|align-block|align-decimal|set-decimal-point| -\begin_inset Newline newline -\end_inset - -valign-top|valign-bottom|valign-middle|longtabular-align-left| -\begin_inset Newline newline -\end_inset - -longtabular-align-center|longtabular-align-right|m-align-left|m-align-right| -\begin_inset Newline newline -\end_inset - -m-align-center|m-valign-top|m-valign-bottom|m-valign-middle|multicolumn| -\begin_inset Newline newline -\end_inset - -set-all-lines|unset-all-lines|toggle-longtabular|set-longtabular|unset-longtabular|set-pwidth| -\begin_inset Newline newline -\end_inset - -set-mpwidth|set-rotate-tabular|unset-rotate-tabular|toggle-rotate-tabular| -\begin_inset Newline newline -\end_inset - -set-rotate-cell|unset-rotate-cell|toggle-rotate-cell|set-usebox|set-lthead| -\begin_inset Newline newline -\end_inset - -unset-lthead|set-ltfirsthead|unset-ltfirsthead|set-ltfoot|unset-ltfoot| -\begin_inset Newline newline -\end_inset - -set-ltlastfoot|unset-ltlastfoot|set-ltnewpage|toggle-ltcaption| -\begin_inset Newline newline -\end_inset - -set-special-column|set-special-multicolumn|set-special-multirow| -\begin_inset Newline newline -\end_inset - -toggle-booktabs|set-booktabs|unset-booktabs|set-top-space|set-bottom-space| -\begin_inset Newline newline -\end_inset - -set-interline-space|set-border-lines|tabular-valign-top| -\begin_inset Newline newline -\end_inset - -tabular-valign-middle|tabular-valign-bottom|set-tabular-width <ARG>: additional argument for some commands, use debug mode to explore its values. +Syntax inset-modify <INSET> <ARGS>inset-modify changetype <TYPE> \end_layout \begin_layout Description @@ -3912,6 +3840,102 @@ Origin vfr, Sep 30 2008 \end_layout \begin_layout Subsection* +table-modify +\end_layout + +\begin_layout Description +Action Modify properties of tabulars and table-like math environments. +\end_layout + +\begin_layout Description +Syntax table-modify <FEATURE> [<ARG>] +\end_layout + +\begin_layout Description +Params Generally see LFUN_INSET_INSERT for further details. +\begin_inset Newline newline +\end_inset + +<FEATURE>: append-row|append-column|delete-row|delete-column|copy-row| +\begin_inset Newline newline +\end_inset + +copy-column|move-column-right|move-column-left|move-row-down|move-row-up| +\begin_inset Newline newline +\end_inset + +toggle-line-top|toggle-line-bottom|toggle-line-left|toggle-line-right| +\begin_inset Newline newline +\end_inset + +align-left|align-right|align-center|align-block|align-decimal|set-decimal-point| +\begin_inset Newline newline +\end_inset + +valign-top|valign-bottom|valign-middle|longtabular-align-left| +\begin_inset Newline newline +\end_inset + +longtabular-align-center|longtabular-align-right|m-align-left|m-align-right| +\begin_inset Newline newline +\end_inset + +m-align-center|m-valign-top|m-valign-bottom|m-valign-middle|multicolumn| +\begin_inset Newline newline +\end_inset + +set-all-lines|unset-all-lines|toggle-longtabular|set-longtabular|unset-longtabular|set-pwidth| +\begin_inset Newline newline +\end_inset + +set-mpwidth|set-rotate-tabular|unset-rotate-tabular|toggle-rotate-tabular| +\begin_inset Newline newline +\end_inset + +set-rotate-cell|unset-rotate-cell|toggle-rotate-cell|set-usebox|set-lthead| +\begin_inset Newline newline +\end_inset + +unset-lthead|set-ltfirsthead|unset-ltfirsthead|set-ltfoot|unset-ltfoot| +\begin_inset Newline newline +\end_inset + +set-ltlastfoot|unset-ltlastfoot|set-ltnewpage|toggle-ltcaption| +\begin_inset Newline newline +\end_inset + +set-special-column|set-special-multicolumn|set-special-multirow| +\begin_inset Newline newline +\end_inset + +toggle-booktabs|set-booktabs|unset-booktabs|set-top-space|set-bottom-space| +\begin_inset Newline newline +\end_inset + +set-interline-space|set-border-lines|tabular-valign-top| +\begin_inset Newline newline +\end_inset + +tabular-valign-middle|tabular-valign-bottom|set-tabular-width +\begin_inset Newline newline +\end_inset + +Various math-environment features are handled as well, e.g. add-vline-left/right for +\begin_inset Newline newline +\end_inset + +the Grid/Array environment. +\begin_inset Newline newline +\end_inset + +<ARG>: additional argument for some commands, use debug mode to explore its values. +\end_layout + +\begin_layout Description +Origin gm, 10 Dec 2015 +\end_layout + +\begin_layout Subsection* tabular-insert \end_layout @@ -3920,7 +3944,7 @@ Action Inserts table into the document. \end_layout \begin_layout Description -Notion See LFUN_INSET_MODIFY for some more details about tabular modifications. +Notion See LFUN_TABLE_MODIFY for some more details about tabular modifications. \end_layout \begin_layout Description diff --git a/lib/doc/Shortcuts.lyx b/lib/doc/Shortcuts.lyx index 0ed7948..1b00ed0 100644 --- a/lib/doc/Shortcuts.lyx +++ b/lib/doc/Shortcuts.lyx @@ -901,7 +901,7 @@ Append Row \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-row" +arg "table-modify append-row" \end_inset @@ -926,7 +926,7 @@ Delete Column \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-column" +arg "table-modify delete-column" \end_inset @@ -949,7 +949,7 @@ Delete Row \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-row" +arg "table-modify delete-row" \end_inset @@ -974,7 +974,7 @@ Copy Column \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-column" +arg "table-modify copy-column" \end_inset @@ -997,7 +997,7 @@ Copy Row \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-row" +arg "table-modify copy-row" \end_inset diff --git a/lib/doc/de/Shortcuts.lyx b/lib/doc/de/Shortcuts.lyx index c76146e..ab38bb4 100644 --- a/lib/doc/de/Shortcuts.lyx +++ b/lib/doc/de/Shortcuts.lyx @@ -949,7 +949,7 @@ Zeile löschen \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-row" +arg "table-modify delete-row" \end_inset @@ -974,7 +974,7 @@ Spalte kopieren \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-column" +arg "table-modify copy-column" \end_inset @@ -997,7 +997,7 @@ Zeile kopieren \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-row" +arg "table-modify copy-row" \end_inset diff --git a/lib/doc/es/Shortcuts.lyx b/lib/doc/es/Shortcuts.lyx index a84fa89..ef97d30 100644 --- a/lib/doc/es/Shortcuts.lyx +++ b/lib/doc/es/Shortcuts.lyx @@ -1026,7 +1026,7 @@ Añadir columna \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-column" +arg "table-modify append-column" \end_inset @@ -1049,7 +1049,7 @@ Añadir fila \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-row" +arg "table-modify append-row" \end_inset @@ -1074,7 +1074,7 @@ Eliminar columna \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-column" +arg "table-modify delete-column" \end_inset @@ -1097,7 +1097,7 @@ Eliminar fila \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-row" +arg "table-modify delete-row" \end_inset @@ -1122,7 +1122,7 @@ Copiar columna \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-column" +arg "table-modify copy-column" \end_inset @@ -1145,7 +1145,7 @@ Copiar fila \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-row" +arg "table-modify copy-row" \end_inset diff --git a/lib/doc/fr/Shortcuts.lyx b/lib/doc/fr/Shortcuts.lyx index 63f1c37..939b6c8 100644 --- a/lib/doc/fr/Shortcuts.lyx +++ b/lib/doc/fr/Shortcuts.lyx @@ -878,7 +878,7 @@ Ajouter une colonne \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-column" +arg "table-modify append-column" \end_inset @@ -901,7 +901,7 @@ Ajouter ligne \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-row" +arg "table-modify append-row" \end_inset @@ -926,7 +926,7 @@ Supprimer une colonne \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-column" +arg "table-modify delete-column" \end_inset @@ -949,7 +949,7 @@ Supprimer ligne \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-row" +arg "table-modify delete-row" \end_inset @@ -974,7 +974,7 @@ Copier colonne \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-column" +arg "table-modify copy-column" \end_inset @@ -997,7 +997,7 @@ Copier ligne \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-row" +arg "table-modify copy-row" \end_inset diff --git a/lib/doc/id/Shortcuts.lyx b/lib/doc/id/Shortcuts.lyx index bc3dfd0..abc5e00 100644 --- a/lib/doc/id/Shortcuts.lyx +++ b/lib/doc/id/Shortcuts.lyx @@ -891,7 +891,7 @@ Tambah Kolom \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-column" +arg "table-modify append-column" \end_inset @@ -914,7 +914,7 @@ Tambah Baris \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-row" +arg "table-modify append-row" \end_inset @@ -939,7 +939,7 @@ Hapus Kolom \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-column" +arg "table-modify delete-column" \end_inset @@ -962,7 +962,7 @@ Hapus Baris \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-row" +arg "table-modify delete-row" \end_inset @@ -987,7 +987,7 @@ Salin Kolom \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-column" +arg "table-modify copy-column" \end_inset @@ -1010,7 +1010,7 @@ Salin Baris \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-row" +arg "table-modify copy-row" \end_inset diff --git a/lib/doc/ja/Shortcuts.lyx b/lib/doc/ja/Shortcuts.lyx index e07a33b..e8f4b2a 100644 --- a/lib/doc/ja/Shortcuts.lyx +++ b/lib/doc/ja/Shortcuts.lyx @@ -956,7 +956,7 @@ arg "newline-insert linebreak" \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-column" +arg "table-modify append-column" \end_inset @@ -979,7 +979,7 @@ arg "inset-modify tabular append-column" \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-row" +arg "table-modify append-row" \end_inset @@ -1004,7 +1004,7 @@ arg "inset-modify tabular append-row" \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-column" +arg "table-modify delete-column" \end_inset @@ -1027,7 +1027,7 @@ arg "inset-modify tabular delete-column" \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-row" +arg "table-modify delete-row" \end_inset @@ -1052,7 +1052,7 @@ arg "inset-modify tabular delete-row" \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-column" +arg "table-modify copy-column" \end_inset @@ -1075,7 +1075,7 @@ arg "inset-modify tabular copy-column" \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-row" +arg "table-modify copy-row" \end_inset diff --git a/lib/doc/sv/Shortcuts.lyx b/lib/doc/sv/Shortcuts.lyx index f44fba3..34975de 100644 --- a/lib/doc/sv/Shortcuts.lyx +++ b/lib/doc/sv/Shortcuts.lyx @@ -1057,7 +1057,7 @@ Tillfoga kolumn \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-column" +arg "table-modify append-column" \end_inset @@ -1080,7 +1080,7 @@ Tillfoga rad \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular append-row" +arg "table-modify append-row" \end_inset @@ -1103,7 +1103,7 @@ Kopiera kolumn \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-column" +arg "table-modify copy-column" \end_inset @@ -1128,7 +1128,7 @@ Radera kolumn \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-column" +arg "table-modify delete-column" \end_inset @@ -1151,7 +1151,7 @@ Radera rad \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular delete-row" +arg "table-modify delete-row" \end_inset @@ -1174,7 +1174,7 @@ Kopiera rad \begin_layout Plain Layout \begin_inset Info type "shortcut" -arg "inset-modify tabular copy-row" +arg "table-modify copy-row" \end_inset diff --git a/lib/scripts/prefs2prefs_lfuns.py b/lib/scripts/prefs2prefs_lfuns.py index 99f75c3..1097507 100644 --- a/lib/scripts/prefs2prefs_lfuns.py +++ b/lib/scripts/prefs2prefs_lfuns.py @@ -140,6 +140,10 @@ def tabular_feature(line): return simple_renaming(line, "tabular-feature", "inset-modify tabular") +def erutaef_ralubat(line): + return simple_renaming(line, "inset-modify tabular", "table-modify") + + re_Bar2bar = re.compile(r'^(\\(?:bind|unbind))\s+"([^"]*)Bar"(\s+"[^"]+")') def Bar2bar(line): m = re_Bar2bar.search(line) @@ -198,6 +202,7 @@ conversions = [ label_copy_as_reference ]], [ 3, [ # list of conversions to format 3, LyX 2.2 - remove_print_support + remove_print_support, + erutaef_ralubat ]] ] diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index 3d0f2fc..4e813bc 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -29,10 +29,10 @@ Menuset Menu "insert_math_context" Item "Array Environment|y" "math-matrix 2 2" Item "Cases Environment|C" "math-insert \cases" - Item "Aligned Environment|l" "command-sequence math-insert \aligned; inset-modify tabular append-column" - Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; inset-modify tabular append-column" + Item "Aligned Environment|l" "command-sequence math-insert \aligned; table-modify append-column" + Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; table-modify append-column" Item "Gathered Environment|h" "math-insert \gathered" - Item "Split Environment|S" "command-sequence math-insert \split; inset-modify tabular append-column" + Item "Split Environment|S" "command-sequence math-insert \split; table-modify append-column" Separator Item "Delimiters...|r" "dialog-show mathdelimiter" Item "Matrix...|x" "dialog-show mathmatrix" @@ -62,15 +62,15 @@ Menuset Separator Submenu "Insert|s" "insert_math_context" Separator - OptItem "Add Line Above|o" "inset-modify tabular add-hline-above" - OptItem "Add Line Below|B" "inset-modify tabular add-hline-below" - OptItem "Delete Line Above|v" "inset-modify tabular delete-hline-above" - OptItem "Delete Line Below|w" "inset-modify tabular delete-hline-below" + OptItem "Add Line Above|o" "table-modify add-hline-above" + OptItem "Add Line Below|B" "table-modify add-hline-below" + OptItem "Delete Line Above|v" "table-modify delete-hline-above" + OptItem "Delete Line Below|w" "table-modify delete-hline-below" Separator - OptItem "Add Line to Left" "inset-modify tabular add-vline-left" - OptItem "Add Line to Right" "inset-modify tabular add-vline-right" - OptItem "Delete Line to Left" "inset-modify tabular delete-vline-left" - OptItem "Delete Line to Right" "inset-modify tabular delete-vline-right" + OptItem "Add Line to Left" "table-modify add-vline-left" + OptItem "Add Line to Right" "table-modify add-vline-right" + OptItem "Delete Line to Left" "table-modify delete-vline-left" + OptItem "Delete Line to Right" "table-modify delete-vline-right" Separator Item "Show Math Toolbar" "toolbar-toggle math toggle" Item "Show Math-Panels Toolbar" "toolbar-toggle math_panels toggle" @@ -406,43 +406,43 @@ Menuset # Menu "table-borders" - Item "Top|T" "inset-modify tabular toggle-line-top" - Item "Bottom|B" "inset-modify tabular toggle-line-bottom" - Item "Left|L" "inset-modify tabular toggle-line-left" - Item "Right|R" "inset-modify tabular toggle-line-right" + Item "Top|T" "table-modify toggle-line-top" + Item "Bottom|B" "table-modify toggle-line-bottom" + Item "Left|L" "table-modify toggle-line-left" + Item "Right|R" "table-modify toggle-line-right" End Menu "table-alignment" - Item "Left|f" "command-alternatives inset-modify tabular m-align-left;inset-modify tabular align-left" - Item "Center|C" "command-alternatives inset-modify tabular m-align-center;inset-modify tabular align-center" - Item "Right|h" "command-alternatives inset-modify tabular m-align-right;inset-modify tabular align-right" - Item "Decimal" "inset-modify tabular align-decimal" + Item "Left|f" "command-alternatives table-modify m-align-left;table-modify align-left" + Item "Center|C" "command-alternatives table-modify m-align-center;table-modify align-center" + Item "Right|h" "command-alternatives table-modify m-align-right;table-modify align-right" + Item "Decimal" "table-modify align-decimal" Separator - Item "Top" "inset-modify tabular valign-top" - Item "Middle" "inset-modify tabular valign-middle" - Item "Bottom" "inset-modify tabular valign-bottom" + Item "Top" "table-modify valign-top" + Item "Middle" "table-modify valign-middle" + Item "Bottom" "table-modify valign-bottom" End Menu "table-cols-rows" - Item "Multicolumn|u" "inset-modify tabular multicolumn" - Item "Multirow|w" "inset-modify tabular multirow" + Item "Multicolumn|u" "table-modify multicolumn" + Item "Multirow|w" "table-modify multirow" Separator - Item "Append Row|A" "inset-modify tabular append-row" - Item "Delete Row|D" "inset-modify tabular delete-row" - Item "Copy Row|o" "inset-modify tabular copy-row" - Item "Move Row Up" "inset-modify tabular move-row-up" - Item "Move Row Down" "inset-modify tabular move-row-down" + Item "Append Row|A" "table-modify append-row" + Item "Delete Row|D" "table-modify delete-row" + Item "Copy Row|o" "table-modify copy-row" + Item "Move Row Up" "table-modify move-row-up" + Item "Move Row Down" "table-modify move-row-down" Separator - Item "Append Column|p" "inset-modify tabular append-column" - Item "Delete Column|e" "inset-modify tabular delete-column" - Item "Copy Column|y" "inset-modify tabular copy-column" - Item "Move Column Right|v" "inset-modify tabular move-column-right" - Item "Move Column Left" "inset-modify tabular move-column-left" + Item "Append Column|p" "table-modify append-column" + Item "Delete Column|e" "table-modify delete-column" + Item "Copy Column|y" "table-modify copy-column" + Item "Move Column Right|v" "table-modify move-column-right" + Item "Move Column Left" "table-modify move-column-left" End Menu "context-tabular" - Item "Multi-page Table|g" "inset-modify tabular toggle-longtabular" - Item "Formal Style|m" "inset-modify tabular toggle-booktabs" + Item "Multi-page Table|g" "table-modify toggle-longtabular" + Item "Formal Style|m" "table-modify toggle-booktabs" Separator Submenu "Borders|d" "table-borders" Submenu "Alignment|i" "table-alignment" diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc index 56e2d08..de6a050 100644 --- a/lib/ui/stdmenus.inc +++ b/lib/ui/stdmenus.inc @@ -191,44 +191,44 @@ Menuset # not much we can do to help here Menu "edit_tabular" - Item "Multi-page Table|g" "inset-modify tabular toggle-longtabular" - Item "Formal Style|F" "inset-modify tabular toggle-booktabs" + Item "Multi-page Table|g" "table-modify toggle-longtabular" + Item "Formal Style|F" "table-modify toggle-booktabs" Separator - Item "Multicolumn|M" "inset-modify tabular multicolumn" - Item "Multirow|u" "inset-modify tabular multirow" + Item "Multicolumn|M" "table-modify multicolumn" + Item "Multirow|u" "table-modify multirow" Separator - Item "Top Line|T" "inset-modify tabular toggle-line-top" - Item "Bottom Line|B" "inset-modify tabular toggle-line-bottom" - Item "Left Line|L" "inset-modify tabular toggle-line-left" - Item "Right Line|R" "inset-modify tabular toggle-line-right" + Item "Top Line|T" "table-modify toggle-line-top" + Item "Bottom Line|B" "table-modify toggle-line-bottom" + Item "Left Line|L" "table-modify toggle-line-left" + Item "Right Line|R" "table-modify toggle-line-right" Separator - Item "Top|p" "inset-modify tabular tabular-valign-top" - Item "Middle|i" "inset-modify tabular tabular-valign-middle" - Item "Bottom|o" "inset-modify tabular tabular-valign-bottom" + Item "Top|p" "table-modify tabular-valign-top" + Item "Middle|i" "table-modify tabular-valign-middle" + Item "Bottom|o" "table-modify tabular-valign-bottom" End Menu "edit_tabular_features" - Item "Left|L" "inset-modify tabular align-left" - Item "Center|C" "inset-modify tabular align-center" - Item "Right|R" "inset-modify tabular align-right" + Item "Left|L" "table-modify align-left" + Item "Center|C" "table-modify align-center" + Item "Right|R" "table-modify align-right" Separator - Item "Top|T" "inset-modify tabular valign-top" - Item "Middle|M" "inset-modify tabular valign-middle" - Item "Bottom|B" "inset-modify tabular valign-bottom" + Item "Top|T" "table-modify valign-top" + Item "Middle|M" "table-modify valign-middle" + Item "Bottom|B" "table-modify valign-bottom" Separator - Item "Add Row|A" "inset-modify tabular append-row" - Item "Delete Row|D" "inset-modify tabular delete-row" - Item "Copy Row|o" "inset-modify tabular copy-row" - Item "Move Row Up" "inset-modify tabular move-row-up" - Item "Move Row Down" "inset-modify tabular move-row-down" - # Item "Swap Rows|S" "inset-modify tabular swap-row" # currently broken + Item "Add Row|A" "table-modify append-row" + Item "Delete Row|D" "table-modify delete-row" + Item "Copy Row|o" "table-modify copy-row" + Item "Move Row Up" "table-modify move-row-up" + Item "Move Row Down" "table-modify move-row-down" + # Item "Swap Rows|S" "table-modify swap-row" # currently broken Separator - Item "Add Column|u" "inset-modify tabular append-column" - Item "Delete Column|e" "inset-modify tabular delete-column" - Item "Copy Column|p" "inset-modify tabular copy-column" - Item "Move Column Right|v" "inset-modify tabular move-column-right" - Item "Move Column Left" "inset-modify tabular move-column-left" - # Item "Swap Columns|w" "inset-modify tabular swap-column" # currently broken + Item "Add Column|u" "table-modify append-column" + Item "Delete Column|e" "table-modify delete-column" + Item "Copy Column|p" "table-modify copy-column" + Item "Move Column Right|v" "table-modify move-column-right" + Item "Move Column Left" "table-modify move-column-left" + # Item "Swap Columns|w" "table-modify swap-column" # currently broken End Menu "edit_math" @@ -245,15 +245,15 @@ Menuset Separator Item "Split Cell|C" "cell-split" Separator - Item "Add Line Above|A" "inset-modify tabular add-hline-above" - Item "Add Line Below|B" "inset-modify tabular add-hline-below" - Item "Delete Line Above|D" "inset-modify tabular delete-hline-above" - Item "Delete Line Below|e" "inset-modify tabular delete-hline-below" + Item "Add Line Above|A" "table-modify add-hline-above" + Item "Add Line Below|B" "table-modify add-hline-below" + Item "Delete Line Above|D" "table-modify delete-hline-above" + Item "Delete Line Below|e" "table-modify delete-hline-below" Separator - Item "Add Line to Left" "inset-modify tabular add-vline-left" - Item "Add Line to Right" "inset-modify tabular add-vline-right" - Item "Delete Line to Left" "inset-modify tabular delete-vline-left" - Item "Delete Line to Right" "inset-modify tabular delete-vline-right" + Item "Add Line to Left" "table-modify add-vline-left" + Item "Add Line to Right" "table-modify add-vline-right" + Item "Delete Line to Left" "table-modify delete-vline-left" + Item "Delete Line to Right" "table-modify delete-vline-right" End Menu "edit_math_macro_definition" @@ -449,10 +449,10 @@ Menuset # "math-matrix" and "math-insert" create an inline formula first if called from text mode Item "Array Environment|y" "math-matrix 2 2" Item "Cases Environment|C" "math-insert \cases" - Item "Aligned Environment|l" "command-sequence math-insert \aligned; inset-modify tabular append-column" - Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; inset-modify tabular append-column" + Item "Aligned Environment|l" "command-sequence math-insert \aligned; table-modify append-column" + Item "AlignedAt Environment|v" "command-sequence math-insert \alignedat; table-modify append-column" Item "Gathered Environment|h" "math-insert \gathered" - Item "Split Environment|S" "command-sequence math-insert \split; inset-modify tabular append-column" + Item "Split Environment|S" "command-sequence math-insert \split; table-modify append-column" Separator Item "Delimiters...|r" "dialog-show mathdelimiter" Item "Matrix...|x" "dialog-show mathmatrix" diff --git a/lib/ui/stdtoolbars.inc b/lib/ui/stdtoolbars.inc index e343888..3633bab 100644 --- a/lib/ui/stdtoolbars.inc +++ b/lib/ui/stdtoolbars.inc @@ -140,36 +140,36 @@ ToolbarSet End Toolbar "table" "Table" - Item "Add row" "inset-modify tabular append-row" - Item "Add column" "inset-modify tabular append-column" - Item "Delete row" "inset-modify tabular delete-row" - Item "Delete column" "inset-modify tabular delete-column" - Item "Move row up" "inset-modify tabular move-row-up" - Item "Move column left" "inset-modify tabular move-column-left" - Item "Move row down" "inset-modify tabular move-row-down" - Item "Move column right" "inset-modify tabular move-column-right" + Item "Add row" "table-modify append-row" + Item "Add column" "table-modify append-column" + Item "Delete row" "table-modify delete-row" + Item "Delete column" "table-modify delete-column" + Item "Move row up" "table-modify move-row-up" + Item "Move column left" "table-modify move-column-left" + Item "Move row down" "table-modify move-row-down" + Item "Move column right" "table-modify move-column-right" Separator - Item "Set top line" "inset-modify tabular toggle-line-top" - Item "Set bottom line" "inset-modify tabular toggle-line-bottom" - Item "Set left line" "inset-modify tabular toggle-line-left" - Item "Set right line" "inset-modify tabular toggle-line-right" - Item "Set border lines" "inset-modify tabular set-border-lines" - Item "Set all lines" "inset-modify tabular set-all-lines" - Item "Unset all lines" "inset-modify tabular unset-all-lines" + Item "Set top line" "table-modify toggle-line-top" + Item "Set bottom line" "table-modify toggle-line-bottom" + Item "Set left line" "table-modify toggle-line-left" + Item "Set right line" "table-modify toggle-line-right" + Item "Set border lines" "table-modify set-border-lines" + Item "Set all lines" "table-modify set-all-lines" + Item "Unset all lines" "table-modify unset-all-lines" Separator - Item "Align left" "command-alternatives inset-modify tabular m-align-left;inset-modify tabular align-left" - Item "Align center" "command-alternatives inset-modify tabular m-align-center;inset-modify tabular align-center" - Item "Align right" "command-alternatives inset-modify tabular m-align-right;inset-modify tabular align-right" - Item "Align on decimal" "inset-modify tabular align-decimal" + Item "Align left" "command-alternatives table-modify m-align-left;table-modify align-left" + Item "Align center" "command-alternatives table-modify m-align-center;table-modify align-center" + Item "Align right" "command-alternatives table-modify m-align-right;table-modify align-right" + Item "Align on decimal" "table-modify align-decimal" Separator - Item "Align top" "command-alternatives inset-modify tabular m-valign-top;inset-modify tabular valign-top" - Item "Align middle" "command-alternatives inset-modify tabular m-valign-middle;inset-modify tabular valign-middle" - Item "Align bottom" "command-alternatives inset-modify tabular m-valign-bottom;inset-modify tabular valign-bottom" + Item "Align top" "command-alternatives table-modify m-valign-top;table-modify valign-top" + Item "Align middle" "command-alternatives table-modify m-valign-middle;table-modify valign-middle" + Item "Align bottom" "command-alternatives table-modify m-valign-bottom;table-modify valign-bottom" Separator - Item "Rotate cell by 90 degrees or unset rotation" "inset-modify tabular toggle-rotate-cell" - Item "Rotate table by 90 degrees or unset rotation" "inset-modify tabular toggle-rotate-tabular" - Item "Set multi-column" "inset-modify tabular multicolumn" - Item "Set multi-row" "inset-modify tabular multirow" + Item "Rotate cell by 90 degrees or unset rotation" "table-modify toggle-rotate-cell" + Item "Rotate table by 90 degrees or unset rotation" "table-modify toggle-rotate-tabular" + Item "Set multi-column" "table-modify multicolumn" + Item "Set multi-row" "table-modify multirow" End Toolbar "math" "Math" @@ -191,10 +191,10 @@ ToolbarSet Separator Item "Insert matrix" "dialog-show mathmatrix" Item "Insert cases environment" "math-insert \cases" - Item "Add row" "inset-modify tabular append-row" - Item "Add column" "inset-modify tabular append-column" - Item "Delete row" "inset-modify tabular delete-row" - Item "Delete column" "inset-modify tabular delete-column" + Item "Add row" "table-modify append-row" + Item "Add column" "table-modify append-column" + Item "Delete row" "table-modify delete-row" + Item "Delete column" "table-modify delete-column" Separator Item "Toggle math panels" "toolbar-toggle math_panels" End -- 2.1.4
>From c1a0522a9f6014c684a146eff887f2d12b2296db Mon Sep 17 00:00:00 2001 From: Guillaume Munch <g...@lyx.org> Date: Fri, 11 Dec 2015 20:45:57 +0000 Subject: [PATCH 3/3] Let table-modify commands fall through non-table math insets. (#4189) --- src/mathed/InsetMathHull.cpp | 30 ++++++++++++++++++++---------- src/mathed/InsetMathHull.h | 2 ++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 27be697..e2e2df8 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -1040,6 +1040,14 @@ void InsetMathHull::footer_write(WriteStream & os) const } +bool InsetMathHull::isTable() const +{ + return + type_ != hullNone && type_ != hullSimple && + type_ != hullEquation && type_ != hullRegexp; +} + + bool InsetMathHull::rowChangeOK() const { return @@ -1702,6 +1710,13 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd) break; } + case LFUN_TABLE_MODIFY: + if (!isTable()) + cur.undispatched(); + else + InsetMathGrid::doDispatch(cur, cmd); + break; + default: InsetMathGrid::doDispatch(cur, cmd); break; @@ -1817,6 +1832,11 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd, return InsetMathGrid::getStatus(cur, cmd, status); case LFUN_TABLE_MODIFY: { + if (!isTable()) { + status.clear(); + status.setUnknown(true); + return true; + } string s = cmd.getArg(0); if (!rowChangeOK() && (s == "append-row" @@ -1838,16 +1858,6 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd, status.setEnabled(false); return true; } - if ((type_ == hullSimple - || type_ == hullEquation - || type_ == hullNone) && - (s == "add-hline-above" || s == "add-hline-below")) { - status.message(bformat( - from_utf8(N_("Can't add horizontal grid lines in '%1$s'")), - hullName(type_))); - status.setEnabled(false); - return true; - } if (s == "add-vline-left" || s == "add-vline-right") { status.message(bformat( from_utf8(N_("Can't add vertical grid lines in '%1$s'")), diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h index 9598ad4..aee43a0 100644 --- a/src/mathed/InsetMathHull.h +++ b/src/mathed/InsetMathHull.h @@ -236,6 +236,8 @@ private: ColorCode standardColor() const; /// consistency check void check() const; + /// does it understand table-modify commands? + bool isTable() const; /// can this change its number of rows? bool rowChangeOK() const; /// can this change its number of cols? -- 2.1.4