+ string const name = cmd.getArg(0);
+ if (name == "normal")
+ cur.insert(MathAtom(new InsetMathSpace(" ", "")));
+ else if (name == "protected")
+ cur.insert(MathAtom(new InsetMathSpace("~", "")));
+ else if (name == "thin" || name == "med" || name == "thick")
+ cur.insert(MathAtom(new InsetMathSpace(name + "space", "")));
+ else if (name == "hfill*")
+ cur.insert(MathAtom(new InsetMathSpace("hspace*{\\fill}", "")));
+ else if (name == "quad" || name == "qquad" ||
+ name == "enspace" || name == "enskip" ||
+ name == "negthinspace" || name == "negmedspace" ||
+ name == "negthickspace" || name == "hfill")
+ cur.insert(MathAtom(new InsetMathSpace(name, "")));
+ else if (name == "hspace" || name == "hspace*") {
+ string const len = cmd.getArg(1);
+ if (len.empty() || !isValidLength(len)) {
+ lyxerr << "LyX function 'space-insert " << name << "' "
+ "needs a valid length argument." << endl;
+ break;
+ }
+ cur.insert(MathAtom(new InsetMathSpace(name, len)));
+ } else
+ cur.insert(MathAtom(new InsetMathSpace));