X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXAction.cpp;h=24687c79f0c201c5b40df085afba8c66290f81e3;hb=0c7bd9a57f2a308bb9659200eda3b7e45f8d5d3c;hp=7c55ecd6a59b7b4c7bd474516dd92c5e86fb0205;hpb=47cefe424d504513b248f58267187f64cda84259;p=lyx.git diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 7c55ecd6a5..24687c79f0 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -35,7 +35,7 @@ namespace lyx { Here's the set of rules to apply when a new command name is introduced: 1) Use the object.event order. That is, use `word-forward' - instead of `forward-word'. + instead of `forward-word'. 2) Don't introduce an alias for an already named object. Same for events. 3) Forward movement or focus is called `forward' (not `right'). 4) Backward movement or focus is called `backward' (not `left'). @@ -57,16 +57,18 @@ namespace lyx { * * Doxygen template below. Some notes: Parameters should be set in uppercase * and put in , [] means optional one. + * + * Use spaces for indentation (doxy -> .lyx generator is tab-sensitive). */ /*! * \var lyx::FuncCode lyx::LFUN_ - * \li Action: - * \li Notion: - * \li Syntax: - * \li Params: + * \li Action: + * \li Notion: + * \li Syntax: + * \li Params: * \li Sample: - * \li Origin: + * \li Origin: * \endvar */ @@ -74,7 +76,7 @@ LyXAction lyxaction; void LyXAction::newFunc(FuncCode action, string const & name, - unsigned int attrib, LyXAction::func_type type) + unsigned int attrib, LyXAction::FuncType type) { lyx_func_map[name] = action; FuncInfo tmpinfo; @@ -97,13 +99,14 @@ void LyXAction::init() // magnitudes faster. static bool init; - if (init) return; + if (init) + return; struct ev_item { FuncCode action; char const * name; unsigned int attrib; - func_type type; + FuncType type; }; ev_item const items[] = { @@ -196,6 +199,14 @@ void LyXAction::init() * \endvar */ { LFUN_ACCENT_OGONEK, "accent-ogonek", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_ACCENT_PERISPOMENI + * \li Action: Adds a perispomeni (Greek circumflex) + over the next character typed. + * \li Syntax: accent-perispomeni + * \endvar + */ + { LFUN_ACCENT_PERISPOMENI, "accent-perispomeni", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_ACCENT_TIE * \li Action: Adds a tie \htmlonly (a͡)\endhtmlonly @@ -314,21 +325,14 @@ void LyXAction::init() */ { LFUN_WRAP_INSERT, "wrap-insert", Noop, Edit }, /*! - * \var lyx::FuncCode lyx::LFUN_OPTIONAL_INSERT - * \li Action: Inserts an optional-argument (short title) inset. - * \li Syntax: optional-insert + * \var lyx::FuncCode lyx::LFUN_ARGUMENT_INSERT + * \li Action: Inserts an argument (short title) inset. + * \li Syntax: argument-insert + * \li Params: : see layout declarations * \li Origin: vermeer, 12 Aug 2002 * \endvar */ - { LFUN_OPTIONAL_INSERT, "optional-insert", Noop, Edit }, -/*! - * \var lyx::FuncCode lyx::LFUN_LINE_INSERT - * \li Action: Inserts a horizontal line. - * \li Syntax: line-insert - * \li Origin: Andre, Oct 27 2003 - * \endvar - */ - { LFUN_LINE_INSERT, "line-insert", Noop, Edit }, + { LFUN_ARGUMENT_INSERT, "argument-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_NEWPAGE_INSERT * \li Action: Inserts a new page. @@ -365,12 +369,20 @@ void LyXAction::init() * \endvar */ { LFUN_LISTING_INSERT, "listing-insert", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_PREVIEW_INSERT + * \li Action: Inserts a new preview inset. + * \li Syntax: preview-insert + * \li Origin: vfr, 28 Mar 2010 + * \endvar + */ + { LFUN_PREVIEW_INSERT, "preview-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_TAB_INSERT * \li Action: Insert a tab into a listings inset. * \li Notion: It also works on a selection. * \li Syntax: tab-insert - * \li Origin: vfvanravesteijn, Sep 30 2008 + * \li Origin: vfr, Sep 30 2008 * \endvar */ { LFUN_TAB_INSERT, "tab-insert", SingleParUpdate, Edit }, @@ -380,16 +392,16 @@ void LyXAction::init() a listings inset. * \li Notion: It also works on a selection - it removes a tab or spaces from the beginning of each line spanned by the selection. This is useful if - you want to indent/unindent multiple lines in one action. + you want to indent/unindent multiple lines in one action. * \li Syntax: tab-delete - * \li Origin: vfvanravesteijn, Sep 30 2008 + * \li Origin: vfr, Sep 30 2008 * \endvar */ { LFUN_TAB_DELETE, "tab-delete", SingleParUpdate, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_QUOTE_INSERT * \li Action: Inserts quotes according to the type and quote-language preference. - * \li Action: Currently English, Swedish, German, Polish, French, Danish quotes + * \li Notion: Currently English, Swedish, German, Polish, French, Danish quotes are distinguished. * \li Syntax: quote-insert [] * \li Params: : 'single' for single quotes, otherwise double quotes will be used. @@ -403,11 +415,20 @@ void LyXAction::init() * \li Notion: Apart from lfun arguments you can use the following method: \n 1. input the type and argument of this inset, e.g. "menu paste", in the work area.\n - 2. select the text and run info-insert lfun. + 2. select the text and run info-insert lfun. * \li Syntax: info-insert - * \li Params: : shortcut|lyxrc|package|textclass|menu|buffer \n + * \li Params: : shortcut[s]|lyxrc|lyxinfo|package|textclass|menu|buffer \n : argument for a given type. Look into InsetInfo.h for detailed - description. + description. \n + shortcut[s]: name of lfun (e.g math-insert \alpha) \n + lyxrc: name of rc_entry (e.g. bind_file) \n + lyxinfo: "version" - used version of LyX \n + package: name of latex package (e.g. listings) \n + textclass: name of textclass (e.g. article) \n + menu: name of lfun used in menu \n + icon: icon of lfun used in toolbar or direct icon name\n + buffer: "name"|"path"|"class"|"vcs-tree-revision"| + "vcs-revision"|"vcs-author"|"vcs-date"|"vcs-time" * \li Sample: command-sequence info-insert buffer path; info-insert buffer name * \li Origin: bpeng, 7 Oct 2007 * \endvar @@ -440,17 +461,13 @@ void LyXAction::init() class you're using has to load the character styles. There are a few contained in the Logical Markup module. You can also of course create some yourself. \n - For dissolving the element see #LFUN_INSET_DISSOLVE. - * \li Syntax: flex-insert - * \li Params: TYPE: CharStyle|Custom|Element|Standard \n - Identifies whether this is a Character Style, a - Custom Inset or an XML Element, and which dynamical - sub-menu this flex inset is in on the LyX menu tree. - If Standard (currently unused): none of these. - Name: This name must be defined either in your layout file - or imported by some module. The definition is \n - InsetLayout - * \li Sample: flex-insert CharStyle:Code + For dissolving the element see #LFUN_INSET_DISSOLVE. + * \li Syntax: flex-insert Name + * \li Params: Name: This name must be defined either in your layout file + or imported by some module. The definition is + InsetLayout Name or InsetLayout . The Flex: + prefix is optional. + * \li Sample: flex-insert Code * \endvar */ { LFUN_FLEX_INSERT, "flex-insert", Noop, Edit }, @@ -467,41 +484,43 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_SPACE_INSERT * \li Action: Inserts one of horizontal space insets. * \li Syntax: space-insert [] - * \li Params: : normal, protected, thin, quad, qquad, enspace, enskip, - negthinspace, hfill, hfill*, dotfill, hrulefill, hspace, - hspace* \n + * \li Params: : normal, protected, visible, thin, quad, qquad, enspace, + enskip, negthinspace, negmedspace, negthickspace, hfill, + hfill*, dotfill, hrulefill, hspace, hspace* \n + Only in math mode: med and thick.\n : length for custom spaces (hspace, hspace* for protected) * \li Origin: JSpitzm, 20 May 2003, Mar 17 2008 * \endvar */ { 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 [] * \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. * \li Syntax: specialchar-insert * \li Params: : hyphenation, ligature-break, slash, nobreakdash, dots, - end-of-sentence, menu-separator. + end-of-sentence, menu-separator, lyx, tex, latex, latex2e. * \li Origin: JSpitzm, 6 Dec 2007 * \endvar */ { LFUN_SPECIALCHAR_INSERT, "specialchar-insert", Noop, Edit }, /*! - * \var lyx::FuncCode lyx::LFUN_TOC_INSERT - * \li Action: Inserts table of contents. - * \li Syntax: toc-insert - * \li Origin: Lgb, 27 May 97 + * \var lyx::FuncCode lyx::LFUN_SCRIPT_INSERT + * \li Action: Inserts a subscript or superscript inset. + * \li Syntax: script-insert + * \li Params: : subscript|superscript + * \li Origin: Georg, 23 Nov 2010 * \endvar */ - { LFUN_TOC_INSERT, "toc-insert", Noop, Edit }, + { LFUN_SCRIPT_INSERT, "script-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_APPENDIX * \li Action: Start (or remove) Appendix on the given cursor position. @@ -517,7 +536,7 @@ void LyXAction::init() * \li Notion: It automatically takes the word on the cursor position. * \li Syntax: index-insert [] * \li Params: : name of the index, if multiple indices are defined. - with an empty argument, the default index is selected. + With an empty argument, the default index is selected. * \li Origin: leeming, 3 Aug 2000 * \endvar */ @@ -527,12 +546,40 @@ void LyXAction::init() * \li Action: Inserts list of Index entries on a new page. * \li Syntax: index-print [] * \li Params: : name of the index, if multiple indices are defined. - with an empty argument, the default index is selected. + With an empty argument, the default index is selected. * \li Origin: Lgb, 27 Feb 1997 * \endvar */ { LFUN_INDEX_PRINT, "index-print", Noop, Edit }, - +/*! + * \var lyx::FuncCode lyx::LFUN_IPA_INSERT + * \li Action: Inserts an IPA inset. + * \li Syntax: ipa-insert + * \li Origin: spitz, 05 Mar 2012 + * \endvar + */ + { LFUN_IPA_INSERT, "ipa-insert", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_IN_IPA + * \li Action: Only active in IPA inset. + * \li Notion: Dummy function which is only active in a IPA inset. + It's used to toggle the IPA toolbar if the cursor moves + into an IPA inset. + * \li Syntax: in-ipa + * \li Origin: spitz, 20 May 2012 + * \endvar + */ + { LFUN_IN_IPA, "in-ipa", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_IPAMACRO_INSERT + * \li Action: Inserts special IPA macros into the document. + * \li Syntax: ipamacro-insert + * \li Params: : tone-falling, tone-rising, tone-high-rising, tone-low-rising, + * tone-high-rising-falling, deco bottomtiebar, deco toptiebar. + * \li Origin: JSpitzm, 22 Aug 2012 + * \endvar + */ + { LFUN_IPAMACRO_INSERT, "ipamacro-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_NOMENCL_INSERT * \li Action: Inserts Nomenclature entry. @@ -553,7 +600,7 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_NOTE_INSERT - * \li Action: Inserts Note on the current cursor postion, + * \li Action: Inserts Note on the current cursor position, move selection inside the inset. * \li Syntax: note-insert [] * \li Params: : default: Note @@ -562,24 +609,14 @@ void LyXAction::init() { LFUN_NOTE_INSERT, "note-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_NOTE_NEXT - * \li Action: Moves the cursor to the begining of next Note inset. + * \li Action: Moves the cursor to the beginning of next Note inset. * \li Syntax: note-next * \endvar */ { LFUN_NOTE_NEXT, "note-next", ReadOnly, Edit }, -/*! - * \var lyx::FuncCode lyx::LFUN_NOTES_MUTATE - * \li Action: Changes all Note insets of a particular type (source) - to a different type (target) fot the current document. - * \li Syntax: notes-mutate - * \li Params: : Note|Comment|Greyedout - * \li Origin: sanda, 18 Jun 2008 - * \endvar - */ - { LFUN_NOTES_MUTATE, "notes-mutate", Argument, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_PHANTOM_INSERT - * \li Action: Inserts phantom on the current cursor postion, + * \li Action: Inserts phantom on the current cursor position, move selection inside the inset. * \li Syntax: phantom-insert [] * \li Params: : default: Phantom @@ -596,9 +633,19 @@ void LyXAction::init() * \endvar */ { LFUN_NEWLINE_INSERT, "newline-insert", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_SEPARATOR_INSERT + * \li Action: Inserts an environment separator or latex paragraph break. + * \li Syntax: separator-insert [] + * \li Params: : default: plain + * \li Origin: ef, 2 May 2014 + * \endvar + */ + { LFUN_SEPARATOR_INSERT, "separator-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_ESCAPE * \li Action: Clears the selection. If no text is selected call #LFUN_FINISHED_FORWARD. + Inside math mode jumps out of the math inset. * \li Syntax: escape * \li Origin: Lgb, 17 May 2001 * \endvar @@ -762,7 +809,7 @@ void LyXAction::init() { LFUN_CHAR_LEFT, "char-left", ReadOnly | NoUpdate, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_CHAR_LEFT_SELECT - * \li Action: Moves the cursor one position "to the left", adding + * \li Action: Moves the cursor one position "to the left", adding traversed position to the selection. * \li Notion: See also #LFUN_CHAR_LEFT for exact details of the movement. * \li Syntax: char-left-select @@ -807,7 +854,7 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_WORD_BACKWARD_SELECT * \li Action: Moves the cursor to the logically previous beginning of a word, - adding the logically traversed text to the selection. + adding the logically traversed text to the selection. * \li Notion: See also #LFUN_WORD_BACKWARD. * \li Syntax: word-backward-select * \endvar @@ -815,7 +862,7 @@ void LyXAction::init() { LFUN_WORD_BACKWARD_SELECT, "word-backward-select", ReadOnly | SingleParUpdate, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_WORD_DELETE_BACKWARD - * \li Action: Deletes characters to the begining of the word (usually the "C+BackSpace" key). + * \li Action: Deletes characters to the beginning of the word (usually the "C+BackSpace" key). * \li Syntax: word-delete-backward * \endvar */ @@ -847,11 +894,11 @@ void LyXAction::init() { LFUN_WORD_FIND_BACKWARD, "word-find-backward", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_WORD_FIND - * \li Action: Search for next occurence of a string. + * \li Action: Search for next occurrence of a string. * \li Syntax: word-find [] * \li Params: : data encoded from Find dialog (see #lyx::find2string()). If no parameter is given, search with last find-dialog - data is used for search (i.e. find-next). + data is used for search (i.e. find-next). * \li Origin: Andre, Jan 7 2004 * \endvar */ @@ -861,16 +908,16 @@ void LyXAction::init() * \li Action: Replace a string in the document. * \li Syntax: word-replace [] * \li Params: : data is of the form - " \n - \n - " + " \n + \n + " * \li Origin: Andre, Jan 7 2004 * \endvar */ { LFUN_WORD_REPLACE, "word-replace", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_WORD_FINDADV - * \li Action: Search for next occurence of a pattern. + * \li Action: Search for next occurrence of a pattern. * \li Syntax: word-findadv [] * \li Params: : data encoded from FindAdv dialog (see #lyx::findadv2string()). If no parameter is given, search with last find-dialog @@ -878,8 +925,9 @@ void LyXAction::init() * \li Origin: Tommaso, Nov 15 2007 * \endvar */ - { LFUN_WORD_FINDADV, "word-findadv", ReadOnly, Edit }, -/*! \var lyx::FuncCode lyx::LFUN_WORD_FORWARD + { LFUN_WORD_FINDADV, "word-findadv", ReadOnly | NoBuffer, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_WORD_FORWARD * \li Action: Moves the cursor to the logically next beginning of a word. * \li Notion: This is not the action which should be bound to the arrow keys, because forward may be left or right, depending on the language. @@ -891,8 +939,8 @@ void LyXAction::init() { LFUN_WORD_FORWARD, "word-forward", ReadOnly | NoUpdate, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_WORD_FORWARD_SELECT - * \li Action: Moves the cursor to the logically next beginning of a word, - adding the logically traversed text to the selection. + * \li Action: Moves the cursor to the logically next beginning of a word, + adding the logically traversed text to the selection. * \li Notion: See also #LFUN_WORD_FORWARD. * \li Syntax: word-forward-select * \endvar @@ -902,12 +950,12 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_WORD_LEFT * \li Action: Moves the cursor to the next beginning of a word "on the left". * \li Notion: This is the action which should be taken when the (e.g., ctrl-) - "left" key is pressed. Generally, it moves the cursor to the - next beginning of a word on the left. However, in Bidi text this - become slightly more complicated, and there are different modes - of cursor movement. In "visual mode", this moves left, plain and - simple. In "logical mode", movement is logically forward in RTL - paragraphs, and logically backwards in LTR paragraphs. + "left" key is pressed. Generally, it moves the cursor to the + next beginning of a word on the left. However, in Bidi text this + become slightly more complicated, and there are different modes + of cursor movement. In "visual mode", this moves left, plain and + simple. In "logical mode", movement is logically forward in RTL + paragraphs, and logically backwards in LTR paragraphs. * \li Syntax: word-left * \li Origin: dov, 28 Oct 2007 * \endvar @@ -916,7 +964,7 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_WORD_LEFT_SELECT * \li Action: Moves the cursor to the next beginning of a word "on the left", - adding *logically* traversed text to the selection. + adding *logically* traversed text to the selection. * \li Notion: See also #LFUN_WORD_LEFT for exact details of the movement. * \li Syntax: word-left-select * \li Origin: dov, 28 Oct 2007 @@ -927,13 +975,13 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_WORD_RIGHT * \li Action: Moves the cursor to the next beginning of a word "on the right". * \li Notion: This is the action which should be taken when the (e.g., ctrl-) - "right" key is pressed. Generally, it moves the cursor to the - next beginning of a word on the right. However, in Bidi text - this become slightly more complicated, and there are different - modes of cursor movement. In "visual mode", this moves right, - plain and simple. In "logical mode", movement is logically - forward in LTR paragraphs, and logically backwards in RTL - paragraphs. + "right" key is pressed. Generally, it moves the cursor to the + next beginning of a word on the right. However, in Bidi text + this become slightly more complicated, and there are different + modes of cursor movement. In "visual mode", this moves right, + plain and simple. In "logical mode", movement is logically + forward in LTR paragraphs, and logically backwards in RTL + paragraphs. * \li Syntax: word-right * \li Origin: dov, 28 Oct 2007 * \endvar @@ -942,7 +990,7 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_WORD_RIGHT_SELECT * \li Action: Moves the cursor to the next beginning of a word "on the right", - adding *logically* traversed text to the selection. + adding *logically* traversed text to the selection. * \li Notion: See also #LFUN_WORD_RIGHT for exact details of the movement. * \li Syntax: word-right-select * \li Origin: dov, 28 Oct 2007 @@ -960,27 +1008,82 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_WORD_CAPITALIZE * \li Action: Capitalizes the words in the selection (i.e. the first letters) - or the letter on the cursor position. - * \li Syntax: word-capitalize + or the first letter of word at cursor position. + * \li Syntax: word-capitalize [] + * \li Params: : if this is equal to "partial", then the + * default word starts at cursor position (emacs-style). + * Otherwise, the whole word is considered. * \endvar */ { LFUN_WORD_CAPITALIZE, "word-capitalize", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_WORD_UPCASE - * \li Action: Change the words in the selection or from the cursor position - to the end of word to the upper case. - * \li Syntax: word-upcase + * \li Action: Change the words in the selection or word at cursor position + to upper case. + * \li Syntax: word-upcase [] + * \li Params: : if this is equal to "partial", then the + * default word starts at cursor position (emacs-style). + * Otherwise, the whole word is considered. * \endvar */ { LFUN_WORD_UPCASE, "word-upcase", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_WORD_LOWCASE - * \li Action: Change the words in the selection or from the cursor position - to the end of word to the lower case. - * \li Syntax: word-lowcase + * \li Action: Change the words in the selection or word at cursor position + to lower case. + * \li Syntax: word-lowcase [] + * \li Params: : if this is equal to "partial", then the + * default word starts at cursor position (emacs-style). + * Otherwise, the whole word is considered. * \endvar */ { LFUN_WORD_LOWCASE, "word-lowcase", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_SPELLING_ADD + * \li Action: Add the word under the cursor to the respective + * spell checker dictionary. + * The default for the language is retrieved from the cursor position. + * \li Syntax: spelling-add [] [] + * \li Params: : word to add + : language name (see file languages) + * \li Origin: JSpitzm, 18 Jan 2010 + * \endvar + */ + { LFUN_SPELLING_ADD, "spelling-add", ReadOnly, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_SPELLING_IGNORE + * \li Action: Let the spell checker ignore the word under the cursor + * in the current session for the given language. + * The default for the language is retrieved from the cursor position. + * \li Syntax: spelling-ignore [] [] + * \li Params: : word to ignore + : language name (see file languages) + * \li Origin: JSpitzm, 18 Jan 2010 + * \endvar + */ + { LFUN_SPELLING_IGNORE, "spelling-ignore", ReadOnly, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_SPELLING_REMOVE + * \li Action: Remove the word under the cursor from the respective + * spell checker dictionary. + * The default for the language is retrieved from the cursor position. + * \li Syntax: spelling-remove [] [] + * \li Params: : word to remove + * : language name (see file languages) + * \li Origin: SWitt, 28 July 2010 + * \endvar + */ + { LFUN_SPELLING_REMOVE, "spelling-remove", ReadOnly, Edit }, + +/*! + * \var lyx::FuncCode lyx::LFUN_SPELLING_CONTINUOUSLY + * \li Action: Toggle continuous spell checking. + * \li Syntax: spelling-continuously + * \li Origin: vfr, 24 March 2013 + * \endvar + */ + { LFUN_SPELLING_CONTINUOUSLY, "spelling-continuously", ReadOnly, Edit }, + /*! * \var lyx::FuncCode lyx::LFUN_THESAURUS_ENTRY * \li Action: Look up thesaurus entries with respect to the word under the cursor. @@ -1024,50 +1127,73 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_INSET_BEGIN - * \li Action: Move the cursor to the beginning of the current inset - if it is not already there, or at the beginning of the + * \li Action: Move the cursor to the beginning of the current inset + if it is not already there, or at the beginning of the enclosing inset otherwise * \li Syntax: inset-begin - * \li Origin: JMarc, 2009/03/16 + * \li Origin: lasgouttes, 16 Mar 2009 * \endvar */ { LFUN_INSET_BEGIN, "inset-begin", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_INSET_BEGIN_SELECT - * \li Action: Move the cursor to the beginning of the current inset - if it is not already there, or at the beginning of the + * \li Action: Move the cursor to the beginning of the current inset + if it is not already there, or at the beginning of the enclosing inset otherwise (adding the traversed text to the selection). * \li Syntax: inset-begin-select - * \li Origin: JMarc, 2009/03/16 + * \li Origin: lasgouttes, 16 Mar 2009 * \endvar */ { LFUN_INSET_BEGIN_SELECT, "inset-begin-select", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_INSET_END - * \li Action: Move the cursor to the end of the current inset - if it is not already there, or at the end of the + * \li Action: Move the cursor to the end of the current inset + if it is not already there, or at the end of the enclosing inset otherwise * \li Syntax: inset-end - * \li Origin: JMarc, 2009/03/16 + * \li Origin: lasgouttes, 16 Mar 2009 * \endvar */ { LFUN_INSET_END, "inset-end", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_INSET_END_SELECT - * \li Action: Move the cursor to the end of the current inset - if it is not already there, or at the end of the + * \li Action: Move the cursor to the end of the current inset + if it is not already there, or at the end of the enclosing inset otherwise (adding the traversed text to the selection). * \li Syntax: inset-end-select - * \li Origin: JMarc, 2009/03/16 + * \li Origin: lasgouttes, 16 Mar 2009 * \endvar */ { LFUN_INSET_END_SELECT, "inset-end-select", ReadOnly, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_INSET_SELECT_ALL + * \li Action: Select all contents of an inset. + * \li Notion: There are 3 successive levels: select current cell, + * select all cells of inset, select the inset from outside + * (in the enclosing inset). + * \li Syntax: inset-select-all + * \li Origin: vfr, 22 Aug 2009; lasgouttes 1 Nov 2014 + * \endvar + */ + { LFUN_INSET_SELECT_ALL, "inset-select-all", ReadOnly, Edit }, + +/*! + * \var lyx::FuncCode lyx::LFUN_SECTION_SELECT + * \li Action: Select the whole section. + * \li Notion: The cursor should be in a section heading + before calling this lfun. + * \li Syntax: section-select + * \li Origin: vfr, 05 May 2009 + * \endvar + */ + { LFUN_SECTION_SELECT, "section-select", ReadOnly, Edit }, + /*! * \var lyx::FuncCode lyx::LFUN_LINE_BEGIN - * \li Action: Move the cursor to the begining of the (screen) line. + * \li Action: Move the cursor to the beginning of the (screen) line. * \li Syntax: line-begin * \endvar */ @@ -1096,16 +1222,16 @@ 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 to the clipboard the last edit. + * \li Action: Copies the current selection to the clipboard. * \li Syntax: copy * \endvar */ @@ -1119,24 +1245,32 @@ void LyXAction::init() { LFUN_CUT, "cut", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_PASTE - * \li Action: Pastes material from the active clipboard. - * \li Syntax: paste [] - * \li Params: : emf|pdf|png|jpeg|linkback|wmf + * \li Action: Pastes material (text or picture) from the active clipboard. + * \li Syntax: paste [|] + * \li Params: : emf|pdf|png|jpeg|linkback|wmf|latex|html \n + : number of the selection in the internal clipboard stack to be pasted. * \endvar */ { LFUN_PASTE, "paste", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_CLIPBOARD_PASTE - * \li Action: Pastes text from the active clipboard. + * \li Action: Pastes text from the active clipboard (retains formatting if the + clipboard contains formatted text). Pastes plain text if plain text is + on the clipboard, but tries to interpret it in special ways for certain + insets, e.g. converting csv data to rows and columns if the paste happens + in a tabular inset. + * \li Notion: Historically, LFUN_CLIPBOARD_PASTE was introduced as a counterpart of + LFUN_PRIMARY_SELECTION_PASTE: It behaved exactly the same, but the source + is the clipboard, not the selection. * \li Syntax: clipboard-paste [] * \li Params: : "paragraph" will cause pasting as one paragraph, i.e. "Join lines". - * \li Origin: baum, 10 Jul 2006 + * \li Origin: Georg, 10 Jul 2006 * \endvar */ { LFUN_CLIPBOARD_PASTE, "clipboard-paste", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_PRIMARY_SELECTION_PASTE - * \li Action: Pastes the currently text selected text. + * \li Action: Pastes the currently selected text. * \li Notion: Primary selection mechanism is linux-only thing. * \li Syntax: primary-selection-paste [] * \li Params: : "paragraph" will cause pasting as one paragraph, i.e. "Join lines". @@ -1145,25 +1279,40 @@ void LyXAction::init() { LFUN_PRIMARY_SELECTION_PASTE, "primary-selection-paste", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_SELECTION_PASTE - * \li Action: Pastes the text in permanent selection. + * \li Action: Pastes the internal selection text in permanent selection. + * \li Notion: Created in order to have middle mouse button pasting correct (bound to + command-alternatives selection-paste ; primary-selection-paste paragraph). * \li Syntax: selection-paste + * \li Origin: lasgouttes, 14 Jan 2009 * \endvar */ { LFUN_SELECTION_PASTE, "selection-paste", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_CLIPBOARD_PASTE_SIMPLE + * \li Action: Pastes plain text from the active clipboard even if formatted + LyX content is in the clipboard. Pastes plain text if plain text + is on the clipboard, without trying to interpret it in special + ways for certain insets, e.g. converting csv data to rows and + columns if the paste happens in a tabular inset. + * \li Syntax: clipboard-paste-simple [] + * \li Params: : "paragraph" will cause pasting as one paragraph, i.e. "Join lines". + * \endvar + */ + { LFUN_CLIPBOARD_PASTE_SIMPLE, "clipboard-paste-simple", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_UNDO * \li Action: Undoes the last edit. * \li Syntax: undo * \endvar */ - { LFUN_UNDO, "undo", Noop, Edit }, + { LFUN_UNDO, "undo", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_REDO * \li Action: Redoes the last thing undone. * \li Syntax: redo * \endvar */ - { LFUN_REDO, "redo", Noop, Edit }, + { LFUN_REDO, "redo", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_REPEAT * \li Action: Repeat the given command. @@ -1228,21 +1377,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). @@ -1315,7 +1464,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_TEXTSTYLE_APPLY * \li Action: Toggle user-defined (=last-time used) text style. * \li Notion: This style is set via #LFUN_TEXTSTYLE_UPDATE, which is - automatically trigerred when using Text Style dialog. + automatically triggered when using Text Style dialog. * \li Syntax: textstyle-apply * \li Origin: leeming, 12 Mar 2003 * \endvar @@ -1327,9 +1476,9 @@ void LyXAction::init() * \li Syntax: textstyle-update * \li Params: : specifies font atributes, e.g. family, series, shape, size, emph, noun, underbar, number, color, language, - toggleall.\n - Use lyx -dbg action for exact syntax of text-style - dialog parameters. + toggleall.\n + Use lyx -dbg action for exact syntax of text-style + dialog parameters. * \li Origin: leeming, 12 Mar 2003 * \endvar */ @@ -1365,7 +1514,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_BIBTEX_DATABASE_ADD * \li Action: Adds database, which will be used for bibtex citations. * \li Notion: Databases are added to the first BibTeX inset - (Inset->List/TOC->BibTeX bibliography) found from the cursor postion. + (Inset->List/TOC->BibTeX bibliography) found from the cursor position. * \li Syntax: bibtex-database-add * \li Origin: Ale, 30 May 1997 * \endvar @@ -1375,7 +1524,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_BIBTEX_DATABASE_DEL * \li Action: Adds database, which will be used for bibtex citations. * \li Notion: Databases are deleted from the first BibTeX inset - (Inset->List/TOC->BibTeX bibliography) found from the cursor postion. + (Inset->List/TOC->BibTeX bibliography) found from the cursor position. * \li Syntax: bibtex-database-del * \li Origin: Ale, 30 May 1997 * \endvar @@ -1422,7 +1571,7 @@ void LyXAction::init() * \li Origin: rgh, 25 August 2007 * \endvar */ - { LFUN_LAYOUT_MODULES_CLEAR, "layout-modules-clear", Noop, Layout }, + { LFUN_LAYOUT_MODULES_CLEAR, "layout-modules-clear", NoInternal, Layout }, /*! * \var lyx::FuncCode lyx::LFUN_LAYOUT_MODULE_ADD * \li Action: Adds a module. @@ -1432,7 +1581,7 @@ void LyXAction::init() * \li Origin: rgh, 25 August 2007 * \endvar */ - { LFUN_LAYOUT_MODULE_ADD, "layout-module-add", Noop, Layout }, + { LFUN_LAYOUT_MODULE_ADD, "layout-module-add", NoInternal, Layout }, /*! * \var lyx::FuncCode lyx::LFUN_LAYOUT_RELOAD * \li Action: Reloads layout information. @@ -1444,7 +1593,18 @@ void LyXAction::init() * \li Origin: rgh, 3 September 2007 * \endvar */ - { LFUN_LAYOUT_RELOAD, "layout-reload", Noop, Layout }, + { LFUN_LAYOUT_RELOAD, "layout-reload", NoInternal, Layout }, +/*! + * \var lyx::FuncCode lyx::LFUN_BUFFER_VIEW_CACHE + * \li Action: Opens the file that was created from last preview of this buffer. + * \li Notion: This LFUN is called by the "Show Output Anyway" button in the LaTeX + * Errors dialog. It can also be called by the user, which is useful + * if the document takes a long time to compile, and you just + * want to see the last previewed version. + * \li Syntax: buffer-view-cache + * \endvar + */ + { LFUN_BUFFER_VIEW_CACHE, "buffer-view-cache", ReadOnly, Buffer }, /*! * \var lyx::FuncCode lyx::LFUN_TEXTCLASS_APPLY * \li Action: Sets the text class for the current buffer. @@ -1453,7 +1613,7 @@ void LyXAction::init() the filename, minus the ".layout" extension. * \endvar */ - { LFUN_TEXTCLASS_APPLY, "textclass-apply", Noop, Layout }, + { LFUN_TEXTCLASS_APPLY, "textclass-apply", NoInternal, Layout }, /*! * \var lyx::FuncCode lyx::LFUN_TEXTCLASS_LOAD * \li Action: Loads information for a textclass from disk. @@ -1462,7 +1622,7 @@ void LyXAction::init() the filename, minus the ".layout" extension. * \endvar */ - { LFUN_TEXTCLASS_LOAD, "textclass-load", Noop, Layout }, + { LFUN_TEXTCLASS_LOAD, "textclass-load", NoInternal, Layout }, /*! * \var lyx::FuncCode lyx::LFUN_MARK_OFF @@ -1487,7 +1647,7 @@ void LyXAction::init() * \endvar */ { LFUN_MARK_TOGGLE, "mark-toggle", ReadOnly, Edit }, - + /*! * \var lyx::FuncCode lyx::LFUN_MATH_DELIM * \li Action: Inserts math delimiters (e.g. parentheses, brackets) enclosing expression. @@ -1527,6 +1687,14 @@ void LyXAction::init() * \li Action: Inserts math objects and symbols. * \li Syntax: math-insert * \li Params: : Symbol or LaTeX code to be inserted. + * \li Notion: When is a _single_ math inset with more than one cell + (such as "x_y^z" or "\frac{x}{y}"), the content of cell(0) is + replaced by the current selection (only works if the selection + is in mathed). As an example, if "abc" is selected in mathed, + "math-insert \frac{x}{y}" replaces "abc" with "\frac{abc}{y}", + and "math-insert x_y^z" replaces "abc" with "abc_y^z". + If nothing is selected (or the selection is not in mathed), + math-insert works as expected. * \endvar */ { LFUN_MATH_INSERT, "math-insert", Noop, Math }, @@ -1540,7 +1708,7 @@ void LyXAction::init() { LFUN_MATH_SUBSCRIPT, "math-subscript", Noop, Math }, /*! * \var lyx::FuncCode lyx::LFUN_MATH_SUPERSCRIPT - * \li Action: Enters subscript expression in math expression. + * \li Action: Enters superscript expression in math expression. * \li Syntax: math-superscript * \li Origin: vermeer, 12 Dec 2001 * \endvar @@ -1561,7 +1729,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_MATH_MACRO * \li Action: Inserts a math macro definition at the cursor position in the text. * \li Syntax: math-macro [] [def] - * \li Params: : The name of the macro, e.g. "mymacro". + * \li Params: : The name of the macro, e.g. "mymacro".\n : The number of parameters of the macro. Default is 0. "def": Has no effect anymore, just for compatibility with former LyX versions. * \li Origin: ale, 10 May 1997; sts, 21 Dec 2007 @@ -1586,9 +1754,9 @@ void LyXAction::init() * \li Params: : negative spaces: !|negthinspace|negmedspace|negthickspace \n positive spaces: ,|thinspace|:|medspace|;|thickspace|enskip|quad|qquad \n custom space: hspace \n - "," used by default. + "," used by default.\n Note that ! is equivalent to negthinspace, , = thinspace, - : = medspace, and ; = thickspace. + : = medspace, and ; = thickspace.\n : length for custom spaces (hspace) * \li Origin: Andre, 25 Jul 2001; sanda, 16 Jun 2008 * \endvar @@ -1599,19 +1767,32 @@ void LyXAction::init() * \li Action: Inserts a matrix. * \li Syntax: math-matrix [] * \li Params: : Alignment is a word composed of the vertical alignment - (b, c or t) (i.e. 1 char) and the horizontal alignments - (l, c or r) (i.e. chars). + (b, c or t) (i.e. 1 char) and the horizontal alignments + (l, c or r) (i.e. chars). * \li Sample: math-matrix 3 3 bccc * \endvar */ { LFUN_MATH_MATRIX, "math-matrix", Noop, Math }, +/*! + * \var lyx::FuncCode lyx::LFUN_MATH_AMS_MATRIX + * \li Action: Inserts an extended matrix as provided by the amsmath package. + * \li Syntax: math-matrix [] + * \li Params: : Decoration determines the LaTeX name of the matrix + that should be created. Possible values include + pmatrix, bmatrix, Bmatrix, vmatrix, Vmatrix and + matrix. The default is 'matrix'. + * \li Sample: math-ams-matrix 3 3 bmatrix + * \endvar + */ + { LFUN_MATH_AMS_MATRIX, "math-ams-matrix", Noop, Math }, /*! * \var lyx::FuncCode lyx::LFUN_MATH_MODE * \li Action: In text mode enters math mode (i.e. puts math insets on the current cursor position), in math mode enters text mode inside math expression. * \li Notion: If there is some selected text, it puts the text inside created math box. - * \li Syntax: math-mode [] - * \li Params: : eventual argument (LaTeX code) is passed to #LFUN_MATH_INSERT . + * \li Syntax: math-mode [on|] + * \li Params: : eventual argument (LaTeX code) is passed to #LFUN_MATH_INSERT .\n + "on": allow only entering of math mode from text mode. * \li Origin: Alejandro, 4 Jun 1996 * \endvar */ @@ -1654,7 +1835,7 @@ void LyXAction::init() * \li Notion: Selection can be used to determine the input for the external program. * \li Syntax: math-extern [] * \li Params: : octave|maxima|maple|mathematica|script \n - where "script" stands fot the external script (normalized + where "script" stands for the external script (normalized expression will be passed) * \li Origin: Andre, 24 Apr 2001 * \li Sample: math-extern maple simplify @@ -1667,7 +1848,7 @@ void LyXAction::init() * \li Notion: Provides an interface to the LaTeX math mode font size commands. * \li Syntax: math-size