]> git.lyx.org Git - lyx.git/blobdiff - lib/doc/Development.lyx
Fix LyX version number
[lyx.git] / lib / doc / Development.lyx
index f9ad337a6a2b49100f88a2ab1d6f233d94d79c8b..8061e645f91d3cc22ec3ec3cbd7bc18a70852a87 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 599
+\lyxformat 607
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -101,6 +101,7 @@ logicalmkup
 \html_css_as_file 0
 \html_be_strict true
 \docbook_table_output 0
+\docbook_mathml_prefix 1
 \end_header
 
 \begin_body
@@ -121,20 +122,18 @@ by the \SpecialChar LyX
 status collapsed
 
 \begin_layout Plain Layout
-\noindent
-If you have comments or error corrections, please send them to the \SpecialChar LyX
- Documentatio
-n mailing list, 
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-<lyx-docs@lists.lyx.org>
-\end_layout
+If you have comments on or error corrections to this documentation, please
+ send them to the \SpecialChar LyX
+ Documentation mailing list: 
+\begin_inset CommandInset href
+LatexCommand href
+target "lyx-docs@lists.lyx.org"
+type "mailto:"
+literal "false"
 
 \end_inset
 
-.
+
 \end_layout
 
 \end_inset
@@ -196,10 +195,6 @@ File formats
 tion.
 \end_layout
 
-\begin_layout Section
-File Format Numbers
-\end_layout
-
 \begin_layout Section
 When is an update of the .lyx file format number needed?
 \begin_inset CommandInset label
@@ -813,6 +808,103 @@ status collapsed
  file format.
 \end_layout
 
+\begin_layout Section
+Backporting new styles to the stable version
+\begin_inset CommandInset label
+LatexCommand label
+name "subsec:Backporting-new-styles"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Starting with the stable \SpecialChar LyX
+ 2.1 branch, there is a mechanism in place to backport
+ new styles to the stable version without the need to update the file format.
+ The basic idea is that the new style definition is automatically copied
+ to the document preamble so that it can even be used by older minor versions
+ that did not yet include the style.
+ To backport a new style to the stable version, the following steps are
+ needed:
+\end_layout
+
+\begin_layout Enumerate
+Add the line 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+ForceLocal -1
+\end_layout
+
+\end_inset
+
+ to the style definition in the development version.
+\end_layout
+
+\begin_layout Enumerate
+Copy the style definition to the stable version, but use 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+ForceLocal 1
+\end_layout
+
+\end_inset
+
+ instead.
+ If needed adjust the format to the one used by the stable version (see
+ the customization manual for details of the layout file format).
+\end_layout
+
+\begin_layout Enumerate
+For each update of the style in a later stable version, increase the argument
+ of 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+ForceLocal
+\end_layout
+
+\end_inset
+
+ by one.
+ (In the stable version, the development version should not be touched.)
+\end_layout
+
+\begin_layout Standard
+For details about the 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+ForceLocal
+\end_layout
+
+\end_inset
+
+ flag see the customization manual.
+ No 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+lyx2lyx
+\end_layout
+
+\end_inset
+
+ support is needed for backported styles: Since the style of the development
+ version has an infinite version number, it will always be used.
+ Furthermore, since its version number is less than one, the style will
+ not be written anymore to the document header for files saved by the new
+ version.
+\end_layout
+
 \begin_layout Section
 Updating the file format number of bind/ui files
 \end_layout
@@ -1040,103 +1132,6 @@ lib/lyx2lyx/lyx2lyx_tools.py
  
 \end_layout
 
