Rename some LFUN names to match their text name

Also, rename copy-label-as-reference to label-copy-as-reference and update LFUNs.lyx accordingly.
This commit is contained in:
Jean-Marc Lasgouttes 2014-02-11 11:00:20 +01:00
parent 4ec02b46b5
commit e7a1cce551
12 changed files with 68 additions and 61 deletions

View File

@ -170,6 +170,9 @@ The following LyX functions have been changed:
- LFUN_BREAK_PARAGRAPH ("break-paragraph") was renamed to - LFUN_BREAK_PARAGRAPH ("break-paragraph") was renamed to
LFUN_PARAGRAPH_BREAK ("paragraph-break"). LFUN_PARAGRAPH_BREAK ("paragraph-break").
- LFUN_COPY_LABEL_AS_REF ("copy-label-as-reference") has been renamed to
LFUN_LABEL_COPY_AS_REF ("label-copy-as-reference").
The following LyX key bindings have been changed: The following LyX key bindings have been changed:

View File

@ -1337,22 +1337,6 @@ Action Copies the current selection to the clipboard.
Syntax copy Syntax copy
\end_layout \end_layout
\begin_layout Subsection*
copy-label-as-reference
\end_layout
\begin_layout Description
Action Copies the label at the cursor as a cross-reference to be pasted elsewhere.
\end_layout
\begin_layout Description
Syntax copy-label-as-reference <LABEL>
\end_layout
\begin_layout Description
Params <LABEL>: The label to copy (for multi-line math)
\end_layout
\begin_layout Description
Origin sts, 16 Nov 2008
\end_layout
\begin_layout Subsection* \begin_layout Subsection*
cut cut
\end_layout \end_layout
@ -2323,6 +2307,22 @@ Syntax keymap-toggle
Origin leeming, 30 Mar 2004 Origin leeming, 30 Mar 2004
\end_layout \end_layout
\begin_layout Subsection*
label-copy-as-reference
\end_layout
\begin_layout Description
Action Copies the label at the cursor as a cross-reference to be pasted elsewhere.
\end_layout
\begin_layout Description
Syntax copy-label-as-reference <LABEL>
\end_layout
\begin_layout Description
Params <LABEL>: The label to copy (for multi-line math)
\end_layout
\begin_layout Description
Origin sts, 16 Nov 2008
\end_layout
\begin_layout Subsection* \begin_layout Subsection*
label-goto label-goto
\end_layout \end_layout

View File

@ -154,6 +154,9 @@ def tab_group_close(line):
def view_split(line): def view_split(line):
return simple_renaming(line, "split-view", "view-split") return simple_renaming(line, "split-view", "view-split")
def label_copy_as_reference(line):
return simple_renaming(line, "copy-label-as-reference", "label-copy-as-reference")
# #
# #
########################################################### ###########################################################
@ -177,7 +180,8 @@ conversions = [
[ 2, [ # list of conversions to format 2, LyX 2.1 [ 2, [ # list of conversions to format 2, LyX 2.1
paragraph_break, paragraph_break,
tab_group_close, tab_group_close,
view_split view_split,
label_copy_as_reference
]], ]],
] ]

View File

