Le 10/02/14 13:03, Jürgen Spitzmüller a écrit :
The first name is the LFUN_ version, normalized to look like the text
versiopn. Shall we rename the enums to match the function names or do
the opposite? Or do nothing?

I'd say go for the first option. renaming the function names is not a good
idea, since those might be in use, and consistency is certainly good.

I did that, except copy-label-as-reference that is not well named IMO; shall I rename it to label-copy-as-reference and change bind file format?

JMarc

>From 5e514fc64649d09754f5051cc471c68f283f7bf5 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Tue, 11 Feb 2014 11:00:20 +0100
Subject: [PATCH] Rename some LFUN names to match the text name

The one that is not changed is
LFUN_LABEL_COPY_AS_REF copy-label-as-reference
because it seems that the right naming is label-copy-as-reference
---
 src/FuncCode.h                | 12 ++++++------
 src/LyXAction.cpp             | 24 ++++++++++++------------
 src/Text3.cpp                 | 16 ++++++++--------
 src/frontends/qt4/GuiView.cpp |  4 ++--
 src/insets/InsetLabel.cpp     |  4 ++--
 src/insets/InsetTabular.cpp   |  4 ++--
 src/mathed/InsetMathGrid.cpp  |  2 +-
 7 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/src/FuncCode.h b/src/FuncCode.h
index 33ebf41..7b4234f 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -168,7 +168,7 @@ enum FuncCode
        LFUN_WORD_DELETE_FORWARD,
        LFUN_WORD_DELETE_BACKWARD,
        // 115
-       LFUN_LINE_DELETE,
+       LFUN_LINE_DELETE_FORWARD,
        LFUN_DEBUG_LEVEL_SET,
        LFUN_MARK_OFF,
        LFUN_MARK_ON,
@@ -230,7 +230,7 @@ enum FuncCode
        // 165
        LFUN_VC_REPO_UPDATE,
        LFUN_VC_COMPARE,
-       LFUN_HYPERLINK_INSERT,          // CFO-G 971121
+       LFUN_HREF_INSERT,          // CFO-G 971121
        LFUN_WORD_FIND_FORWARD,         // Etienne 980216
        LFUN_WORD_FIND_BACKWARD,        // Etienne 980220
        // 170
@@ -402,7 +402,7 @@ enum FuncCode
        LFUN_COMPLETION_POPUP,
        LFUN_COMPLETION_INLINE,
        // 310
-       LFUN_COMPLETION_COMPLETE,
+       LFUN_COMPLETE,
        LFUN_SET_GRAPHICS_GROUP,
        LFUN_COMPLETION_CANCEL,
        LFUN_COMPLETION_ACCEPT,
@@ -415,7 +415,7 @@ enum FuncCode
        LFUN_LABEL_GOTO,                // Ale 970806
        // 320
        LFUN_LABEL_COPY_AS_REF,         // sts, 20081116
-       LFUN_LABEL_INSERT_AS_REF,       // vfr, 20090407
+       LFUN_LABEL_INSERT_AS_REFERENCE,       // vfr, 20090407
        LFUN_PHANTOM_INSERT,            // uwestoehr, 20090130
        LFUN_INSET_BEGIN,               // JMarc, 20090316
        LFUN_INSET_END,                 // JMarc, 20090316
@@ -430,9 +430,9 @@ enum FuncCode
        LFUN_SECTION_SELECT,            // vfr, 20090503
        LFUN_FONT_UNDERLINE,
        LFUN_FONT_STRIKEOUT,
-       LFUN_FONT_UULINE,
+       LFUN_FONT_UNDERUNDERLINE,
        // 335