-\begin_layout Section
-Backporting new styles to the stable version
-\begin_inset CommandInset label
-LatexCommand label
-name "subsec:Backporting-new-styles"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Starting with the stable \SpecialChar LyX
- 2.1 branch, there is a mechanism in place to backport
- new styles to the stable version without the need to update the file format.
- The basic idea is that the new style definition is automatically copied
- to the document preamble so that it can even be used by older minor versions
- that did not yet include the style.
- To backport a new style to the stable version, the following steps are
- needed:
-\end_layout
-
-\begin_layout Enumerate
-Add the line 
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-ForceLocal -1
-\end_layout
-
-\end_inset
-
- to the style definition in the development version.
-\end_layout
-
-\begin_layout Enumerate
-Copy the style definition to the stable version, but use 
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-ForceLocal 1
-\end_layout
-
-\end_inset
-
- instead.
- If needed adjust the format to the one used by the stable version (see
- the customization manual for details of the layout file format).
-\end_layout
-
-\begin_layout Enumerate
-For each update of the style in a later stable version, increase the argument
- of 
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-ForceLocal
-\end_layout
-
-\end_inset
-
- by one.
- (In the stable version, the development version should not be touched.)
-\end_layout
-
-\begin_layout Standard
-For details about the 
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-ForceLocal
-\end_layout
-
-\end_inset
-
- flag see the customization manual.
- No 
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-lyx2lyx
-\end_layout
-
-\end_inset
-
- support is needed for backported styles: Since the style of the development
- version has an infinite version number, it will always be used.
- Furthermore, since its version number is less than one, the style will
- not be written anymore to the document header for files saved by the new
- version.
-\end_layout
-
 \begin_layout Chapter
 New layouts and modules
 \end_layout
@@ -3618,7 +3613,7 @@ Wontfix
 \end_layout
 
 \begin_layout Paragraph
-suspended tests
+Suspended tests
 \end_layout
 
 \begin_layout Standard
@@ -5180,7 +5175,7 @@ PDF (pdflatex)
 
 \begin_layout Enumerate
 All fixes (typos, compilation fixes, updates info etc.) go at first into
- the current GIT branch because the user should benefit from all fixes with
+ the current Git branch because the user should benefit from all fixes with
  every minor release.
  Feel free to commit directly to branch as long as you follow rule
 \begin_inset space ~
@@ -5215,12 +5210,10 @@ The main documentation consists of these files:
 \end_layout
 
 \begin_layout Description
-Welcome.lyx it is the first file you see after an installation.
+Welcome.lyx It is the first file you see after an installation.
  We assume that a new user sees this.
  It is therefore designed to be as simple as possible.
  Therefore please don't add any new formatting, only fix typos etc.
- Welcome.lyx is up to date for \SpecialChar LyX
- 2.1.x, currently maintained by Uwe Stöhr.
 \end_layout
 
 \begin_layout Description
@@ -5231,60 +5224,47 @@ Intro.lyx This is the manual new users will read to learn \SpecialChar LyX
  Since new users will first learn about the formatting possibilities of
  \SpecialChar LyX
  please keep this file that simple.
- Intro.lyx is up to date for \SpecialChar LyX
- 2.1.x, currently maintained by Uwe Stöhr.
 \end_layout
 
 \begin_layout Description
-Tutorial.lyx our tutorial.
+Tutorial.lyx Our tutorial.
  It must be always up to date.
  Normally there is nothing to add since we don't want to overwhelm new users
  with too much details.
- The will learn these details while using \SpecialChar LyX
+ They will learn these details while using \SpecialChar LyX
  and we have special manuals.
- Tutorial.lyx is up to date for \SpecialChar LyX
- 2.1.x, currently maintained by Uwe Stöhr.
 \end_layout
 
 \begin_layout Description
-UserGuide.lyx our main user guide.
+UserGuide.lyx Our main user guide.
  It covers a mixture of basic and detailed information.
  Some information is also in the Math and EmbeddedObjects manual so that
  the UserGuide refers to these files.
- UserGuide.lyx is up to date for \SpecialChar LyX
- 2.1.x, currently maintained by Uwe Stöhr.
 \end_layout
 
 \begin_layout Description
-EmbeddedObjects.lyx a special manual to explain things like tables floats
+EmbeddedObjects.lyx A special manual to explain things like tables floats
  boxes etc.
  in all detail.
- EmbeddedObjects.lyx is up to date for \SpecialChar LyX
- 2.1.x, currently maintained by Uwe
- Stöhr.
 \end_layout
 
 \begin_layout Description
-Math.lyx a special manual to explain everything regarding math in all detail.
- Math.lyx is up to date for \SpecialChar LyX
- 2.1.x, currently maintained by Uwe Stöhr.
+Math.lyx A special manual to explain everything regarding math in all detail.
 \end_layout
 
 \begin_layout Description
