]> git.lyx.org Git - features.git/commitdiff
Introduce new tag ParbreakIsNewline in Layout and InsetLayout (not yet used)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 9 Aug 2010 21:20:29 +0000 (21:20 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 9 Aug 2010 21:20:29 +0000 (21:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35110 a592a061-630c-0410-9148-cb99ea01b6c8

lib/doc/Customization.lyx
lib/layouts/literate-scrap.inc
lib/layouts/noweb.module
lib/layouts/stdinsets.inc
lib/layouts/sweave.module
lib/scripts/layout2layout.py
src/Layout.cpp
src/Layout.h
src/TextClass.cpp
src/insets/InsetLayout.cpp
src/insets/InsetLayout.h

index 01a06732803e0c4ddecba707f2e7cc3c1ba702f4..114587c7caea061e45803c8d900625f676e214ff 100644 (file)
@@ -11761,6 +11761,59 @@ at least, not without ERT (with which you can have anything).
 \begin_inset Flex CharStyle:Code
 status collapsed
 
+\begin_layout Plain Layout
+ParbreakIsNewline
+\end_layout
+
+\end_inset
+
+
+\begin_inset CommandInset label
+LatexCommand label
+name "des:ParbreakIsNewline"
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\emph on
+0
+\end_layout
+
+\end_inset
+
+, 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+
+] Indicates that paragraphs will not be separated by an empty line in LaTeX
+ output, but only by a line break; together with 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+PassThru 1
+\end_layout
+
+\end_inset
+
+, this allows to emulate a plain text editor (like the ERT inset).
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
 \begin_layout Plain Layout
 ParIndent
 \end_layout
@@ -11942,7 +11995,7 @@ PassThru
  
 \begin_inset CommandInset label
 LatexCommand label
-name "des:PathThru"
+name "des:PassThru"
 
 \end_inset
 
@@ -14627,6 +14680,49 @@ not
 \begin_inset Flex CharStyle:Code
 status collapsed
 
+\begin_layout Plain Layout
+ParbreakIsNewline
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\emph on
+0
+\end_layout
+
+\end_inset
+
+, 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+
+] As with paragraph styles (see page 
+\begin_inset CommandInset ref
+LatexCommand pageref
+reference "des:ParbreakIsNewline"
+
+\end_inset
+
+).
+ Default is false.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
 \begin_layout Plain Layout
 PassThru
 \end_layout