@ -168,7 +168,7 @@ enum FuncCode
LFUN_WORD_DELETE_FORWARD, LFUN_WORD_DELETE_FORWARD,
LFUN_WORD_DELETE_BACKWARD, LFUN_WORD_DELETE_BACKWARD,
// 115 // 115
LFUN_LINE_DELETE, LFUN_LINE_DELETE_FORWARD,
LFUN_DEBUG_LEVEL_SET, LFUN_DEBUG_LEVEL_SET,
LFUN_MARK_OFF, LFUN_MARK_OFF,
LFUN_MARK_ON, LFUN_MARK_ON,
@ -230,7 +230,7 @@ enum FuncCode
// 165 // 165
LFUN_VC_REPO_UPDATE, LFUN_VC_REPO_UPDATE,
LFUN_VC_COMPARE, LFUN_VC_COMPARE,
LFUN_HYPERLINK_INSERT, // CFO-G 971121 LFUN_HREF_INSERT, // CFO-G 971121
LFUN_WORD_FIND_FORWARD, // Etienne 980216 LFUN_WORD_FIND_FORWARD, // Etienne 980216
LFUN_WORD_FIND_BACKWARD, // Etienne 980220 LFUN_WORD_FIND_BACKWARD, // Etienne 980220
// 170 // 170
@ -402,7 +402,7 @@ enum FuncCode
LFUN_COMPLETION_POPUP, LFUN_COMPLETION_POPUP,
LFUN_COMPLETION_INLINE, LFUN_COMPLETION_INLINE,
// 310 // 310
LFUN_COMPLETION_COMPLETE, LFUN_COMPLETE,
LFUN_SET_GRAPHICS_GROUP, LFUN_SET_GRAPHICS_GROUP,
LFUN_COMPLETION_CANCEL, LFUN_COMPLETION_CANCEL,
LFUN_COMPLETION_ACCEPT, LFUN_COMPLETION_ACCEPT,
@ -414,8 +414,8 @@ enum FuncCode
LFUN_REGEXP_MODE, // Tommaso, 20081003 LFUN_REGEXP_MODE, // Tommaso, 20081003
LFUN_LABEL_GOTO, // Ale 970806 LFUN_LABEL_GOTO, // Ale 970806
// 320 // 320
LFUN_LABEL_COPY_AS_REF, // sts, 20081116 LFUN_LABEL_COPY_AS_REFERENCE, // sts, 20081116
LFUN_LABEL_INSERT_AS_REF, // vfr, 20090407 LFUN_LABEL_INSERT_AS_REFERENCE, // vfr, 20090407
LFUN_PHANTOM_INSERT, // uwestoehr, 20090130 LFUN_PHANTOM_INSERT, // uwestoehr, 20090130
LFUN_INSET_BEGIN, // JMarc, 20090316 LFUN_INSET_BEGIN, // JMarc, 20090316
LFUN_INSET_END, // JMarc, 20090316 LFUN_INSET_END, // JMarc, 20090316
@ -430,9 +430,9 @@ enum FuncCode
LFUN_SECTION_SELECT, // vfr, 20090503 LFUN_SECTION_SELECT, // vfr, 20090503
LFUN_FONT_UNDERLINE, LFUN_FONT_UNDERLINE,
LFUN_FONT_STRIKEOUT, LFUN_FONT_STRIKEOUT,
LFUN_FONT_UULINE, LFUN_FONT_UNDERUNDERLINE,
// 335 // 335
LFUN_FONT_UWAVE, LFUN_FONT_UNDERWAVE,
LFUN_BUFFER_EXPORT, // Lgb 97-07-29 LFUN_BUFFER_EXPORT, // Lgb 97-07-29
LFUN_BUFFER_TOGGLE_COMPRESSION, // bpeng 20060427 LFUN_BUFFER_TOGGLE_COMPRESSION, // bpeng 20060427
LFUN_BRANCH_ADD, // spitz 20090707 LFUN_BRANCH_ADD, // spitz 20090707

View File