-Additional.lyx this manual covers information that would be too much detail
+Additional.lyx This manual covers information that would be too much detail
  for the UserGuide or would make the UserGuide uncompilable or only compilable
  when installing a lot of special \SpecialChar LaTeX
--packages.
+ packages.
  What should be in the UserGuide or better in Additional is a matter of
  taste.
- it is up to you to decide that.
- Additional.lyx is not completely up to date for \SpecialChar LyX
- 2.1.x.
- Only chapter
+ It is up to you to decide that.
+ Additional.lyx is not completely up to date (only chapter
 \begin_inset space ~
 \end_inset
 
-8 is up to date and currently maintained by Uwe Stöhr.
+8 is up to date).
  It certainly needs a rewrite and update.
  For example many info in chapter
 \begin_inset space ~
@@ -5295,7 +5275,7 @@ Additional.lyx this manual covers information that would be too much detail
 \end_layout
 
 \begin_layout Description
-Customization.lyx this manual covers information how to customize \SpecialChar LyX
+Customization.lyx This manual covers information how to customize \SpecialChar LyX
  for certain
  output formats, operating systems, languages etc.
  It is currently completely out of date and needs a major rewrite and update.
@@ -5338,13 +5318,13 @@ These guidelines should save us a lot of work while cleaning up the code
 \end_layout
 
 \begin_layout Itemize
-the most important rule first: KISS (Keep It Simple Stupid), always use
+The most important rule first: KISS (Keep It Simple Stupid), always use
  a simple implementation in favor of a more complicated one.
  This eases maintenance a lot.
 \end_layout
 
 \begin_layout Itemize
-write good C++ code: Readable, well commented and taking advantage of the
+Write good C++ code: readable, well commented, and taking advantage of the
  OO model.
  Follow the formatting guidelines.
  See sec.
@@ -5365,20 +5345,30 @@ noprefix "false"
 \end_layout
 
 \begin_layout Itemize
-adapt the code to the structures already existing in \SpecialChar LyX
+As of LyX 2.4.0, you can use features of C++11.
+ Accordingly you have to use C++11 standard conforming compiler, e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+ not too dated version of GCC or Clang.
+\end_layout
+
+\begin_layout Itemize
+Adapt the code to the structures already existing in \SpecialChar LyX
 , or in the case that
  you have better ideas, discuss them on the developer's list before writing
  the code.
 \end_layout
 
 \begin_layout Itemize
-take advantage of the C++ standard library.
+Take advantage of the C++ standard library.
  Especially don't use custom containers when a standard container is usable;
  learn to use the algorithms and functors in the standard library.
 \end_layout
 
 \begin_layout Itemize
-be aware of exceptions and write exception safe code.
+Be aware of exceptions and write exception safe code.
  See sec.
 \begin_inset space ~
 \end_inset
@@ -5397,7 +5387,7 @@ noprefix "false"
 \end_layout
 
 \begin_layout Itemize
-document all variables, methods, functions, classes etc.
+Document all variables, methods, functions, classes etc.
  We are using the source documentation program doxygen, a program that handles
  javadoc syntax, to document sources.
  You can download doxygen from: 
@@ -5415,7 +5405,7 @@ http://www.stack.nl/~dimitri/doxygen/
 \end_layout
 
 \begin_layout Itemize
-we have certain code constructs that we try to follow.
+We have certain code constructs that we try to follow.
  See sec.
 \begin_inset space ~
 \end_inset
@@ -5447,11 +5437,19 @@ It is implicitly understood that all patches contributed to The \SpecialChar LyX
 .
  Always discuss your ideas with the developers on the developer's mailing
  list.
- When you create the patch, please use "
+ When you create the patch, please use 
+\begin_inset Quotes eld
+\end_inset
+
+
 \family typewriter
 diff -up
 \family default
-" since we find that a lot easier to read than the other diff formats.
+
+\begin_inset Quotes erd
+\end_inset
+
+ since we find that a lot easier to read than the other diff formats.
  Also please do not send patches that implements or fixes several different
  things; several patches is a much better option.
  We also require you to provide a commit message entry with every patch,
