Re: Approaching LyX 1.6.3 [status update #2]

2009-05-27 Thread Jürgen Spitzmüller
Georg Baum wrote:

 What about this small fix for external boost detection?
 
 Since I do not feel competent for the build stuff, I'd like to hear
 someone else's (JMarc's?) take on this.
 
 In any case, at this stage in the cycle, this should only go in if we are
 really sure it does not break anything else.
 
 Sure (but please be aware that the current version is almost completely
 broken: It only works reliably if somebody builds a multithreaded boost
 using the single threaded naming scheme. I don't know what happens if you
 link against a true single threaded boost, you might be lucky, or get
 spurious problems at runtime).

Still waiting for some expertise ...

Jürgen




Re: possible Windows LyX 1.6.3 release blocker

2009-05-27 Thread Uwe Stöhr

Uwe Stöhr schrieb:


configure.py breaks at this check:

checking LaTeX configuration...   default values
+checking list of textclasses...
Layout file C:/Program Files (x86)/LyX 
1.6.3/bin/../Resources\layouts\manpage.layout has no \DeclareXXClass line.

done


Can anybody please take care of this? When I remember it correctly, we have removed LinuxDoc support 
but this file declares a LinuxDoc class.


I investigated a bit deeper and the reason is a broken 
hyph-es.tex file so that MiKTeX cannot build any format.


The MikTeX developer is not willing to fix this since it is not his fault. So I have to contact the 
author of the file hyph-es.tex.


regards Uwe


Re: r29856 - lyx-devel/trunk/config

2009-05-27 Thread Abdelrazak Younes

b...@lyx.org wrote:

Author: baum
Date: Tue May 26 21:50:37 2009
New Revision: 29856
URL: http://www.lyx.org/trac/changeset/29856



+BOOST_FILESYSTEM = -lboost_filesystem$(BOOST_MT)


AFAIR we don't use boost_filesystem anymore (neither in 1.6 nor in 
trunk). Not sure about boost_iostreams but I would say so too.


Abdel.



Re: [PATCH] outputformat tag for literate programming

2009-05-27 Thread Jean-Marc Lasgouttes
Jean-Marc Lasgouttes jean-marc.lasgout...@inria.fr writes:

 This patch allows the sweave module to work our of the box (when R is
 installed, of course). 

The attached patch fixes the recognition of the module by adding a new
feature one can test against: from-to, wheich tests whether the is a
way to convert 'from' to 'to'. The sweave module depends on the feature
sweave-latex. I think this is the best way to convey what we want
(and it was easy to implement!).

 The only reason why I did not commit it yet is that I do not know
 whether I have to increase the layout format, considering that I have
 nothing to update here.

This is my next step, using Richard's patch.

JMarc


Re: changeset/29734

2009-05-27 Thread Jean-Marc Lasgouttes
Uwe Stöhr uwesto...@web.de writes:

 Jean-Marc Lasgouttes schrieb:

 What I can do right now, until I have a proper way to check for R, is to
 remove the condition on Sweave.sty. Would that seem better to you for
 now?

 Yes.

I'll do that for branch (after 1.6.3), but I have a good solution for
trunk (see other message).

JMarc


Re: Show disabled OptItems

2009-05-27 Thread Jean-Marc Lasgouttes
Vincent van Ravesteijn v.f.vanraveste...@tudelft.nl writes:

 This patch enables to show even disabled OptItems.

 I found that this is wanted sometimes. Example: An inlined equation
 does not have a label and thus no copy as reference, so these can be
 hidden. When the equation is displayed, you can insert a label. But,
 as long as there is no label inserted, copy as reference will be
 disabled, but I'd like to show it disabled.

What is the difference with an Item then?

JMarc


Re: Documentation of tex2lyx

2009-05-27 Thread Jean-Marc Lasgouttes
Lavaud Michel michel.lav...@cegetel.net writes:

 Hello,

 Would it be possible, for Windows users, to have tex2lyx documentation
 in html form in addition to Unix man form? As far as I know, there is
 no user-friendly man viewer for Windows (except Emacs)? I suppose the
 source of the doc is in texinfo, so html output could be generated
 automatically ?

This is a very good point. In the old days, the man page was produced
from a lyx document, but this is not true anymore...

Anyone has a good idea?

JMarc