@ -486,14 +486,14 @@ void LyXAction::init()
*/ */
{ LFUN_SPACE_INSERT, "space-insert", Noop, Edit }, { LFUN_SPACE_INSERT, "space-insert", Noop, Edit },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_HYPERLINK_INSERT * \var lyx::FuncCode lyx::LFUN_HREF_INSERT
* \li Action: Inserts hyperlinks into the document (clickable in pdf output). * \li Action: Inserts hyperlinks into the document (clickable in pdf output).
* \li Notion: Hyperlink target can be set via selection + hyperlink-insert function. * \li Notion: Hyperlink target can be set via selection + hyperlink-insert function.
* \li Syntax: href-insert [<TARGET>] * \li Syntax: href-insert [<TARGET>]
* \li Origin: CFO-G, 21 Nov 1997 * \li Origin: CFO-G, 21 Nov 1997
* \endvar * \endvar
*/ */
{ LFUN_HYPERLINK_INSERT, "href-insert", Noop, Edit }, { LFUN_HREF_INSERT, "href-insert", Noop, Edit },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_SPECIALCHAR_INSERT * \var lyx::FuncCode lyx::LFUN_SPECIALCHAR_INSERT
* \li Action: Inserts various characters into the document. * \li Action: Inserts various characters into the document.
@ -1190,13 +1190,13 @@ void LyXAction::init()
*/ */
{ LFUN_LINE_END_SELECT, "line-end-select", ReadOnly | SingleParUpdate, Edit }, { LFUN_LINE_END_SELECT, "line-end-select", ReadOnly | SingleParUpdate, Edit },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_LINE_DELETE * \var lyx::FuncCode lyx::LFUN_LINE_DELETE_FORWARD
* \li Action: Deletes the letters to the end of the (screen) line or * \li Action: Deletes the letters to the end of the (screen) line or
deletes the selection. deletes the selection.
* \li Syntax: line-delete-forward * \li Syntax: line-delete-forward
* \endvar * \endvar
*/ */
{ LFUN_LINE_DELETE, "line-delete-forward", Noop, Edit }, // there is no line-delete-backward { LFUN_LINE_DELETE_FORWARD, "line-delete-forward", Noop, Edit }, // there is no line-delete-backward
/*! /*!
* \var lyx::FuncCode lyx::LFUN_COPY * \var lyx::FuncCode lyx::LFUN_COPY
* \li Action: Copies the current selection to the clipboard. * \li Action: Copies the current selection to the clipboard.
@ -1345,21 +1345,21 @@ void LyXAction::init()
*/ */
{ LFUN_FONT_UNDERLINE, "font-underline", Noop, Layout }, { LFUN_FONT_UNDERLINE, "font-underline", Noop, Layout },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_FONT_UULINE * \var lyx::FuncCode lyx::LFUN_FONT_UNDERUNDERLINE
* \li Action: Toggles double underline in the font (selection-wise). * \li Action: Toggles double underline in the font (selection-wise).
* \li Syntax: font-underunderline * \li Syntax: font-underunderline
* \li Origin: sanda, 5 May 2009 * \li Origin: sanda, 5 May 2009
* \endvar * \endvar
*/ */
{ LFUN_FONT_UULINE, "font-underunderline", Noop, Layout }, { LFUN_FONT_UNDERUNDERLINE, "font-underunderline", Noop, Layout },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_FONT_UWAVE * \var lyx::FuncCode lyx::LFUN_FONT_UNDERWAVE
* \li Action: Toggles wavy underline in the font (selection-wise). * \li Action: Toggles wavy underline in the font (selection-wise).
* \li Syntax: font-underwave * \li Syntax: font-underwave
* \li Origin: sanda, 5 May 2009 * \li Origin: sanda, 5 May 2009
* \endvar * \endvar
*/ */
{ LFUN_FONT_UWAVE, "font-underwave", Noop, Layout }, { LFUN_FONT_UNDERWAVE, "font-underwave", Noop, Layout },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_FONT_STRIKEOUT * \var lyx::FuncCode lyx::LFUN_FONT_STRIKEOUT
* \li Action: Toggles strikeout (strike-through) in the font (selection-wise). * \li Action: Toggles strikeout (strike-through) in the font (selection-wise).
@ -3533,13 +3533,13 @@ void LyXAction::init()
*/ */
{ LFUN_COMPLETION_POPUP, "completion-popup", ReadOnly | NoUpdate, Edit }, { LFUN_COMPLETION_POPUP, "completion-popup", ReadOnly | NoUpdate, Edit },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_COMPLETION_COMPLETE * \var lyx::FuncCode lyx::LFUN_COMPLETE
* \li Action: Try to complete the word or command at the cursor position. * \li Action: Try to complete the word or command at the cursor position.
* \li Syntax: complete * \li Syntax: complete
* \li Origin: sts, Feb 19 2008 * \li Origin: sts, Feb 19 2008
* \endvar * \endvar
*/ */
{ LFUN_COMPLETION_COMPLETE, "complete", SingleParUpdate, Edit }, { LFUN_COMPLETE, "complete", SingleParUpdate, Edit },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_COMPLETION_CANCEL * \var lyx::FuncCode lyx::LFUN_COMPLETION_CANCEL
@ -3643,17 +3643,17 @@ void LyXAction::init()
* \li Origin: sts, 16 Nov 2008 * \li Origin: sts, 16 Nov 2008
* \endvar * \endvar
*/ */
{ LFUN_LABEL_COPY_AS_REF, "copy-label-as-reference", { LFUN_LABEL_COPY_AS_REFERENCE, "label-copy-as-reference",
ReadOnly | NoUpdate | AtPoint, Edit }, ReadOnly | NoUpdate | AtPoint, Edit },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_LABEL_INSERT_AS_REF * \var lyx::FuncCode lyx::LFUN_LABEL_INSERT_AS_REFERENCE
* \li Action: Inserts the label (in ToC pane) as a cross-reference at the position of the cursor. * \li Action: Inserts the label (in ToC pane) as a cross-reference at the position of the cursor.
* \li Syntax: label-insert-as-reference * \li Syntax: label-insert-as-reference
* \li Origin: vfr, 7 Apr 2009 * \li Origin: vfr, 7 Apr 2009
* \endvar * \endvar
*/ */
{ LFUN_LABEL_INSERT_AS_REF, "label-insert-as-reference", Noop, Edit}, { LFUN_LABEL_INSERT_AS_REFERENCE, "label-insert-as-reference", Noop, Edit},
/*! /*!
* \var lyx::FuncCode lyx::LFUN_BUFFER_ZOOM_IN * \var lyx::FuncCode lyx::LFUN_BUFFER_ZOOM_IN

View File

@ -567,7 +567,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
finishChange(cur, false); finishChange(cur, false);
break; break;
case LFUN_LINE_DELETE: case LFUN_LINE_DELETE_FORWARD:
if (cur.selection()) if (cur.selection())
cutSelection(cur, true, false); cutSelection(cur, true, false);
else else
@ -1667,7 +1667,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
break; break;
} }
case LFUN_HYPERLINK_INSERT: { case LFUN_HREF_INSERT: {
InsetCommandParams p(HYPERLINK_CODE); InsetCommandParams p(HYPERLINK_CODE);
docstring content; docstring content;
if (cur.selection()) { if (cur.selection()) {
@ -2003,14 +2003,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
break; break;
} }
case LFUN_FONT_UULINE: { case LFUN_FONT_UNDERUNDERLINE: {
Font font(ignore_font, ignore_language); Font font(ignore_font, ignore_language);
font.fontInfo().setUuline(FONT_TOGGLE); font.fontInfo().setUuline(FONT_TOGGLE);
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
break; break;
} }
case LFUN_FONT_UWAVE: { case LFUN_FONT_UNDERWAVE: {
Font font(ignore_font, ignore_language); Font font(ignore_font, ignore_language);
font.fontInfo().setUwave(FONT_TOGGLE); font.fontInfo().setUwave(FONT_TOGGLE);
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
@ -2667,7 +2667,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
// not allowed in description items // not allowed in description items
enable = !inDescriptionItem(cur); enable = !inDescriptionItem(cur);
break; break;
case LFUN_HYPERLINK_INSERT: case LFUN_HREF_INSERT:
if (cur.selIsMultiCell() || cur.selIsMultiLine()) { if (cur.selIsMultiCell() || cur.selIsMultiLine()) {
enable = false; enable = false;
break; break;
@ -2973,8 +2973,8 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_FONT_STATE: case LFUN_FONT_STATE:
case LFUN_FONT_UNDERLINE: case LFUN_FONT_UNDERLINE:
case LFUN_FONT_STRIKEOUT: case LFUN_FONT_STRIKEOUT:
case LFUN_FONT_UULINE: case LFUN_FONT_UNDERUNDERLINE:
case LFUN_FONT_UWAVE: case LFUN_FONT_UNDERWAVE:
case LFUN_TEXTSTYLE_APPLY: case LFUN_TEXTSTYLE_APPLY:
case LFUN_TEXTSTYLE_UPDATE: case LFUN_TEXTSTYLE_UPDATE:
enable = !cur.paragraph().isPassThru(); enable = !cur.paragraph().isPassThru();
@ -2982,7 +2982,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_WORD_DELETE_FORWARD: case LFUN_WORD_DELETE_FORWARD:
case LFUN_WORD_DELETE_BACKWARD: case LFUN_WORD_DELETE_BACKWARD:
case LFUN_LINE_DELETE: case LFUN_LINE_DELETE_FORWARD:
case LFUN_WORD_FORWARD: case LFUN_WORD_FORWARD:
case LFUN_WORD_BACKWARD: case LFUN_WORD_BACKWARD:
case LFUN_WORD_RIGHT: case LFUN_WORD_RIGHT:

View File

@ -1778,7 +1778,7 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
enable = false; enable = false;
break; break;
case LFUN_COMPLETION_COMPLETE: case LFUN_COMPLETE:
if (!d.current_work_area_ if (!d.current_work_area_
|| !d.current_work_area_->completer().inlinePossible( || !d.current_work_area_->completer().inlinePossible(
currentBufferView()->cursor())) currentBufferView()->cursor()))
@ -3693,7 +3693,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
break; break;
case LFUN_COMPLETION_COMPLETE: case LFUN_COMPLETE:
if (d.current_work_area_) if (d.current_work_area_)
d.current_work_area_->completer().tab(); d.current_work_area_->completer().tab();
break; break;

View File

@ -155,9 +155,9 @@ bool TocWidget::getStatus(Cursor & cur, FuncRequest const & cmd,
status.setEnabled(item.dit() != 0); status.setEnabled(item.dit() != 0);
return true; return true;
case LFUN_LABEL_COPY_AS_REF: { case LFUN_LABEL_COPY_AS_REFERENCE: {
// For labels in math, we need to supply the label as a string // For labels in math, we need to supply the label as a string
FuncRequest label_copy(LFUN_LABEL_COPY_AS_REF, item.asString()); FuncRequest label_copy(LFUN_LABEL_COPY_AS_REFERENCE, item.asString());
if (inset) if (inset)
return inset->getStatus(cur, label_copy, status); return inset->getStatus(cur, label_copy, status);
} }
@ -192,9 +192,9 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd)
cur.dispatch(tmpcmd); cur.dispatch(tmpcmd);
break; break;
case LFUN_LABEL_COPY_AS_REF: { case LFUN_LABEL_COPY_AS_REFERENCE: {
// For labels in math, we need to supply the label as a string // For labels in math, we need to supply the label as a string
FuncRequest label_copy(LFUN_LABEL_COPY_AS_REF, item.asString()); FuncRequest label_copy(LFUN_LABEL_COPY_AS_REFERENCE, item.asString());
if (inset) if (inset)
inset->dispatch(cur, label_copy); inset->dispatch(cur, label_copy);
break; break;

View File

@ -200,8 +200,8 @@ bool InsetLabel::getStatus(Cursor & cur, FuncRequest const & cmd,
{ {
bool enabled; bool enabled;
switch (cmd.action()) { switch (cmd.action()) {
case LFUN_LABEL_INSERT_AS_REF: case LFUN_LABEL_INSERT_AS_REFERENCE:
case LFUN_LABEL_COPY_AS_REF: case LFUN_LABEL_COPY_AS_REFERENCE:
enabled = true; enabled = true;
break; break;
default: default:
@ -233,7 +233,7 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
break; break;
} }
case LFUN_LABEL_COPY_AS_REF: { case LFUN_LABEL_COPY_AS_REFERENCE: {
InsetCommandParams p(REF_CODE, "ref"); InsetCommandParams p(REF_CODE, "ref");
p["reference"] = getParam("name"); p["reference"] = getParam("name");
cap::clearSelection(); cap::clearSelection();
@ -241,7 +241,7 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
break; break;
} }
case LFUN_LABEL_INSERT_AS_REF: { case LFUN_LABEL_INSERT_AS_REFERENCE: {
InsetCommandParams p(REF_CODE, "ref"); InsetCommandParams p(REF_CODE, "ref");
p["reference"] = getParam("name"); p["reference"] = getParam("name");
string const data = InsetCommand::params2string(p); string const data = InsetCommand::params2string(p);

View File

@ -4384,8 +4384,8 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_FONT_SIZE: case LFUN_FONT_SIZE:
case LFUN_FONT_UNDERLINE: case LFUN_FONT_UNDERLINE:
case LFUN_FONT_STRIKEOUT: case LFUN_FONT_STRIKEOUT:
case LFUN_FONT_UULINE: case LFUN_FONT_UNDERUNDERLINE:
case LFUN_FONT_UWAVE: case LFUN_FONT_UNDERWAVE:
case LFUN_LANGUAGE: case LFUN_LANGUAGE:
case LFUN_PARAGRAPH_PARAMS_APPLY: case LFUN_PARAGRAPH_PARAMS_APPLY:
case LFUN_PARAGRAPH_PARAMS: case LFUN_PARAGRAPH_PARAMS:

View File

@ -1142,7 +1142,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
switch (act) { switch (act) {
// insert file functions // insert file functions
case LFUN_LINE_DELETE: case LFUN_LINE_DELETE_FORWARD:
cur.recordUndoInset(); cur.recordUndoInset();
//autocorrect_ = false; //autocorrect_ = false;
//macroModeClose(); //macroModeClose();

View File

@ -1434,7 +1434,7 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd)
break; break;
} }
case LFUN_LABEL_COPY_AS_REF: { case LFUN_LABEL_COPY_AS_REFERENCE: {
row_type row; row_type row;
if (cmd.argument().empty() && &cur.inset() == this) if (cmd.argument().empty() && &cur.inset() == this)
// if there is no argument and we're inside math, we retrieve // if there is no argument and we're inside math, we retrieve
@ -1630,7 +1630,7 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd,
status.setEnabled(type_ != hullSimple); status.setEnabled(type_ != hullSimple);
return true; return true;
case LFUN_LABEL_COPY_AS_REF: { case LFUN_LABEL_COPY_AS_REFERENCE: {
bool enabled = false; bool enabled = false;
row_type row; row_type row;
if (cmd.argument().empty() && &cur.inset() == this) { if (cmd.argument().empty() && &cur.inset() == this) {