-       LFUN_FONT_UWAVE,
+       LFUN_FONT_UNDERWAVE,
        LFUN_BUFFER_EXPORT,             // Lgb 97-07-29
        LFUN_BUFFER_TOGGLE_COMPRESSION, // bpeng 20060427
        LFUN_BRANCH_ADD,                // spitz 20090707
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index d100905..f3c70d5 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -486,14 +486,14 @@ void LyXAction::init()
  */
                { 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 Notion: Hyperlink target can be set via selection + hyperlink-insert 
function.
  * \li Syntax: href-insert [<TARGET>]
  * \li Origin: CFO-G, 21 Nov 1997
  * \endvar
  */
-               { LFUN_HYPERLINK_INSERT, "href-insert", Noop, Edit },
+               { LFUN_HREF_INSERT, "href-insert", Noop, Edit },
 /*!
  * \var lyx::FuncCode lyx::LFUN_SPECIALCHAR_INSERT
  * \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 },
 /*!
- * \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
                deletes the selection.
  * \li Syntax: line-delete-forward
  * \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
  * \li Action: Copies the current selection to the clipboard.
@@ -1345,21 +1345,21 @@ void LyXAction::init()
  */
                { 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 Syntax: font-underunderline
  * \li Origin: sanda, 5 May 2009
  * \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 Syntax: font-underwave
  * \li Origin: sanda, 5 May 2009
  * \endvar
  */
-               { LFUN_FONT_UWAVE, "font-underwave", Noop, Layout },
+               { LFUN_FONT_UNDERWAVE, "font-underwave", Noop, Layout },
 /*!
  * \var lyx::FuncCode lyx::LFUN_FONT_STRIKEOUT
  * \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 },
 /*!
- * \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 Syntax: complete
  * \li Origin: sts, Feb 19 2008
  * \endvar
  */
-               { LFUN_COMPLETION_COMPLETE, "complete", SingleParUpdate, Edit },
+               { LFUN_COMPLETE, "complete", SingleParUpdate, Edit },
 
 /*!
  * \var lyx::FuncCode lyx::LFUN_COMPLETION_CANCEL
@@ -3647,13 +3647,13 @@ void LyXAction::init()
                        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 Syntax: label-insert-as-reference
  * \li Origin: vfr, 7 Apr 2009
  * \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
diff --git a/src/Text3.cpp b/src/Text3.cpp
index e46270c..1dead38 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -567,7 +567,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                finishChange(cur, false);
                break;
 
-       case LFUN_LINE_DELETE:
+       case LFUN_LINE_DELETE_FORWARD:
                if (cur.selection())
                        cutSelection(cur, true, false);
                else
@@ -1667,7 +1667,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_HYPERLINK_INSERT: {
+       case LFUN_HREF_INSERT: {
                InsetCommandParams p(HYPERLINK_CODE);
                docstring content;
                if (cur.selection()) {
@@ -2003,14 +2003,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_FONT_UULINE: {
+       case LFUN_FONT_UNDERUNDERLINE: {
                Font font(ignore_font, ignore_language);
                font.fontInfo().setUuline(FONT_TOGGLE);
                toggleAndShow(cur, this, font);
                break;
        }
 
-       case LFUN_FONT_UWAVE: {
+       case LFUN_FONT_UNDERWAVE: {
                Font font(ignore_font, ignore_language);
                font.fontInfo().setUwave(FONT_TOGGLE);
                toggleAndShow(cur, this, font);
@@ -2667,7 +2667,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & 
cmd,
                // not allowed in description items
                enable = !inDescriptionItem(cur);
                break;
-       case LFUN_HYPERLINK_INSERT:
+       case LFUN_HREF_INSERT:
                if (cur.selIsMultiCell() || cur.selIsMultiLine()) {
                        enable = false;
                        break;
@@ -2973,8 +2973,8 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & 
cmd,
        case LFUN_FONT_STATE:
        case LFUN_FONT_UNDERLINE:
        case LFUN_FONT_STRIKEOUT:
-       case LFUN_FONT_UULINE:
-       case LFUN_FONT_UWAVE:
+       case LFUN_FONT_UNDERUNDERLINE:
+       case LFUN_FONT_UNDERWAVE:
        case LFUN_TEXTSTYLE_APPLY:
        case LFUN_TEXTSTYLE_UPDATE:
                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_BACKWARD:
-       case LFUN_LINE_DELETE:
+       case LFUN_LINE_DELETE_FORWARD:
        case LFUN_WORD_FORWARD:
        case LFUN_WORD_BACKWARD:
        case LFUN_WORD_RIGHT:
diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 644f143..d76c3c8 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1778,7 +1778,7 @@ bool GuiView::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
                        enable = false;
                break;
 
-       case LFUN_COMPLETION_COMPLETE:
+       case LFUN_COMPLETE:
                if (!d.current_work_area_
                        || !d.current_work_area_->completer().inlinePossible(
                        currentBufferView()->cursor()))
@@ -3693,7 +3693,7 @@ void GuiView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
                        break;
 
 
-               case LFUN_COMPLETION_COMPLETE:
+               case LFUN_COMPLETE:
                        if (d.current_work_area_)
                                d.current_work_area_->completer().tab();
                        break;
diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp
index 4dfbc96..64b9fa5 100644
--- a/src/insets/InsetLabel.cpp
+++ b/src/insets/InsetLabel.cpp
@@ -200,7 +200,7 @@ bool InsetLabel::getStatus(Cursor & cur, FuncRequest const 
& cmd,
 {
        bool enabled;
        switch (cmd.action()) {
-       case LFUN_LABEL_INSERT_AS_REF:
+       case LFUN_LABEL_INSERT_AS_REFERENCE:
        case LFUN_LABEL_COPY_AS_REF:
                enabled = true;
                break;
@@ -241,7 +241,7 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_LABEL_INSERT_AS_REF: {
+       case LFUN_LABEL_INSERT_AS_REFERENCE: {
                InsetCommandParams p(REF_CODE, "ref");
                p["reference"] = getParam("name");
                string const data = InsetCommand::params2string(p);
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 932b994..e52b762 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -4384,8 +4384,8 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & 
cmd)
        case LFUN_FONT_SIZE:
        case LFUN_FONT_UNDERLINE:
        case LFUN_FONT_STRIKEOUT:
-       case LFUN_FONT_UULINE:
-       case LFUN_FONT_UWAVE:
+       case LFUN_FONT_UNDERUNDERLINE:
+       case LFUN_FONT_UNDERWAVE:
        case LFUN_LANGUAGE:
        case LFUN_PARAGRAPH_PARAMS_APPLY:
        case LFUN_PARAGRAPH_PARAMS:
diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
index 47bb7f7..16e519c 100644
--- a/src/mathed/InsetMathGrid.cpp
+++ b/src/mathed/InsetMathGrid.cpp
@@ -1142,7 +1142,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest 
& cmd)
        switch (act) {
 
        // insert file functions
-       case LFUN_LINE_DELETE:
+       case LFUN_LINE_DELETE_FORWARD:
                cur.recordUndoInset();
                //autocorrect_ = false;
                //macroModeClose();
-- 
1.8.5.2

Reply via email to