I intend to merge the two separate line break insets (InsetLinebreak and 
InsetNewline) into one in the same vein as I merged the page break insets.

Patch is attached.

In the future, we should take care to not create several insets for derivates 
of a specific funtion.

Jürgen
Index: lib/lyx2lyx/LyX.py
===================================================================
--- lib/lyx2lyx/LyX.py	(Revision 23947)
+++ lib/lyx2lyx/LyX.py	(Arbeitskopie)
@@ -80,7 +80,7 @@
                    ("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,324), minor_versions("1.6" , 0))]
+                   ("1_6", range(277,325), minor_versions("1.6" , 0))]
 
 
 def formats_list():
Index: lib/lyx2lyx/lyx_1_6.py
===================================================================
--- lib/lyx2lyx/lyx_1_6.py	(Revision 23947)
+++ lib/lyx2lyx/lyx_1_6.py	(Arbeitskopie)
@@ -1672,6 +1672,29 @@
         document.body[i] = document.body[i].replace('\\begin_inset Newpage cleardoublepage', '\\cleardoublepage')
 
 
+def convert_linebreaks(document):
+    ' Convert inline Newline insets to new format '
+    for i in range(len(document.body)):
+        document.body[i] = document.body[i].replace('\\newline', '\\begin_inset Newline newline\n\\end_inset')
+        document.body[i] = document.body[i].replace('\\linebreak', '\\begin_inset Newline linebreak\n\\end_inset')
+
+
+def revert_linebreaks(document):
+    ' Revert \\begin_inset Newline to previous inline format '
+    i = 0
+    while True:
+        i = find_token(document.body, '\\begin_inset Newline', i)
+        if i == -1:
+            return
+        j = find_end_of_inset(document.body, i)
+        if j == -1:
+            document.warning("Malformed LyX document: Could not find end of Newline inset.")
+            continue
+        del document.body[j]
+        document.body[i] = document.body[i].replace('\\begin_inset Newline newline', '\\newline')
+        document.body[i] = document.body[i].replace('\\begin_inset Newline linebreak', '\\linebreak')
+
+
 ##
 # Conversion hub
 #
@@ -1723,10 +1746,12 @@
            [320, []],
            [321, [convert_tablines]],
            [322, []],
-           [323, [convert_pagebreaks]]
+           [323, [convert_pagebreaks]],
+           [324, [convert_linebreaks]]
           ]
 