Re: Approaching LyX 1.6.3 [status update #2]

2009-05-27 Thread Jean-Marc Lasgouttes
Richard heck rgh...@bobjweil.com writes:
 I don't think JMarc and I really know quite what to do yet. This is in
 part because tex2lyx does not produce a suitable format. Until it
 does

I thought you would try to backport some of the code from trunk... This
is enough for this bug AFAIR.

JMarc


Re: Approaching LyX 1.6.3 [status update #2]

2009-05-27 Thread Jean-Marc Lasgouttes
Jürgen Spitzmüller sp...@lyx.org writes:

 Georg Baum wrote:
  A short message: I think we are ready.

 What about this small fix for external boost detection?

 Since I do not feel competent for the build stuff, I'd like to hear someone 
 else's (JMarc's?) take on this.

I do not have much ideas at this point.

JMarc


RE: Show disabled OptItems

2009-05-27 Thread Vincent van Ravesteijn - TNW
 
 This patch enables to show even disabled OptItems.

 I found that this is wanted sometimes. Example: An inlined equation 
 does not have a label and thus no copy as reference, so these can be 
 hidden. When the equation is displayed, you can insert a label. But, 
 as long as there is no label inserted, copy as reference will be 
 disabled, but I'd like to show it disabled.

What is the difference with an Item then?


An Item can be on/off, an OptItem can be on/hidden, but sometimes you
might want an item to be on/off/hidden.

Jmarc

Vincent


Re: [PATCH] outputformat tag for literate programming

2009-05-27 Thread Jean-Marc Lasgouttes
Jean-Marc Lasgouttes jean-marc.lasgout...@inria.fr writes:

 Jean-Marc Lasgouttes jean-marc.lasgout...@inria.fr writes:

 This patch allows the sweave module to work our of the box (when R is
 installed, of course). 

 The attached patch fixes the recognition of the module by adding a new
 feature one can test against: from-to, wheich tests whether the is a
 way to convert 'from' to 'to'. The sweave module depends on the feature
 sweave-latex. I think this is the best way to convey what we want
 (and it was easy to implement!).

With the patch now.

JMarc

svndiff

Index: src/TextClass.cpp
===
--- src/TextClass.cpp	(révision 29865)
+++ src/TextClass.cpp	(copie de travail)
@@ -127,6 +127,7 @@ InsetLayout DocumentClass::plain_insetla
 TextClass::TextClass()
 {
 	outputType_ = LATEX;
+	outputFormat_ = latex;
 	columns_ = 1;
 	sides_ = OneSide;
 	secnumdepth_ = 3;
@@ -160,6 +161,7 @@ bool TextClass::readStyle(Lexer  lexrc,
 
 enum TextClassTags {
 	TC_OUTPUTTYPE = 1,
+	TC_OUTPUTFORMAT,
 	TC_INPUT,
 	TC_STYLE,
 	TC_DEFAULTSTYLE,
@@ -208,6 +210,7 @@ namespace {
 		{ leftmargin,  TC_LEFTMARGIN },
 		{ nofloat, TC_NOFLOAT },
 		{ nostyle, TC_NOSTYLE },
+		{ outputformat,TC_OUTPUTFORMAT },
 		{ outputtype,  TC_OUTPUTTYPE },
 		{ pagestyle,   TC_PAGESTYLE },
 		{ preamble,TC_PREAMBLE },
@@ -352,8 +355,24 @@ TextClass::ReturnValues TextClass::read(
 format = lexrc.getInteger();
 			break;
 
-		case TC_OUTPUTTYPE:   // output type definition
+		case TC_OUTPUTFORMAT:
+			if (lexrc.next())
+outputFormat_ = lexrc.getString();
+			break;
+
+		case TC_OUTPUTTYPE:
 			readOutputType(lexrc);
+			switch(outputType_) {
+			case LATEX:
+outputFormat_ = latex;
+break;
+			case DOCBOOK:
+outputFormat_ = docbook;
+break;
+			case LITERATE:
+outputFormat_ = literate;
+break;
+			}
 			break;
 
 		case TC_INPUT: // Include file
Index: src/TextClass.h
===
--- src/TextClass.h	(révision 29865)
+++ src/TextClass.h	(copie de travail)
@@ -191,6 +191,8 @@ public:
 	std::string const  latexname() const { return latexname_; }
 	/// Can be LaTeX, DocBook, etc.
 	OutputType outputType() const { return outputType_; }
+	/// Can be latex, docbook ... (the name of a format)
+	std::string outputFormat() const { return outputFormat_; }
 protected:
 	/// Protect construction
 	TextClass();
@@ -272,6 +274,8 @@ protected:
 	int tocdepth_;
 	/// Can be LaTeX, DocBook, etc.
 	OutputType outputType_;
+	/// Can be latex, docbook ... (the name of a format)
+	std::string outputFormat_;
 	/** Base font. The paragraph and layout fonts are resolved against
 	this font. This has to be fully instantiated. Attributes
 	FONT_INHERIT, FONT_IGNORE, and FONT_TOGGLE are
@@ -406,8 +410,6 @@ public:
 	int max_toclevel() const { return max_toclevel_; }
 	/// returns true if the class has a ToC structure
 	bool hasTocLevels() const;
-	/// Can be LaTeX, DocBook, etc.
-	OutputType outputType() const { return outputType_; }
 protected:
 	/// Constructs a DocumentClass based upon a LayoutFile.
 	DocumentClass(LayoutFile const  tc);
Index: src/frontends/qt4/GuiLog.cpp
===
--- src/frontends/qt4/GuiLog.cpp	(révision 29865)
+++ src/frontends/qt4/GuiLog.cpp	(copie de travail)
@@ -150,6 +150,7 @@ bool GuiLog::initialiseParams(string con
 
 	if (logtype == latex)
 		type_ = LatexLog;
+	// FIXME: not sure literate still works.
 	else if (logtype == literate)
 		type_ = LiterateLog;
 	else if (logtype == lyx2lyx)
Index: src/LaTeXFeatures.cpp
===
--- src/LaTeXFeatures.cpp	(révision 29865)
+++ src/LaTeXFeatures.cpp	(copie de travail)
@@ -19,6 +19,7 @@
 #include Buffer.h
 #include BufferParams.h
 #include ColorSet.h
+#include Converter.h
 #include Encoding.h
 #include Floating.h
 #include FloatList.h
@@ -370,6 +371,14 @@ bool LaTeXFeatures::mustProvide(string c
 
 bool LaTeXFeatures::isAvailable(string const  name)
 {
+	string::size_type const i = name.find(-);
+	if (i != string::npos) {
+		string const from = name.substr(0,i);
+		string const to = name.substr(i+2);
+		LYXERR0(from=[  from  ] to=[  to  ]);
+		return theConverters().isReachable(from, to);
+	}
+
 	if (packages_.empty())
 		getAvailable();
 	string n = name;
Index: src/Buffer.cpp
===
--- src/Buffer.cpp	(révision 29865)
+++ src/Buffer.cpp	(copie de travail)
@@ -459,10 +459,12 @@ string Buffer::logName(LogType * type) c
 	FileName const fname(addName(temppath(),
  onlyFilename(changeExtension(filename,
   .log;
+
+	// FIXME: how do we know this is the name of the build log?
 	FileName const bname(
 		addName(path, onlyFilename(
 			changeExtension(filename,
-	formats.extension(literate) + .out;
+	

Re: Show disabled OptItems

2009-05-27 Thread Jean-Marc Lasgouttes
Vincent van Ravesteijn - TNW v.f.vanraveste...@tudelft.nl writes:
What is the difference with an Item then?

 An Item can be on/off, an OptItem can be on/hidden, but sometimes you
 might want an item to be on/off/hidden.

In what situation would your item be hidden then? Sorry if I am a bit
dense today :)

JMarc


RE: Show disabled OptItems

2009-05-27 Thread Vincent van Ravesteijn - TNW
What is the difference with an Item then?

 An Item can be on/off, an OptItem can be on/hidden, but sometimes you

 might want an item to be on/off/hidden.

In what situation would your item be hidden then? Sorry if I am a bit
dense today :)

Jmarc


It would be hidden by default if the item is disabled, unless you call
status.showAlways(true) (or another name).

I'll repeat the example I gave..

An inline equation can't have a label, so in the context menu, the items
Equation Label and Copy as Ref are hidden. When you change the
equation to a display Equation, both items will appear, but Copy as
Ref will be disabled as long as you don't insert a label.

I like this better than that for almost every action, new items
appear/disappear in the context menu. There must be other cases for
which this holds..



Vincent


Re: Show disabled OptItems

2009-05-27 Thread Jean-Marc Lasgouttes
Vincent van Ravesteijn - TNW v.f.vanraveste...@tudelft.nl writes:
 It would be hidden by default if the item is disabled, unless you call
 status.showAlways(true) (or another name).

OK.

 An inline equation can't have a label, so in the context menu, the items
 Equation Label and Copy as Ref are hidden. When you change the
 equation to a display Equation, both items will appear, but Copy as
 Ref will be disabled as long as you don't insert a label.

What if the inset says that it does not handle the lfun when the
equation is inline? The item will go away even if it is not optional,
won't it?

 I like this better than that for almost every action, new items
 appear/disappear in the context menu. There must be other cases for
 which this holds..

I think the distinction between 'do not handle' and 'handle but is
disabled' captures what you want. It might even be that all uses of
OptItem could be replaced by that in the code.

JMarc


Re: Show disabled OptItems

2009-05-27 Thread Vincent van Ravesteijn



An inline equation can't have a label, so in the context menu, the items
Equation Label and Copy as Ref are hidden. When you change the
equation to a display Equation, both items will appear, but Copy as
Ref will be disabled as long as you don't insert a label.



What if the inset says that it does not handle the lfun when the
equation is inline? The item will go away even if it is not optional,
won't it?

  
No. It's just for optional items. It's ignored for normal items. Don't 
know how to make it more elegant. Maybe we can switch dynamically 
between an Item and an OptItem.

I like this better than that for almost every action, new items
appear/disappear in the context menu. There must be other cases for
which this holds..



I think the distinction between 'do not handle' and 'handle but is
disabled' captures what you want. It might even be that all uses of
OptItem could be replaced by that in the code.
  


Well, it's a not-so-very-well-defined difference in my opinion. At least 
in my example, it would be both 'handle but is disabled'.

JMarc
  


Vincent


Re: Approaching LyX 1.6.3 [status update #2]

2009-05-27 Thread Sven Hoexter
On Tue, May 26, 2009 at 11:23:56PM +0200, Pavel Sanda wrote:
 Sven Hoexter wrote:
  I don't know what other distributions currently do with relation to the 
  boost
  changes. At least Fedora seems to provide the single threaded version with
  the old naming and the multi threaded version in the same package.
 
 please can you be more verbose about the whole issue or provide some link?
 we should probably put some notice in release notes what version of boost we
 support?

http://lists.alioth.debian.org/pipermail/pkg-lyx-devel/2009-May/003244.html

For other possible variations:
http://www.boost.org/doc/libs/1_39_0/more/getting_started/unix-variants.html#id36
(I don't think that sane distributions use the whole possible range of
'information' in the soname.)

Sven
-- 
forevermore


Re: Show disabled OptItems

2009-05-27 Thread Jean-Marc Lasgouttes
Vincent van Ravesteijn v.f.vanraveste...@tudelft.nl writes:
 I think the distinction between 'do not handle' and 'handle but is
 disabled' captures what you want. It might even be that all uses of
 OptItem could be replaced by that in the code.

 Well, it's a not-so-very-well-defined difference in my opinion. At
 least in my example, it would be both 'handle but is disabled'.

In my view, it boils down to have enabled/disabled/notapplicable. With
the following untested trivial patch, all lfuns that do not get handled
by _someone_ become unknown() (which is admittedly a bit strong, but
efficient). This means that getStatus for inline equation can say that
COPY_AS_REF does not make sense for an inline equation and in this sense
cannot be implemented. If inline equations and display equations had
two separate implmentations, we would have implemented COPY_AS_REF only in the
second case, anyway. 

A second problem I have with your proposal, is that the new flag
describes an effect on the interface, and not a property of the
lfun/inset couple.

Does the attached patch make sense? It does not work (yet) but I did not
have time to debug it.

JMarc

svndiff src/mathed/InsetMathHull.cpp src/LyXFunc.cpp lib/ui/stdcontext.inc

Index: src/mathed/InsetMathHull.cpp
===
--- src/mathed/InsetMathHull.cpp	(révision 29865)
+++ src/mathed/InsetMathHull.cpp	(copie de travail)
@@ -1388,13 +1388,19 @@ bool InsetMathHull::getStatus(Cursor  c
 	}
 
 	case LFUN_LABEL_INSERT:
-		status.setEnabled(type_ != hullSimple);
+		if (type_ == hullSimple)
+			// the lfun makes no sense for inline math
+			return false;
+		status.setEnabled(true);
 		return true;
 
 	case LFUN_LABEL_COPY_AS_REF: {
 		bool enabled = false;
 		row_type row;
 		if (cmd.argument().empty()  cur.inset() == this) {
+			if (type_ == hullSimple)
+// the lfun makes no sense for inline math
+return false;
 			// if there is no argument and we're inside math, we retrieve
 			// the row number from the cursor position.
 			row = (type_ == hullMultline) ? nrows() - 1 : cur.row();
Index: src/LyXFunc.cpp
===
--- src/LyXFunc.cpp	(révision 29866)
+++ src/LyXFunc.cpp	(copie de travail)
@@ -684,7 +684,11 @@ FuncStatus LyXFunc::getStatus(FuncReques
 			decided = view()-getStatus(cmd, flag);
 		if (!decided)
 			// try the Buffer
-			view()-buffer().getStatus(cmd, flag);
+			decided = view()-buffer().getStatus(cmd, flag);
+		if (!decided) {
+			lyxerr Unknown lfun   cmd endl;
+			flag.unknown(true);
+		}
 	}
 
 	if (!enable)
Index: lib/ui/stdcontext.inc
===
--- lib/ui/stdcontext.inc	(révision 29865)
+++ lib/ui/stdcontext.inc	(copie de travail)
@@ -46,7 +46,7 @@ Menuset
 		OptItem Number whole Formula|N math-number-toggle
 		OptItem Number this Line|u math-number-line-toggle
 		OptItem Equation Label|L label-insert
-		OptItem Copy as Reference|R copy-label-as-reference
+		Item Copy as Reference|R copy-label-as-reference
 		Separator
 		Item Split Cell|C cell-split
 		Separator


Re: Documentation of tex2lyx

2009-05-27 Thread Enrico Forestieri
On Wed, May 27, 2009 at 04:05:32PM +0200, Jean-Marc Lasgouttes wrote:
 Lavaud Michel michel.lav...@cegetel.net writes:
 
  Hello,
 
  Would it be possible, for Windows users, to have tex2lyx documentation
  in html form in addition to Unix man form? As far as I know, there is
  no user-friendly man viewer for Windows (except Emacs)? I suppose the
  source of the doc is in texinfo, so html output could be generated
  automatically ?
 
 This is a very good point. In the old days, the man page was produced
 from a lyx document, but this is not true anymore...
 
 Anyone has a good idea?

Use man2html?

Attached what I get when running it on the raw tex2lyx.1in

-- 
Enrico


Re: Documentation of tex2lyx

2009-05-27 Thread Enrico Forestieri
On Wed, May 27, 2009 at 07:56:00PM +0200, Enrico Forestieri wrote:
 On Wed, May 27, 2009 at 04:05:32PM +0200, Jean-Marc Lasgouttes wrote:
  Lavaud Michel michel.lav...@cegetel.net writes:
  
   Hello,
  
   Would it be possible, for Windows users, to have tex2lyx documentation
   in html form in addition to Unix man form? As far as I know, there is
   no user-friendly man viewer for Windows (except Emacs)? I suppose the
   source of the doc is in texinfo, so html output could be generated
   automatically ?
  
  This is a very good point. In the old days, the man page was produced
  from a lyx document, but this is not true anymore...
  
  Anyone has a good idea?
 
 Use man2html?
 
 Attached what I get when running it on the raw tex2lyx.1in

Hmm... I can swear I attached it. Trying again but compressed this time
(maybe there's a filter that strips html attachments).


-- 
Enrico


tex2lyx.html.gz
Description: application/gunzip


Too many alternatives and options...

2009-05-27 Thread Enrico Forestieri
This happens in trunk.

1) Move apart the preferences file
   (mv ~/.lyx-2.0/preferences ~/.lyx-2.0/preferences.save)
2) In Tools-Preferences, change something and then save.
3) Now load a document with some bibliography and try to view the output.
4) References are missing [??] because bibtex failed.

Looking at ~/.lyx-2.0/preferences I see these lines:

...
#
# MISC SECTION ##
#

\bibtex_alternatives bibtex
\bibtex_alternatives bibtex8
\bibtex_alternatives bibtex
\bibtex_alternatives bibtex8
\bibtex_command bibtex bibtex
\index_alternatives makeindex -c -q
\index_alternatives makeindex -c -q
...

So, bibtex is failing because it is called in the wrong way.
Looking at Tools-Preferences-Output-LaTeX, the Options field for
bibtex contains bibtex, which explains the bogus \bibtex_command
above.

Removing bibtex from Options fixes it, however, anytime the preferences
are saved, the number of \bibtex_alternatives and \index_alternatives
lines that are written to the preferences file increases.

I think that this is due to the following code in LyXRC.cpp:

case RC_BIBTEX_ALTERNATIVES:
if (ignore_system_lyxrc ||
bibtex_alternatives != system_lyxrc.bibtex_alternatives) {
for (vectorstring::const_iterator it = 
bibtex_alternatives.begin();
 it != bibtex_alternatives.end(); ++it)
os  \\bibtex_alternatives \  *it  \\n;
}


Here, bibtex_alternatives and system_lyxrc.bibtex_alternatives are two
different vectors, such that the check
bibtex_alternatives != system_lyxrc.bibtex_alternatives
is always true. Same story for index_alternatives.

I have still to investigate the bogus bibtex option problem.

-- 
Enrico


Re: Too many alternatives and options...

2009-05-27 Thread Enrico Forestieri
On Wed, May 27, 2009 at 09:06:35PM +0200, Enrico Forestieri wrote:
 Removing bibtex from Options fixes it, however, anytime the preferences
 are saved, the number of \bibtex_alternatives and \index_alternatives
 lines that are written to the preferences file increases.
 
 I think that this is due to the following code in LyXRC.cpp:
 
 case RC_BIBTEX_ALTERNATIVES:
   if (ignore_system_lyxrc ||
   bibtex_alternatives != system_lyxrc.bibtex_alternatives) {
   for (vectorstring::const_iterator it = 
 bibtex_alternatives.begin();
it != bibtex_alternatives.end(); ++it)
   os  \\bibtex_alternatives \  *it  \\n;
   }
 
 
 Here, bibtex_alternatives and system_lyxrc.bibtex_alternatives are two
 different vectors, such that the check
 bibtex_alternatives != system_lyxrc.bibtex_alternatives
 is always true. Same story for index_alternatives.

The attached patch fixes the multiple-times-written alternatives problem.

-- 
Enrico
Index: src/LyXRC.cpp
===
--- src/LyXRC.cpp   (revisione 29866)
+++ src/LyXRC.cpp   (copia locale)
@@ -1370,15 +1370,35 @@ void LyXRC::write(ostream  os, bool ign
}
if (tag != RC_LAST)
break;
-   case RC_BIBTEX_ALTERNATIVES:
-   if (ignore_system_lyxrc ||
-   bibtex_alternatives != system_lyxrc.bibtex_alternatives) {
-   for (vectorstring::const_iterator it = 
bibtex_alternatives.begin();
-it != bibtex_alternatives.end(); ++it)
-   os  \\bibtex_alternatives \  *it  \\n;
+   case RC_BIBTEX_ALTERNATIVES: {
+   vectorstring::const_iterator beg = 
bibtex_alternatives.begin();
+   vectorstring::const_iterator end = bibtex_alternatives.end();
+   if (ignore_system_lyxrc) {
+   for (vectorstring::const_iterator it = beg;
+it != end; ++it)
+   os  \\bibtex_alternatives \
+   *it  \\n;
+   } else {
+   vectorstring::const_iterator sbeg =
+   system_lyxrc.bibtex_alternatives.begin();
+   vectorstring::const_iterator send =
+   system_lyxrc.bibtex_alternatives.end();
+   for (vectorstring::const_iterator it = beg;
+   it != end; ++it) {
+   bool found = false;
+   for (vectorstring::const_iterator sit = sbeg;
+   sit != send; ++sit) {
+   if (*it == *sit)
+   found = true;
+   }
+   if (!found)
+   os  \\bibtex_alternatives \
+   *it  \\n;
+   }
}
if (tag != RC_LAST)
break;
+   }
case RC_BIBTEX_COMMAND:
if (ignore_system_lyxrc ||
bibtex_command != system_lyxrc.bibtex_command) {
@@ -1393,15 +1413,35 @@ void LyXRC::write(ostream  os, bool ign
}
if (tag != RC_LAST)
break;
-   case RC_INDEX_ALTERNATIVES:
-   if (ignore_system_lyxrc ||
-   index_alternatives != system_lyxrc.index_alternatives) {
-   for (vectorstring::const_iterator it = 
index_alternatives.begin();
-it != index_alternatives.end(); ++it)
-   os  \\index_alternatives \  *it  \\n;
+   case RC_INDEX_ALTERNATIVES: {
+   vectorstring::const_iterator beg = index_alternatives.begin();
+   vectorstring::const_iterator end = index_alternatives.end();
+   if (ignore_system_lyxrc) {
+   for (vectorstring::const_iterator it = beg;
+it != end; ++it)
+   os  \\index_alternatives \
+   *it  \\n;
+   } else {
+   vectorstring::const_iterator sbeg =
+   system_lyxrc.index_alternatives.begin();
+   vectorstring::const_iterator send =
+   system_lyxrc.index_alternatives.end();
+   for (vectorstring::const_iterator it = beg;
+   it != end; ++it) {
+   bool found = false;
+   for (vectorstring::const_iterator sit = sbeg;
+

Re: Documentation of tex2lyx

2009-05-27 Thread Guenter Milde
On 2009-05-27, Jean-Marc Lasgouttes wrote:
 Lavaud Michel michel.lav...@cegetel.net writes:


 Would it be possible, for Windows users, to have tex2lyx documentation
 in html form in addition to Unix man form? 

 This is a very good point. In the old days, the man page was produced
 from a lyx document, but this is not true anymore...

 Anyone has a good idea?

Use reStructuredText for the source and generate HTML, LaTeX and man from it
(there is a rst2manpage converter in the Docutils sandbox and as Debian
package).

Günter



Re: Show disabled OptItems

2009-05-27 Thread Vincent van Ravesteijn

Jean-Marc Lasgouttes schreef:

Does the attached patch make sense? It does not work (yet) but I did not
have time to debug it.

  
It makes sense, but it doesn't work because BufferView::getStatus() 
always returns true for LFUN_LABEL_COPY_AS_REF.


Second, when InsetMathHull is asked for the status of LABEL_INSERT, it 
_should_ return that it handles the LFUN, even when the math is inlined. 
Otherwise, LyXFunc::getStatus will ask the view and the buffer, and the 
item will always be enabled, because you can (almost) always insert a 
label in the document. In this case, you want to have another option : 
I do not handle the lfun, but I do have the authority to decide that 
you shouldn't ask anyone else.


Vincent


Hartmut has created updated screenshots for the LyX Graphical Tour

2009-05-27 Thread Christian Ridderström

Hi,

Hartmut has created updated screenshots for the LyX Graphical Tour. 
According to him, these screenshots require a slight update to the text in 
the graphical tour, so for now I've place the new images in the 
subdirectory

 images/LGT/En

If anyone (perhaps the original authors) would like to update the text 
accordingly, that'd be great. Otherwise we'll still have the old text and 
the old images, and translators are free to use the old images, the new 
images or send me localized versions of screenshots.


Best regards
/Christian

PS. Hartmut, maybe you could briefly mention what the differences are in 
the pictures, and/or what made you think it was time for better 
screenshots?


--
Christian Ridderström   Mobile: +46-70 687 39 44

request to delete the file manpage.layout

2009-05-27 Thread Uwe Stöhr
manpage.layout declares a LinuxDoc class, but we removed LinuxDoc support in LyX some time ago. So I 
opt to delete this layout file.

OK?

regards Uwe


Re: Show disabled OptItems

2009-05-27 Thread Jean-Marc Lasgouttes

Le 27 mai 09 à 23:08, Vincent van Ravesteijn a écrit :
It makes sense, but it doesn't work because BufferView::getStatus()  
always returns true for LFUN_LABEL_COPY_AS_REF.


Second, when InsetMathHull is asked for the status of LABEL_INSERT,  
it _should_ return that it handles the LFUN, even when the math is  
inlined. Otherwise, LyXFunc::getStatus will ask the view and the  
buffer, and the item will always be enabled, because you can  
(almost) always insert a label in the document. In this case, you  
want to have another option : I do not handle the lfun, but I do  
have the authority to decide that you shouldn't ask anyone else.


Those are both good reasons. My first idea (use unknown()) would still  
work, but it is a bit contrived.


I'll sleep over it.

JMarc

Re: request to delete the file manpage.layout

2009-05-27 Thread Jean-Marc Lasgouttes

Le 27 mai 09 à 23:36, Uwe Stöhr a écrit :
manpage.layout declares a LinuxDoc class, but we removed LinuxDoc  
support in LyX some time ago. So I opt to delete this layout file.

OK?


José said it is OK there, but I forgot about it...
http://thread.gmane.org/gmane.editors.lyx.devel/112377/focus=112686

Please remove it (at least in trunk)

JMarc




Re: request to delete the file manpage.layout

2009-05-27 Thread Uwe Stöhr

Jean-Marc Lasgouttes schrieb:

manpage.layout declares a LinuxDoc class, but we removed LinuxDoc 
support in LyX some time ago. So I opt to delete this layout file.

OK?


José said it is OK there, but I forgot about it...
http://thread.gmane.org/gmane.editors.lyx.devel/112377/focus=112686

Please remove it (at least in trunk)


Done.

Jürgen, can this go in branch too? It only makes there problems, see 
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg151617.html


regards Uwe


Re: Too many alternatives and options...

2009-05-27 Thread Enrico Forestieri
On Wed, May 27, 2009 at 10:03:53PM +0200, Enrico Forestieri wrote:
 On Wed, May 27, 2009 at 09:06:35PM +0200, Enrico Forestieri wrote:
  Removing bibtex from Options fixes it, however, anytime the preferences
  are saved, the number of \bibtex_alternatives and \index_alternatives
  lines that are written to the preferences file increases.
  
  I think that this is due to the following code in LyXRC.cpp:
  
  case RC_BIBTEX_ALTERNATIVES:
  if (ignore_system_lyxrc ||
  bibtex_alternatives != system_lyxrc.bibtex_alternatives) {
  for (vectorstring::const_iterator it = 
  bibtex_alternatives.begin();
   it != bibtex_alternatives.end(); ++it)
  os  \\bibtex_alternatives \  *it  \\n;
  }
  
  
  Here, bibtex_alternatives and system_lyxrc.bibtex_alternatives are two
  different vectors, such that the check
  bibtex_alternatives != system_lyxrc.bibtex_alternatives
  is always true. Same story for index_alternatives.
 
 The attached patch fixes the multiple-times-written alternatives problem.

The Options problem is instead cured by this patch. There still is the line
\bibtex_command bibtex 
written to the preferences file (notice the trailing space), meaning that
another off-by-one error is still hidden somewhere, but at least this
doesn't cause any problem, seemingly.

-- 
Enrico
Index: src/frontends/qt4/GuiPrefs.cpp
===
--- src/frontends/qt4/GuiPrefs.cpp  (revisione 29866)
+++ src/frontends/qt4/GuiPrefs.cpp  (copia locale)
@@ -631,10 +631,9 @@ void PrefLatex::on_latexBibtexCO_activat
QString const bib = toqstr(*it);
int ind = bib.indexOf( );
QString sel_command = bib.left(ind);
-   QString sel_options = bib;
-   sel_options.remove(0, ind);
+   QString sel_options = ind  0 ? QString() : bib.mid(ind + 1);
if (bibtex == sel_command) {
-   if (ind == -1)
+   if (ind  0)
latexBibtexED-clear();
else
latexBibtexED-setText(sel_options.trimmed());
@@ -657,10 +656,9 @@ void PrefLatex::on_latexIndexCO_activate
QString const idx = toqstr(*it);
int ind = idx.indexOf( );
QString sel_command = idx.left(ind);
-   QString sel_options = idx;
-   sel_options.remove(0, ind);
+   QString sel_options = ind  0 ? QString() : idx.mid(ind + 1);
if (index == sel_command) {
-   if (ind == -1)
+   if (ind  0)
latexIndexED-clear();
else
latexIndexED-setText(sel_options.trimmed());
@@ -717,8 +715,7 @@ void PrefLatex::update(LyXRC const  rc)
QString const bib = toqstr(rc.bibtex_command);
int ind = bib.indexOf( );
QString sel_command = bib.left(ind);
-   QString sel_options = bib;
-   sel_options.remove(0, ind);
+   QString sel_options = ind  0 ? QString() : bib.mid(ind + 1);
 
int pos = latexBibtexCO-findData(sel_command);
if (pos != -1) {
@@ -745,8 +742,7 @@ void PrefLatex::update(LyXRC const  rc)
QString const idx = toqstr(rc.index_command);
ind = idx.indexOf( );
sel_command = idx.left(ind);
-   sel_options = idx;
-   sel_options.remove(0, ind);
+   sel_options = ind  0 ? QString() : idx.mid(ind + 1);
 
pos = latexIndexCO-findData(sel_command);
if (pos != -1) {


Re: Too many alternatives and options...

2009-05-27 Thread Enrico Forestieri
On Thu, May 28, 2009 at 12:10:48AM +0200, Enrico Forestieri wrote:
 There still is the line
 \bibtex_command bibtex 
 written to the preferences file (notice the trailing space), meaning that
 another off-by-one error is still hidden somewhere, but at least this
 doesn't cause any problem, seemingly.

This is also fixed, now.

-- 
Enrico


Re: Approaching LyX 1.6.3 [status update #2]

2009-05-27 Thread Jürgen Spitzmüller
Georg Baum wrote:

>>> What about this small fix for external boost detection?
>> 
>> Since I do not feel competent for the build stuff, I'd like to hear
>> someone else's (JMarc's?) take on this.
>> 
>> In any case, at this stage in the cycle, this should only go in if we are
>> really sure it does not break anything else.
> 
> Sure (but please be aware that the current version is almost completely
> broken: It only works reliably if somebody builds a multithreaded boost
> using the single threaded naming scheme. I don't know what happens if you
> link against a true single threaded boost, you might be lucky, or get
> spurious problems at runtime).

Still waiting for some expertise ...

Jürgen




Re: possible Windows LyX 1.6.3 release blocker

2009-05-27 Thread Uwe Stöhr

Uwe Stöhr schrieb:


configure.py breaks at this check:

checking LaTeX configuration...   default values
+checking list of textclasses...
Layout file C:/Program Files (x86)/LyX 
1.6.3/bin/../Resources\layouts\manpage.layout has no \DeclareXXClass line.

done


Can anybody please take care of this? When I remember it correctly, we have removed LinuxDoc support 
but this file declares a LinuxDoc class.


I investigated a bit deeper and the reason is a broken 
"hyph-es.tex" file so that MiKTeX cannot build any format.


The MikTeX developer is not willing to fix this since it is not his fault. So I have to contact the 
author of the file "hyph-es.tex".


regards Uwe


Re: r29856 - lyx-devel/trunk/config

2009-05-27 Thread Abdelrazak Younes

b...@lyx.org wrote:

Author: baum
Date: Tue May 26 21:50:37 2009
New Revision: 29856
URL: http://www.lyx.org/trac/changeset/29856



+BOOST_FILESYSTEM = -lboost_filesystem$(BOOST_MT)


AFAIR we don't use boost_filesystem anymore (neither in 1.6 nor in 
trunk). Not sure about boost_iostreams but I would say so too.


Abdel.



Re: [PATCH] outputformat tag for literate programming

2009-05-27 Thread Jean-Marc Lasgouttes
Jean-Marc Lasgouttes  writes:

> This patch allows the sweave module to work our of the box (when R is
> installed, of course). 

The attached patch fixes the recognition of the module by adding a new
"feature" one can test against: from->to, wheich tests whether the is a
way to convert 'from' to 'to'. The sweave module depends on the feature
"sweave->latex". I think this is the best way to convey what we want
(and it was easy to implement!).

> The only reason why I did not commit it yet is that I do not know
> whether I have to increase the layout format, considering that I have
> nothing to update here.

This is my next step, using Richard's patch.

JMarc


Re: changeset/29734

2009-05-27 Thread Jean-Marc Lasgouttes
Uwe Stöhr  writes:

> Jean-Marc Lasgouttes schrieb:
>
>> What I can do right now, until I have a proper way to check for R, is to
>> remove the condition on Sweave.sty. Would that seem better to you for
>> now?
>
> Yes.

I'll do that for branch (after 1.6.3), but I have a good solution for
trunk (see other message).

JMarc


Re: Show disabled OptItems

2009-05-27 Thread Jean-Marc Lasgouttes
Vincent van Ravesteijn  writes:

> This patch enables to show even disabled OptItems.
>
> I found that this is wanted sometimes. Example: An inlined equation
> does not have a label and thus no copy as reference, so these can be
> hidden. When the equation is displayed, you can insert a label. But,
> as long as there is no label inserted, copy as reference will be
> disabled, but I'd like to show it disabled.

What is the difference with an "Item" then?

JMarc


Re: Documentation of tex2lyx

2009-05-27 Thread Jean-Marc Lasgouttes
Lavaud Michel  writes:

> Hello,
>
> Would it be possible, for Windows users, to have tex2lyx documentation
> in html form in addition to Unix man form? As far as I know, there is
> no user-friendly man viewer for Windows (except Emacs)? I suppose the
> source of the doc is in texinfo, so html output could be generated
> automatically ?

This is a very good point. In the old days, the man page was produced
from a lyx document, but this is not true anymore...

Anyone has a good idea?

JMarc


Re: Approaching LyX 1.6.3 [status update #2]

2009-05-27 Thread Jean-Marc Lasgouttes
Richard heck  writes:
> I don't think JMarc and I really know quite what to do yet. This is in
> part because tex2lyx does not produce a suitable format. Until it
> does

I thought you would try to backport some of the code from trunk... This
is enough for this bug AFAIR.

JMarc


Re: Approaching LyX 1.6.3 [status update #2]

2009-05-27 Thread Jean-Marc Lasgouttes
Jürgen Spitzmüller  writes:

> Georg Baum wrote:
>> > A short message: I think we are ready.
>>
>> What about this small fix for external boost detection?
>
> Since I do not feel competent for the build stuff, I'd like to hear someone 
> else's (JMarc's?) take on this.

I do not have much ideas at this point.

JMarc


RE: Show disabled OptItems

2009-05-27 Thread Vincent van Ravesteijn - TNW
 
>> This patch enables to show even disabled OptItems.
>>
>> I found that this is wanted sometimes. Example: An inlined equation 
>> does not have a label and thus no copy as reference, so these can be 
>> hidden. When the equation is displayed, you can insert a label. But, 
>> as long as there is no label inserted, copy as reference will be 
>> disabled, but I'd like to show it disabled.
>
>What is the difference with an "Item" then?
>

An Item can be on/off, an OptItem can be on/hidden, but sometimes you
might want an item to be on/off/hidden.

>Jmarc

Vincent


Re: [PATCH] outputformat tag for literate programming

2009-05-27 Thread Jean-Marc Lasgouttes
Jean-Marc Lasgouttes  writes:

> Jean-Marc Lasgouttes  writes:
>
>> This patch allows the sweave module to work our of the box (when R is
>> installed, of course). 
>
> The attached patch fixes the recognition of the module by adding a new
> "feature" one can test against: from->to, wheich tests whether the is a
> way to convert 'from' to 'to'. The sweave module depends on the feature
> "sweave->latex". I think this is the best way to convey what we want
> (and it was easy to implement!).

With the patch now.

JMarc

svndiff

Index: src/TextClass.cpp
===
--- src/TextClass.cpp	(révision 29865)
+++ src/TextClass.cpp	(copie de travail)
@@ -127,6 +127,7 @@ InsetLayout DocumentClass::plain_insetla
 TextClass::TextClass()
 {
 	outputType_ = LATEX;
+	outputFormat_ = "latex";
 	columns_ = 1;
 	sides_ = OneSide;
 	secnumdepth_ = 3;
@@ -160,6 +161,7 @@ bool TextClass::readStyle(Lexer & lexrc,
 
 enum TextClassTags {
 	TC_OUTPUTTYPE = 1,
+	TC_OUTPUTFORMAT,
 	TC_INPUT,
 	TC_STYLE,
 	TC_DEFAULTSTYLE,
@@ -208,6 +210,7 @@ namespace {
 		{ "leftmargin",  TC_LEFTMARGIN },
 		{ "nofloat", TC_NOFLOAT },
 		{ "nostyle", TC_NOSTYLE },
+		{ "outputformat",TC_OUTPUTFORMAT },
 		{ "outputtype",  TC_OUTPUTTYPE },
 		{ "pagestyle",   TC_PAGESTYLE },
 		{ "preamble",TC_PREAMBLE },
@@ -352,8 +355,24 @@ TextClass::ReturnValues TextClass::read(
 format = lexrc.getInteger();
 			break;
 
-		case TC_OUTPUTTYPE:   // output type definition
+		case TC_OUTPUTFORMAT:
+			if (lexrc.next())
+outputFormat_ = lexrc.getString();
+			break;
+
+		case TC_OUTPUTTYPE:
 			readOutputType(lexrc);
+			switch(outputType_) {
+			case LATEX:
+outputFormat_ = "latex";
+break;
+			case DOCBOOK:
+outputFormat_ = "docbook";
+break;
+			case LITERATE:
+outputFormat_ = "literate";
+break;
+			}
 			break;
 
 		case TC_INPUT: // Include file
Index: src/TextClass.h
===
--- src/TextClass.h	(révision 29865)
+++ src/TextClass.h	(copie de travail)
@@ -191,6 +191,8 @@ public:
 	std::string const & latexname() const { return latexname_; }
 	/// Can be LaTeX, DocBook, etc.
 	OutputType outputType() const { return outputType_; }
+	/// Can be latex, docbook ... (the name of a format)
+	std::string outputFormat() const { return outputFormat_; }
 protected:
 	/// Protect construction
 	TextClass();
@@ -272,6 +274,8 @@ protected:
 	int tocdepth_;
 	/// Can be LaTeX, DocBook, etc.
 	OutputType outputType_;
+	/// Can be latex, docbook ... (the name of a format)
+	std::string outputFormat_;
 	/** Base font. The paragraph and layout fonts are resolved against
 	this font. This has to be fully instantiated. Attributes
 	FONT_INHERIT, FONT_IGNORE, and FONT_TOGGLE are
@@ -406,8 +410,6 @@ public:
 	int max_toclevel() const { return max_toclevel_; }
 	/// returns true if the class has a ToC structure
 	bool hasTocLevels() const;
-	/// Can be LaTeX, DocBook, etc.
-	OutputType outputType() const { return outputType_; }
 protected:
 	/// Constructs a DocumentClass based upon a LayoutFile.
 	DocumentClass(LayoutFile const & tc);
Index: src/frontends/qt4/GuiLog.cpp
===
--- src/frontends/qt4/GuiLog.cpp	(révision 29865)
+++ src/frontends/qt4/GuiLog.cpp	(copie de travail)
@@ -150,6 +150,7 @@ bool GuiLog::initialiseParams(string con
 
 	if (logtype == "latex")
 		type_ = LatexLog;
+	// FIXME: not sure "literate" still works.
 	else if (logtype == "literate")
 		type_ = LiterateLog;
 	else if (logtype == "lyx2lyx")
Index: src/LaTeXFeatures.cpp
===
--- src/LaTeXFeatures.cpp	(révision 29865)
+++ src/LaTeXFeatures.cpp	(copie de travail)
@@ -19,6 +19,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "ColorSet.h"
+#include "Converter.h"
 #include "Encoding.h"
 #include "Floating.h"
 #include "FloatList.h"
@@ -370,6 +371,14 @@ bool LaTeXFeatures::mustProvide(string c
 
 bool LaTeXFeatures::isAvailable(string const & name)
 {
+	string::size_type const i = name.find("->");
+	if (i != string::npos) {
+		string const from = name.substr(0,i);
+		string const to = name.substr(i+2);
+		LYXERR0("from=[" << from << "] to=[" << to << "]");
+		return theConverters().isReachable(from, to);
+	}
+
 	if (packages_.empty())
 		getAvailable();
 	string n = name;
Index: src/Buffer.cpp
===
--- src/Buffer.cpp	(révision 29865)
+++ src/Buffer.cpp	(copie de travail)
@@ -459,10 +459,12 @@ string Buffer::logName(LogType * type) c
 	FileName const fname(addName(temppath(),
  onlyFilename(changeExtension(filename,
   ".log";
+
+	// FIXME: how do we know this is the name of the build log?
 	FileName const bname(
 		addName(path, 

Re: Show disabled OptItems

2009-05-27 Thread Jean-Marc Lasgouttes
"Vincent van Ravesteijn - TNW"  writes:
>>What is the difference with an "Item" then?
>
> An Item can be on/off, an OptItem can be on/hidden, but sometimes you
> might want an item to be on/off/hidden.

In what situation would your item be hidden then? Sorry if I am a bit
dense today :)

JMarc


RE: Show disabled OptItems

2009-05-27 Thread Vincent van Ravesteijn - TNW
>>>What is the difference with an "Item" then?
>>
>> An Item can be on/off, an OptItem can be on/hidden, but sometimes you

>> might want an item to be on/off/hidden.
>
>In what situation would your item be hidden then? Sorry if I am a bit
dense today :)
>
>Jmarc
>

It would be hidden by default if the item is disabled, unless you call
status.showAlways(true) (or another name).

I'll repeat the example I gave..

An inline equation can't have a label, so in the context menu, the items
"Equation Label" and "Copy as Ref" are hidden. When you change the
equation to a display Equation, both items will appear, but "Copy as
Ref" will be disabled as long as you don't insert a label.

I like this better than that for almost every action, new items
appear/disappear in the context menu. There must be other cases for
which this holds..



Vincent


Re: Show disabled OptItems

2009-05-27 Thread Jean-Marc Lasgouttes
"Vincent van Ravesteijn - TNW"  writes:
> It would be hidden by default if the item is disabled, unless you call
> status.showAlways(true) (or another name).

OK.

> An inline equation can't have a label, so in the context menu, the items
> "Equation Label" and "Copy as Ref" are hidden. When you change the
> equation to a display Equation, both items will appear, but "Copy as
> Ref" will be disabled as long as you don't insert a label.

What if the inset says that it does not handle the lfun when the
equation is inline? The item will go away even if it is not optional,
won't it?

> I like this better than that for almost every action, new items
> appear/disappear in the context menu. There must be other cases for
> which this holds..

I think the distinction between 'do not handle' and 'handle but is
disabled' captures what you want. It might even be that all uses of
OptItem could be replaced by that in the code.

JMarc


Re: Show disabled OptItems

2009-05-27 Thread Vincent van Ravesteijn



An inline equation can't have a label, so in the context menu, the items
"Equation Label" and "Copy as Ref" are hidden. When you change the
equation to a display Equation, both items will appear, but "Copy as
Ref" will be disabled as long as you don't insert a label.



What if the inset says that it does not handle the lfun when the
equation is inline? The item will go away even if it is not optional,
won't it?

  
No. It's just for optional items. It's ignored for normal items. Don't 
know how to make it more elegant. Maybe we can switch dynamically 
between an Item and an OptItem.

I like this better than that for almost every action, new items
appear/disappear in the context menu. There must be other cases for
which this holds..



I think the distinction between 'do not handle' and 'handle but is
disabled' captures what you want. It might even be that all uses of
OptItem could be replaced by that in the code.
  


Well, it's a not-so-very-well-defined difference in my opinion. At least 
in my example, it would be both 'handle but is disabled'.

JMarc
  


Vincent


Re: Approaching LyX 1.6.3 [status update #2]

2009-05-27 Thread Sven Hoexter
On Tue, May 26, 2009 at 11:23:56PM +0200, Pavel Sanda wrote:
> Sven Hoexter wrote:
> > I don't know what other distributions currently do with relation to the 
> > boost
> > changes. At least Fedora seems to provide the single threaded version with
> > the old naming and the multi threaded version in the same package.
> 
> please can you be more verbose about the whole issue or provide some link?
> we should probably put some notice in release notes what version of boost we
> support?

http://lists.alioth.debian.org/pipermail/pkg-lyx-devel/2009-May/003244.html

For other possible variations:
http://www.boost.org/doc/libs/1_39_0/more/getting_started/unix-variants.html#id36
(I don't think that sane distributions use the whole possible range of
'information' in the soname.)

Sven
-- 
forevermore


Re: Show disabled OptItems

2009-05-27 Thread Jean-Marc Lasgouttes
Vincent van Ravesteijn  writes:
>> I think the distinction between 'do not handle' and 'handle but is
>> disabled' captures what you want. It might even be that all uses of
>> OptItem could be replaced by that in the code.
>
> Well, it's a not-so-very-well-defined difference in my opinion. At
> least in my example, it would be both 'handle but is disabled'.

In my view, it boils down to have enabled/disabled/notapplicable. With
the following untested trivial patch, all lfuns that do not get handled
by _someone_ become unknown() (which is admittedly a bit strong, but
efficient). This means that getStatus for inline equation can say that
COPY_AS_REF does not make sense for an inline equation and in this sense
cannot be implemented. If inline equations and display equations had
two separate implmentations, we would have implemented COPY_AS_REF only in the
second case, anyway. 

A second problem I have with your proposal, is that the new flag
describes an effect on the interface, and not a property of the
lfun/inset couple.

Does the attached patch make sense? It does not work (yet) but I did not
have time to debug it.

JMarc

svndiff src/mathed/InsetMathHull.cpp src/LyXFunc.cpp lib/ui/stdcontext.inc

Index: src/mathed/InsetMathHull.cpp
===
--- src/mathed/InsetMathHull.cpp	(révision 29865)
+++ src/mathed/InsetMathHull.cpp	(copie de travail)
@@ -1388,13 +1388,19 @@ bool InsetMathHull::getStatus(Cursor & c
 	}
 
 	case LFUN_LABEL_INSERT:
-		status.setEnabled(type_ != hullSimple);
+		if (type_ == hullSimple)
+			// the lfun makes no sense for inline math
+			return false;
+		status.setEnabled(true);
 		return true;
 
 	case LFUN_LABEL_COPY_AS_REF: {
 		bool enabled = false;
 		row_type row;
 		if (cmd.argument().empty() && () == this) {
+			if (type_ == hullSimple)
+// the lfun makes no sense for inline math
+return false;
 			// if there is no argument and we're inside math, we retrieve
 			// the row number from the cursor position.
 			row = (type_ == hullMultline) ? nrows() - 1 : cur.row();
Index: src/LyXFunc.cpp
===
--- src/LyXFunc.cpp	(révision 29866)
+++ src/LyXFunc.cpp	(copie de travail)
@@ -684,7 +684,11 @@ FuncStatus LyXFunc::getStatus(FuncReques
 			decided = view()->getStatus(cmd, flag);
 		if (!decided)
 			// try the Buffer
-			view()->buffer().getStatus(cmd, flag);
+			decided = view()->buffer().getStatus(cmd, flag);
+		if (!decided) {
+			lyxerr <<"Unknown lfun " << cmd <

Re: Documentation of tex2lyx

2009-05-27 Thread Enrico Forestieri
On Wed, May 27, 2009 at 04:05:32PM +0200, Jean-Marc Lasgouttes wrote:
> Lavaud Michel  writes:
> 
> > Hello,
> >
> > Would it be possible, for Windows users, to have tex2lyx documentation
> > in html form in addition to Unix man form? As far as I know, there is
> > no user-friendly man viewer for Windows (except Emacs)? I suppose the
> > source of the doc is in texinfo, so html output could be generated
> > automatically ?
> 
> This is a very good point. In the old days, the man page was produced
> from a lyx document, but this is not true anymore...
> 
> Anyone has a good idea?

Use man2html?

Attached what I get when running it on the raw tex2lyx.1in

-- 
Enrico


Re: Documentation of tex2lyx

2009-05-27 Thread Enrico Forestieri
On Wed, May 27, 2009 at 07:56:00PM +0200, Enrico Forestieri wrote:
> On Wed, May 27, 2009 at 04:05:32PM +0200, Jean-Marc Lasgouttes wrote:
> > Lavaud Michel  writes:
> > 
> > > Hello,
> > >
> > > Would it be possible, for Windows users, to have tex2lyx documentation
> > > in html form in addition to Unix man form? As far as I know, there is
> > > no user-friendly man viewer for Windows (except Emacs)? I suppose the
> > > source of the doc is in texinfo, so html output could be generated
> > > automatically ?
> > 
> > This is a very good point. In the old days, the man page was produced
> > from a lyx document, but this is not true anymore...
> > 
> > Anyone has a good idea?
> 
> Use man2html?
> 
> Attached what I get when running it on the raw tex2lyx.1in

Hmm... I can swear I attached it. Trying again but compressed this time
(maybe there's a filter that strips html attachments).


-- 
Enrico


tex2lyx.html.gz
Description: application/gunzip


Too many alternatives and options...

2009-05-27 Thread Enrico Forestieri
This happens in trunk.

1) Move apart the preferences file
   (mv ~/.lyx-2.0/preferences ~/.lyx-2.0/preferences.save)
2) In Tools->Preferences, change something and then save.
3) Now load a document with some bibliography and try to view the output.
4) References are missing [??] because bibtex failed.

Looking at ~/.lyx-2.0/preferences I see these lines:

...
#
# MISC SECTION ##
#

\bibtex_alternatives "bibtex"
\bibtex_alternatives "bibtex8"
\bibtex_alternatives "bibtex"
\bibtex_alternatives "bibtex8"
\bibtex_command "bibtex bibtex"
\index_alternatives "makeindex -c -q"
\index_alternatives "makeindex -c -q"
...

So, bibtex is failing because it is called in the wrong way.
Looking at Tools->Preferences->Output->LaTeX, the Options field for
bibtex contains "bibtex", which explains the bogus \bibtex_command
above.

Removing "bibtex" from Options fixes it, however, anytime the preferences
are saved, the number of \bibtex_alternatives and \index_alternatives
lines that are written to the preferences file increases.

I think that this is due to the following code in LyXRC.cpp:

case RC_BIBTEX_ALTERNATIVES:
if (ignore_system_lyxrc ||
bibtex_alternatives != system_lyxrc.bibtex_alternatives) {
for (vector::const_iterator it = 
bibtex_alternatives.begin();
 it != bibtex_alternatives.end(); ++it)
os << "\\bibtex_alternatives \"" << *it << "\"\n";
}


Here, bibtex_alternatives and system_lyxrc.bibtex_alternatives are two
different vectors, such that the check
bibtex_alternatives != system_lyxrc.bibtex_alternatives
is always true. Same story for index_alternatives.

I have still to investigate the bogus "bibtex" option problem.

-- 
Enrico


Re: Too many alternatives and options...

2009-05-27 Thread Enrico Forestieri
On Wed, May 27, 2009 at 09:06:35PM +0200, Enrico Forestieri wrote:
> Removing "bibtex" from Options fixes it, however, anytime the preferences
> are saved, the number of \bibtex_alternatives and \index_alternatives
> lines that are written to the preferences file increases.
> 
> I think that this is due to the following code in LyXRC.cpp:
> 
> case RC_BIBTEX_ALTERNATIVES:
>   if (ignore_system_lyxrc ||
>   bibtex_alternatives != system_lyxrc.bibtex_alternatives) {
>   for (vector::const_iterator it = 
> bibtex_alternatives.begin();
>it != bibtex_alternatives.end(); ++it)
>   os << "\\bibtex_alternatives \"" << *it << "\"\n";
>   }
> 
> 
> Here, bibtex_alternatives and system_lyxrc.bibtex_alternatives are two
> different vectors, such that the check
> bibtex_alternatives != system_lyxrc.bibtex_alternatives
> is always true. Same story for index_alternatives.

The attached patch fixes the multiple-times-written alternatives problem.

-- 
Enrico
Index: src/LyXRC.cpp
===
--- src/LyXRC.cpp   (revisione 29866)
+++ src/LyXRC.cpp   (copia locale)
@@ -1370,15 +1370,35 @@ void LyXRC::write(ostream & os, bool ign
}
if (tag != RC_LAST)
break;
-   case RC_BIBTEX_ALTERNATIVES:
-   if (ignore_system_lyxrc ||
-   bibtex_alternatives != system_lyxrc.bibtex_alternatives) {
-   for (vector::const_iterator it = 
bibtex_alternatives.begin();
-it != bibtex_alternatives.end(); ++it)
-   os << "\\bibtex_alternatives \"" << *it << "\"\n";
+   case RC_BIBTEX_ALTERNATIVES: {
+   vector::const_iterator beg = 
bibtex_alternatives.begin();
+   vector::const_iterator end = bibtex_alternatives.end();
+   if (ignore_system_lyxrc) {
+   for (vector::const_iterator it = beg;
+it != end; ++it)
+   os << "\\bibtex_alternatives \""
+  << *it << "\"\n";
+   } else {
+   vector::const_iterator sbeg =
+   system_lyxrc.bibtex_alternatives.begin();
+   vector::const_iterator send =
+   system_lyxrc.bibtex_alternatives.end();
+   for (vector::const_iterator it = beg;
+   it != end; ++it) {
+   bool found = false;
+   for (vector::const_iterator sit = sbeg;
+   sit != send; ++sit) {
+   if (*it == *sit)
+   found = true;
+   }
+   if (!found)
+   os << "\\bibtex_alternatives \""
+  << *it << "\"\n";
+   }
}
if (tag != RC_LAST)
break;
+   }
case RC_BIBTEX_COMMAND:
if (ignore_system_lyxrc ||
bibtex_command != system_lyxrc.bibtex_command) {
@@ -1393,15 +1413,35 @@ void LyXRC::write(ostream & os, bool ign
}
if (tag != RC_LAST)
break;
-   case RC_INDEX_ALTERNATIVES:
-   if (ignore_system_lyxrc ||
-   index_alternatives != system_lyxrc.index_alternatives) {
-   for (vector::const_iterator it = 
index_alternatives.begin();
-it != index_alternatives.end(); ++it)
-   os << "\\index_alternatives \"" << *it << "\"\n";
+   case RC_INDEX_ALTERNATIVES: {
+   vector::const_iterator beg = index_alternatives.begin();
+   vector::const_iterator end = index_alternatives.end();
+   if (ignore_system_lyxrc) {
+   for (vector::const_iterator it = beg;
+it != end; ++it)
+   os << "\\index_alternatives \""
+  << *it << "\"\n";
+   } else {
+   vector::const_iterator sbeg =
+   system_lyxrc.index_alternatives.begin();
+   vector::const_iterator send =
+   system_lyxrc.index_alternatives.end();
+   for (vector::const_iterator it = beg;
+   it != end; ++it) {
+   bool found = false;
+   for (vector::const_iterator sit = sbeg;
+  

Re: Documentation of tex2lyx

2009-05-27 Thread Guenter Milde
On 2009-05-27, Jean-Marc Lasgouttes wrote:
> Lavaud Michel  writes:


>> Would it be possible, for Windows users, to have tex2lyx documentation
>> in html form in addition to Unix man form? 

> This is a very good point. In the old days, the man page was produced
> from a lyx document, but this is not true anymore...

> Anyone has a good idea?

Use reStructuredText for the source and generate HTML, LaTeX and man from it
(there is a rst2manpage converter in the Docutils sandbox and as Debian
package).

Günter



Re: Show disabled OptItems

2009-05-27 Thread Vincent van Ravesteijn

Jean-Marc Lasgouttes schreef:

Does the attached patch make sense? It does not work (yet) but I did not
have time to debug it.

  
It makes sense, but it doesn't work because BufferView::getStatus() 
always returns true for LFUN_LABEL_COPY_AS_REF.


Second, when InsetMathHull is asked for the status of LABEL_INSERT, it 
_should_ return that it handles the LFUN, even when the math is inlined. 
Otherwise, LyXFunc::getStatus will ask the view and the buffer, and the 
item will always be enabled, because you can (almost) always insert a 
label in the document. In this case, you want to have another option : 
"I do not handle the lfun, but I do have the authority to decide that 
you shouldn't ask anyone else".


Vincent


Hartmut has created updated screenshots for the LyX Graphical Tour

2009-05-27 Thread Christian Ridderström

Hi,

Hartmut has created updated screenshots for the LyX Graphical Tour. 
According to him, these screenshots require a slight update to the text in 
the graphical tour, so for now I've place the new images in the 
subdirectory

 images/LGT/En

If anyone (perhaps the original authors) would like to update the text 
accordingly, that'd be great. Otherwise we'll still have the old text and 
the old images, and translators are free to use the old images, the new 
images or send me localized versions of screenshots.


Best regards
/Christian

PS. Hartmut, maybe you could briefly mention what the differences are in 
the pictures, and/or what made you think it was time for better 
screenshots?


--
Christian Ridderström   Mobile: +46-70 687 39 44

request to delete the file "manpage.layout"

2009-05-27 Thread Uwe Stöhr
manpage.layout declares a LinuxDoc class, but we removed LinuxDoc support in LyX some time ago. So I 
opt to delete this layout file.

OK?

regards Uwe


Re: Show disabled OptItems

2009-05-27 Thread Jean-Marc Lasgouttes

Le 27 mai 09 à 23:08, Vincent van Ravesteijn a écrit :
It makes sense, but it doesn't work because BufferView::getStatus()  
always returns true for LFUN_LABEL_COPY_AS_REF.


Second, when InsetMathHull is asked for the status of LABEL_INSERT,  
it _should_ return that it handles the LFUN, even when the math is  
inlined. Otherwise, LyXFunc::getStatus will ask the view and the  
buffer, and the item will always be enabled, because you can  
(almost) always insert a label in the document. In this case, you  
want to have another option : "I do not handle the lfun, but I do  
have the authority to decide that you shouldn't ask anyone else".


Those are both good reasons. My first idea (use unknown()) would still  
work, but it is a bit contrived.


I'll sleep over it.

JMarc

Re: request to delete the file "manpage.layout"

2009-05-27 Thread Jean-Marc Lasgouttes

Le 27 mai 09 à 23:36, Uwe Stöhr a écrit :
manpage.layout declares a LinuxDoc class, but we removed LinuxDoc  
support in LyX some time ago. So I opt to delete this layout file.

OK?


José said it is OK there, but I forgot about it...
http://thread.gmane.org/gmane.editors.lyx.devel/112377/focus=112686

Please remove it (at least in trunk)

JMarc




Re: request to delete the file "manpage.layout"

2009-05-27 Thread Uwe Stöhr

Jean-Marc Lasgouttes schrieb:

manpage.layout declares a LinuxDoc class, but we removed LinuxDoc 
support in LyX some time ago. So I opt to delete this layout file.

OK?


José said it is OK there, but I forgot about it...
http://thread.gmane.org/gmane.editors.lyx.devel/112377/focus=112686

Please remove it (at least in trunk)


Done.

Jürgen, can this go in branch too? It only makes there problems, see 
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg151617.html


regards Uwe


Re: Too many alternatives and options...

2009-05-27 Thread Enrico Forestieri
On Wed, May 27, 2009 at 10:03:53PM +0200, Enrico Forestieri wrote:
> On Wed, May 27, 2009 at 09:06:35PM +0200, Enrico Forestieri wrote:
> > Removing "bibtex" from Options fixes it, however, anytime the preferences
> > are saved, the number of \bibtex_alternatives and \index_alternatives
> > lines that are written to the preferences file increases.
> > 
> > I think that this is due to the following code in LyXRC.cpp:
> > 
> > case RC_BIBTEX_ALTERNATIVES:
> > if (ignore_system_lyxrc ||
> > bibtex_alternatives != system_lyxrc.bibtex_alternatives) {
> > for (vector::const_iterator it = 
> > bibtex_alternatives.begin();
> >  it != bibtex_alternatives.end(); ++it)
> > os << "\\bibtex_alternatives \"" << *it << "\"\n";
> > }
> > 
> > 
> > Here, bibtex_alternatives and system_lyxrc.bibtex_alternatives are two
> > different vectors, such that the check
> > bibtex_alternatives != system_lyxrc.bibtex_alternatives
> > is always true. Same story for index_alternatives.
> 
> The attached patch fixes the multiple-times-written alternatives problem.

The Options problem is instead cured by this patch. There still is the line
\bibtex_command "bibtex "
written to the preferences file (notice the trailing space), meaning that
another off-by-one error is still hidden somewhere, but at least this
doesn't cause any problem, seemingly.

-- 
Enrico
Index: src/frontends/qt4/GuiPrefs.cpp
===
--- src/frontends/qt4/GuiPrefs.cpp  (revisione 29866)
+++ src/frontends/qt4/GuiPrefs.cpp  (copia locale)
@@ -631,10 +631,9 @@ void PrefLatex::on_latexBibtexCO_activat
QString const bib = toqstr(*it);
int ind = bib.indexOf(" ");
QString sel_command = bib.left(ind);
-   QString sel_options = bib;
-   sel_options.remove(0, ind);
+   QString sel_options = ind < 0 ? QString() : bib.mid(ind + 1);
if (bibtex == sel_command) {
-   if (ind == -1)
+   if (ind < 0)
latexBibtexED->clear();
else
latexBibtexED->setText(sel_options.trimmed());
@@ -657,10 +656,9 @@ void PrefLatex::on_latexIndexCO_activate
QString const idx = toqstr(*it);
int ind = idx.indexOf(" ");
QString sel_command = idx.left(ind);
-   QString sel_options = idx;
-   sel_options.remove(0, ind);
+   QString sel_options = ind < 0 ? QString() : idx.mid(ind + 1);
if (index == sel_command) {
-   if (ind == -1)
+   if (ind < 0)
latexIndexED->clear();
else
latexIndexED->setText(sel_options.trimmed());
@@ -717,8 +715,7 @@ void PrefLatex::update(LyXRC const & rc)
QString const bib = toqstr(rc.bibtex_command);
int ind = bib.indexOf(" ");
QString sel_command = bib.left(ind);
-   QString sel_options = bib;
-   sel_options.remove(0, ind);
+   QString sel_options = ind < 0 ? QString() : bib.mid(ind + 1);
 
int pos = latexBibtexCO->findData(sel_command);
if (pos != -1) {
@@ -745,8 +742,7 @@ void PrefLatex::update(LyXRC const & rc)
QString const idx = toqstr(rc.index_command);
ind = idx.indexOf(" ");
sel_command = idx.left(ind);
-   sel_options = idx;
-   sel_options.remove(0, ind);
+   sel_options = ind < 0 ? QString() : idx.mid(ind + 1);
 
pos = latexIndexCO->findData(sel_command);
if (pos != -1) {


Re: Too many alternatives and options...

2009-05-27 Thread Enrico Forestieri
On Thu, May 28, 2009 at 12:10:48AM +0200, Enrico Forestieri wrote:
> There still is the line
> \bibtex_command "bibtex "
> written to the preferences file (notice the trailing space), meaning that
> another off-by-one error is still hidden somewhere, but at least this
> doesn't cause any problem, seemingly.

This is also fixed, now.

-- 
Enrico