Re: Re: changeset/e94e9e41 makes trunk uncompilable

2012-10-24 Thread Kornel Benko
Am Dienstag, 23. Oktober 2012 um 20:49:59, schrieb Uwe Stöhr uwesto...@web.de
 The problem is the following:
 when
 
 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target rebuild_cache
 
 is called my ${CMAKE_BINARY_DIR} is
 D:\LyXGit\Master\compile-result
 
 But after this call MSVC stops because it cannot find the file:
 
Generating ui_WrapUi.h
Generating Resources.qrc
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.269]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
 MSBUILD : error MSB1009: Project file does not exist.
 [D:\LyXGit\Master\compile-result\src\frontends\qt4\frontend_qt4.vcxproj]
 
 Build FAILED.

May I ask, if this was done on a fresh tree?
Looks like the command is done, but the rules evaluating
the existence were done prior to that.
Do you have problems calling ninja directly?
#cd D:/LyXGit/Master/compile-result
#ninja

Maybe an error in ninja-generator for WIN32? (On linux it works also with ninja)
Nonetheless I removed it now in WIN32 build.

Konrel


signature.asc
Description: This is a digitally signed message part.


Re: [LyX master] Add xfig import test

2012-10-24 Thread Kornel Benko
Am Dienstag, 23. Oktober 2012 um 22:09:29, schrieb Georg Baum b...@lyx.org
 The branch, master, has been updated.
 
 - Log -
 
 commit ecf24f1cb5189dfd493609c7f2bc577b0b1c4b3b
 Author: Georg Baum b...@lyx.org
 Date:   Tue Oct 23 22:08:57 2012 +0200
 
 Add xfig import test
 

Provided lyx-files have (now) wrong format (444 - 445). This
make the test failing.

Kornel

signature.asc
Description: This is a digitally signed message part.


[PATCH] config/lyxinclude.m4: add support for -flto

2012-10-24 Thread Lars Gullik Bjønnes
Add feature --enable-lto, link-time optimization.

Enabling link-time optimization turns debug information off (-g),
sine -flto and -g does not currently well work together.

Also stdlib-debug is turned off, does also not work well with -flto.
---
 config/lyxinclude.m4 | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index 2e529ea..67aea1f 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -236,6 +236,24 @@ AC_ARG_ENABLE(cxx11,
   AC_HELP_STRING([--enable-cxx11],[enable C++11 mode]),,
   enable_cxx11=no;)
 
