Support for \slash and \nobreakdash-

* src/lfuns.h:
* src/Text3.cpp:
* src/insets/InsetMathNest.cpp:
* src/insets/insetCollapsable:
	- new LFUN_SPECIALCHAR_INSERT
	- nuke LFUN_HYPHENATION_POINT_INSERT, 
	  LFUN_LIGATURE_BREAK_INSERT,
	  LFUN_DOTS_INSERT,
               LFUN_END_OF_SENTENCE_PERIOD_INSERT,
	  LFUN_MENU_SEPARATOR_INSERT
	  (functions now handled as arguments of the above)

* src/insets/InsetSpecialChar.{cpp,h}:
	- implement \slash and \nobreakdash-

* src/Buffer.cpp:
	- increment format to 307.
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
	- reversion methods for SpecialChar \slash{} and
	  SpecialChar \nobreakdash-
* development/FORMAT:
	- document file format change

* lib/ui/stdmenus.inc:
* lib/ui/classic.ui:
	- add new SpecialChars to the menus, adapt lfuns to new scheme

* lib/bind/aqua.bind:
* lib/bind/cua.bind:
* lib/bind/emacs.bind:
* lib/bind/fi/menus.bind:
* lib/bind/mac.bind:
* lib/bind/menus.bind:
* lib/bind/sciword.bind:
* lib/bind/xemacs.bind:
	- add shortcuts for new SpecialChars, adapt lfuns to new scheme

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21989 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2007-12-06 11:04:56 +00:00
parent 6fef639091
commit 61e1643821
21 changed files with 259 additions and 164 deletions

View File

@ -1,6 +1,9 @@
LyX file-format changes
-----------------------
2007-12-05 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* Format incremented to 307: support for \slash and \nobreakdash.
2007-12-05 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 306: support for Interlingua

View File

@ -23,13 +23,15 @@
\bind "M-~S-i s s" "command-sequence math-mode ; math-superscript ; font-free; "
\bind "M-~S-i s u" "command-sequence math-mode ; math-subscript ; font-free; "
\bind "M-~S-i s h" "hfill-insert"
\bind "M-~S-i s p" "hyphenation-point-insert"
\bind "M-~S-i s k" "ligature-break-insert"
\bind "M-~S-i s b" "protected-space-insert"
\bind "M-~S-i s p" "specialchar-insert hyphenation-point"
\bind "C-M-minus" "specialchar-insert nobreakdash"
\bind "M-~S-i s k" "specialchar-insert ligature-break"
\bind "M-~S-i s b" "space-insert protected"
\bind "C-S-slash" "specialchar-insert slash"
\bind "M-~S-i s l" "new-line"
\bind "M-~S-i s r" "line-break"
\bind "M-~S-i s i" "dots-insert"
\bind "M-~S-i s e" "end-of-sentence-period-insert"
\bind "M-~S-i s i" "specialchar-insert dots"
\bind "M-~S-i s e" "specialchar-insert end-of-sentence-period"
\bind "M-~S-i s q" "self-insert \""
# FIXME: find a binding for single quotes
# \bind "M-~S-i s q" "quote-insert single"

View File

@ -47,8 +47,8 @@
\bind "C-M-d" "master-buffer-view dvi"
\bind "C-S-D" "buffer-update dvi" # 'd' for dvi
\bind "C-S-T" "buffer-update ps"
\bind "C-M-S-t" "master-buffer-update ps"
\bind "C-M-S-d" "master-buffer-update dvi"
\bind "C-M-S-t" "master-buffer-update ps"
\bind "C-M-S-d" "master-buffer-update dvi"
\bind "C-q" "lyx-quit"
\bind "C-Next" "buffer-next"
\bind "C-Tab" "buffer-next"
@ -84,10 +84,12 @@
\bind "C-S-E" "changes-track" # it's what MS Word uses
\bind "~S-M-quotedbl" "quote-insert single"
\bind "~S-C-quotedbl" "self-insert \""
\bind "C-minus" "hyphenation-point-insert"
\bind "C-minus" "specialchar-insert hyphenation-point"
\bind "C-M-minus" "specialchar-insert nobreakdash"
\bind "M-S-Right" "depth-increment"
\bind "M-S-Left" "depth-decrement"
\bind "C-S-L" "ligature-break-insert"
\bind "C-S-L" "specialchar-insert ligature-break"
\bind "C-S-slash" "specialchar-insert slash"
\bind "C-l" "ert-insert" # 'l' for LaTeX
\bind "C-S-I" "info-insert"
@ -200,10 +202,10 @@
\bind "C-S-Return" "line-break"
\bind "C-k" "line-delete-forward"
\bind "C-space" "space-insert protected"
\bind "C-M-space" "space-insert normal"
\bind "S-C-space" "space-insert thin"
\bind "C-period" "end-of-sentence-period-insert"
\bind "M-period" "dots-insert"
\bind "C-M-space" "space-insert normal"
\bind "S-C-space" "space-insert thin"
\bind "C-period" "specialchar-insert end-of-sentence"
\bind "M-period" "specialchar-insert dots"
\bind "Escape" "cancel"
\bind "F9" "meta-prefix"

View File

@ -35,7 +35,8 @@
\bind "C-g" "cancel"
# help in emacs
\bind "C-h" "hyphenation-point-insert"
\bind "C-h" "specialchar-insert hyphenation-point"
\bind "C-M-minus" "specialchar-insert nobreakdash"
\bind "C-i" "hfill-insert"
\bind "C-j" "break-paragraph"
\bind "C-k" "line-delete-forward"
@ -211,12 +212,13 @@
\bind "M-Return" "break-paragraph inverse"
\bind "C-Return" "new-line"
\bind "C-S-Return" "line-break"
\bind "C-S-L" "ligature-break-insert"
\bind "C-S-L" "specialchar-insert ligature-break"
\bind "C-space" "space-insert protected"
\bind "C-M-space" "space-insert normal"
\bind "S-C-space" "space-insert thin"
\bind "C-period" "end-of-sentence-period-insert"
\bind "M-period" "dots-insert"
\bind "C-M-space" "space-insert normal"
\bind "S-C-space" "space-insert thin"
\bind "C-S-slash" "specialchar-insert slash"
\bind "C-period" "specialchar-insert end-of-sentence"
\bind "M-period" "specialchar-insert dots"
\bind "M-w" "copy"
\bind "Escape" "meta-prefix"