@@ -5475,20 +5473,47 @@ We have several guidelines on code constructs, some of these exist to make
  the code faster, others to make the code clearer.
  Yet others exist to allow us to take advantage of the strong type checking
  in C++.
 \end_layout
 
 \begin_layout Itemize
 Declaration of variables should wait as long as possible.
- The rule is: "Don't declare it until you need it." In C++ there are a lot
- of user defined types, and these can very often be expensive to initialize.
+ The rule is: 
+\begin_inset Quotes eld
+\end_inset
+
+Don't declare it until you need it.
+\begin_inset Quotes erd
+\end_inset
+
+ In C++ there are a lot of user defined types, and these can very often
+ be expensive to initialize.
  This rule connects to the next rule too.
  
 \end_layout
 
 \begin_layout Itemize
-Declare the variable as const if you don't need to change it.
- This applies to POD types like int as well as classes.
+Declare the variable as 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+const
+\end_layout
+
+\end_inset
+
+ if you don't need to change it.
+ This applies to POD types like 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+int
+\end_layout
+
+\end_inset
+
+ as well as classes.
  
 \end_layout
 
@@ -5498,7 +5523,17 @@ Make the scope of a variable as small as possible.
 
 \begin_layout Itemize
 Make good use of namespaces.
- Prefer anonymous namespaces to declaring "static" for file scope.
+ Prefer anonymous namespaces to declaring 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+static
+\end_layout
+
+\end_inset
+
+ for file scope.
 \end_layout
 
 \begin_layout Itemize