-revert =  [[322, [revert_pagebreaks]],
+revert =  [[323, [revert_linebreaks]],
+           [322, [revert_pagebreaks]],
            [321, [revert_local_layout]],
            [320, [revert_tablines]],
            [319, [revert_protected_hfill]],
Index: lib/bind/cua.bind
===================================================================
--- lib/bind/cua.bind	(Revision 23947)
+++ lib/bind/cua.bind	(Arbeitskopie)
@@ -206,8 +206,8 @@
 \bind "C-Delete"		"word-delete-forward"
 \bind "C-BackSpace"		"word-delete-backward"
 \bind "M-Return"		"break-paragraph inverse"
-\bind "C-Return"		"new-line"
-\bind "C-S-Return"		"line-break"
+\bind "C-Return"		"newline-insert newline"
+\bind "C-S-Return"		"newline-insert linebreak"
 \bind "C-k"			"line-delete-forward"
 \bind "C-space"			"space-insert protected"
 \bind "C-M-space"		"space-insert normal"
Index: lib/bind/xemacs.bind
===================================================================
--- lib/bind/xemacs.bind	(Revision 23947)
+++ lib/bind/xemacs.bind	(Arbeitskopie)
@@ -221,8 +221,8 @@
 \bind "M-d"                     "word-delete-forward"
 \bind "C-BackSpace"		"word-delete-backward"
 \bind "M-Return"		"break-paragraph inverse"
-\bind "C-Return"		"new-line"
-\bind "C-S-Return"		"line-break"
+\bind "C-Return"		"newline-insert newline"
+\bind "C-S-Return"		"newline-insert linebreak"
 \bind "C-S-L"			"specialchar-insert ligature-break"
 \bind "C-space"			"space-insert protected"
 \bind "C-M-space"		"space-insert normal"
Index: lib/bind/aqua.bind
===================================================================
--- lib/bind/aqua.bind	(Revision 23947)
+++ lib/bind/aqua.bind	(Arbeitskopie)
@@ -28,8 +28,8 @@
 \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 l"		"newline-insert newline"
+\bind "M-~S-i s r"		"newline-insert linebreak"
 \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 \""
Index: lib/bind/emacs.bind
===================================================================
--- lib/bind/emacs.bind	(Revision 23947)
+++ lib/bind/emacs.bind	(Arbeitskopie)
@@ -210,8 +210,8 @@
 \bind "M-d"			"word-delete-forward"
 \bind "C-BackSpace"		"word-delete-backward"
 \bind "M-Return"		"break-paragraph inverse"
-\bind "C-Return"		"new-line"
-\bind "C-S-Return"		"line-break"
+\bind "C-Return"		"newline-insert newline"
+\bind "C-S-Return"		"newline-insert linebreak"
 \bind "C-S-L"			"specialchar-insert ligature-break"
 \bind "C-space"			"space-insert protected"
 \bind "C-M-space"		"space-insert normal"
Index: lib/bind/mac.bind
===================================================================
--- lib/bind/mac.bind	(Revision 23947)
+++ lib/bind/mac.bind	(Arbeitskopie)
@@ -180,8 +180,8 @@
 \bind "M-Delete"		"word-delete-forward"
 \bind "M-BackSpace"		"word-delete-backward"
 \bind "M-Return"		"break-paragraph inverse"
-\bind "C-Return"		"new-line"
-\bind "C-S-Return"		"line-break"
+\bind "C-Return"		"newline-insert newline"
+\bind "C-S-Return"		"newline-insert linebreak"
 \bind "C-k"			"line-delete-forward"
 \bind "M-space"			"space-insert protected"
 \bind "C-M-space"		"space-insert normal"
Index: lib/ui/stdmenus.inc
===================================================================
--- lib/ui/stdmenus.inc	(Revision 23947)
+++ lib/ui/stdmenus.inc	(Arbeitskopie)
@@ -372,8 +372,8 @@
 		Separator
 		Item "Hyphenation Point|H" "specialchar-insert hyphenation"
 		Item "Ligature Break|k" "specialchar-insert ligature-break"
-		Item "New Line|e" "new-line"
-		Item "Line Break|B" "line-break"
+		Item "Ragged Line Break|R" "newline-insert newline"
+		Item "Justified Line Break|J" "newline-insert linebreak"
 		Separator
 		Item "New Page|N" "newpage-insert newpage"
 		Item "Page Break|a" "newpage-insert pagebreak"
@@ -669,6 +669,14 @@
 	End
 
 #
+# InsetNewline context menu
+#
+	Menu "context-newline"
+		Item "Ragged Line Break|R" "next-inset-modify newline newline"
+		Item "Justified Line Break|J" "next-inset-modify newline linebreak"
+	End
+
+#
 # Edit context menu
 #
 	Menu "context-edit"
Index: development/FORMAT
===================================================================
--- development/FORMAT	(Revision 23947)
+++ development/FORMAT	(Arbeitskopie)
@@ -2,6 +2,9 @@
 -----------------------
 
 2008-03-25 Jürgen Spitzmüller <[EMAIL PROTECTED]>
+	* Format incremented to 324: merge the two newline insets.
+
+2008-03-25 Jürgen Spitzmüller <[EMAIL PROTECTED]>
 	* Format incremented to 323: merge the diverse newpage insets.
 
 2008-03-24 Richard Heck <[EMAIL PROTECTED]>
Index: src/LyXAction.cpp
===================================================================
--- src/LyXAction.cpp	(Revision 23947)
+++ src/LyXAction.cpp	(Arbeitskopie)
@@ -530,11 +530,18 @@
 
 		{ LFUN_LINE_BEGIN, "line-begin", ReadOnly | NoUpdate, Edit },
 		{ LFUN_LINE_BEGIN_SELECT, "line-begin-select", ReadOnly | SingleParUpdate, Edit },
-		{ LFUN_LINE_BREAK, "line-break", Noop, Edit },
 		{ LFUN_LINE_DELETE, "line-delete-forward", Noop, Edit }, // there is no line-delete-backward
 		{ LFUN_LINE_END, "line-end", ReadOnly | NoUpdate, Edit },
 		{ LFUN_LINE_END_SELECT, "line-end-select", ReadOnly | SingleParUpdate, Edit },
-		{ LFUN_NEW_LINE, "new-line", Noop, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_NEWLINE_INSERT
+ * \li Action: Inserts a line break or new line.
+ * \li Syntax: newline-insert<ARG>
+ * \li Params: <ARG>: <newline|linebreak> default: newline
+ * \li Origin: JSpitzm, 25 Mar 2008
+ * \endvar
+ */
+		{ LFUN_NEWLINE_INSERT, "newline-insert", Noop, Edit },
 
 /*!
  * \var lyx::FuncCode lyx::LFUN_COPY
Index: src/insets/InsetTabular.cpp
===================================================================
--- src/insets/InsetTabular.cpp	(Revision 23947)
+++ src/insets/InsetTabular.cpp	(Arbeitskopie)
@@ -3705,7 +3705,7 @@
 	}
 
 	// disable in non-fixed-width cells
-	case LFUN_NEW_LINE:
+	case LFUN_NEWLINE_INSERT:
 	case LFUN_BREAK_PARAGRAPH:
 	case LFUN_BREAK_PARAGRAPH_SKIP: {
 		if (tabular.getPWidth(cur.idx()).zero()) {
Index: src/insets/InsetNewline.cpp
===================================================================
--- src/insets/InsetNewline.cpp	(Revision 23947)
+++ src/insets/InsetNewline.cpp	(Arbeitskopie)
@@ -4,6 +4,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author John Levon
+ * \author Jürgen Spitzmüller
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -12,7 +13,10 @@
 
 #include "InsetNewline.h"
 
+#include "FuncRequest.h"
+#include "FuncStatus.h"
 #include "Dimension.h"
+#include "Lexer.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 
@@ -27,19 +31,58 @@
 
 namespace lyx {
 
+InsetNewline::InsetNewline()
+{}
 
-void InsetNewline::read(Lexer &)
+void InsetNewlineParams::write(ostream & os) const
 {
-	/* Nothing to read */
+	string command;
+	switch (kind) {
+	case InsetNewlineParams::NEWLINE:
+		os << "newline";
+		break;
+	case InsetNewlineParams::LINEBREAK:
+		os <<  "linebreak";
+		break;
+	}
 }
 
 
+void InsetNewlineParams::read(Lexer & lex)
+{
+	lex.next();
+	string const command = lex.getString();
+
+	if (command == "newline")
+		kind = InsetNewlineParams::NEWLINE;
+	else if (command == "linebreak")
+		kind = InsetNewlineParams::LINEBREAK;
+	else
+		lex.printError("InsetNewline: Unknown kind: `$$Token'");
+
+	string token;
+	lex >> token;
+	if (!lex)
+		return;
+	if (token != "\\end_inset")
+		lex.printError("Missing \\end_inset at this point. "
+			       "Read: `$$Token'");
+}
+
+
 void InsetNewline::write(ostream & os) const
 {
-	os << "\n" << getLyXName() << '\n';
+	os << "Newline ";
+	params_.write(os);
 }
 
 
+void InsetNewline::read(Lexer & lex)
+{
+	params_.read(lex);
+}
+
+
 void InsetNewline::metrics(MetricsInfo & mi, Dimension & dim) const
 {
 	frontend::FontMetrics const & fm = theFontMetrics(mi.base.font);
@@ -49,9 +92,72 @@
 }
 
 
+void InsetNewline::doDispatch(Cursor & cur, FuncRequest & cmd)
+{
+	switch (cmd.action) {
+
+	case LFUN_INSET_MODIFY: {
+		InsetNewlineParams params;
+		InsetNewlineMailer::string2params(to_utf8(cmd.argument()), params);
+		params_.kind = params.kind;
+		break;
+	}
+
+	default:
+		Inset::doDispatch(cur, cmd);
+		break;
+	}
+}
+
+
+bool InsetNewline::getStatus(Cursor & cur, FuncRequest const & cmd,
+	FuncStatus & status) const
+{
+	switch (cmd.action) {
+	// we handle these
+	case LFUN_INSET_MODIFY:
+		if (cmd.getArg(0) == "newline") {
+			InsetNewlineParams params;
+			InsetNewlineMailer::string2params(to_utf8(cmd.argument()), params);
+			status.setOnOff(params_.kind == params.kind);
+		} else
+			status.enabled(true);
+		return true;
+	default:
+		return Inset::getStatus(cur, cmd, status);
+	}
+}
+
+
+ColorCode InsetNewline::ColorName() const
+{
+	switch (params_.kind) {
+		case InsetNewlineParams::NEWLINE:
+			return Color_eolmarker;
+			break;
+		case InsetNewlineParams::LINEBREAK:
+			return Color_pagebreak;
+			break;
+		default:
+			return Color_eolmarker;
+			break;
+	}
+}
+
+
 int InsetNewline::latex(odocstream & os, OutputParams const &) const
 {
-	os << from_ascii(getCmdName()) << '\n';
+	switch (params_.kind) {
+		case InsetNewlineParams::NEWLINE:
+			os << "\\\\\n";
+			break;
+		case InsetNewlineParams::LINEBREAK:
+			os << "\\linebreak{}\n";
+			break;
+		default:
+			os << "\\\\\n";
+			break;
+	}
 	return 0;
 }
 
@@ -114,23 +220,85 @@
 
 	pi.pain.lines(xp, yp, 3, ColorName());
 
-	// add label text behind the newline marker to divide from \newline
-	int w = 0;
-	int a = 0;
-	int d = 0;
-	theFontMetrics(font).rectText(insetLabel(), w, a, d);
+	if (params_.kind == InsetNewlineParams::LINEBREAK) {
+
+		yp[2] = int(y - 0.500 * asc * 0.75);
+
+		if (pi.ltr_pos) {
+			xp[0] = int(x + wid);
+			xp[1] = int(x + 2 * wid);
+			xp[2] = int(x + 2 * wid);
+		} else {
+			xp[0] = int(x + 2 * wid);
+			xp[1] = int(x + wid);
+			xp[2] = int(x + wid);
+		}
+		pi.pain.lines(xp, yp, 3, ColorName());
+
+		yp[0] = int(y - 0.875 * asc * 0.75);
+		yp[1] = int(y - 0.500 * asc * 0.75);
+		yp[2] = int(y - 0.125 * asc * 0.75);
 	
-	int const text_start = int(x + 2 * wid);
-			
-	pi.pain.rectText(text_start, yp[0] + d, insetLabel(), font,
-		Color_none, Color_none);
+		if (pi.ltr_pos) {
+			xp[0] = int(x + 2 * wid * 0.813);
+			xp[1] = int(x + 2 * wid);
+			xp[2] = int(x + 2 * wid * 0.813);
+		} else {
+			xp[0] = int(x + 2 * wid * 0.188);
+			xp[1] = int(x + 2 * wid);
+			xp[2] = int(x + 2 * wid * 0.188);
+		}
+		pi.pain.lines(xp, yp, 3, ColorName());
+	}
 }
 
 
-bool InsetNewline::isSpace() const
+docstring InsetNewline::contextMenu(BufferView const &, int, int) const
 {
-	return true;
+	return from_ascii("context-newline");
 }
 
 
+string const InsetNewlineMailer::name_ = "newline";
+
+
+InsetNewlineMailer::InsetNewlineMailer(InsetNewline & inset)
+	: inset_(inset)
+{}
+
+
+string const InsetNewlineMailer::inset2string(Buffer const &) const
+{
+	return params2string(inset_.params());
+}
+
+
+void InsetNewlineMailer::string2params(string const & in, InsetNewlineParams & params)
+{
+	params = InsetNewlineParams();
+	if (in.empty())
+		return;
+
+	istringstream data(in);
+	Lexer lex(0,0);
+	lex.setStream(data);
+
+	string name;
+	lex >> name;
+	if (!lex || name != name_)
+		return print_mailer_error("InsetNewlineMailer", in, 1, name_);
+
+	params.read(lex);
+}
+
+
+string const InsetNewlineMailer::params2string(InsetNewlineParams const & params)
+{
+	ostringstream data;
+	data << name_ << ' ';
+	params.write(data);
+	return data.str();
+}
+
+
 } // namespace lyx