+AC_ARG_ENABLE(lto,
+  AC_HELP_STRING([--enable-lto],[enable link time optimization]),,
+  enable_lto=no;)
+case $enable_lto in
+yes)
+   lto_opt=-flto
+   enable_debug=no
+   enable_stdlib_debug=no
+   ;;
+no)
+   lto_opt=;;
+*)
+   lto_opt=-flto=${enable_lto}
+   enable_debug=no
+   enable_stdlib_debug=no
+   ;;
+esac
+
 AC_ARG_ENABLE(assertions,
   AC_HELP_STRING([--enable-assertions],[add runtime sanity checks in the 
program]),,
   [AS_CASE([$build_type], [dev*|pre*], [enable_assertions=yes],
@@ -322,6 +340,15 @@ if test x$GXX = xyes; then
  ;;
   esac
   fi
+  if test x$enable_lto != xno ; then
+  case $gxx_version in
+ 4.7*|4.8*)
+ lyx_flags=$lyx_flags link-time-optimization
+ CFLAGS=$lto_opt $CFLAGS
+ CXXFLAGS=$lto_opt $CXXFLAGS
+ ;;
+  esac
+  fi
 fi
 test $lyx_pch_comp = yes  lyx_flags=$lyx_flags pch
 AM_CONDITIONAL(LYX_BUILD_PCH, test $lyx_pch_comp = yes)
-- 
1.8.0



Re: [PATCH] config/lyxinclude.m4: add support for -flto

2012-10-24 Thread Jean-Marc Lasgouttes

Le 24/10/2012 13:13, Lars Gullik Bjønnes a écrit :

Add feature --enable-lto, link-time optimization.


Do you see a visible gain, that would make it worth using on release builds?

JMarc



[PATCH] Fix importation of noweb files with tex2lyx

2012-10-24 Thread Jean-Marc Lasgouttes
This is a patch for testing (Kayvan?) since I do not have the 
tools/knowledge. This allows proper importation of noweb files (at least 
as good as it used to be).


I also renamed the literate format. Tell me whether this is a problem.

Finally, is there a reason why the Scrap layout is not Chunk, like it is 
in noweb documentation? Where does this scrap term come from?


I wanted to extend that to sweave/knitr, but I have two problems:

* knitr should have its own file extension
* we need proper verbatim reading to make things work. There are too 
many strange characters in R code.


JMarc

From 254498696f3245909446b3b1ec7cee2a18dae4e4 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes lasgout...@lyx.org
Date: Wed, 24 Oct 2012 15:20:46 +0200
Subject: [PATCH] Fix importation of noweb files with tex2lyx

This handles correctly the noweb module instead of the old literate-xxx classes. Next step will be to get rid of these classes.

I also used this occasion to rename format literate to noweb.
---
 lib/configure.py |8 
 src/tex2lyx/Preamble.cpp |2 --
 src/tex2lyx/tex2lyx.cpp  |4 ++--
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/lib/configure.py b/lib/configure.py
index 58234c0..164caf7 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -534,7 +534,7 @@ def checkFormatEntries(dtl_tools):
 \Format dotdotGraphviz Dot   	%%	vector	text/vnd.graphviz
 \Format dviluatex  texLaTeX (dviluatex)   %%	document,menu=export	
 \Format platex texLaTeX (pLaTeX)  %% 	document,menu=export	
-\Format literate   nw  NoWeb  N  	%%	document,menu=export	
+\Format noweb  nw  NoWeb  N  	%%	document,menu=export	
 \Format sweave RnwSweaveS   %%	document,menu=export	
 \Format r  R  R/S code%%	document,menu=export	
 \Format knitr  RnwRnw (knitr) %%	document,menu=export	
@@ -646,14 +646,14 @@ def checkConverterEntries():
 
 path, t2l = checkProg('a LaTeX/Noweb - LyX converter', [in_place, 'tex2lyx' + version_suffix, 'tex2lyx'],
 rc_entry = [r'''\converter latex  lyx%% -f $$i $$o	
-\converter literate   lyx%% -n -f $$i $$o	'''], not_found = 'tex2lyx')
+\converter noweb   lyx%% -n -m noweb -f $$i $$o	'''], not_found = 'tex2lyx')
 if path == '':
 logger.warning(Failed to find tex2lyx on your system.)
 
 #
 checkProg('a Noweb - LaTeX converter', ['noweave -delay -index $$i  $$o'],
-rc_entry = [r'''\converter literate   latex  %%	
-\converter literate   pdflatex  %%	'''])
+rc_entry = [r'''\converter noweb   latex  %%	
+\converter noweb   pdflatex  %%	'''])
 #
 checkProg('a Sweave - LaTeX converter', ['Rscript --verbose --no-save --no-restore $$s/scripts/lyxsweave.R $$p$$i $$p$$o $$e $$r'],
 rc_entry = [r'''\converter sweave   latex  %%	
diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index 430708c..86a420a 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -1632,8 +1632,6 @@ void Preamble::parse(Parser  p, string const  forceclass,
 	// Force textclass if the user wanted it
 	if (!forceclass.empty())
 		h_textclass = forceclass;
-	if (noweb_mode  !prefixIs(h_textclass, literate-))
-		h_textclass.insert(0, literate-);
 	tc.setName(h_textclass);
 	if (!tc.load()) {
 		cerr  Error: Could not read layout file for textclass \  h_textclass  \.  endl;
diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp
index 1abdecb..b288095 100644
--- a/src/tex2lyx/tex2lyx.cpp
+++ b/src/tex2lyx/tex2lyx.cpp
@@ -495,8 +495,7 @@ int parse_help(string const , string const )
 		\t-copyfiles Copy all included files to the directory of outfile.lyx.\n
 		\t-e encodingSet the default encoding (latex name).\n
 		\t-f Force overwrite of .lyx files.\n
-		\t-help  Print this message and quit.\n
-		\t-n translate a noweb (aka literate programming) file.\n
+		\t-n literate programming mode (noweb).\n
 		\t-skipchildren  Do not translate included child documents.\n
 		\t-roundtrip re-export created .lyx file infile.lyx.lyx to infile.lyx.tex.\n
 		\t-s syntaxfile  read additional syntax file.\n
@@ -504,6 +503,7 @@ int parse_help(string const , string const )
 		\t   Default:   package().system_support()  \n
 		\t-userdir USERDIR   Set user directory to USERDIR.\n
 		\t   Default:   package().user_support()  \n
+		\t-help  Print this message and quit.\n
 		\t-version   Summarize version and build info.\n
 		Paths:\n
 		\tThe program searches for the files \encodings\, \lyxmodules.lst\,\n
-- 
1.7.0.4



Re: [PATCH 2/2] config/lyxinclude.m4: add support for --enable-cxx11

2012-10-24 Thread Richard Heck

On 10/23/2012 09:07 PM, Lars Gullik Bjønnes wrote:

Using --enable-cxx11 turns on C++11 mode in gcc.

Seems like a good idea.

rh



Re: [PATCH] Fix importation of noweb files with tex2lyx

2012-10-24 Thread Jean-Marc Lasgouttes

Le 24/10/2012 15:27, Jean-Marc Lasgouttes a écrit :

This is a patch for testing (Kayvan?) since I do not have the
tools/knowledge. This allows proper importation of noweb files (at least
as good as it used to be).


I know now that this patch is broken. Stay tuned for more soon.


I wanted to extend that to sweave/knitr, but I have two problems:

* knitr should have its own file extension
* we need proper verbatim reading to make things work. There are too
many strange characters in R code.


Actually it is not  verbatim problem but a clash with quotes. 
However, I still have issues with line breaks.


JMarc



Re: [PATCH] Fix importation of noweb files with tex2lyx

2012-10-24 Thread Kayvan Sylvan
Ok, thanks. I'll test your updated patch when you finish it.

On Wed, Oct 24, 2012 at 7:21 AM, Jean-Marc Lasgouttes lasgout...@lyx.orgwrote:

 Le 24/10/2012 15:27, Jean-Marc Lasgouttes a écrit :

  This is a patch for testing (Kayvan?) since I do not have the
 tools/knowledge. This allows proper importation of noweb files (at least
 as good as it used to be).


 I know now that this patch is broken. Stay tuned for more soon.




Re: [LyX master] Add support for the URW Classico (Optima) LaTeX font

2012-10-24 Thread Jürgen Spitzmüller
2012/10/23 Georg Baum:
 Please update src/tex2lyx/TODO.txt

Done.

 and the tex2lyx test cases with the new
 format (they are currently failing). The latter can be done using

 make updatetests

 in the src/tex2lyx sub folder of the build tree.

This fails for me with

/usr/bin/python ./test/runtests.py ./tex2lyx ../../../lib/scripts ./test
Traceback (most recent call last):
  File ./test/runtests.py, line 84, in module
main(sys.argv)
  File ./test/runtests.py, line 32, in main
from lyxpreview_tools import error
ImportError: No module named lyxpreview_tools

also when I pass the path to the scripts dir explicitly on the cl.

Jürgen

 Georg


Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-24 Thread André Pönitz
On Wed, Oct 24, 2012 at 01:27:40AM +0200, Lars Gullik Bjønnes wrote:
 André Pönitz andre.poen...@mathematik.tu-chemnitz.de writes:
 
 | On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
  From: Lars Gullik Bjønnes lar...@gullik.org
  
  Use a local typedef pairstring, string P to avoid having to repeat
  that multiple times.
  ---
   src/lyxfind.cpp | 72
  -
   1 file changed, 40 insertions(+), 32 deletions(-)
  
  diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
  index a19724b..33dbd8a 100644
  --- a/src/lyxfind.cpp
  +++ b/src/lyxfind.cpp
  @@ -495,54 +495,62 @@ typedef vectorpairstring, string  Escapes;
   /// @note Beware of order
   Escapes const  get_regexp_escapes()
   {
  +  typedef std::pairstd::string, std::string P;
  +
 
 | Conveniently adding a std:: or three, so next time the discussion
 | comes up we can reasonably claim that it is used inconsistently
 | and the 'using' on top could go...
 
 What is your agenda really?

Preventing attempts to turn the LyX code base into a guinea pig for
programming experiments again. Especially the kind of experiment that
add a burden for others.

Andre'


Re: [LyX master] Add support for the URW Classico (Optima) LaTeX font

2012-10-24 Thread Georg Baum
Jürgen Spitzmüller wrote:

 This fails for me with
 
 /usr/bin/python ./test/runtests.py ./tex2lyx ../../../lib/scripts
 ./test Traceback (most recent call last):
   File ./test/runtests.py, line 84, in module
 main(sys.argv)
   File ./test/runtests.py, line 32, in main
 from lyxpreview_tools import error
 ImportError: No module named lyxpreview_tools
 
 also when I pass the path to the scripts dir explicitly on the cl.

Does it work now? There was an assumption that the build tree was below the 
source tree which I forgot about.


Georg



Re: [PATCH] config/lyxinclude.m4: add support for -flto

2012-10-24 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes lasgout...@lyx.org writes:

| Le 24/10/2012 13:13, Lars Gullik Bjønnes a écrit :
 Add feature --enable-lto, link-time optimization.

| Do you see a visible gain, that would make it worth using on release builds?

textdatabss   dec  hexfilename
8042443 28616   39624 8110683  7bc25b src/lyx-flto
8912062 31888   40760 8984710  891886 src/lyx

(or there about). If that is enough gain to be worth it? Dunno.

It if faster is not that easy to measure.

-- 
   Lgb



Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-24 Thread Lars Gullik Bjønnes
André Pönitz andre.poen...@mathematik.tu-chemnitz.de writes:

| On Wed, Oct 24, 2012 at 01:27:40AM +0200, Lars Gullik Bjønnes wrote:
 André Pönitz andre.poen...@mathematik.tu-chemnitz.de writes:
 
 | On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
  From: Lars Gullik Bjønnes lar...@gullik.org
  
  Use a local typedef pairstring, string P to avoid having to repeat
  that multiple times.
  ---
   src/lyxfind.cpp | 72
  -
   1 file changed, 40 insertions(+), 32 deletions(-)
  
  diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
  index a19724b..33dbd8a 100644
  --- a/src/lyxfind.cpp
  +++ b/src/lyxfind.cpp
  @@ -495,54 +495,62 @@ typedef vectorpairstring, string  Escapes;
   /// @note Beware of order
   Escapes const  get_regexp_escapes()
   {
  + typedef std::pairstd::string, std::string P;
  +
 
 | Conveniently adding a std:: or three, so next time the discussion
 | comes up we can reasonably claim that it is used inconsistently
 | and the 'using' on top could go...
 
 What is your agenda really?

| Preventing attempts to turn the LyX code base into a guinea pig for
| programming experiments again. Especially the kind of experiment that
| add a burden for others.

Since you are not doing any, perhaps you should let those that do
decide? I am not going to push anything without a +1 anyway.

-- 
   Lgb



Re: [PATCH 2/2] config/lyxinclude.m4: add support for --enable-cxx11

2012-10-24 Thread Lars Gullik Bjønnes
Richard Heck rgh...@lyx.org writes:

| On 10/23/2012 09:07 PM, Lars Gullik Bjønnes wrote:
 Using --enable-cxx11 turns on C++11 mode in gcc.
| Seems like a good idea.

I will have to commit 1/2 in this series as well.

Ok?

-- 
   Lgb



Re: [PATCH] config/lyxinclude.m4: add support for -flto

2012-10-24 Thread Jean-Marc Lasgouttes

Le 24/10/12 22:18, Lars Gullik Bjønnes a écrit :

Jean-Marc Lasgouttes lasgout...@lyx.org writes:

| Le 24/10/2012 13:13, Lars Gullik Bjønnes a écrit :

Add feature --enable-lto, link-time optimization.



| Do you see a visible gain, that would make it worth using on release builds?

textdatabss   dec  hexfilename
8042443 28616   39624 8110683  7bc25b src/lyx-flto
8912062 31888   40760 8984710  891886 src/lyx

(or there about). If that is enough gain to be worth it? Dunno.

It if faster is not that easy to measure.


And is the link significantly more painful (time/memory)?

JMarc



Re: [PATCH] config/lyxinclude.m4: add support for -flto

2012-10-24 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes lasgout...@lyx.org writes:

| Le 24/10/12 22:18, Lars Gullik Bjønnes a écrit :
 Jean-Marc Lasgouttes lasgout...@lyx.org writes:

 | Le 24/10/2012 13:13, Lars Gullik Bjønnes a écrit :
 Add feature --enable-lto, link-time optimization.

 | Do you see a visible gain, that would make it worth using on release 
 builds?

 textdatabss   dec  hexfilename
 8042443 28616   39624 8110683  7bc25b src/lyx-flto
 8912062 31888   40760 8984710  891886 src/lyx

 (or there about). If that is enough gain to be worth it? Dunno.

 It if faster is not that easy to measure.

| And is the link significantly more painful (time/memory)?

Oh, yes to both.
All optimization is redone, although wiht -flto=6 will will run the
optmization/assembly 6-way paralell so it is not that bad on a multicore
machine. Also you can compile with -flto -O0 and link with -flto
-O2. So you might get a huge speed bonus on the compiling and only way
when linking/optimizing.

As a side note:

textdatabss   dec  hexfilename
8817187 31904   40760 8889851  87a5fb src/lyx-cxx11

(Most likely due to rvalue-references and move semantics.)

-- 
   Lgb



Re: [PATCH] Fix importation of noweb files with tex2lyx

2012-10-24 Thread Yihui Xie
Gregor may know the history of Scrap; that term has been there ever
since I started using LyX/Sweave, and I never know how it came in.

Noweb is only one of the implementations of literate programming (to
beat Knuth's WEB), so I guess literate may actually be a better
name.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Oct 24, 2012 at 8:27 AM, Jean-Marc Lasgouttes
lasgout...@lyx.org wrote:
 This is a patch for testing (Kayvan?) since I do not have the
 tools/knowledge. This allows proper importation of noweb files (at least as
 good as it used to be).

 I also renamed the literate format. Tell me whether this is a problem.

 Finally, is there a reason why the Scrap layout is not Chunk, like it is in
 noweb documentation? Where does this scrap term come from?

 I wanted to extend that to sweave/knitr, but I have two problems:

 * knitr should have its own file extension
 * we need proper verbatim reading to make things work. There are too many
 strange characters in R code.

 JMarc



Re: [LyX master] Add support for the URW Classico (Optima) LaTeX font

2012-10-24 Thread Jürgen Spitzmüller
2012/10/24 Georg Baum:
 Does it work now? There was an assumption that the build tree was below the
 source tree which I forgot about.

Yes. Not all tests passed (since I do not have gnumeric installed, for
instance), but I committed the updated files.

Hope this is all correct.

Jürgen

 Georg



google app for lyx?

2012-10-24 Thread xPol
I am thinking about the possibilty to retrive lyx file from google 
repository (so called 'drive'), pass it to lyx on my station, edit and 
save the modified file then upload to google drive as a new version. 
(google drive manages doc versions).

Would an app for google be useful and easy to build?

thank you
paolo



Re: Re: changeset/e94e9e41 makes trunk uncompilable

2012-10-24 Thread Kornel Benko
Am Dienstag, 23. Oktober 2012 um 20:49:59, schrieb Uwe Stöhr 
> The problem is the following:
> when
> 
> COMMAND ${CMAKE_COMMAND} --build "${CMAKE_BINARY_DIR}" --target rebuild_cache
> 
> is called my ${CMAKE_BINARY_DIR} is
> "D:\LyXGit\Master\compile-result"
> 
> But after this call MSVC stops because it cannot find the file:
> 
>Generating ui_WrapUi.h
>Generating Resources.qrc
>Microsoft (R) Build Engine Version 4.0.30319.1
>[Microsoft .NET Framework, Version 4.0.30319.269]
>Copyright (C) Microsoft Corporation 2007. All rights reserved.
> MSBUILD : error MSB1009: Project file does not exist.
> [D:\LyXGit\Master\compile-result\src\frontends\qt4\frontend_qt4.vcxproj]
> 
> Build FAILED.

May I ask, if this was done on a fresh tree?
Looks like the command is done, but the rules evaluating
the existence were done prior to that.
Do you have problems calling "ninja" directly?
#cd D:/LyXGit/Master/compile-result
#ninja

Maybe an error in ninja-generator for WIN32? (On linux it works also with ninja)
Nonetheless I removed it now in WIN32 build.

Konrel


signature.asc
Description: This is a digitally signed message part.


Re: [LyX master] Add xfig import test

2012-10-24 Thread Kornel Benko
Am Dienstag, 23. Oktober 2012 um 22:09:29, schrieb Georg Baum 
> The branch, master, has been updated.
> 
> - Log -
> 
> commit ecf24f1cb5189dfd493609c7f2bc577b0b1c4b3b
> Author: Georg Baum 
> Date:   Tue Oct 23 22:08:57 2012 +0200
> 
> Add xfig import test
> 

Provided lyx-files have (now) wrong format (444 -> 445). This
make the test failing.

Kornel

signature.asc
Description: This is a digitally signed message part.


[PATCH] config/lyxinclude.m4: add support for -flto

2012-10-24 Thread Lars Gullik Bjønnes
Add feature --enable-lto, link-time optimization.

Enabling link-time optimization turns debug information off (-g),
sine -flto and -g does not currently well work together.

Also stdlib-debug is turned off, does also not work well with -flto.
---
 config/lyxinclude.m4 | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index 2e529ea..67aea1f 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -236,6 +236,24 @@ AC_ARG_ENABLE(cxx11,
   AC_HELP_STRING([--enable-cxx11],[enable C++11 mode]),,
   enable_cxx11=no;)
 
+AC_ARG_ENABLE(lto,
+  AC_HELP_STRING([--enable-lto],[enable link time optimization]),,
+  enable_lto=no;)
+case $enable_lto in
+yes)
+   lto_opt=-flto
+   enable_debug=no
+   enable_stdlib_debug=no
+   ;;
+no)
+   lto_opt=;;
+*)
+   lto_opt="-flto=${enable_lto}"
+   enable_debug=no
+   enable_stdlib_debug=no
+   ;;
+esac
+
 AC_ARG_ENABLE(assertions,
   AC_HELP_STRING([--enable-assertions],[add runtime sanity checks in the 
program]),,
   [AS_CASE([$build_type], [dev*|pre*], [enable_assertions=yes],
@@ -322,6 +340,15 @@ if test x$GXX = xyes; then
  ;;
   esac
   fi
+  if test x$enable_lto != xno ; then
+  case $gxx_version in
+ 4.7*|4.8*)
+ lyx_flags="$lyx_flags link-time-optimization"
+ CFLAGS="$lto_opt $CFLAGS"
+ CXXFLAGS="$lto_opt $CXXFLAGS"
+ ;;
+  esac
+  fi
 fi
 test "$lyx_pch_comp" = yes && lyx_flags="$lyx_flags pch"
 AM_CONDITIONAL(LYX_BUILD_PCH, test "$lyx_pch_comp" = yes)
-- 
1.8.0



Re: [PATCH] config/lyxinclude.m4: add support for -flto

2012-10-24 Thread Jean-Marc Lasgouttes

Le 24/10/2012 13:13, Lars Gullik Bjønnes a écrit :

Add feature --enable-lto, link-time optimization.


Do you see a visible gain, that would make it worth using on release builds?

JMarc



[PATCH] Fix importation of noweb files with tex2lyx

2012-10-24 Thread Jean-Marc Lasgouttes
This is a patch for testing (Kayvan?) since I do not have the 
tools/knowledge. This allows proper importation of noweb files (at least 
as good as it used to be).


I also renamed the "literate" format. Tell me whether this is a problem.

Finally, is there a reason why the Scrap layout is not Chunk, like it is 
in noweb documentation? Where does this scrap term come from?


I wanted to extend that to sweave/knitr, but I have two problems:

* knitr should have its own file extension
* we need proper verbatim reading to make things work. There are too 
many strange characters in R code.


JMarc

>From 254498696f3245909446b3b1ec7cee2a18dae4e4 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes 
Date: Wed, 24 Oct 2012 15:20:46 +0200
Subject: [PATCH] Fix importation of noweb files with tex2lyx

This handles correctly the noweb module instead of the old literate-xxx classes. Next step will be to get rid of these classes.

I also used this occasion to rename format "literate" to "noweb".
---
 lib/configure.py |8 
 src/tex2lyx/Preamble.cpp |2 --
 src/tex2lyx/tex2lyx.cpp  |4 ++--
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/lib/configure.py b/lib/configure.py
index 58234c0..164caf7 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -534,7 +534,7 @@ def checkFormatEntries(dtl_tools):
 \Format dotdot"Graphviz Dot"  "" ""	"%%"	"vector"	"text/vnd.graphviz"
 \Format dviluatex  tex"LaTeX (dviluatex)" "" "" "%%"	"document,menu=export"	""
 \Format platex tex"LaTeX (pLaTeX)""" "" "%%" 	"document,menu=export"	""
-\Format literate   nw  NoWeb  N  ""	"%%"	"document,menu=export"	""
+\Format noweb  nw  NoWeb  N  ""	"%%"	"document,menu=export"	""
 \Format sweave Rnw"Sweave"S  "" "%%"	"document,menu=export"	""
 \Format r  R  "R/S code"  "" "" "%%"	"document,menu=export"	""
 \Format knitr  Rnw"Rnw (knitr)"   "" "" "%%"	"document,menu=export"	""
@@ -646,14 +646,14 @@ def checkConverterEntries():
 
 path, t2l = checkProg('a LaTeX/Noweb -> LyX converter', [in_place, 'tex2lyx' + version_suffix, 'tex2lyx'],
 rc_entry = [r'''\converter latex  lyx"%% -f $$i $$o"	""
-\converter literate   lyx"%% -n -f $$i $$o"	""'''], not_found = 'tex2lyx')
+\converter noweb   lyx"%% -n -m noweb -f $$i $$o"	""'''], not_found = 'tex2lyx')
 if path == '':
 logger.warning("Failed to find tex2lyx on your system.")
 
 #
 checkProg('a Noweb -> LaTeX converter', ['noweave -delay -index $$i > $$o'],
-rc_entry = [r'''\converter literate   latex  "%%"	""
-\converter literate   pdflatex  "%%"	""'''])
+rc_entry = [r'''\converter noweb   latex  "%%"	""
+\converter noweb   pdflatex  "%%"	""'''])
 #
 checkProg('a Sweave -> LaTeX converter', ['Rscript --verbose --no-save --no-restore $$s/scripts/lyxsweave.R $$p$$i $$p$$o $$e $$r'],
 rc_entry = [r'''\converter sweave   latex  "%%"	""
diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index 430708c..86a420a 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -1632,8 +1632,6 @@ void Preamble::parse(Parser & p, string const & forceclass,
 	// Force textclass if the user wanted it
 	if (!forceclass.empty())
 		h_textclass = forceclass;
-	if (noweb_mode && !prefixIs(h_textclass, "literate-"))
-		h_textclass.insert(0, "literate-");
 	tc.setName(h_textclass);
 	if (!tc.load()) {
 		cerr << "Error: Could not read layout file for textclass \"" << h_textclass << "\"." << endl;
diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp
index 1abdecb..b288095 100644
--- a/src/tex2lyx/tex2lyx.cpp
+++ b/src/tex2lyx/tex2lyx.cpp
@@ -495,8 +495,7 @@ int parse_help(string const &, string const &)
 		"\t-copyfiles Copy all included files to the directory of outfile.lyx.\n"
 		"\t-e encodingSet the default encoding (latex name).\n"
 		"\t-f Force overwrite of .lyx files.\n"
-		"\t-help  Print this message and quit.\n"
-		"\t-n translate a noweb (aka literate programming) file.\n"
+		"\t-n literate programming mode (noweb).\n"
 		"\t-skipchildren  Do not translate included child documents.\n"
 		"\t-roundtrip re-export created .lyx file infile.lyx.lyx to infile.lyx.tex.\n"
 		"\t-s syntaxfile  read additional syntax file.\n"
@@ -504,6 +503,7 @@ int parse_help(string const &, string const &)
 		"\t   Default: " << package().system_support() << "\n"
 		"\t-userdir USERDIR   Set user directory to USERDIR.\n"
 		"\t   Default: " << package().user_support() << "\n"
+		"\t-help  Print this message and quit.\n"
 		"\t-version   Summarize version and build info.\n"
 		"Paths:\n"
 		"\tThe program searches for the files \"encodings\", 

Re: [PATCH 2/2] config/lyxinclude.m4: add support for --enable-cxx11

2012-10-24 Thread Richard Heck

On 10/23/2012 09:07 PM, Lars Gullik Bjønnes wrote:

Using --enable-cxx11 turns on C++11 mode in gcc.

Seems like a good idea.

rh



Re: [PATCH] Fix importation of noweb files with tex2lyx

2012-10-24 Thread Jean-Marc Lasgouttes

Le 24/10/2012 15:27, Jean-Marc Lasgouttes a écrit :

This is a patch for testing (Kayvan?) since I do not have the
tools/knowledge. This allows proper importation of noweb files (at least
as good as it used to be).


I know now that this patch is broken. Stay tuned for more soon.


I wanted to extend that to sweave/knitr, but I have two problems:

* knitr should have its own file extension
* we need proper verbatim reading to make things work. There are too
many strange characters in R code.


Actually it is not  verbatim problem but a clash with <>. 
However, I still have issues with line breaks.


JMarc



Re: [PATCH] Fix importation of noweb files with tex2lyx

2012-10-24 Thread Kayvan Sylvan
Ok, thanks. I'll test your updated patch when you finish it.

On Wed, Oct 24, 2012 at 7:21 AM, Jean-Marc Lasgouttes wrote:

> Le 24/10/2012 15:27, Jean-Marc Lasgouttes a écrit :
>
>  This is a patch for testing (Kayvan?) since I do not have the
>> tools/knowledge. This allows proper importation of noweb files (at least
>> as good as it used to be).
>>
>
> I know now that this patch is broken. Stay tuned for more soon.
>
>


Re: [LyX master] Add support for the URW Classico (Optima) LaTeX font

2012-10-24 Thread Jürgen Spitzmüller
2012/10/23 Georg Baum:
> Please update src/tex2lyx/TODO.txt

Done.

> and the tex2lyx test cases with the new
> format (they are currently failing). The latter can be done using
>
> make updatetests
>
> in the src/tex2lyx sub folder of the build tree.

This fails for me with

/usr/bin/python "./test/runtests.py" ./tex2lyx ../../../lib/scripts "./test"
Traceback (most recent call last):
  File "./test/runtests.py", line 84, in 
main(sys.argv)
  File "./test/runtests.py", line 32, in main
from lyxpreview_tools import error
ImportError: No module named lyxpreview_tools

also when I pass the path to the scripts dir explicitly on the cl.

Jürgen

> Georg


Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-24 Thread André Pönitz
On Wed, Oct 24, 2012 at 01:27:40AM +0200, Lars Gullik Bjønnes wrote:
> André Pönitz  writes:
> 
> | On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
> >> From: Lars Gullik Bjønnes 
> >> 
> >> Use a local typedef pair P to avoid having to repeat
> >> that multiple times.
> >> ---
> >>  src/lyxfind.cpp | 72
> >> -
> >>  1 file changed, 40 insertions(+), 32 deletions(-)
> >> 
> >> diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
> >> index a19724b..33dbd8a 100644
> >> --- a/src/lyxfind.cpp
> >> +++ b/src/lyxfind.cpp
> >> @@ -495,54 +495,62 @@ typedef vector > Escapes;
> >>  /// @note Beware of order
> >>  Escapes const & get_regexp_escapes()
> >>  {
> >> +  typedef std::pair P;
> >> +
> >
> | Conveniently adding a std:: or three, so next time the discussion
> | comes up we can reasonably claim that it is used "inconsistently"
> | and the 'using' on top could go...
> 
> What is your agenda really?

Preventing attempts to turn the LyX code base into a guinea pig for
programming experiments again. Especially the kind of experiment that
add a burden for others.

Andre'


Re: [LyX master] Add support for the URW Classico (Optima) LaTeX font

2012-10-24 Thread Georg Baum
Jürgen Spitzmüller wrote:

> This fails for me with
> 
> /usr/bin/python "./test/runtests.py" ./tex2lyx ../../../lib/scripts
> "./test" Traceback (most recent call last):
>   File "./test/runtests.py", line 84, in 
> main(sys.argv)
>   File "./test/runtests.py", line 32, in main
> from lyxpreview_tools import error
> ImportError: No module named lyxpreview_tools
> 
> also when I pass the path to the scripts dir explicitly on the cl.

Does it work now? There was an assumption that the build tree was below the 
source tree which I forgot about.


Georg



Re: [PATCH] config/lyxinclude.m4: add support for -flto

2012-10-24 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes  writes:

| Le 24/10/2012 13:13, Lars Gullik Bjønnes a écrit :
>> Add feature --enable-lto, link-time optimization.
>
| Do you see a visible gain, that would make it worth using on release builds?

textdatabss   dec  hexfilename
8042443 28616   39624 8110683  7bc25b src/lyx-flto
8912062 31888   40760 8984710  891886 src/lyx

(or there about). If that is enough gain to be worth it? Dunno.

It if faster is not that easy to measure.

-- 
   Lgb



Re: [PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-24 Thread Lars Gullik Bjønnes
André Pönitz  writes:

| On Wed, Oct 24, 2012 at 01:27:40AM +0200, Lars Gullik Bjønnes wrote:
>> André Pönitz  writes:
>> 
>> | On Tue, Oct 23, 2012 at 11:14:42PM +0200, lar...@gullik.org wrote:
>> >> From: Lars Gullik Bjønnes 
>> >> 
>> >> Use a local typedef pair P to avoid having to repeat
>> >> that multiple times.
>> >> ---
>> >>  src/lyxfind.cpp | 72
>> >> -
>> >>  1 file changed, 40 insertions(+), 32 deletions(-)
>> >> 
>> >> diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
>> >> index a19724b..33dbd8a 100644
>> >> --- a/src/lyxfind.cpp
>> >> +++ b/src/lyxfind.cpp
>> >> @@ -495,54 +495,62 @@ typedef vector > Escapes;
>> >>  /// @note Beware of order
>> >>  Escapes const & get_regexp_escapes()
>> >>  {
>> >> + typedef std::pair P;
>> >> +
>> >
>> | Conveniently adding a std:: or three, so next time the discussion
>> | comes up we can reasonably claim that it is used "inconsistently"
>> | and the 'using' on top could go...
>> 
>> What is your agenda really?
>
| Preventing attempts to turn the LyX code base into a guinea pig for
| programming experiments again. Especially the kind of experiment that
| add a burden for others.

Since you are not doing any, perhaps you should let those that do
decide? I am not going to push anything without a +1 anyway.

-- 
   Lgb



Re: [PATCH 2/2] config/lyxinclude.m4: add support for --enable-cxx11

2012-10-24 Thread Lars Gullik Bjønnes
Richard Heck  writes:

| On 10/23/2012 09:07 PM, Lars Gullik Bjønnes wrote:
>> Using --enable-cxx11 turns on C++11 mode in gcc.
| Seems like a good idea.

I will have to commit 1/2 in this series as well.

Ok?

-- 
   Lgb



Re: [PATCH] config/lyxinclude.m4: add support for -flto

2012-10-24 Thread Jean-Marc Lasgouttes

Le 24/10/12 22:18, Lars Gullik Bjønnes a écrit :

Jean-Marc Lasgouttes  writes:

| Le 24/10/2012 13:13, Lars Gullik Bjønnes a écrit :

Add feature --enable-lto, link-time optimization.



| Do you see a visible gain, that would make it worth using on release builds?

textdatabss   dec  hexfilename
8042443 28616   39624 8110683  7bc25b src/lyx-flto
8912062 31888   40760 8984710  891886 src/lyx

(or there about). If that is enough gain to be worth it? Dunno.

It if faster is not that easy to measure.


And is the link significantly more painful (time/memory)?

JMarc



Re: [PATCH] config/lyxinclude.m4: add support for -flto

2012-10-24 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes  writes:

| Le 24/10/12 22:18, Lars Gullik Bjønnes a écrit :
>> Jean-Marc Lasgouttes  writes:
>>
>> | Le 24/10/2012 13:13, Lars Gullik Bjønnes a écrit :
 Add feature --enable-lto, link-time optimization.
>>>
>> | Do you see a visible gain, that would make it worth using on release 
>> builds?
>>
>> textdatabss   dec  hexfilename
>> 8042443 28616   39624 8110683  7bc25b src/lyx-flto
>> 8912062 31888   40760 8984710  891886 src/lyx
>>
>> (or there about). If that is enough gain to be worth it? Dunno.
>>
>> It if faster is not that easy to measure.
>
| And is the link significantly more painful (time/memory)?

Oh, yes to both.
All optimization is redone, although wiht -flto=6 will will run the
optmization/assembly 6-way paralell so it is not that bad on a multicore
machine. Also you can compile with "-flto -O0" and link with "-flto
-O2". So you might get a huge speed bonus on the compiling and only way
when linking/optimizing.

As a side note:

textdatabss   dec  hexfilename
8817187 31904   40760 8889851  87a5fb src/lyx-cxx11

(Most likely due to rvalue-references and move semantics.)

-- 
   Lgb



Re: [PATCH] Fix importation of noweb files with tex2lyx

2012-10-24 Thread Yihui Xie
Gregor may know the history of "Scrap"; that term has been there ever
since I started using LyX/Sweave, and I never know how it came in.

Noweb is only one of the implementations of literate programming (to
beat Knuth's WEB), so I guess "literate" may actually be a better
name.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Oct 24, 2012 at 8:27 AM, Jean-Marc Lasgouttes
 wrote:
> This is a patch for testing (Kayvan?) since I do not have the
> tools/knowledge. This allows proper importation of noweb files (at least as
> good as it used to be).
>
> I also renamed the "literate" format. Tell me whether this is a problem.
>
> Finally, is there a reason why the Scrap layout is not Chunk, like it is in
> noweb documentation? Where does this scrap term come from?
>
> I wanted to extend that to sweave/knitr, but I have two problems:
>
> * knitr should have its own file extension
> * we need proper verbatim reading to make things work. There are too many
> strange characters in R code.
>
> JMarc
>


Re: [LyX master] Add support for the URW Classico (Optima) LaTeX font

2012-10-24 Thread Jürgen Spitzmüller
2012/10/24 Georg Baum:
> Does it work now? There was an assumption that the build tree was below the
> source tree which I forgot about.

Yes. Not all tests passed (since I do not have gnumeric installed, for
instance), but I committed the updated files.

Hope this is all correct.

Jürgen

> Georg
>


google app for lyx?

2012-10-24 Thread xPol
I am thinking about the possibilty to retrive lyx file from google 
repository (so called 'drive'), pass it to lyx on my station, edit and 
save the modified file then upload to google drive as a new version. 
(google drive manages doc versions).

Would an app for google be useful and easy to build?

thank you
paolo