View File

@ -17,14 +17,14 @@
#
# These ones are not supported anymore.
#\bind "M-i minus" "hyphenation-point-insert"
#\bind "M-i p" "dots-insert"
#\bind "M-i e" "end-of-sentence-period-insert"
#\bind "M-i minus" "specialchar-insert hyphenation-point"
#\bind "M-i p" "specialchar-insert dots"
#\bind "M-i e" "specialchar-insert end-of-sentence"
#\bind "M-i q" "quote-insert"
#\bind "M-i apostrophe" "quote-insert"
#\bind "M-i S-quotedbl" "quote-insert"
#\bind "M-i s h" "hfill-insert"
#\bind "M-i s minus" "hyphenation-point-insert"
#\bind "M-i s h" "hfill-insert"
#\bind "M-i s minus" "specialchar-insert hyphenation-point"
#
# Font size menu

View File

@ -68,10 +68,11 @@
\bind "C-S-E" "changes-track" # it's what MS Word uses
\bind "~S-M-quotedbl" "quote-insert single"
\bind "~S-C-quotedbl" "self-insert \""
\bind "C-minus" "hyphenation-point-insert"
\bind "C-minus" "specialchar-insert hyphenation-point"
\bind "C-M-minus" "specialchar-insert nobreakdash"
\bind "M-C-Right" "depth-increment"
\bind "M-C-Left" "depth-decrement"
\bind "C-S-L" "ligature-break-insert"
\bind "C-S-L" "specialchar-insert ligature-break"
\bind "C-l" "ert-insert" # 'l' for LaTeX
\bind "C-S-I" "info-insert"
@ -182,10 +183,11 @@
\bind "C-S-Return" "line-break"
\bind "C-k" "line-delete-forward"
\bind "M-space" "space-insert protected"
\bind "C-M-space" "space-insert normal"
\bind "S-M-space" "space-insert thin"
\bind "C-period" "end-of-sentence-period-insert"
\bind "M-period" "dots-insert"
\bind "C-M-space" "space-insert normal"
\bind "S-M-space" "space-insert thin"
\bind "C-S-slash" "specialchar-insert slash"
\bind "C-period" "specialchar-insert end-of-sentence-period"
\bind "M-period" "specialchar-insert dots"
\bind "Escape" "cancel"
\bind "C-M-Up" "paragraph-move-up"
\bind "C-M-Down" "paragraph-move-down"

View File

@ -18,14 +18,14 @@
#
# These ones are not supported anymore.
#\bind "M-i minus" "hyphenation-point-insert"
#\bind "M-i p" "dots-insert"
#\bind "M-i e" "end-of-sentence-period-insert"
#\bind "M-i minus" "specialchar-insert hyphenation-point"
#\bind "M-i p" "specialchar-insert dots"
#\bind "M-i e" "specialchar-insert end-of-sentence"
#\bind "M-i q" "quote-insert"
#\bind "M-i apostrophe" "quote-insert"
#\bind "M-i S-quotedbl" "quote-insert"
#\bind "M-i s h" "hfill-insert"
#\bind "M-i s minus" "hyphenation-point-insert"
#\bind "M-i s h" "hfill-insert"
#\bind "M-i s minus" "specialchar-insert hyphenation-point"
#
# Font size menu

View File

@ -69,7 +69,7 @@
# Do we need this?
#\bind "C-h" "hyphenation-point-insert"
#\bind "C-h" "specialchar-insert hyphenation-point"
# Sciword mnemonic.
\bind "C-i" "math-insert \int"

View File

@ -37,7 +37,8 @@
\bind "C-g" "cancel"
# help in emacs
\bind "C-h" "hyphenation-point-insert"
\bind "C-h" "specialchar-insert hyphenation-point"
\bind "C-M-minus" "specialchar-insert nobreakdash"
\bind "C-i" "hfill-insert"
#bind "C-j" "------"
\bind "C-k" "line-delete-forward"
@ -222,12 +223,13 @@
\bind "M-Return" "break-paragraph inverse"
\bind "C-Return" "new-line"
\bind "C-S-Return" "line-break"
\bind "C-S-L" "ligature-break-insert"
\bind "C-S-L" "specialchar-insert ligature-break"
\bind "C-space" "space-insert protected"
\bind "C-M-space" "space-insert normal"
\bind "S-C-space" "space-insert thin"
\bind "C-period" "end-of-sentence-period-insert"
\bind "M-period" "dots-insert"
\bind "C-S-slash" "specialchar-insert slash"
\bind "C-period" "specialchar-insert end-of-sentence"
\bind "M-period" "specialchar-insert dots"
\bind "M-w" "copy"
\bind "Escape" "meta-prefix"

View File

@ -80,7 +80,7 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)),
("1_3", [221], minor_versions("1.3" , 7)),
("1_4", range(222,246), minor_versions("1.4" , 5)),
("1_5", range(246,277), minor_versions("1.5" , 2)),
("1_6", range(277,307), minor_versions("1.6" , 0))] # Uwe: support for Interlingua
("1_6", range(277,308), minor_versions("1.6" , 0))]
def formats_list():

View File