@@ -5522,7 +5557,7 @@ Use:
 \begin_deeper
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\footnotesize},language={C++}"
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -5547,6 +5582,7 @@ Do not use:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -5583,6 +5619,7 @@ Use:
 \begin_deeper
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -5612,11 +5649,42 @@ for (Container::iterator it = large.begin(); it != end; ++it) {
 \end_layout
 
 \begin_layout Standard
-Do not use:
+Or better (C++11):
 \end_layout
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
+inline false
+status open
+
+\begin_layout Plain Layout
+
+for (auto const & it : large) {
+\end_layout
+
+\begin_layout Plain Layout
+
+       ...;
+\end_layout
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Do not use:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -5652,7 +5720,27 @@ Plain Ol' Data type
 
 \end_inset
 
- T, return T const instead.
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+T
+\end_layout
+
+\end_inset
+
+, return 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+T const
+\end_layout
+
+\end_inset
+
+ instead.
  This gives better type checking, and will give a compiler warning when
  temporaries are used wrongly.
 \begin_inset Separator latexpar
@@ -5668,12 +5756,13 @@ Use:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
 \begin_layout Plain Layout
 
-T const add(..);
+T const add(...);
 \end_layout
 
 \end_inset
@@ -5687,12 +5776,13 @@ Do not use:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
 \begin_layout Plain Layout
 
-T add(..);
+T add(...);
 \end_layout
 
 \end_inset
@@ -5709,6 +5799,7 @@ Avoid using the default cases in switch statements unless you have too.
 
 \begin_layout Itemize
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -5752,7 +5843,12 @@ switch (f) {
 
 \begin_layout Plain Layout
 
-case FOO_BAR1: ...; 
+case FOO_BAR1:
+\end_layout
+
+\begin_layout Plain Layout
+
+       ...;
 \end_layout
 
 \begin_layout Plain Layout
@@ -5762,7 +5858,12 @@ case FOO_BAR1: ...;
 
 \begin_layout Plain Layout
 
-case FOO_BAR2: ...; 
+case FOO_BAR2:
+\end_layout
+
+\begin_layout Plain Layout
+
+       ...;
 \end_layout
 
 \begin_layout Plain Layout
@@ -5772,12 +5873,12 @@ case FOO_BAR2: ...;
 
 \begin_layout Plain Layout
 
-default: ...; 
+default: // not needed and would shadow a wrong use of Foo
 \end_layout
 
 \begin_layout Plain Layout
 
-       // not needed and would shadow a wrong use of Foo
+       ...;
 \end_layout
 
 \begin_layout Plain Layout
@@ -5793,6 +5894,46 @@ default: ...;
 \end_inset
 
 
+\end_layout
+
+\begin_layout Itemize
+Use default initialization such as
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+int i = 0;
+\end_layout
+
+\begin_layout Plain Layout
+
+Class * ptr = nullptr;
+\end_layout
+
+\end_inset
+
+rather than brace initialization:
+\begin_inset listings
+inline false
+status open
+
+\begin_layout Plain Layout
+
+int i {};
+\end_layout
+
+\begin_layout Plain Layout
+
+Class * ptr {};
+\end_layout
+
+\end_inset
+
+for PODs.
+ Use brace initialization only for more complex data structures.
 \end_layout
 
 \begin_layout Section
@@ -5911,6 +6052,7 @@ Use:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -5935,6 +6077,7 @@ Do not use:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -5958,6 +6101,7 @@ Use:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -5982,6 +6126,7 @@ Do not use:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -5996,16 +6141,42 @@ string a = "Lars", b = "Gullik"; // not used in LyX
 \end_layout
 
 \begin_layout Standard
-[Note that 'string a = "Lars"' is formally calling a copy constructor on
- a temporary constructed from a string literal and therefore has the potential
- of being more expensive then direct construction by 'string a("Lars")'.
+[Note that 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+string a = "Lars"
+\end_layout
+
+\end_inset
+
+ is formally calling a copy constructor on a temporary constructed from
+ a string literal and therefore has the potential of being more expensive
+ then direct construction by 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+string a("Lars")
+\end_layout
+
+\end_inset
+
+.
  However the compiler is allowed to elide the copy (even if it had side
  effects), and modern compilers typically do so.
  Given these equal costs, \SpecialChar LyX
  code favours the '=' idiom as it is in line with
- the traditional C-style initialization, _and_ cannot be mistaken as function
- declaration, _and_ reduces the level of nested parantheses in more initializati
-ons.]
+ the traditional C-style initialization, 
+\emph on
+and
+\emph default
+ cannot be mistaken as function declaration, 
+\emph on
+and
+\emph default
+ reduces the level of nested parentheses in more initializations.]
 \end_layout
 
 \end_deeper
@@ -6024,6 +6195,7 @@ Use:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6048,6 +6220,7 @@ Do not use:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6074,6 +6247,7 @@ Some time ago we had a huge discussion on this subject and after convincing
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6093,6 +6267,7 @@ and not
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6118,6 +6293,7 @@ Operator names and parentheses
 \begin_deeper
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6137,6 +6313,7 @@ and not
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6167,6 +6344,7 @@ Function names and parentheses
 \begin_deeper
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6186,6 +6364,7 @@ and not
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6211,6 +6390,7 @@ Enumerators
 \begin_deeper
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6245,11 +6425,48 @@ enum Foo {
 \end_layout
 
 \begin_layout Standard
+or (C++11)
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
+inline false
+status open
+
+\begin_layout Plain Layout
+
+enum class Foo {
+\end_layout
+
+\begin_layout Plain Layout
+
+       One = 1,
+\end_layout
+
+\begin_layout Plain Layout
+
+       Two = 2,
+\end_layout
+
+\begin_layout Plain Layout
+
+       Three = 3
+\end_layout
+
+\begin_layout Plain Layout
+
+};
+\end_layout
+
+\end_inset
+
 and not
 \end_layout
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6269,6 +6486,7 @@ and not
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6313,18 +6531,18 @@ Null pointers
 
 \begin_deeper
 \begin_layout Standard
-Using a plain 0 is always correct and least effort to type.
- So: 
+Use nullptr (C++11):
 \end_layout
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
 \begin_layout Plain Layout
 
-void * p = 0;
+void * p = nullptr;
 \end_layout
 
 \end_inset
@@ -6338,6 +6556,7 @@ and not
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6357,6 +6576,7 @@ and not
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6378,6 +6598,7 @@ and not
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6393,7 +6614,25 @@ void * p = 42 - 7 * 6; // not used in LyX
 
 \begin_layout Standard
 Note: As an exception, imported third party code as well as code interfacing
- the "native" APIs (src/support/os_*) can use NULL.
+ the 
+\begin_inset Quotes eld
+\end_inset
+
+native
+\begin_inset Quotes erd
+\end_inset
+
+ APIs (
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+src/support/os_*
+\end_layout
+
+\end_inset
+
+) can use NULL.
 \end_layout
 
 \end_deeper
@@ -6420,27 +6659,43 @@ Enums are named like Classes, values are usually in lower-case.
 \end_layout
 
 \begin_layout Itemize
-Public API is camel-case ('
-\family typewriter
+Public API functions are camel-case (
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
 void setAFlagToAValue(bool)
-\family default
-')
+\end_layout
+
+\end_inset
+
+).
 \end_layout
 
 \begin_layout Itemize
-Members variables are underscored ('
-\family typewriter
+Member variables are underscored (
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
 enable_this_feature_flag_
-\family default
-') with a final '
-\family typewriter
+\end_layout
+
+\end_inset
+
+) with a final 
+\begin_inset Quotes eld
+\end_inset
+
 _
-\family default
-'
+\begin_inset Quotes erd
+\end_inset
+
+.
 \end_layout
 
 \begin_layout Itemize
-Private/protected functions are also camel-case
+Private/protected functions are also camel-case.
 \end_layout
 
 \begin_layout Itemize
@@ -6483,20 +6738,66 @@ name "Use-string-wherever"
 
 \end_inset
 
-Use string wherever possible.
- \SpecialChar LyX
- will someday move to Unicode, and that will be easy if everybody uses
- string now.
- Unicode strings should prefer using docstring instead of UTF-8 encoded
- std::string.
+Use 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+ wherever possible.
+ Unicode strings should prefer using 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+docstring
+\end_layout
+
+\end_inset
+
+ instead of UTF-8 encoded 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+std::string
+\end_layout
+
+\end_inset
+
+.
 \end_layout
 
 \begin_layout Itemize
-Check out the filename and path tools in filetools.h
+Check out the filename and path tools in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+filetools.h
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Itemize
-Check out the string tools in lstring.h.
+Check out the string tools in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+lstring.h
+\end_layout
+
+\end_inset
+
+.
 \end_layout
 
 \begin_layout Itemize
@@ -6553,6 +6854,7 @@ If you create a new file, the top of the file should look something like
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6597,7 +6899,12 @@ author Kaiser Sose
 
 \begin_layout Plain Layout
 
-* Full author contact details are available in file CREDITS
+* Full author contact details are available
+\end_layout
+
+\begin_layout Plain Layout
+
+* in file CREDITS.
 \end_layout
 
 \begin_layout Plain Layout
@@ -6643,13 +6950,34 @@ in the .cpp files you document the implementation.
 
 \end_deeper
 \begin_layout Itemize
-Single line description (///), multiple lines description (/** ...
- */) see the doxygen webpage referenced above
+Single line description (
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+///
+\end_layout
+
+\end_inset
+
+), multiple lines description (
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+/** ...
+ */
+\end_layout
+
+\end_inset
+
+), see the doxygen webpage referenced above.
 \end_layout
 
 \end_deeper
 \begin_layout Section
-Naming rules for Lyx User Functions (LFUNs)
+Naming rules for \SpecialChar LyX
+ User Functions (LFUNs)
 \end_layout
 
 \begin_layout Standard
@@ -6658,7 +6986,7 @@ Here is the set of rules to apply when a new command name is introduced:
 
 \begin_layout Enumerate
 Use the object.event order.
- That is, use `word-forward' instead of`forward-word'.
+ That is, use `word-forward' instead of `forward-word'.
 \end_layout
 
 \begin_layout Enumerate
@@ -6716,6 +7044,7 @@ We need to add a function f to the class C's API.
 \begin_deeper
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -6832,9 +7161,67 @@ inline
 
 \begin_layout Itemize
 use the same form in corresponding calls to new and delete, i.e.
- write delete[] obj; if new obj[n]; was used to create the object and write
- delete obj; if you wrote new obj; Notice strings should be std::string's
- instead of char *'s.
+ write 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+delete[] obj;
+\end_layout
+
+\end_inset
+
+ if 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+new obj[n];
+\end_layout
+
+\end_inset
+
+ was used to create the object and write 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+delete obj;
+\end_layout
+
+\end_inset
+
+ if you wrote 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+new obj;
+\end_layout
+
+\end_inset
+
+ Notice strings should be 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+std::string
+\end_layout
+
+\end_inset
+
+'s instead of 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+char *
+\end_layout
+
+\end_inset
+
+'s.
  (this contradicts to 
 \begin_inset CommandInset ref
 LatexCommand ref
@@ -6917,7 +7304,27 @@ ensure that global objects are initialized before they are used
 \end_layout
 
 \begin_layout Itemize
-avoid conditions to 'if' and 'while' that span more than a line
+avoid conditions to 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+if
+\end_layout
+
+\end_inset
+
+ and 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+while
+\end_layout
+
+\end_inset
+
+ that span more than a line
 \end_layout
 
 \begin_layout Chapter
@@ -6986,6 +7393,7 @@ In C++11 there's a "built-in":
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -7005,12 +7413,18 @@ until then on namespace scope:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
 \begin_layout Plain Layout
 
-#include <boost/static_assert.hpp> BOOST_STATIC_ASSERT(sizeof(int) == 4)
+#include <boost/static_assert.hpp>
+\end_layout
+
+\begin_layout Plain Layout
+
+BOOST_STATIC_ASSERT(sizeof(int) == 4)
 \end_layout
 
 \end_inset
@@ -7024,22 +7438,43 @@ or without boost:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
 \begin_layout Plain Layout
 
-template<bool Condition> struct static_assert_helper;
+template<bool Condition>
 \end_layout
 
 \begin_layout Plain Layout
 
-template <> struct static_assert_helper<true> {}; 
+struct static_assert_helper;
 \end_layout
 
 \begin_layout Plain Layout
 
-enum { dummy = sizeof(static_assert_helper<sizeof(int) == 4>)};
+template <>
+\end_layout
+
+\begin_layout Plain Layout
+
+struct static_assert_helper<true> {}; 
+\end_layout
+
+\begin_layout Plain Layout
+
+enum {
+\end_layout
+
+\begin_layout Plain Layout
+
+       dummy = sizeof(static_assert_helper<sizeof(int) == 4>)
+\end_layout
+
+\begin_layout Plain Layout
+
+};
 \end_layout
 
 \end_inset
@@ -7053,6 +7488,7 @@ or somewhat brutish without templates, in any function:
 
 \begin_layout Standard
 \begin_inset listings
+lstparams "basicstyle={\ttfamily},showstringspaces=false,tabsize=4"
 inline false
 status open
 
@@ -7063,7 +7499,7 @@ const int d = sizeof(int) - 4;
 
 \begin_layout Plain Layout
 
-switch(0) { 
+switch (0) { 
 \end_layout
 
 \begin_layout Plain Layout
@@ -7078,7 +7514,7 @@ case !(d*d):
 
 \begin_layout Plain Layout
 
-break; 
+       break; 
 \end_layout
 
 \begin_layout Plain Layout
@@ -7092,7 +7528,16 @@ break;
 \end_layout
 
 \begin_layout Standard
-Any of them in a .cpp file will break compilation as soon as sizeof(int)
+Any of them in a .cpp file will break compilation as soon as 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+sizeof(int)
+\end_layout
+
+\end_inset
+
  is not equal 4.
  Personally I prefer something like the third version (or the first, if
  using C++11 is allowed).
@@ -7233,10 +7678,9 @@ literal "true"
 
 \end_inset
 
-S.
- Meyers.
- Effective C++, 50 Specific Ways to Improve Your Programs and Design.
- Addison-Wesley, 1992
+Meyers, Scott.
+ Effective C++: 50 Specific Ways to Improve Your Programs and Design.
+ Addison-Wesley, 1992.
 \end_layout
 
 \begin_layout Bibliography
@@ -7249,7 +7693,7 @@ literal "true"
 
 Sutter, Herb.
  Exceptional C++: 47 engineering puzzles, programming problems, and solutions.
- ISBN 0-201-61562-2
+ ISBN 0-201-61562-2.
 \end_layout
 
 \begin_layout Bibliography
@@ -7260,7 +7704,8 @@ literal "true"
 
 \end_inset
 
-Scott Meyers, C/C++ User's Journal (Vol.18,No.2)
+Meyers, Scott.
+ C/C++ User's Journal (Vol.18, No.2).
 \end_layout
 
 \end_body