@@ -14658,7 +14754,7 @@ status collapsed
 ] As with paragraph styles (see page 
 \begin_inset CommandInset ref
 LatexCommand pageref
-reference "des:PathThru"
+reference "des:PassThru"
 
 \end_inset
 
index 1c3086cac9bd6875b8c581122cdba20fe425f9dc..7db784c306f57f9bf8857c472092ba06b2cc3552 100644 (file)
@@ -23,6 +23,7 @@ Style Scrap
        AlignPossible         Block,Left
        FreeSpacing           1
        PassThru              1
+       ParbreakIsNewline     1
        LabelType             Static
        LabelFont
          Color               magenta
index d26b6ae74a6f2cc7ea2b6705209a19bb60ea22dd..ca657b17dbfa6c9bb1627234e4253dabba6b85a1 100644 (file)
@@ -30,6 +30,7 @@ Style Scrap
        AlignPossible         Block,Left
        FreeSpacing           1
        PassThru              1
+       ParbreakIsNewline     1
        LabelType             Static
        LabelFont
          Color               magenta
index cfb0804f9da7e74907bc2b64950f80e2f830f488..f275b371e72bff2071d563fe7ef28b86632fda83 100644 (file)
@@ -146,6 +146,7 @@ InsetLayout ERT
        CustomPars            false
        ForcePlain            true
        PassThru              true
+       ParbreakIsNewline     true
        KeepEmpty             true
        FreeSpacing           true
        ForceLTR              true
@@ -175,6 +176,7 @@ InsetLayout Listings
        BgColor               listingsbg
        MultiPar              true
        PassThru              true
+       ParbreakIsNewline     true
        KeepEmpty             true
        FreeSpacing           true
        ForceLTR              true
index cc3f2990b6ea2e51b8c6448e2d9033cdfecf74fa..08b3067d821c3df95242a5b8c53c6e25040c588a 100644 (file)
@@ -4,7 +4,6 @@
 #DescriptionEnd
 #Category: literate
 
-# Within the chunk, lines are separated by newlines (Ctrl-Return)!
 
 # To add :
 # - \setkeys{Gin}{width=0.8\textwidth} How to add such a "beast"? This is used to define
@@ -32,6 +31,7 @@ Style Chunk
        NewLine               0
        FreeSpacing           1
        PassThru              1
+       ParbreakIsNewline     1
        ## What is LabelType used for?
        LabelType             Static
        TextFont
index 0c85e57ad7f62850dbee0309ec33f78b6fdb516f..9c7129d7ca1cd54d63b1ebe186d65230ef15abb2 100644 (file)
@@ -97,6 +97,9 @@ import os, re, string, sys
 # Incremented to format 27, 4 June 2010 by rgh
 # Added RequiredArgs tag.
 
+# Incremented to format 28, 6 August 2010 by lasgouttes
+# Added ParbreakIsNewline tag for Layout and InsetLayout.
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -104,7 +107,7 @@ import os, re, string, sys
 # development/tools/updatelayouts.sh script to update all
 # layout files to the new format.
 
-currentFormat = 27
+currentFormat = 28
 
 
 def usage(prog_name):
@@ -277,7 +280,7 @@ def convert(lines):
             continue
         
         # Only new features
-        if format >= 24 and format <= 26:
+        if format >= 24 and format <= 27:
             i += 1
             continue
 
index 1f68979dd44adfe9833ac4f20c979c63b49b0481..86755e7099a430d0b9f761e4e4d5145913380202 100644 (file)
@@ -55,6 +55,7 @@ enum LayoutTags {
        LT_FONT,
        LT_FREE_SPACING,
        LT_PASS_THRU,
+       LT_PARBREAK_IS_NEWLINE,
        //LT_HEADINGS,
        LT_ITEMSEP,
        LT_KEEPEMPTY,
@@ -143,6 +144,7 @@ Layout::Layout()
        newline_allowed = true;
        free_spacing = false;
        pass_thru = false;
+       parbreak_is_newline = false;
        toclevel = NOT_IN_TOC;
        commanddepth = 0;
        htmllabelfirst_ = false;
@@ -210,6 +212,7 @@ bool Layout::read(Lexer & lex, TextClass const & tclass)
                { "nextnoindent",   LT_NEXTNOINDENT },
                { "obsoletedby",    LT_OBSOLETEDBY },
                { "optionalargs",   LT_OPTARGS },
+               { "parbreakisnewline", LT_PARBREAK_IS_NEWLINE },
                { "parindent",      LT_PARINDENT },
                { "parsep",         LT_PARSEP },
                { "parskip",        LT_PARSKIP },
@@ -495,6 +498,10 @@ bool Layout::read(Lexer & lex, TextClass const & tclass)
                        lex >> pass_thru;
                        break;
 
+               case LT_PARBREAK_IS_NEWLINE:
+                       lex >> parbreak_is_newline;
+                       break;
+
                case LT_SPACING: // setspace.sty
                        readSpacing(lex);
                        break;
index 0a398d31c29b2ac0e9fda2bd413cc35910e2b091..a80999701814bf3e75e8e31c475619bbc8c55775 100644 (file)
@@ -225,6 +225,8 @@ public:
        bool free_spacing;
        ///
        bool pass_thru;
+       ///
+       bool parbreak_is_newline;
        /// show this in toc
        int toclevel;
        /// special value of toclevel for non-section layouts
index 73ad37c409e26efbc1f93316990c1ffb02225cc8..fad437724e55ae55b362ac4d1df4f347a11c228f 100644 (file)
@@ -60,7 +60,7 @@ namespace lyx {
 // development/updatelayouts.sh script, to update the format of 
 // all of our layout files.
 //
-int const LAYOUT_FORMAT = 27;
+int const LAYOUT_FORMAT = 28;
        
 namespace {
 
index 0a02c739c4053c0888b0eb0a98f65aa4d2124f9b..5433db83d99fee108b021fd343a13a121cc7805d 100644 (file)
@@ -36,8 +36,9 @@ InsetLayout::InsetLayout() :
        labelfont_(sane_font), bgcolor_(Color_error), 
        htmlforcecss_ (false), htmlisblock_(true),
        multipar_(true), custompars_(true), forceplain_(false), 
-       passthru_(false), needprotect_(false), freespacing_(false), 
-       keepempty_(false), forceltr_(false), intoc_(false), spellcheck_(true)
+       passthru_(false), parbreakisnewline_(false), freespacing_(false), 
+       keepempty_(false), forceltr_(false), 
+       needprotect_(false), intoc_(false), spellcheck_(true)
 { 
        labelfont_.setColor(Color_error);
 }
@@ -103,6 +104,7 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass)
                IL_MULTIPAR,
                IL_NEEDPROTECT,
                IL_PASSTHRU,
+               IL_PARBREAKISNEWLINE,
                IL_PREAMBLE,
                IL_REQUIRES,
                IL_SPELLCHECK,
@@ -142,6 +144,7 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass)
                { "lyxtype", IL_LYXTYPE },
                { "multipar", IL_MULTIPAR },
                { "needprotect", IL_NEEDPROTECT },
+               { "parbreakisnewline", IL_PARBREAKISNEWLINE },
                { "passthru", IL_PASSTHRU },
                { "preamble", IL_PREAMBLE },
                { "refprefix", IL_REFPREFIX },
@@ -239,6 +242,9 @@ bool InsetLayout::read(Lexer & lex, TextClass const & tclass)
                case IL_PASSTHRU:
                        lex >> passthru_;
                        break;
+               case IL_PARBREAKISNEWLINE:
+                       lex >> parbreakisnewline_;
+                       break;
                case IL_KEEPEMPTY:
                        lex >> keepempty_;
                        break;
index 3fdc17f8cecfb5f5036a77789b821d8cd061db86..82fbe75edc6eb42a54690834de8e81a95ca7aa00 100644 (file)
@@ -129,6 +129,8 @@ public:
        ///
        bool isPassThru() const { return passthru_; }
        ///
+       bool parbreakIsNewline() const { return parbreakisnewline_; }
+       ///
        bool isNeedProtect() const { return needprotect_; }
        ///
        bool isFreeSpacing() const { return freespacing_; }
@@ -213,13 +215,15 @@ private:
        ///
        bool passthru_;
        ///
-       bool needprotect_;
+       bool parbreakisnewline_;
        ///
        bool freespacing_;
        ///
        bool keepempty_;
        ///
        bool forceltr_;
+       ///
+       bool needprotect_;
        /// should the contents be written to TOC strings?
        bool intoc_;
        /// check spelling of this inset?