@ -404,7 +404,7 @@ def convert_latexcommand_index(document):
def revert_latexcommand_index(document):
"Revert from collapsable form toLatexCommand form."
"Revert from collapsable form to LatexCommand form."
i = 0
while True:
i = find_token(document.body, "\\begin_inset Index", i)
@ -913,6 +913,37 @@ def revert_framed_notes(document):
i = i + 1
def revert_slash(document):
'Revert \\SpecialChar \\slash{} to ERT'
for i in range(len(document.body)):
document.body[i] = document.body[i].replace('\\SpecialChar \\slash{}', \
'\\begin_inset ERT\nstatus collapsed\n\n' \
'\\begin_layout Standard\n\n\n\\backslash\n' \
'slash{}\n\\end_layout\n\n\\end_inset\n\n')
def revert_nobreakdash(document):
'Revert \\SpecialChar \\nobreakdash- to ERT'
found = 0
for i in range(len(document.body)):
line = document.body[i]
r = re.compile(r'\\SpecialChar \\nobreakdash-')
m = r.match(line)
if m:
found = 1
document.body[i] = document.body[i].replace('\\SpecialChar \\nobreakdash-', \
'\\begin_inset ERT\nstatus collapsed\n\n' \
'\\begin_layout Standard\n\n\n\\backslash\n' \
'nobreakdash-\n\\end_layout\n\n\\end_inset\n\n')
if not found:
return
j = find_token(document.header, "\\use_amsmath", 0)
if j == -1:
document.warning("Malformed LyX document: Missing '\\use_amsmath'.")
return
document.header[j] = "\\use_amsmath 2"
def revert_bahasam(document):
"Set language Bahasa Malaysia to Bahasa Indonesia"
i = 0
@ -981,10 +1012,12 @@ convert = [[277, [fix_wrong_tables]],
[303, [convert_serbocroatian]],
[304, [convert_framed_notes]],
[305, []],
[306, []]
[306, []],
[307, []]
]
revert = [[305, [revert_interlingua]],
revert = [[306, [revert_slash, revert_nobreakdash]],
[305, [revert_interlingua]],
[304, [revert_bahasam]],
[303, [revert_framed_notes]],
[302, []],

View File

@ -242,17 +242,20 @@ Menuset
Item "Subscript|u" "command-sequence math-mode on; math-subscript; math-insert \text;"
Item "Horizontal Fill|H" "hfill-insert"
Item "Hyphenation Point|P" "hyphenation-point-insert"
Item "Ligature Break|k" "ligature-break-insert"
Item "Protected Hyphen|y" "specialchar-insert nobreakdash"
Item "Ligature Break|k" "specialchar-insert ligature-break"
Item "Protected Space|r" "space-insert protected"
Item "Inter-word Space|w" "space-insert normal"
Item "Thin Space|T" "space-insert thin"
Item "Vertical Space..." "dialog-show-new-inset vspace"
Item "Line Break|L" "break-line"
Item "Ellipsis|i" "dots-insert"
Item "End of Sentence|E" "end-of-sentence-period-insert"
Item "Ellipsis|i" "specialchar-insert dots"
Item "End of Sentence|E" "specialchar-insert end-of-sentence"
Item "Protected Dash|D" "specialchar-insert nobreakdash"
Item "Breakable Slash|a" "specialchar-insert slash"
Item "Single Quote|Q" "quote-insert single"
Item "Ordinary Quote|O" "self-insert \""
Item "Menu Separator|M" "menu-separator-insert"
Item "Menu Separator|M" "specialchar-insert menu-separator"
Item "Horizontal Line" "line-insert"
Item "Page Break" "pagebreak-insert"
End

View File

@ -339,12 +339,14 @@ Menuset
End
Menu "insert_special"
Item "Ellipsis|i" "dots-insert"
Item "End of Sentence|E" "end-of-sentence-period-insert"
Item "Ellipsis|i" "specialchar-insert dots"
Item "End of Sentence|E" "specialchar-insert end-of-sentence"
Item "Ordinary Quote|Q" "self-insert \""
Item "Single Quote|S" "quote-insert single"
Item "Menu Separator|M" "menu-separator-insert"
Item "Phonetic Symbols|y" "command-sequence math-mode on; math-insert \text\textipa ; char-forward ;"
Item "Protected Hyphen|y" "specialchar-insert nobreakdash"
Item "Breakable Slash|a" "specialchar-insert slash"
Item "Menu Separator|M" "specialchar-insert menu-separator"
Item "Phonetic Symbols|P" "command-sequence math-mode on; math-insert \text\textipa ; char-forward ;"
End
Menu "insert_formatting"
@ -358,8 +360,8 @@ Menuset
Item "Horizontal Line|L" "line-insert"
Item "Vertical Space...|V" "dialog-show-new-inset vspace"
Separator
Item "Hyphenation Point|H" "hyphenation-point-insert"
Item "Ligature Break|k" "ligature-break-insert"
Item "Hyphenation Point|H" "specialchar-insert hyphenation-point"
Item "Ligature Break|k" "specialchar-insert ligature-break"
Item "New Line|e" "new-line"
Item "Line Break|B" "line-break"
Separator

View File

@ -154,7 +154,7 @@ namespace os = support::os;
namespace {
int const LYX_FORMAT = 306; // Uwe: support for Interlingua
int const LYX_FORMAT = 307; // JSpitzm: support for \slash
} // namespace anon

View File

@ -155,11 +155,9 @@ void LyXAction::init()
{ LFUN_DELETE_FORWARD_SKIP, "delete-forward-skip", Noop, Edit },
{ LFUN_DEPTH_DECREMENT, "depth-decrement", Noop, Edit },
{ LFUN_DEPTH_INCREMENT, "depth-increment", Noop, Edit },
{ LFUN_DOTS_INSERT, "dots-insert", Noop, Edit },
{ LFUN_DOWN, "down", ReadOnly | NoUpdate, Edit },
{ LFUN_DOWN_SELECT, "down-select", ReadOnly | SingleParUpdate, Edit },
{ LFUN_DROP_LAYOUTS_CHOICE, "drop-layouts-choice", ReadOnly, Layout },
{ LFUN_END_OF_SENTENCE_PERIOD_INSERT, "end-of-sentence-period-insert", Noop, Edit },
{ LFUN_ENVIRONMENT_INSERT, "environment-insert", Noop, Edit },
{ LFUN_ERROR_NEXT, "error-next", ReadOnly, Edit },
{ LFUN_ERT_INSERT, "ert-insert", Noop, Edit },
@ -188,8 +186,6 @@ void LyXAction::init()
{ LFUN_FOOTNOTE_INSERT, "footnote-insert", Noop, Edit },
{ LFUN_HFILL_INSERT, "hfill-insert", Noop, Edit },
{ LFUN_HELP_OPEN, "help-open", NoBuffer | Argument, Buffer },
{ LFUN_HYPHENATION_POINT_INSERT, "hyphenation-point-insert", Noop, Edit },
{ LFUN_LIGATURE_BREAK_INSERT, "ligature-break-insert", Noop, Edit },
{ LFUN_INDEX_INSERT, "index-insert", Noop, Edit },
{ LFUN_INDEX_PRINT, "index-print", Noop, Edit },
{ LFUN_KEYMAP_OFF, "keymap-off", ReadOnly, Edit },
@ -252,7 +248,6 @@ void LyXAction::init()
{ LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM, "math-macro-remove-optional-param", Noop, Math },
{ LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM, "math-macro-add-greedy-optional-param", Noop, Math },
{ LFUN_MENU_OPEN, "menu-open", NoBuffer, Buffer },
{ LFUN_MENU_SEPARATOR_INSERT, "menu-separator-insert", Noop, Edit },
{ LFUN_META_PREFIX, "meta-prefix", NoBuffer, System },
{ LFUN_NEW_LINE, "new-line", Noop, Edit },
{ LFUN_NEXT_INSET_TOGGLE, "next-inset-toggle", ReadOnly, Edit },
@ -289,6 +284,7 @@ void LyXAction::init()
{ LFUN_SCREEN_UP_SELECT, "screen-up-select", ReadOnly, Edit },
{ LFUN_SELF_INSERT, "self-insert", SingleParUpdate, Hidden },
{ LFUN_SPACE_INSERT, "space-insert", Noop, Edit },
{ LFUN_SPECIALCHAR_INSERT, "specialchar-insert", Noop, Edit },
{ LFUN_SERVER_CHAR_AFTER, "server-char-after", ReadOnly, System },
{ LFUN_SERVER_GET_FONT, "server-get-font", ReadOnly, System },
{ LFUN_SERVER_GET_LAYOUT, "server-get-layout", ReadOnly, System },

View File

@ -871,25 +871,28 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
moveCursor(cur, false);
break;
case LFUN_HYPHENATION_POINT_INSERT:
specialChar(cur, InsetSpecialChar::HYPHENATION);
break;
case LFUN_LIGATURE_BREAK_INSERT:
specialChar(cur, InsetSpecialChar::LIGATURE_BREAK);
break;
case LFUN_DOTS_INSERT:
specialChar(cur, InsetSpecialChar::LDOTS);
break;
case LFUN_END_OF_SENTENCE_PERIOD_INSERT:
specialChar(cur, InsetSpecialChar::END_OF_SENTENCE);
break;
case LFUN_MENU_SEPARATOR_INSERT:
specialChar(cur, InsetSpecialChar::MENU_SEPARATOR);
case LFUN_SPECIALCHAR_INSERT: {
string const name = to_utf8(cmd.argument());
if (name == "hyphenation")
specialChar(cur, InsetSpecialChar::HYPHENATION);
else if (name == "ligature-break")
specialChar(cur, InsetSpecialChar::LIGATURE_BREAK);
else if (name == "slash")
specialChar(cur, InsetSpecialChar::SLASH);
else if (name == "nobreakdash")
specialChar(cur, InsetSpecialChar::NOBREAKDASH);
else if (name == "dots")
specialChar(cur, InsetSpecialChar::LDOTS);
else if (name == "end-of-sentence")
specialChar(cur, InsetSpecialChar::END_OF_SENTENCE);
else if (name == "menu-separator")
specialChar(cur, InsetSpecialChar::MENU_SEPARATOR);
else if (name.empty())
lyxerr << "LyX function 'specialchar-insert' needs an argument." << endl;
else
lyxerr << "Wrong argument for LyX function 'specialchar-insert'." << endl;
break;
}
case LFUN_WORD_UPCASE:
changeCase(cur, text_uppercase);
@ -1955,12 +1958,8 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
// always allow this, since we will inset a raw quote
// if an inset is not allowed.
break;
case LFUN_HYPHENATION_POINT_INSERT:
case LFUN_LIGATURE_BREAK_INSERT:
case LFUN_HFILL_INSERT:
case LFUN_MENU_SEPARATOR_INSERT:
case LFUN_DOTS_INSERT:
case LFUN_END_OF_SENTENCE_PERIOD_INSERT:
case LFUN_SPECIALCHAR_INSERT:
code = SPECIALCHAR_CODE;
break;
case LFUN_SPACE_INSERT:

View File

@ -658,8 +658,6 @@ bool InsetCollapsable::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_CLEARDOUBLEPAGE_INSERT:
case LFUN_DEPTH_DECREMENT:
case LFUN_DEPTH_INCREMENT:
case LFUN_DOTS_INSERT:
case LFUN_END_OF_SENTENCE_PERIOD_INSERT:
case LFUN_ENVIRONMENT_INSERT:
case LFUN_ERT_INSERT:
case LFUN_FILE_INSERT:
@ -684,13 +682,11 @@ bool InsetCollapsable::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_FOOTNOTE_INSERT:
case LFUN_HFILL_INSERT:
case LFUN_HYPERLINK_INSERT:
case LFUN_HYPHENATION_POINT_INSERT:
case LFUN_INDEX_INSERT:
case LFUN_INDEX_PRINT:
case LFUN_INSET_INSERT:
case LFUN_LABEL_GOTO:
case LFUN_LABEL_INSERT:
case LFUN_LIGATURE_BREAK_INSERT:
case LFUN_LINE_INSERT:
case LFUN_NEWPAGE_INSERT:
case LFUN_PAGEBREAK_INSERT:
@ -703,7 +699,6 @@ bool InsetCollapsable::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_MATH_MATRIX:
case LFUN_MATH_MODE:
case LFUN_MENU_OPEN:
case LFUN_MENU_SEPARATOR_INSERT:
case LFUN_NOACTION:
case LFUN_NOMENCL_INSERT:
case LFUN_NOMENCL_PRINT:
@ -719,6 +714,7 @@ bool InsetCollapsable::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_SERVER_NOTIFY:
case LFUN_SERVER_SET_XY:
case LFUN_SPACE_INSERT:
case LFUN_SPECIALCHAR_INSERT:
case LFUN_TABULAR_INSERT:
case LFUN_TOC_INSERT:
case LFUN_WRAP_INSERT:

View File

@ -51,11 +51,27 @@ void InsetSpecialChar::metrics(MetricsInfo & mi, Dimension & dim) const
string s;
switch (kind_) {
case LIGATURE_BREAK: s = "|"; break;
case END_OF_SENTENCE: s = "."; break;
case LDOTS: s = ". . ."; break;
case MENU_SEPARATOR: s = " x "; break;
case HYPHENATION: s = "-"; break;
case LIGATURE_BREAK:
s = "|";
break;
case END_OF_SENTENCE:
s = ".";
break;
case LDOTS:
s = ". . .";
break;
case MENU_SEPARATOR:
s = " x ";
break;
case HYPHENATION:
s = "-";
break;
case SLASH:
s = "/";
break;
case NOBREAKDASH:
s = "-";
break;
}
docstring ds(s.begin(), s.end());
dim.wid = fm.width(ds);
@ -116,6 +132,18 @@ void InsetSpecialChar::draw(PainterInfo & pi, int x, int y) const
pi.pain.lines(xp, yp, 4, Color_special);
break;
}
case SLASH:
{
font.setColor(Color_special);
pi.pain.text(x, y, char_type('/'), font);
break;
}
case NOBREAKDASH:
{
font.setColor(Color_latex);
pi.pain.text(x, y, char_type('-'), font);
break;
}
}
}
@ -140,6 +168,12 @@ void InsetSpecialChar::write(Buffer const &, ostream & os) const
case MENU_SEPARATOR:
command = "\\menuseparator";
break;
case SLASH:
command = "\\slash{}";
break;
case NOBREAKDASH:
command = "\\nobreakdash-";
break;
}
os << "\\SpecialChar " << command << "\n";
}
@ -161,6 +195,10 @@ void InsetSpecialChar::read(Buffer const &, Lexer & lex)
kind_ = LDOTS;
else if (command == "\\menuseparator")
kind_ = MENU_SEPARATOR;
else if (command == "\\slash{}")
kind_ = SLASH;
else if (command == "\\nobreakdash-")
kind_ = NOBREAKDASH;
else
lex.printError("InsetSpecialChar: Unknown kind: `$$Token'");
}
@ -185,6 +223,12 @@ int InsetSpecialChar::latex(Buffer const &, odocstream & os,
case MENU_SEPARATOR:
os << "\\lyxarrow{}";
break;
case SLASH:
os << "\\slash{}";
break;
case NOBREAKDASH:
os << "\\nobreakdash-";
break;
}
return 0;
}
@ -206,6 +250,12 @@ int InsetSpecialChar::plaintext(Buffer const &, odocstream & os,
case MENU_SEPARATOR:
os << "->";
return 2;
case SLASH:
os << '/';
return 1;
case NOBREAKDASH:
os << '-';
return 1;
}
return 0;
}
@ -227,6 +277,12 @@ int InsetSpecialChar::docbook(Buffer const &, odocstream & os,
case MENU_SEPARATOR:
os << "&lyxarrow;";
break;
case SLASH:
os << '/';
break;
case NOBREAKDASH:
os << '-';
break;
}
return 0;
}
@ -249,6 +305,8 @@ void InsetSpecialChar::validate(LaTeXFeatures & features) const
{
if (kind_ == MENU_SEPARATOR)
features.require("lyxarrow");
if (kind_ == NOBREAKDASH)
features.require("amsmath");
}