Index: src/insets/InsetCitation.h
===================================================================
--- src/insets/InsetCitation.h	(Revision 23947)
+++ src/insets/InsetCitation.h	(Arbeitskopie)
@@ -62,6 +62,8 @@
 	static std::string defaultCommand() { return "cite"; };
 	///
 	static bool isCompatibleCommand(std::string const & cmd);
+	///
+	virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
 private:
 	///
 	Inset * clone() const { return new InsetCitation(*this); }
Index: src/insets/InsetNewline.h
===================================================================
--- src/insets/InsetNewline.h	(Revision 23947)
+++ src/insets/InsetNewline.h	(Arbeitskopie)
@@ -13,6 +13,7 @@
 #define INSET_NEWLINE_H
 
 #include "Inset.h"
+#include "MailInset.h"
 
 #include "support/docstring.h"
 #include "support/gettext.h"
@@ -20,12 +21,36 @@
 
 namespace lyx {
 
+class InsetNewlineParams {
+public:
+	/// The different kinds of spaces we support
+	enum Kind {
+		///
+		NEWLINE,
+		///
+		LINEBREAK
+	};
+	///
+	InsetNewlineParams() : kind(NEWLINE) {}
+	///
+	void write(std::ostream & os) const;
+	///
+	void read(Lexer & lex);
+	///
+	Kind kind;
+};
+
+
 class InsetNewline : public Inset
 {
 public:
 	///
-	InsetNewline() {}
+	InsetNewline();
 	///
+	InsetNewline(InsetNewlineParams par) { params_.kind = par.kind; }
+	///
+	InsetNewlineParams params() const { return params_; }
+	///
 	InsetCode lyxCode() const { return NEWLINE_CODE; }
 	///
 	void metrics(MetricsInfo &, Dimension &) const;
@@ -41,43 +66,45 @@
 	void read(Lexer & lex);
 	///
 	void write(std::ostream & os) const;
-	/// We don't need \begin_inset and \end_inset
-	bool directWrite() const { return true; }
 	/// is this equivalent to a space (which is BTW different from
 	/// a line separator)?
-	bool isSpace() const;
+	bool isSpace() const { return true; }
 	///
-	docstring insetLabel() const { return docstring(); }
+	ColorCode ColorName() const;
 	///
-	std::string getLyXName() const { return "\\newline"; }
-	///
-	std::string getCmdName() const { return "\\\\"; }
-	///
-	ColorCode ColorName() const { return Color_eolmarker; }
+	virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
 
 private:
 	///
 	Inset * clone() const { return new InsetNewline(*this); }
+	///
+	void doDispatch(Cursor & cur, FuncRequest & cmd);
+	///
+	bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
+	///
+	InsetNewlineParams params_;
 };
 
 
-class InsetLinebreak : public InsetNewline
-{
+class InsetNewlineMailer : public MailInset {
 public:
 	///
-	InsetLinebreak() {}
+	InsetNewlineMailer(InsetNewline & inset);
 	///
-	docstring insetLabel() const { return _("line break"); }
+	virtual Inset & inset() const { return inset_; }
 	///
-	std::string getLyXName() const { return "\\linebreak"; }
+	virtual std::string const & name() const { return name_; }
 	///
-	std::string getCmdName() const { return "\\linebreak{}"; }
+	virtual std::string const inset2string(Buffer const &) const;
 	///
-	ColorCode ColorName() const { return Color_pagebreak; }
-
+	static void string2params(std::string const &, InsetNewlineParams &);
+	///
+	static std::string const params2string(InsetNewlineParams const &);
 private:
 	///
-	Inset * clone() const { return new InsetLinebreak(*this); }
+	static std::string const name_;
+	///
+	InsetNewline & inset_;
 };
 
 
Index: src/insets/InsetCollapsable.cpp
===================================================================
--- src/insets/InsetCollapsable.cpp	(Revision 23947)
+++ src/insets/InsetCollapsable.cpp	(Arbeitskopie)
@@ -662,7 +662,7 @@
 	case LFUN_BIBITEM_INSERT:
 	case LFUN_BOX_INSERT:
 	case LFUN_BRANCH_INSERT:
-	case LFUN_NEW_LINE:
+	case LFUN_NEWLINE_INSERT:
 	case LFUN_CAPTION_INSERT:
 	case LFUN_DEPTH_DECREMENT:
 	case LFUN_DEPTH_INCREMENT:
Index: src/mathed/InsetMathGrid.cpp
===================================================================
--- src/mathed/InsetMathGrid.cpp	(Revision 23947)
+++ src/mathed/InsetMathGrid.cpp	(Arbeitskopie)
@@ -1093,7 +1093,7 @@
 		}
 		break;
 
-	case LFUN_NEW_LINE: {
+	case LFUN_NEWLINE_INSERT: {
 		cur.recordUndoInset();
 		row_type const r = cur.row();
 		addRow(r);
Index: src/mathed/InsetMathHull.cpp
===================================================================
--- src/mathed/InsetMathHull.cpp	(Revision 23947)
+++ src/mathed/InsetMathHull.cpp	(Arbeitskopie)
@@ -1126,7 +1126,7 @@
 		// just swallow this
 		break;
 
-	case LFUN_NEW_LINE:
+	case LFUN_NEWLINE_INSERT:
 		// some magic for the common case
 		if (type_ == hullSimple || type_ == hullEquation) {
 			cur.recordUndoInset();
@@ -1285,7 +1285,7 @@
 	case LFUN_FINISHED_LEFT:
 	case LFUN_UP:
 	case LFUN_DOWN:
-	case LFUN_NEW_LINE:
+	case LFUN_NEWLINE_INSERT:
 	case LFUN_MATH_EXTERN:
 	case LFUN_MATH_MUTATE:
 	case LFUN_MATH_DISPLAY:
Index: src/Text.cpp
===================================================================
--- src/Text.cpp	(Revision 23947)
+++ src/Text.cpp	(Arbeitskopie)
@@ -206,14 +206,6 @@
 					font, change);
 	} else if (token == "\\backslash") {
 		par.appendChar('\\', font, change);
-	} else if (token == "\\linebreak") {
-		auto_ptr<Inset> inset(new InsetLinebreak);
-		inset->read(lex);
-		par.insertInset(par.size(), inset.release(), font, change);
-	} else if (token == "\\newline") {
-		auto_ptr<Inset> inset(new InsetNewline);
-		inset->read(lex);
-		par.insertInset(par.size(), inset.release(), font, change);
 	} else if (token == "\\LyXTable") {
 		auto_ptr<Inset> inset(new InsetTabular(buf));
 		inset->read(lex);
Index: src/factory.cpp
===================================================================
--- src/factory.cpp	(Revision 23947)
+++ src/factory.cpp	(Arbeitskopie)
@@ -40,6 +40,7 @@
 #include "insets/InsetLabel.h"
 #include "insets/InsetLine.h"
 #include "insets/InsetMarginal.h"
+#include "insets/InsetNewline.h"
 #include "insets/InsetNewpage.h"
 #include "insets/InsetNote.h"
 #include "insets/InsetBox.h"
@@ -541,6 +542,8 @@
 			inset.reset(new InsetMarginal(buf));
 		} else if (tmptok == "Newpage") {
 			inset.reset(new InsetNewpage);
+		} else if (tmptok == "Newline") {
+			inset.reset(new InsetNewline);
 		} else if (tmptok == "OptArg") {
 			inset.reset(new InsetOptArg(buf));
 		} else if (tmptok == "Float") {
Index: src/Text3.cpp
===================================================================
--- src/Text3.cpp	(Revision 23947)
+++ src/Text3.cpp	(Arbeitskopie)
@@ -658,36 +658,24 @@
 		break;
 	}
 
-	case LFUN_NEW_LINE: {
-		// Not allowed by LaTeX (labels or empty par)
-		if (cur.pos() > cur.paragraph().beginOfBody()) {
-			// this avoids a double undo
-			// FIXME: should not be needed, ideally
-			if (!cur.selection())
-				cur.recordUndo();
-			cap::replaceSelection(cur);
-			cur.insert(new InsetNewline);
-			cur.posForward();
-			moveCursor(cur, false);
-		}
+	case LFUN_NEWLINE_INSERT: {
+		InsetNewlineParams inp;
+		docstring arg = cmd.argument();
+		// this avoids a double undo
+		// FIXME: should not be needed, ideally
+		if (!cur.selection())
+			cur.recordUndo();
+		cap::replaceSelection(cur);
+		if (arg == "linebreak")
+			inp.kind = InsetNewlineParams::LINEBREAK;
+		else
+			inp.kind = InsetNewlineParams::NEWLINE;
+		cur.insert(new InsetNewline(inp));
+		cur.posForward();
+		moveCursor(cur, false);
 		break;
 	}
 	
-	case LFUN_LINE_BREAK: {
-		// Not allowed by LaTeX (labels or empty par)
-		if (cur.pos() > cur.paragraph().beginOfBody()) {
-			// this avoids a double undo
-			// FIXME: should not be needed, ideally
-			if (!cur.selection())
-				cur.recordUndo();
-			cap::replaceSelection(cur);
-			cur.insert(new InsetLinebreak);
-			cur.posForward();
-			moveCursor(cur, false);
-		}
-		break;
-	}
-
 	case LFUN_CHAR_DELETE_FORWARD:
 		if (!cur.selection()) {
 			if (cur.pos() == cur.paragraph().size())
@@ -2120,6 +2108,11 @@
 		enable = (cur.paragraph().layout().toclevel != Layout::NOT_IN_TOC);
 		break;
 
+	case LFUN_NEWLINE_INSERT:
+		// LaTeX restrictions (labels or empty par)
+		enable = (cur.pos() > cur.paragraph().beginOfBody());
+		break;
+
 	case LFUN_WORD_DELETE_FORWARD:
 	case LFUN_WORD_DELETE_BACKWARD:
 	case LFUN_LINE_DELETE:
@@ -2151,9 +2144,7 @@
 	case LFUN_PARAGRAPH_UP:
 	case LFUN_PARAGRAPH_DOWN:
 	case LFUN_LINE_BEGIN:
-	case LFUN_LINE_BREAK:
 	case LFUN_LINE_END:
-	case LFUN_NEW_LINE:
 	case LFUN_CHAR_DELETE_FORWARD:
 	case LFUN_DELETE_FORWARD_SKIP:
 	case LFUN_CHAR_DELETE_BACKWARD:
Index: src/FuncCode.h
===================================================================
--- src/FuncCode.h	(Revision 23947)
+++ src/FuncCode.h	(Arbeitskopie)
@@ -103,318 +103,317 @@
 	LFUN_CHAR_DELETE_FORWARD,
 	// 60
 	LFUN_CHAR_DELETE_BACKWARD,
-	LFUN_NEW_LINE,
-	LFUN_LINE_BREAK,                // uwestoehr 20071125
+	LFUN_NEWLINE_INSERT,		// renamed: JSpitzm, 20080325
 	LFUN_BREAK_PARAGRAPH,
 	LFUN_QUOTE_INSERT,
-	// 65
 	LFUN_ACCENT_CIRCUMFLEX,
+	// 65
 	LFUN_MATH_SUBSCRIPT,
 	LFUN_MATH_SUPERSCRIPT,
 	LFUN_ACCENT_GRAVE,
 	LFUN_ACCENT_ACUTE,
-	// 70
 	LFUN_ACCENT_TILDE,
+	// 70
 	LFUN_ACCENT_CEDILLA,
 	LFUN_ACCENT_MACRON,
 	LFUN_ACCENT_UNDERBAR,
 	LFUN_ACCENT_UNDERDOT,
-	// 75
 	LFUN_ACCENT_CIRCLE,
+	// 75
 	LFUN_ACCENT_TIE,
 	LFUN_ACCENT_BREVE,
 	LFUN_ACCENT_CARON,
 	LFUN_ACCENT_SPECIAL_CARON,
-	// 80
 	LFUN_ACCENT_HUNGARIAN_UMLAUT,
+	// 80
 	LFUN_ACCENT_UMLAUT,
 	LFUN_ACCENT_DOT,
 	LFUN_ACCENT_OGONEK,
 	LFUN_SELF_INSERT,
-	// 85
 	LFUN_GETBUFNAME,
+	// 85
 	LFUN_SERVER_GET_XY,
 	LFUN_SERVER_SET_XY,
 	LFUN_SERVER_CHAR_AFTER,
 	LFUN_LINEATCURSOR,
-	// 90
 	LFUN_SERVER_GET_LAYOUT,
+	// 90
 	LFUN_SERVER_GET_FONT,
 	LFUN_SERVER_GET_NAME,
 	LFUN_SERVER_NOTIFY,
 	LFUN_SERVER_GOTO_FILE_ROW,
-	// 95
 	LFUN_NOTE_INSERT,
+	// 95
 	LFUN_ENVIRONMENT_INSERT,        // unused as of 20060905
 	LFUN_KEYMAP_OFF,
 	LFUN_KEYMAP_PRIMARY,
 	LFUN_KEYMAP_SECONDARY,
-	// 100
 	LFUN_KEYMAP_TOGGLE,
+	// 100
 	LFUN_MATH_INSERT,
 	LFUN_MATH_MATRIX,
 	LFUN_MATH_LIMITS,
 	LFUN_MATH_DELIM,                // Alejandro 180696
-	// 105
 	LFUN_MATH_DISPLAY,              // Alejandro 180696
+	// 105
 	LFUN_MATH_MODE,                 // Alejandro 040696
 	LFUN_MATH_NUMBER_TOGGLE,
 	LFUN_MATH_NUMBER_LINE_TOGGLE,
 	LFUN_MATH_SIZE,                 // Alejandro 150896
-	// 110
 	LFUN_MATH_MACRO,                // ale970510
+	// 110
 	LFUN_MATH_EXTERN,               // Andre' 20010424
 	LFUN_MATH_MUTATE,               // Andre' 20010523
 	LFUN_MATH_IMPORT_SELECTION,     // Andre' 20010704
 	LFUN_MATH_SPACE,                // Andre' 20010725
-	// 115
 	LFUN_WORD_DELETE_FORWARD,
+	// 115
 	LFUN_WORD_DELETE_BACKWARD,
 	LFUN_LINE_DELETE,
 	LFUN_MARK_OFF,
 	LFUN_MARK_ON,
-	// 120
 	LFUN_LAYOUT,
+	// 120
 	LFUN_LAYOUT_PARAGRAPH,
 	LFUN_DROP_LAYOUTS_CHOICE,       // used in bindings as of 20071228
 	LFUN_FONT_TYPEWRITER,           // changed from FONT_CODE 20070920
 	LFUN_FONT_SANS,
-	// 125
 	LFUN_FONT_DEFAULT,
+	// 125
 	LFUN_FONT_UNDERLINE,
 	LFUN_FONT_SIZE,
 	LFUN_FONT_STATE,
 	LFUN_WORD_UPCASE,
-	// 130
 	LFUN_WORD_LOWCASE,
+	// 130
 	LFUN_WORD_CAPITALIZE,
 	LFUN_LABEL_INSERT,
 	LFUN_DEPTH_DECREMENT,
 	LFUN_DEPTH_INCREMENT,
-	// 135
 	LFUN_MENU_OPEN,                 // used in bindings as of 20060905
+	// 135
 	LFUN_CANCEL,
 	LFUN_META_PREFIX,
 	LFUN_COMMAND_EXECUTE,
 	LFUN_FILE_INSERT,
-	// 140
 	LFUN_FILE_INSERT_PLAINTEXT,     // CFO-G 1997-11-19
+	// 140
 	LFUN_FILE_INSERT_PLAINTEXT_PARA,// Levon 2001-02-14
 	LFUN_FILE_OPEN,
 	LFUN_PARAGRAPH_UP,              // Asger 1996-10-01
 	LFUN_PARAGRAPH_UP_SELECT,       // Asger 1996-10-01
-	// 145
 	LFUN_PARAGRAPH_DOWN,            // Asger 1996-10-01
+	// 145
 	LFUN_PARAGRAPH_DOWN_SELECT,     // Asger 1996-10-01
 	LFUN_BREAK_PARAGRAPH_SKIP,
 	LFUN_DELETE_BACKWARD_SKIP,
 	LFUN_DELETE_FORWARD_SKIP,
-	// 150
 	LFUN_BUFFER_NEW_TEMPLATE,       // Asger 1997-02-02
+	// 150
 	LFUN_BUFFER_RELOAD,             // Asger 1997-02-02
 	LFUN_RECONFIGURE,
 	LFUN_INDEX_PRINT,               // Lgb 97-02-27
 	LFUN_CELL_SPLIT,
-	// 155
 	LFUN_BUFFER_CHILD_OPEN,         // Ale 970528
+	// 155
 	LFUN_TOC_INSERT,                // Lgb 97-05-27
 	LFUN_FLOAT_LIST,                // Lgb 20010503
 	LFUN_BUFFER_TOGGLE_READ_ONLY,   // Lgb 97-05-27
 	LFUN_VC_REGISTER,               // Lgb 97-07-01
-	// 160
 	LFUN_VC_CHECK_IN,               // Lgb 97-07-01
+	// 160
 	LFUN_VC_CHECK_OUT,              // Lgb 97-07-01
 	LFUN_VC_REVERT,                 // Lgb 97-07-01
 	LFUN_VC_UNDO_LAST,              // Lgb 97-07-01
 	LFUN_BUFFER_EXPORT,             // Lgb 97-07-29
-	// 165
 	LFUN_LABEL_GOTO,                // Ale 970806
+	// 165
 	LFUN_CURSOR_FOLLOWS_SCROLLBAR_TOGGLE, // ARRae 971202
 	LFUN_BUFFER_CHKTEX,             // Asger 971030
 	LFUN_HYPERLINK_INSERT,          // CFO-G 971121
 	LFUN_WORD_FIND_FORWARD,         // Etienne 980216
-	// 170
 	LFUN_WORD_FIND_BACKWARD,        // Etienne 980220
+	// 170
 	LFUN_APPENDIX,                  // ettrich 980505
 	LFUN_BUFFER_IMPORT,             // Asger 980724
 	LFUN_COMMAND_SEQUENCE,          // Andre' 991111
 	LFUN_PREFERENCES_SAVE,
-	// 175
 	LFUN_HELP_OPEN,                 // Jug 990627
+	// 175
 	LFUN_DATE_INSERT,               // jdblair 20000131
 	LFUN_LANGUAGE,                  // Dekel 20000203
 	LFUN_ERT_INSERT,                // Jug 20000218
 	LFUN_FOOTNOTE_INSERT,           // Jug 20000307
-	// 180
 	LFUN_PARAGRAPH_SPACING,         // Lgb 20000411
+	// 180
 	LFUN_TABULAR_INSERT,            // Jug 20000412
 	LFUN_LOFVIEW,                   // Dekel 20000519
 	LFUN_LOTVIEW,                   // Dekel 20000519
 	LFUN_LOAVIEW,                   // Dekel 20000519
-	// 185
 	LFUN_SET_COLOR,                 // SLior 20000611
+	// 185
 	LFUN_MARGINALNOTE_INSERT,       // Lgb 20000626
 	LFUN_FLOAT_INSERT,              // Lgb 20000627
 	LFUN_FLOAT_WIDE_INSERT,         // Lgb 20010531
 	LFUN_CAPTION_INSERT,            // Lgb 20000718; inactive as of 20060905
-	// 190
 	LFUN_BUFFER_SWITCH,
+	// 190
 	LFUN_TABULAR_FEATURE,           // Jug 20000728
 	LFUN_LAYOUT_TABULAR,            // Jug 20000731
 	LFUN_BUFFER_UPDATE,             // Dekel 20000805
 	LFUN_INDEX_INSERT,              // Angus 20000803
-	// 195
 	LFUN_SCREEN_FONT_UPDATE,        // ARRae 20000813
+	// 195
 	LFUN_PARAGRAPH_GOTO,            // Dekel 20000826
 	LFUN_REFERENCE_NEXT,            // Dekel 20010114
 	LFUN_BOOKMARK_SAVE,
 	LFUN_BOOKMARK_GOTO,
-	// 200
 	LFUN_SELECT_FILE_SYNC,          // Levon 20010214
+	// 200
 	LFUN_MESSAGE,                   // Lgb 20010408; for scripting purposes, output in minibuffer
 	LFUN_CHARS_TRANSPOSE,           // Lgb 20010425
 	LFUN_ESCAPE,                    // Lgb 20010517
 	LFUN_THESAURUS_ENTRY,           // Levon 20010720
-	// 205
 	LFUN_OPTIONAL_INSERT,           // Martin 12 Aug 2002
+	// 205
 	LFUN_MOUSE_PRESS,               // André 9 Aug 2002
 	LFUN_MOUSE_MOTION,              // André 9 Aug 2002
 	LFUN_MOUSE_RELEASE,             // André 9 Aug 2002
 	LFUN_MOUSE_DOUBLE,              // André 9 Aug 2002
-	// 210
 	LFUN_MOUSE_TRIPLE,              // André 9 Aug 2002
+	// 210
 	LFUN_WRAP_INSERT,               // Dekel 7 Apr 2002
 	LFUN_CHANGES_TRACK,             // Levon 20021001 (cool date !)
 	LFUN_CHANGES_MERGE,             // Levon 20021016
 	LFUN_CHANGE_ACCEPT,             // Levon 20021016
-	// 215
 	LFUN_CHANGE_REJECT,             // Levon 20021016
+	// 215
 	LFUN_ALL_CHANGES_ACCEPT,        // Levon 20021016
 	LFUN_ALL_CHANGES_REJECT,        // Levon 20021016
 	LFUN_BIBITEM_INSERT,            // André 14 Feb 2003
 	LFUN_DIALOG_SHOW,
-	// 220
 	LFUN_DIALOG_SHOW_NEW_INSET,
+	// 220
 	LFUN_DIALOG_UPDATE,
 	LFUN_DIALOG_HIDE,
 	LFUN_DIALOG_TOGGLE,             // JSpitzm 20070430
 	LFUN_DIALOG_DISCONNECT_INSET,
-	// 225
 	LFUN_INSET_APPLY,
+	// 225
 	LFUN_INSET_INSERT,
 	LFUN_INSET_MODIFY,
 	LFUN_INSET_DIALOG_UPDATE,
 	LFUN_INSET_SETTINGS,
-	// 230
 	LFUN_PARAGRAPH_PARAMS_APPLY,
+	// 230
 	LFUN_PARAGRAPH_UPDATE,
 	LFUN_EXTERNAL_EDIT,
 	LFUN_BRANCH_INSERT,
 	LFUN_BOX_INSERT,
-	// 235
 	LFUN_LINE_INSERT,
+	// 235
 	LFUN_NEWPAGE_INSERT,		// uwestoehr, 20071124
 	LFUN_REPEAT,
 	LFUN_FINISHED_LEFT,
 	LFUN_FINISHED_RIGHT,
-	// 240
 	LFUN_FLEX_INSERT,
+	// 240
 	LFUN_WORD_FIND,
 	LFUN_WORD_REPLACE,
 	LFUN_BUFFER_EXPORT_CUSTOM,
 	LFUN_BUFFER_PRINT,
-	// 245
 	LFUN_NEXT_INSET_TOGGLE,
+	// 245
 	LFUN_ALL_INSETS_TOGGLE,
 	LFUN_BUFFER_LANGUAGE,
 	LFUN_TEXTCLASS_APPLY,
 	LFUN_TEXTCLASS_LOAD,
-	// 250
 	LFUN_BUFFER_SAVE_AS_DEFAULT,
+	// 250
 	LFUN_BUFFER_PARAMS_APPLY,
 	LFUN_LYXRC_APPLY,
 	LFUN_GRAPHICS_EDIT,
 	LFUN_BUFFER_NEXT,
-	// 255
 	LFUN_BUFFER_PREVIOUS,
+	// 255
 	LFUN_STATISTICS,
 	LFUN_CHANGES_OUTPUT,             // jspitzm 20050121
 	LFUN_BIBTEX_DATABASE_ADD,
 	LFUN_BIBTEX_DATABASE_DEL,
-	// 260
 	LFUN_CITATION_INSERT,
+	// 260
 	LFUN_OUTLINE_UP,
 	LFUN_OUTLINE_DOWN,
 	LFUN_OUTLINE_IN,
 	LFUN_OUTLINE_OUT,
-	// 265
 	LFUN_PARAGRAPH_MOVE_DOWN,
+	// 265
 	LFUN_PARAGRAPH_MOVE_UP,
 	LFUN_BUFFER_TOGGLE_COMPRESSION,  // bpeng 20060427
 	LFUN_MATH_BIGDELIM,
 	LFUN_CLIPBOARD_PASTE,
-	// 270
 	LFUN_INSET_DISSOLVE,             // jspitzm 20060807
+	// 270
 	LFUN_CHANGE_NEXT,
 	LFUN_WINDOW_NEW,                 // Abdel 20061021
 	LFUN_WINDOW_CLOSE,               // Abdel 20061023
 	LFUN_UNICODE_INSERT,             // Lgb 20061022
-	// 275
 	LFUN_BOOKMARK_CLEAR,             // bpeng 20061031
+	// 275
 	LFUN_NOMENCL_INSERT,             // Ugras
 	LFUN_NOMENCL_PRINT,              // Ugras
 	LFUN_LISTING_INSERT,             // Herbert 20011110, bpeng 20070502
 	LFUN_TOOLBAR_TOGGLE,             // Edwin 20070521
-	// 280
 	LFUN_BUFFER_WRITE_ALL,           // rgh, gpothier 200707XX
+	// 280
 	LFUN_PARAGRAPH_PARAMS,
 	LFUN_LAYOUT_MODULES_CLEAR,
 	LFUN_LAYOUT_MODULE_ADD,
 	LFUN_LAYOUT_RELOAD,
-	// 285
 	LFUN_MASTER_BUFFER_VIEW,         // Tommaso, 20070920
+	// 285
 	LFUN_MASTER_BUFFER_UPDATE,       // Tommaso, 20070920
 	LFUN_INFO_INSERT,                // bpeng, 20071007
 	LFUN_CALL,                       // broider, 20071002
 	LFUN_BUFFER_TOGGLE_EMBEDDING,    // bpeng, 20071021
-	// 290
 	LFUN_CHAR_LEFT,			 // dov, 20071022
+	// 290
 	LFUN_CHAR_LEFT_SELECT,		 // dov, 20071022
 	LFUN_CHAR_RIGHT,		 // dov, 20071022
 	LFUN_CHAR_RIGHT_SELECT,		 // dov, 20071022
 	LFUN_FINISHED_BACKWARD,		 // dov, 20071022
-	// 295
 	LFUN_FINISHED_FORWARD,		 // dov, 20071022
+	// 295
 	LFUN_WORD_LEFT,			 // dov, 20071028
 	LFUN_WORD_LEFT_SELECT,		 // dov, 20071028
 	LFUN_WORD_RIGHT,		 // dov, 20071028
 	LFUN_WORD_RIGHT_SELECT,		 // dov, 20071028
-	// 300
 	LFUN_MATH_MACRO_FOLD,
+	// 300
 	LFUN_MATH_MACRO_UNFOLD,
 	LFUN_MATH_MACRO_ADD_PARAM,
 	LFUN_MATH_MACRO_REMOVE_PARAM,
 	LFUN_MATH_MACRO_APPEND_GREEDY_PARAM,
-	// 305
 	LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM,
+	// 305
 	LFUN_MATH_MACRO_MAKE_OPTIONAL,
 	LFUN_MATH_MACRO_MAKE_NONOPTIONAL,
 	LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM,
 	LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM,
-	// 310
 	LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
+	// 310
 	LFUN_IN_MATHMACROTEMPLATE,
 	LFUN_SCROLL,
 	LFUN_UI_TOGGLE,
 	LFUN_SPLIT_VIEW,
-	// 315
 	LFUN_CLOSE_TAB_GROUP,
+	// 315
 	LFUN_COMPLETION_POPUP,
 	LFUN_COMPLETION_INLINE,
 	LFUN_COMPLETION_COMPLETE,
 	LFUN_NEXT_INSET_MODIFY,		// JSpitzm 20080323
-	// 320
 	LFUN_LASTACTION                  // end of the table
+	// 320
 };
 
 
Index: src/Buffer.cpp
===================================================================
--- src/Buffer.cpp	(Revision 23947)
+++ src/Buffer.cpp	(Arbeitskopie)
@@ -116,7 +116,7 @@
 
 namespace {
 
-int const LYX_FORMAT = 323;
+int const LYX_FORMAT = 324;
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;

Reply via email to