View File

@ -38,6 +38,10 @@ public:
END_OF_SENTENCE,
/// Menu separator
MENU_SEPARATOR,
/// breakable slash
SLASH,
/// protected dash
NOBREAKDASH,
};
///

View File

@ -75,367 +75,362 @@ enum kb_action {
LFUN_NOTE_NEXT,
LFUN_INSET_TOGGLE,
// 20
LFUN_HYPHENATION_POINT_INSERT,
LFUN_LIGATURE_BREAK_INSERT,
LFUN_HFILL_INSERT,
LFUN_FONT_FREE_APPLY,
LFUN_FONT_FREE_UPDATE,
// 25
LFUN_FONT_EMPH,
LFUN_FONT_BOLD,
// 25
LFUN_FONT_ROMAN,
LFUN_FONT_NOUN,
LFUN_FONT_ITAL,
// 30
LFUN_FONT_FRAK,
LFUN_CHAR_FORWARD,
// 30
LFUN_CHAR_BACKWARD,
LFUN_UP,
LFUN_DOWN,
// 35
LFUN_SCREEN_UP,
LFUN_SCREEN_DOWN,
// 35
LFUN_LINE_BEGIN,
LFUN_LINE_END,
LFUN_CELL_FORWARD,
// 40
LFUN_CELL_BACKWARD,
LFUN_WORD_FORWARD,
// 40
LFUN_WORD_BACKWARD,
LFUN_BUFFER_BEGIN,
LFUN_BUFFER_END,
// 45
LFUN_CHAR_FORWARD_SELECT,
LFUN_CHAR_BACKWARD_SELECT,
// 45
LFUN_UP_SELECT,
LFUN_DOWN_SELECT,
LFUN_SCREEN_UP_SELECT,
// 50
LFUN_SCREEN_DOWN_SELECT,
LFUN_LINE_BEGIN_SELECT,
// 50
LFUN_LINE_END_SELECT,
LFUN_WORD_FORWARD_SELECT,
LFUN_WORD_BACKWARD_SELECT,
// 55
LFUN_WORD_SELECT,
LFUN_BUFFER_BEGIN_SELECT,
// 55
LFUN_BUFFER_END_SELECT,
LFUN_SPACE_INSERT, // JSpitzm 20030520
LFUN_SPECIALCHAR_INSERT, // JSpitzm, 20071205
LFUN_MARK_TOGGLE,
// 60
LFUN_CHAR_DELETE_FORWARD,
// 60
LFUN_CHAR_DELETE_BACKWARD,
LFUN_NEW_LINE,
LFUN_LINE_BREAK,
LFUN_BREAK_PARAGRAPH,
// 65
LFUN_QUOTE_INSERT,
// 65
LFUN_ACCENT_CIRCUMFLEX,
LFUN_MATH_SUBSCRIPT,
LFUN_MATH_SUPERSCRIPT,
LFUN_ACCENT_GRAVE,
// 70
LFUN_ACCENT_ACUTE,
// 70
LFUN_ACCENT_TILDE,
LFUN_ACCENT_CEDILLA,
LFUN_ACCENT_MACRON,
LFUN_ACCENT_UNDERBAR,
// 75
LFUN_ACCENT_UNDERDOT,
// 75
LFUN_ACCENT_CIRCLE,
LFUN_ACCENT_TIE,
LFUN_ACCENT_BREVE,
LFUN_ACCENT_CARON,
// 80
LFUN_ACCENT_SPECIAL_CARON,
// 80
LFUN_ACCENT_HUNGARIAN_UMLAUT,
LFUN_ACCENT_UMLAUT,
LFUN_ACCENT_DOT,
LFUN_ACCENT_OGONEK,
// 85
LFUN_SELF_INSERT,
// 85
LFUN_GETBUFNAME,
LFUN_SERVER_GET_XY,
LFUN_SERVER_SET_XY,
LFUN_SERVER_CHAR_AFTER,
// 90
LFUN_LINEATCURSOR,
// 90
LFUN_SERVER_GET_LAYOUT,
LFUN_SERVER_GET_FONT,
LFUN_SERVER_GET_NAME,
LFUN_SERVER_NOTIFY,
// 95
LFUN_SERVER_GOTO_FILE_ROW,
// 95
LFUN_NOTE_INSERT,
LFUN_ENVIRONMENT_INSERT, // unused as of 20060905
LFUN_KEYMAP_OFF,
LFUN_KEYMAP_PRIMARY,
// 100
LFUN_KEYMAP_SECONDARY,
// 100
LFUN_KEYMAP_TOGGLE,
LFUN_MATH_INSERT,
LFUN_MATH_MATRIX,
LFUN_MATH_LIMITS,
// 105
LFUN_MATH_DELIM, // Alejandro 180696
// 105
LFUN_MATH_DISPLAY, // Alejandro 180696
LFUN_MATH_MODE, // Alejandro 040696
LFUN_MATH_NUMBER, // Alejandro 040696
LFUN_MATH_NONUMBER, // Alejandro 180696
// 110
LFUN_MATH_SIZE, // Alejandro 150896
// 110
LFUN_MATH_MACRO, // ale970510
LFUN_MATH_EXTERN, // Andre' 20010424
LFUN_MATH_MUTATE, // Andre' 20010523
LFUN_MATH_IMPORT_SELECTION, // Andre' 20010704
// 115
LFUN_MATH_SPACE, // Andre' 20010725
// 115
LFUN_WORD_DELETE_FORWARD,
LFUN_WORD_DELETE_BACKWARD,
LFUN_LINE_DELETE,
LFUN_MARK_OFF,
// 120
LFUN_MARK_ON,
// 120
LFUN_LAYOUT,
LFUN_LAYOUT_PARAGRAPH,
LFUN_DROP_LAYOUTS_CHOICE, // used in bindings as of 20060905
LFUN_FONT_TYPEWRITER, // changed from FONT_CODE 20070920
// 125
LFUN_FONT_SANS,
// 125
LFUN_FONT_DEFAULT,
LFUN_FONT_UNDERLINE,
LFUN_FONT_SIZE,
LFUN_FONT_STATE,
// 130
LFUN_WORD_UPCASE,
// 130
LFUN_WORD_LOWCASE,
LFUN_WORD_CAPITALIZE,
LFUN_LABEL_INSERT,
LFUN_DEPTH_DECREMENT,
// 135
LFUN_DEPTH_INCREMENT,
// 135
LFUN_MENU_OPEN, // used in bindings as of 20060905
LFUN_CANCEL,
LFUN_META_PREFIX,
LFUN_COMMAND_EXECUTE,
// 140
LFUN_FILE_INSERT,
// 140
LFUN_FILE_INSERT_PLAINTEXT, // CFO-G 1997-11-19
LFUN_FILE_INSERT_PLAINTEXT_PARA,// Levon 2001-02-14
LFUN_FILE_NEW, // for scripting purposes
LFUN_FILE_OPEN,
// 145
LFUN_PARAGRAPH_UP, // Asger 1996-10-01
// 145
LFUN_PARAGRAPH_UP_SELECT, // Asger 1996-10-01
LFUN_PARAGRAPH_DOWN, // Asger 1996-10-01
LFUN_PARAGRAPH_DOWN_SELECT, // Asger 1996-10-01
LFUN_BREAK_PARAGRAPH_SKIP,
// 150
LFUN_DELETE_BACKWARD_SKIP,
// 150
LFUN_DELETE_FORWARD_SKIP,
LFUN_BUFFER_NEW_TEMPLATE, // Asger 1997-02-02
LFUN_BUFFER_RELOAD, // Asger 1997-02-02
LFUN_RECONFIGURE, // Asger 1997-02-14
// 155
LFUN_INDEX_PRINT, // Lgb 97-02-27
// 155
LFUN_CELL_SPLIT,
LFUN_BUFFER_CHILD_OPEN, // Ale 970528
LFUN_TOC_INSERT, // Lgb 97-05-27
LFUN_FLOAT_LIST, // Lgb 20010503
// 160
LFUN_BUFFER_TOGGLE_READ_ONLY, // Lgb 97-05-27
// 160
LFUN_VC_REGISTER, // Lgb 97-07-01
LFUN_VC_CHECK_IN, // Lgb 97-07-01
LFUN_VC_CHECK_OUT, // Lgb 97-07-01
LFUN_VC_REVERT, // Lgb 97-07-01
// 165
LFUN_VC_UNDO_LAST, // Lgb 97-07-01
// 165
LFUN_BUFFER_EXPORT, // Lgb 97-07-29
LFUN_LABEL_GOTO, // Ale 970806
LFUN_DOTS_INSERT, // Asger 970929
LFUN_END_OF_SENTENCE_PERIOD_INSERT, // Asger 970929
// 170
LFUN_TOGGLE_CURSOR_FOLLOWS_SCROLLBAR, // ARRae 971202
LFUN_BUFFER_CHKTEX, // Asger 971030
LFUN_HYPERLINK_INSERT, // CFO-G 971121
// 170
LFUN_WORD_FIND_FORWARD, // Etienne 980216
LFUN_WORD_FIND_BACKWARD, // Etienne 980220
// 175
LFUN_APPENDIX, // ettrich 980505
LFUN_BUFFER_IMPORT, // Asger 980724
LFUN_MENU_SEPARATOR_INSERT, // Asger 990220
LFUN_COMMAND_SEQUENCE, // Andre' 991111
// 175
LFUN_PREFERENCES_SAVE, // Lgb 991127
// 180
LFUN_HELP_OPEN, // Jug 990627
LFUN_DATE_INSERT, // jdblair 20000131
LFUN_LANGUAGE, // Dekel 20000203
LFUN_ERT_INSERT, // Jug 20000218
// 180
LFUN_FOOTNOTE_INSERT, // Jug 20000307
// 185
LFUN_PARAGRAPH_SPACING, // Lgb 20000411
LFUN_TABULAR_INSERT, // Jug 20000412
LFUN_LOFVIEW, // Dekel 20000519
LFUN_LOTVIEW, // Dekel 20000519
// 185
LFUN_LOAVIEW, // Dekel 20000519
// 190
LFUN_SET_COLOR, // SLior 20000611
LFUN_MARGINALNOTE_INSERT, // Lgb 20000626
LFUN_FLOAT_INSERT, // Lgb 20000627
LFUN_FLOAT_WIDE_INSERT, // Lgb 20010531
// 190
LFUN_CAPTION_INSERT, // Lgb 20000718; inactive as of 20060905
// 195
LFUN_BUFFER_SWITCH,
LFUN_TABULAR_FEATURE, // Jug 20000728
LFUN_LAYOUT_TABULAR, // Jug 20000731
LFUN_BUFFER_UPDATE, // Dekel 20000805
// 195
LFUN_INDEX_INSERT, // Angus 20000803
// 200
LFUN_SCREEN_FONT_UPDATE, // ARRae 20000813
LFUN_PARAGRAPH_GOTO, // Dekel 20000826
LFUN_REFERENCE_NEXT, // Dekel 20010114
LFUN_BOOKMARK_SAVE, // Dekel 20010127
// 200
LFUN_BOOKMARK_GOTO, // Dekel 20010127
// 205
LFUN_SELECT_FILE_SYNC, // Levon 20010214
LFUN_MESSAGE, // Lgb 20010408; for scripting purposes, output in minibuffer
LFUN_CHARS_TRANSPOSE, // Lgb 20010425
LFUN_ESCAPE, // Lgb 20010517
// 205
LFUN_THESAURUS_ENTRY, // Levon 20010720
// 210
LFUN_OPTIONAL_INSERT, // Martin 12 Aug 2002
LFUN_MOUSE_PRESS, // André 9 Aug 2002
LFUN_MOUSE_MOTION, // André 9 Aug 2002
LFUN_MOUSE_RELEASE, // André 9 Aug 2002
// 210
LFUN_MOUSE_DOUBLE, // André 9 Aug 2002
// 215
LFUN_MOUSE_TRIPLE, // André 9 Aug 2002
LFUN_WRAP_INSERT, // Dekel 7 Apr 2002
LFUN_CHANGES_TRACK, // Levon 20021001 (cool date !)
LFUN_CHANGES_MERGE, // Levon 20021016
// 215
LFUN_CHANGE_ACCEPT, // Levon 20021016
// 220
LFUN_CHANGE_REJECT, // Levon 20021016
LFUN_ALL_CHANGES_ACCEPT, // Levon 20021016
LFUN_ALL_CHANGES_REJECT, // Levon 20021016
LFUN_BIBITEM_INSERT, // André 14 Feb 2003
// 220
LFUN_DIALOG_SHOW,
// 225
LFUN_DIALOG_SHOW_NEW_INSET,
LFUN_DIALOG_UPDATE,
LFUN_DIALOG_HIDE,
LFUN_DIALOG_TOGGLE, // JSpitzm 20070430
// 225
LFUN_DIALOG_DISCONNECT_INSET,
// 230
LFUN_INSET_APPLY,
LFUN_INSET_INSERT,
LFUN_INSET_MODIFY,
LFUN_INSET_DIALOG_UPDATE,
// 230
LFUN_INSET_SETTINGS,
// 235
LFUN_PARAGRAPH_PARAMS_APPLY,
LFUN_PARAGRAPH_UPDATE,
LFUN_EXTERNAL_EDIT,
LFUN_BRANCH_INSERT,
// 235
LFUN_BOX_INSERT,
// 240
LFUN_LINE_INSERT,
LFUN_NEWPAGE_INSERT, // uwestoehr 20071124
LFUN_PAGEBREAK_INSERT,
LFUN_REPEAT,
// 240
LFUN_FINISHED_LEFT,
// 245
LFUN_FINISHED_RIGHT,
LFUN_FLEX_INSERT,
LFUN_WORD_FIND,
LFUN_WORD_REPLACE,
// 245
LFUN_BUFFER_EXPORT_CUSTOM,
// 250
LFUN_BUFFER_PRINT,
LFUN_NEXT_INSET_TOGGLE,
LFUN_ALL_INSETS_TOGGLE,
LFUN_BUFFER_LANGUAGE,
// 250
LFUN_TEXTCLASS_APPLY,
// 255
LFUN_TEXTCLASS_LOAD,
LFUN_BUFFER_SAVE_AS_DEFAULT,
LFUN_BUFFER_PARAMS_APPLY,
LFUN_LYXRC_APPLY,
// 255
LFUN_GRAPHICS_EDIT,
// 260
LFUN_INSET_REFRESH,
LFUN_BUFFER_NEXT,
LFUN_BUFFER_PREVIOUS,
LFUN_WORDS_COUNT,
// 260
LFUN_CHANGES_OUTPUT, // jspitzm 20050121
// 265
LFUN_BIBTEX_DATABASE_ADD,
LFUN_BIBTEX_DATABASE_DEL,
LFUN_CITATION_INSERT,
LFUN_OUTLINE_UP, // Vermeer 20060323
// 265
LFUN_OUTLINE_DOWN,
// 270
LFUN_OUTLINE_IN,
LFUN_OUTLINE_OUT,
LFUN_PARAGRAPH_MOVE_DOWN, // Edwin 20060408
LFUN_PARAGRAPH_MOVE_UP, // Edwin 20060408
// 270
LFUN_BUFFER_TOGGLE_COMPRESSION, // bpeng 20060427
// 275
LFUN_MATH_BIGDELIM,
LFUN_CLIPBOARD_PASTE,
LFUN_INSET_DISSOLVE, // jspitzm 20060807
LFUN_CHANGE_NEXT,
// 275
LFUN_WINDOW_NEW, // Abdel 20061021
// 280
LFUN_WINDOW_CLOSE, // Abdel 20061023
LFUN_UNICODE_INSERT, // Lgb 20061022
LFUN_BOOKMARK_CLEAR, // bpeng 20061031
LFUN_NOMENCL_INSERT, // Ugras
// 280
LFUN_NOMENCL_PRINT, // Ugras
// 285
LFUN_CLEARPAGE_INSERT, // Ugras 20061125
LFUN_CLEARDOUBLEPAGE_INSERT, // Ugras 20061125
LFUN_LISTING_INSERT, // Herbert 20011110, bpeng 20070502
LFUN_TOOLBAR_TOGGLE, // Edwin 20070521
// 285
LFUN_BUFFER_WRITE_ALL, // rgh, gpothier 200707XX
// 290
LFUN_PARAGRAPH_PARAMS, // rgh, 200708XX
LFUN_LAYOUT_MODULES_CLEAR, // rgh, 20070825
LFUN_LAYOUT_MODULE_ADD, // rgh, 20070825
LFUN_LAYOUT_RELOAD, // rgh, 20070903
// 290
LFUN_MASTER_BUFFER_VIEW, // Tommaso, 20070920
// 295
LFUN_MASTER_BUFFER_UPDATE, // Tommaso, 20070920
LFUN_INFO_INSERT, // bpeng, 20071007
LFUN_CALL, // broider, 20071002
LFUN_BUFFER_TOGGLE_EMBEDDING, // bpeng, 20071021
// 295
LFUN_CHAR_LEFT, // dov, 20071022
// 300
LFUN_CHAR_LEFT_SELECT, // dov, 20071022
LFUN_CHAR_RIGHT, // dov, 20071022
LFUN_CHAR_RIGHT_SELECT, // dov, 20071022
LFUN_FINISHED_BACKWARD, // dov, 20071022
// 300
LFUN_FINISHED_FORWARD, // dov, 20071022
// 305
LFUN_WORD_LEFT, // dov, 20071028
LFUN_WORD_LEFT_SELECT, // dov, 20071028
LFUN_WORD_RIGHT, // dov, 20071028
LFUN_WORD_RIGHT_SELECT, // dov, 20071028
// 305
LFUN_MATH_MACRO_FOLD,
// 310
LFUN_MATH_MACRO_UNFOLD,
LFUN_MATH_MACRO_ADD_PARAM,
LFUN_MATH_MACRO_REMOVE_PARAM,
LFUN_MATH_MACRO_APPEND_GREEDY_PARAM,
// 310
LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM,
// 315
LFUN_MATH_MACRO_MAKE_OPTIONAL,
LFUN_MATH_MACRO_MAKE_NONOPTIONAL,
LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM,
LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM,
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
// 320
// 315
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
LFUN_LASTACTION // end of the table
};

View File

@ -1189,11 +1189,7 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd,
break;
}
case LFUN_HYPHENATION_POINT_INSERT:
case LFUN_LIGATURE_BREAK_INSERT:
case LFUN_MENU_SEPARATOR_INSERT:
case LFUN_DOTS_INSERT:
case LFUN_END_OF_SENTENCE_PERIOD_INSERT:
case LFUN_SPECIALCHAR_INSERT:
// FIXME: These would probably make sense in math-text mode
flag.enabled(false);
break;