RE: Patch for crash on top-level inset-modify command

2010-03-03 Thread Vincent van Ravesteijn - TNW
   Upon following these steps, I consistently encoutered a crash.

1. New lyx doc.
2. Insert table (I chose 3x3)
3. Select entire table and invoke unset-all-lines from toolbar =
CRASH!


I think this is basically the same problem as bug #6553. 

We send an LFUN to the table, while the cursor is not in the table.
Also, the toolbar items for tables should all be disabled as we are not
in a table anymore.

Vincent


RE: Re: #6564: Crash on moving out of math-cases placed in table cell

2010-03-03 Thread Vincent van Ravesteijn - TNW

  Trac comments don't seem to go out to the lyx-devel list so I'm
forwarding this.

Those who are interested should look into the bug report once in a
while, or should add their name to the cc-list. I guess there's no need
to post it here.

Unless of course, you need some extra attention ;).

Vincent


Re: Branches…

2010-03-03 Thread Helge Hafting

jezZiFeR wrote:

Yes, this would be a way, but a uncomfortable way:
As my main text is very long and has lots of branches, it would be much 
more convenient, if there would be a possibility to disable the main 
text. Otherwise I would have to put quite a few parts into a new branch.

Is there no other way?


LyX offer no other way. There is no way to disable anything that is not
in some branch.

I can see two ways:
* Add all those branches to the rest.
* Make a copy of the document, where you delete what you don't want.

If you are a programmer, then you have more options:
* Make a script that removes anything not in a branch
  from a copy of the .lyx file. Then open the reduced copy
  in lyx, and print it. Might not be that hard, if
  you use a scripting language that is good for text
  processing.
* Or, make a script that stuffs everything that isn't in some
  branch already, into a new branch.
* If you know C++: implement what you want in LyX.

Helge Hafting




[Patch] fix #6574: ChkTeX selects entire paragraph, rather than just line where error occurs

2010-03-03 Thread John McCabe-Dansted
On Wed, Mar 3, 2010 at 11:38 AM, LyX Ticket Tracker t...@lyx.org wrote:
 #6574: ChkTeX selects entire paragraph, rather than just line where error 
 occurs.
 Ticket URL: http://www.lyx.org/trac/ticket/6574

This regression from LyX 1.6.x can be fixed just by adding the line
+   runparams.linelen = lyxrc.plaintext_linelen;
to Buffer::runChktex()

This cannot break anything other than Chktex (and as the primary user
of runChktex, I think I'd have noticed the breakage)

Shall we commit the attached patch now?

-- 
John C. McCabe-Dansted
Index: Buffer.cpp
===
--- Buffer.cpp	(revision 33612)
+++ Buffer.cpp	(working copy)
@@ -1607,6 +1607,7 @@
 	OutputParams runparams(params().encoding());
 	runparams.flavor = OutputParams::LATEX;
 	runparams.nice = false;
+	runparams.linelen = lyxrc.plaintext_linelen;
 	makeLaTeXFile(FileName(name), org_path, runparams);
 
 	TeXErrors terr;


Warning the user if the file is modified externally.

2010-03-03 Thread John McCabe-Dansted
Below I present very preliminary support for warning the user when
their LyX file is externally modified. Does the following approach
sound worthwhile?

When the buffer is marked dirty it checks if the file is modified
externally. This may avoid the need to merge at all. I suggest that we
also:
1) Checks every 1 minute if the file has been modified (Even if a
merge is required, the sooner the easier)
2) Checks if the file is modified when the Buffer gains (like kwrite)

Finally, I was thinking that when the file is under version control
LyX could poll the version control about every half hour to see if
there is a remote update. This should be subject to various
limitations
1) It should be off by default, so no unexpected network access shows
up in log files.
2) It should never poll anonymous svn servers, (we don't want e.g.
thousands of LyX users polling svn.lyx.org)
3) It should never poll read-only files, unless explicitly told to
poll these files, as these will never have merge conflicts.

The final dialog should look a lot like:
  http://www.ucc.asn.au/~mccabedj/KWrite.png
although it might be even nicer if we could redesign it as a pane as in:
  www.ucc.asn.au/~mccabedj/gedit.png

The following code is given as an example only. It needs much more work.
--
 void Buffer::markDirty()
 {
if (d-lyx_clean) {
+   // We may want to offer to revert to saved.
+   // We may want to present a similar warning when buffer is 
dirty,
possibly as a pane rather than a dialog.
+   if (d-checksum_ != 0  fileName().exists() 
isExternallyModified(checksum_method)){
+   docstring msg = _(You are modifying a document that is 
modified
externally.\nYou may want to \Revert to Saved\.\n);
+   Alert::warning(_(Document has been externally 
modified.), msg);
+   }
d-lyx_clean = false;
updateTitles();
}

-- 
John C. McCabe-Dansted


LyX's import/export capabilities advertised in the Features web-page

2010-03-03 Thread Νίκος Αλεξανδρής
Dear LyX developers,

in my post Import and export to many formats... [1] sent in the
lyx-users mailing list, Helge Hafting replied as seen below. His text
covers everything (?) and very precise.

My opinion about LyX's import/export capabilities is to super-compress
Helge's words, keep the positive stuff and replace/alter the text in the
Features web-page [2] that currently leaves the impression that
everything works out of the box.

For the records: I can't imagine myself working under M$' disorientating
environment (and I hope I'll never be forced to do so). However, the key
to get more users isn't only to self-improve LyX. It's also to make it
really cross-platform and interoperable. This will attract a _lot_ more
users than expected.

I hope that you see my sceptical point of view than just say another
complain from a simple user Thank you for your attention,

Nikos


---
Helge's detailed reply:

//
The conversions depends on external software. This must be installed
before conversion is possible. Some conversions can be done in several 
ways, with different programs. Some programs do a better job than 
others, so you might get bad results if all you have is the worst
program.

Do not expect all the conversions to yield good results in all cases.
Most of the formats you can export to, is only partially compatible
with 
LyX. So the converted document will at best be different, and at worst 
be useless.

Conversion to latex is about the only conversion that always works 
perfectly. Conversions to pdf, dvi and  postscript goes through latex 
and is normally perfect. But documents using special features may fail 
in some of these conversions. For example, dvi does not support
pstricks.

All other formats have less than perfect conversions.

ASCII obviously looses most of the formatting, as it doesn't support
fonts and images. But then, nobody expects more from ASCII.

Not all features are supported in HTML, so some things may be missing.
Still, LyX can be ok for writing html if you avoid some features.

opendocument/rtf/word is particularly troublesome. The three are 
compatible, and therefore all have the same problems. This is a word 
processor format with a simpler feature set than LyX, so a perfect
conversion will never be possible. In particular, any such conversion 
will loose the good line and page breaking and the hyphenation that LyX 
does so well. After conversion, a document can merely look like a
word document, not better.

Also, this converter is far from finished. Much better conversion to 
word is _possible_, but it looks like nobody/few is interested in 
working on that for free. Developers tend to want to improve LyX itself 
rather than the converters, removing the need for word rather than 
adding compatibility.

Helge Hafting
//


---
[1] http://www.mail-archive.com/lyx-us...@lists.lyx.org/msg79685.html
and http://www.mail-archive.com/lyx-us...@lists.lyx.org/msg79699.html

[2] http://www.lyx.org/Features


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


Re: #6574: ChkTeX selects entire paragraph, rather than just line where error occurs.

2010-03-03 Thread Tommaso Cucinotta

LyX Ticket Tracker wrote:

 2) Press F8 to activate ChkTeX.
  
Thanks for highlighting this tool, I didn't know there was something 
like that.

 In 2.0.0svn the entire paragraph is selected, the Good the Bad and the
 Ugly. In LyX 1.6.x, only the line containing Good is selected. This bug
 makes it considerably harder to find the offending text when dealing with
 a long paragraph.

 Reverting change r31263 by tommaso fixes this bug, but I am not sure how
 important change 31263 is (OutputParams.linelen now controls line-width
 also for LaTeX exports, additionally to plaintext ones).
  
Also applying the attached patch should fix it (simply setting linelen 
to the default value in lyxrc [instead of 0]) when invoking chktex.


If it works for you, I can commit the patch.

   T.
Index: src/Buffer.cpp
===
--- src/Buffer.cpp	(revisione 33612)
+++ src/Buffer.cpp	(copia locale)
@@ -1607,6 +1607,7 @@
 	OutputParams runparams(params().encoding());
 	runparams.flavor = OutputParams::LATEX;
 	runparams.nice = false;
+	runparams.linelen = lyxrc.plaintext_linelen;
 	makeLaTeXFile(FileName(name), org_path, runparams);
 
 	TeXErrors terr;


LyX ignorant of \listoffloats defined in document-class

2010-03-03 Thread Manoj Rajagopalan
Hi lyx-devel,

   I am building a layout for the new REVTeX 4.1 document class and the 
associated revtex4-1.cls defines a new float-type called video. It therefore 
makes available the \listofvideos command which should list all videos much 
like \listoftables and \listoffigures.

   I am attaching the .layout file where I have created a new video float and 
have assigned ListName = List of Videos. As expected, this shows up in 
Insert - List/TOC and clicking this also inserts the expected inset. But the 
latex source shows %% unknown builtin inset. The failure is being caused in 
InsetFloatList::latex() which only checks for float-inset type table 
and figure.

   Since the video float is being defined in the document class, I have also 
assigned LaTeXBuiltin = true. Is this correct? If so, then LyX should parse 
the document class to extract info about new floats.

   Another solution might be introducing a new LaTeXListName parameter which, 
in this case, should be assigned listofvideos. In the case of the 
TODO-notes module, this parameter could be listoftodos. And LyX can take 
care of inserting \LaTeXListName

Thanks,
Manoj


Re: LyX ignorant of \listoffloats defined in document-class

2010-03-03 Thread rgheck

On 03/03/2010 04:48 PM, Manoj Rajagopalan wrote:

Hi lyx-devel,

I am building a layout for the new REVTeX 4.1 document class and the
associated revtex4-1.cls defines a new float-type called video. It therefore
makes available the \listofvideos command which should list all videos much
like \listoftables and \listoffigures.

I am attaching the .layout file where I have created a new video float and
have assigned ListName = List of Videos. As expected, this shows up in
Insert -  List/TOC and clicking this also inserts the expected inset. But the
latex source shows %% unknown builtin inset. The failure is being caused in
InsetFloatList::latex() which only checks for float-inset type table
and figure.

   
I'm not sure exactly how this is handled, but I'd check how the list of 
algorithms works. Isn't that done the same way, basically?


rh



Re: Warning the user if the file is modified externally.

2010-03-03 Thread Pavel Sanda
John McCabe-Dansted wrote:
 Below I present very preliminary support for warning the user when
 their LyX file is externally modified. Does the following approach
 sound worthwhile?

this has even some bug number. the reason why its not implementeed
yet is that its not easy to find a point where to trigger such
check. for example you definitely dont want it to be checked after
each typing keystroke inside markdirty. you avoided it, but for the
price that you'll never check this once editing file started. 
also i would like to have this check on one point not at 10 different
places...

 When the buffer is marked dirty it checks if the file is modified
 externally. This may avoid the need to merge at all. I suggest that we
 also:
 1) Checks every 1 minute if the file has been modified (Even if a
 merge is required, the sooner the easier)

that is one possibility. i felt somewhat uncomfortable to have such
asynchronous events in the code, but now i realized it might be possible
to attach it to the code for automatical file saves...

secondly it should be possible to turn it off (maybe even by the
automatical save option?). there are rare but regular reports
about problems when file are saved over network, and it should
be possible to avoid automatical saves/polling for such users.

 2) Checks if the file is modified when the Buffer gains (like kwrite)

dont understand this.

 Finally, I was thinking that when the file is under version control
 LyX could poll the version control about every half hour to see if
 there is a remote update. This should be subject to various

how do you imagine such svn poll technically?

pavel


Re: LyX's import/export capabilities advertised in the Features web-page

2010-03-03 Thread Pavel Sanda
??  wrote:
 My opinion about LyX's import/export capabilities is to super-compress
 Helge's words, keep the positive stuff and replace/alter the text in the
 Features web-page [2] that currently leaves the impression that
 everything works out of the box.

my feeling was that untrivial part of the problem was your unability to
setup convertors on your box, not that the convertors do not work at all.
there are much more things in the features page, which wont work out of
the box too, you have to setup them.

 to get more users isn't only to self-improve LyX. It's also to make it
 really cross-platform and interoperable. This will attract a _lot_ more

i'm all for it :) do you have some patch in the pipe? :)

 I hope that you see my sceptical point of view than just say another
 complain from a simple user Thank you for your attention,

i dont see anything sceptical, the convertors to office-like formats
principally cant work without flaws. 

pavel


Re: LyX ignorant of \listoffloats defined in document-class [Patch]

2010-03-03 Thread Manoj Rajagopalan


On Wednesday 03 March 2010 04:58:19 pm rgheck wrote:
 On 03/03/2010 04:48 PM, Manoj Rajagopalan wrote:
  Hi lyx-devel,
 
  I am building a layout for the new REVTeX 4.1 document class and the
  associated revtex4-1.cls defines a new float-type called video. It
  therefore makes available the \listofvideos command which should list all
  videos much like \listoftables and \listoffigures.
 
  I am attaching the .layout file where I have created a new video
  float and have assigned ListName = List of Videos. As expected, this
  shows up in Insert -  List/TOC and clicking this also inserts the
  expected inset. But the latex source shows %% unknown builtin inset.
  The failure is being caused in InsetFloatList::latex() which only checks
  for float-inset type table and figure.

 I'm not sure exactly how this is handled, but I'd check how the list of
 algorithms works. Isn't that done the same way, basically?

 rh


My bad: actually, lyx does in fact successfully parse the documentclass. Only, 
during latex export, it doesn't allow any \listoffloats except for table 
and figure - at this point in InsetFloatList::latex(), these are the only two 
builtin floats.

But the Customization manual describes the LaTeXBuiltin parameter for custom 
floats to be true if the documentclass defines the float - if not, LyX will 
emit latex code to define the new float.

Therefore, all floats defined by the documentclass should be allowed to emit 
\listoffloats as built-ins if this command is defined. Currently, LyX even 
performs this check. I am attaching a patch that fixes this problem. Requires 
only one additional line.

Patch created from within src/insets

I have tested this with my REVTeX 4.1 layout and it works fine: the 
\listofvideos is properly emitted.

Thanks,
Manoj
Index: InsetFloatList.cpp
===
--- InsetFloatList.cpp	(revision 33612)
+++ InsetFloatList.cpp	(working copy)
@@ -128,6 +128,7 @@
 os  \\listoffigures\n;
 			} else {
 os  %% unknown builtin float\n;
+os  \\listof  type.c_str()  s\n;
 			}
 		} else {
 			os  \\listof{  getParam(type)  }{


Re: Greek text mixed with English [on/off-topic]

2010-03-03 Thread Νίκος Αλεξανδρής
On Mon, 2010-03-01 at 01:28 +0100, Νίκος Αλεξανδρής wrote:
 On Sun, 2010-02-28 at 23:47 +, Liviu Andronic wrote:
  Hello
  
  On 2/28/10, Νίκος Αλεξανδρής nikos.alexand...@uranus.uni-freiburg.de 
  wrote:
I read almost all of the posts in http://www.mail-archive.com. I will
eventually register myself in lyx-dev but dunno if its worth it for only
one thread.
  
  You could register for the thread, and unsubscribe when it's done.
  Liviu
 
 Done!

And... undone :-)

I'll try to follow the thread (hopefully there will be more on this in
the future). Thank you for your time folks,

Nikos


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


Re: trunk crash (missing Addsec*)

2010-03-03 Thread Guenter Milde
On 2010-03-02, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:
 when I tried to open DocumentSettings on a file containing

 Could you post this file?

Yes.

The crash happens in lyx-svn but not in the release version.

It disappeared after manually deleting the Addsec* part.

Günter


#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\textclass article
\use_default_options false
\language german
\inputencoding auto
\font_roman lmodern
\font_sans lmss
\font_typewriter lmtt
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder true
\pdf_colorlinks true
\pdf_backref section
\pdf_pdfusetitle true
\papersize a4paper
\use_geometry false
\use_amsmath 1
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author  
\author  
\end_header

\begin_body

\begin_layout Addsec*

\series bold
\lang greek
Με μια ματιά...
\end_layout

\begin_layout Itemize

\lang greek
Λήψη πλακιδίων από τον πανευρωπαϊκό χάρτη CORINE
\end_layout

\begin_layout Itemize

\lang greek
Λήψη ακτογραμμών από την διαδικτυακή υπηρεσία του Οργανισμού NOAA coastline
 extractor
\end_layout

\begin_layout Itemize

\lang greek
Δημιουργία τοποθεσίας (LOCATION) στο GRASS βάσει του datum 
\emph on
WGS84
\emph default
 και εισαγωγή των ακτογραμμών στην βάση δεδομένων
\end_layout

\begin_layout Itemize

\lang greek
Επεξεργασία των ακτογραμμών για τη δημιουργία ενός χάρτη-μάσκας που καλύπτει
 την υπό μελέτη περιοχή
\end_layout

\end_body
\end_document



Re: Greek text mixed with English

2010-03-03 Thread Guenter Milde
On 2010-03-02, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:

 The following minimal document

 -

 \documentclass[greek]{article}
 \usepackage{fontspec}
 \usepackage{babel}

 \usepackage{xunicode}
 \usepackage{xltxtra}
 \begin{document}
 test
 \end{document}

 --

 produces a PDF with the string τεστ. This proves that transliteration in 
 XeTeX works as in (pdf)latex, contrary to your claim.

With babel, yes.  As the transliteration is done at the font level (it is
a feature of the LGR font encoding), it cannot be kept for
Unicode-encoded fonts.

However, Greek Unicode chars are missing in the output in the
following example if:

a) babel is included, or
b) the \setmainfont line is commented

\documentclass[greek]{article}
\usepackage{fontspec}
\setmainfont{Gentium}

% \usepackage{babel}
% \usepackage{polyglossia}

\begin{document}

Me mia mati'a...

Με μια ματιά...

\end{document}

Babel selects a different font (the missing unicode support is a
consequence of this font change). 

This is one of the reasons why I believe the XeTeX documentation when it
tells that babel and XeTeX are incompatible.

 It does not matter whether or not polyglossia does this different than
 babel.  If you use a different package, you have to be prepared for
 such changes 

Well, I expect changes with the pdftex - xetex switch, otherwise I would
not switch.

 (although I'd say this is a polyglossia bug *if* polyglossia claims to
 be a drop-in-replacement for babel [which I don't know]. 

It is a replacement but not a drop in. 

 However, if polyglossia changes behaviour, we cannot replace
 babel by it anyway, unless the user explicitely requests this.

We must replace babel by polyglossia, as babel is not compatible with
XeTeX. Selecting XeTeX as output machine is an explicite request for
full, language-independent Unicode support.

We might have to care for possible incompatibilities in supported options
and languages with polyglossia, though.

Günter



Tabular code question

2010-03-03 Thread Uwe Stöhr
I want to fix the vertical alignment bugs in LyX 1.6 and also trunk. To be able to do this, I need 
to calculate the height of the content of the current cell (not the height of the row). How is this 
done?


thanks and regards
Uwe



Re: Warning the user if the file is modified externally.

2010-03-03 Thread John McCabe-Dansted
On Thu, Mar 4, 2010 at 6:05 AM, Pavel Sanda sa...@lyx.org wrote:
 John McCabe-Dansted wrote:
 Below I present very preliminary support for warning the user when
 their LyX file is externally modified. Does the following approach
 sound worthwhile?

 this has even some bug number. the reason why its not implementeed
 yet is that its not easy to find a point where to trigger such
 check. for example you definitely dont want it to be checked after
 each typing keystroke inside markdirty. you avoided it, but for the
 price that you'll never check this once editing file started.
 also i would like to have this check on one point not at 10 different
 places...

Would checking in two or three places (as proposed) seem excessive?

 When the buffer is marked dirty it checks if the file is modified
 externally. This may avoid the need to merge at all. I suggest that we
 also:
 1) Checks every 1 minute if the file has been modified (Even if a
 merge is required, the sooner the easier)

 that is one possibility. i felt somewhat uncomfortable to have such
 asynchronous events in the code, but now i realized it might be possible
 to attach it to the code for automatical file saves...

 secondly it should be possible to turn it off (maybe even by the
 automatical save option?). there are rare but regular reports
 about problems when file are saved over network, and it should
 be possible to avoid automatical saves/polling for such users.

 2) Checks if the file is modified when the Buffer gains (like kwrite)

 dont understand this.

Sorry, this should have been:
  Checks if the file is modified when the Buffer gains *focus* (like kwrite)

This presumably could be done by listening for Qt focusChanged
signals, though I haven't checked how kwrite does this.

 Finally, I was thinking that when the file is under version control
 LyX could poll the version control about every half hour to see if
 there is a remote update. This should be subject to various

 how do you imagine such svn poll technically?

Well, for example, when I start LyX I run (attached)
svn-up-to-date.sh 
Polling the server every 30 minutes could reduce further the
possibility that a merge is needed.

-- 
John C. McCabe-Dansted


svn-up-to-date.sh
Description: Bourne shell script


Re: Tabular: call for help

2010-03-03 Thread Uwe Stöhr

In case you didn't notice in the commit logs, I committed a big patch
that changed quite
fundamentally how the tabular inset and its dialog works. There is
still a lot of room for
improvement but I believe we are now in a much saner situation. This
code was so broken and complicated that it was almost funny :-)

So, please hard test this dialog and try to fix remaining bugs (which
is now way easier than before).


You somehow broke the connection between InsetTabular and GuiTabular:

- create a table
- open the table dialog and use the option apply immediately
- set the checkbox to make the table a longtable

Result: All longtable settings are still greyed out. (Before your
changes, these options were correctly enabled.)

I cannot figure out the problem because the GuiTabular code wasn't
changed and this code is absolutely correct.

Can you please have a look?

regards Uwe


Re: #6574: ChkTeX selects entire paragraph, rather than just line where error occurs.

2010-03-03 Thread John McCabe-Dansted
On Thu, Mar 4, 2010 at 2:06 AM, Tommaso Cucinotta tomm...@lyx.org wrote:
 LyX Ticket Tracker wrote:

  2) Press F8 to activate ChkTeX.


 Thanks for highlighting this tool, I didn't know there was something like
 that.

I mostly use it for:
  http://wiki.lyx.org/Tools/LyX-GrammarChecker
which provides regex based checking as well as wraps tools like ChkTex
and languagetool (which supports Italian). At some point I am
intending to translate it into Python so it can be included in LyX.

 Also applying the attached patch should fix it (simply setting linelen to
 the default value in lyxrc [instead of 0]) when invoking chktex.

 If it works for you, I can commit the patch.

Great minds think alike?
  http://www.lyx.org/trac/attachment/ticket/6574/Chktex_SelectOnlyLine.patch

Your copia locale looks fine to me ;)

Lets commit it.

-- 
John C. McCabe-Dansted


Re: Warning the user if the file is modified externally.

2010-03-03 Thread Pavel Sanda
John McCabe-Dansted wrote:
 On Thu, Mar 4, 2010 at 6:05 AM, Pavel Sanda sa...@lyx.org wrote:
  John McCabe-Dansted wrote:
  Below I present very preliminary support for warning the user when
  their LyX file is externally modified. Does the following approach
  sound worthwhile?
 
  this has even some bug number. the reason why its not implementeed
  yet is that its not easy to find a point where to trigger such
  check. for example you definitely dont want it to be checked after
  each typing keystroke inside markdirty. you avoided it, but for the
  price that you'll never check this once editing file started.
  also i would like to have this check on one point not at 10 different
  places...
 
 Would checking in two or three places (as proposed) seem excessive?

concerning the fact how rarely will be the check in previous patch 
reached... i mean lets try to find place general enough instead of
spilling the code in corner cases. each added place means double the
debugging work in case something goes wrong.

  When the buffer is marked dirty it checks if the file is modified
  externally. This may avoid the need to merge at all. I suggest that we
  also:
  1) Checks every 1 minute if the file has been modified (Even if a
  merge is required, the sooner the easier)
 
  that is one possibility. i felt somewhat uncomfortable to have such
  asynchronous events in the code, but now i realized it might be possible
  to attach it to the code for automatical file saves...
 
  secondly it should be possible to turn it off (maybe even by the
  automatical save option?). there are rare but regular reports
  about problems when file are saved over network, and it should
  be possible to avoid automatical saves/polling for such users.
 
  2) Checks if the file is modified when the Buffer gains (like kwrite)
 
  dont understand this.
 
 Sorry, this should have been:
   Checks if the file is modified when the Buffer gains *focus* (like kwrite)
 
 This presumably could be done by listening for Qt focusChanged
 signals, though I haven't checked how kwrite does this.

i see, focus-trigger is a better idea. still i feel bit uncomfortable.
in case the network connection disconnects for a while you will freeze
lyx until it gets better again? another place coming into my mind will
be the code for checking if the buffer can be reverted - its get triggered
eg every time you launch file menu. it already touches the active buffer
so no additional harm.

sorry to be so picky about this, but i clearly remember the frustration
i had with ms exploder when he tried to poll network places around every
second (nonrelated) action i did with him. normally you dont recognize,
but if the net by accident goes down or have lags... or we need at least
some setting to turn it off.

  Finally, I was thinking that when the file is under version control
  LyX could poll the version control about every half hour to see if
  there is a remote update. This should be subject to various
 
  how do you imagine such svn poll technically?
 
 Well, for example, when I start LyX I run (attached)
 svn-up-to-date.sh 
 Polling the server every 30 minutes could reduce further the
 possibility that a merge is needed.

you mean this really works for you? to my knowledge svn info touches only the
local checkout not the archive on server.

pavel


RE: Patch for crash on top-level inset-modify command

2010-03-03 Thread Vincent van Ravesteijn - TNW
>   Upon following these steps, I consistently encoutered a crash.
>
>1. New lyx doc.
>2. Insert table (I chose 3x3)
>3. Select entire table and invoke unset-all-lines from toolbar =>
CRASH!
>

I think this is basically the same problem as bug #6553. 

We send an LFUN to the table, while the cursor is not in the table.
Also, the toolbar items for tables should all be disabled as we are not
in a table anymore.

Vincent


RE: Re: #6564: Crash on moving out of math-cases placed in table cell

2010-03-03 Thread Vincent van Ravesteijn - TNW

 > Trac comments don't seem to go out to the lyx-devel list so I'm
forwarding this.

Those who are interested should look into the bug report once in a
while, or should add their name to the cc-list. I guess there's no need
to post it here.

Unless of course, you need some extra attention ;).

Vincent


Re: Branches…

2010-03-03 Thread Helge Hafting

jezZiFeR wrote:

Yes, this would be a way, but a uncomfortable way:
As my main text is very long and has lots of branches, it would be much 
more convenient, if there would be a possibility to disable the main 
text. Otherwise I would have to put quite a few parts into a new branch.

Is there no other way?


LyX offer no other way. There is no way to disable "anything that is not
in some branch".

I can see two ways:
* Add all those branches to the rest.
* Make a copy of the document, where you delete what you don't want.

If you are a programmer, then you have more options:
* Make a script that removes anything not in a branch
  from a copy of the .lyx file. Then open the reduced copy
  in lyx, and print it. Might not be that hard, if
  you use a scripting language that is good for text
  processing.
* Or, make a script that stuffs everything that isn't in some
  branch already, into a new branch.
* If you know C++: implement what you want in LyX.

Helge Hafting




[Patch] "fix #6574: ChkTeX selects entire paragraph, rather than just line where error occurs"

2010-03-03 Thread John McCabe-Dansted
On Wed, Mar 3, 2010 at 11:38 AM, LyX Ticket Tracker  wrote:
> #6574: ChkTeX selects entire paragraph, rather than just line where error 
> occurs.
> Ticket URL: 

This regression from LyX 1.6.x can be fixed just by adding the line
+   runparams.linelen = lyxrc.plaintext_linelen;
to Buffer::runChktex()

This cannot break anything other than Chktex (and as the primary user
of runChktex, I think I'd have noticed the breakage)

Shall we commit the attached patch now?

-- 
John C. McCabe-Dansted
Index: Buffer.cpp
===
--- Buffer.cpp	(revision 33612)
+++ Buffer.cpp	(working copy)
@@ -1607,6 +1607,7 @@
 	OutputParams runparams(().encoding());
 	runparams.flavor = OutputParams::LATEX;
 	runparams.nice = false;
+	runparams.linelen = lyxrc.plaintext_linelen;
 	makeLaTeXFile(FileName(name), org_path, runparams);
 
 	TeXErrors terr;


Warning the user if the file is modified externally.

2010-03-03 Thread John McCabe-Dansted
Below I present very preliminary support for warning the user when
their LyX file is externally modified. Does the following approach
sound worthwhile?

When the buffer is marked dirty it checks if the file is modified
externally. This may avoid the need to merge at all. I suggest that we
also:
1) Checks every 1 minute if the file has been modified (Even if a
merge is required, the sooner the easier)
2) Checks if the file is modified when the Buffer gains (like kwrite)

Finally, I was thinking that when the file is under version control
LyX could poll the version control about every half hour to see if
there is a remote update. This should be subject to various
limitations
1) It should be off by default, so no unexpected network access shows
up in log files.
2) It should never poll anonymous svn servers, (we don't want e.g.
thousands of LyX users polling svn.lyx.org)
3) It should never poll read-only files, unless explicitly told to
poll these files, as these will never have merge conflicts.

The final dialog should look a lot like:
  http://www.ucc.asn.au/~mccabedj/KWrite.png
although it might be even nicer if we could redesign it as a pane as in:
  www.ucc.asn.au/~mccabedj/gedit.png

The following code is given as an example only. It needs much more work.
--
 void Buffer::markDirty()
 {
if (d->lyx_clean) {
+   // We may want to offer to revert to saved.
+   // We may want to present a similar warning when buffer is 
dirty,
possibly as a pane rather than a dialog.
+   if (d->checksum_ != 0 && fileName().exists() &&
isExternallyModified(checksum_method)){
+   docstring msg = _("You are modifying a document that is 
modified
externally.\nYou may want to \"Revert to Saved\".\n");
+   Alert::warning(_("Document has been externally 
modified."), msg);
+   }
d->lyx_clean = false;
updateTitles();
}

-- 
John C. McCabe-Dansted


LyX's import/export capabilities advertised in the "Features" web-page

2010-03-03 Thread Νίκος Αλεξανδρής
Dear LyX developers,

in my post "Import and export to many formats..." [1] sent in the
lyx-users mailing list, Helge Hafting replied as seen below. His text
covers everything (?) and very precise.

My opinion about LyX's import/export capabilities is to super-compress
Helge's words, keep the positive stuff and replace/alter the text in the
"Features" web-page [2] that currently leaves the impression that
everything works out of the box.

For the records: I can't imagine myself working under M$' disorientating
environment (and I hope I'll never be forced to do so). However, the key
to get more users isn't only to self-improve LyX. It's also to make it
really cross-platform and interoperable. This will attract a _lot_ more
users than expected.

I hope that you see my "sceptical point of view" than just say "another
complain from a simple user...". Thank you for your attention,

Nikos


---
Helge's detailed reply:

//
The conversions depends on external software. This must be installed
before conversion is possible. Some conversions can be done in several 
ways, with different programs. Some programs do a better job than 
others, so you might get bad results if all you have is the worst
program.

Do not expect all the conversions to yield good results in all cases.
Most of the formats you can export to, is only partially compatible
with 
LyX. So the converted document will at best be different, and at worst 
be useless.

Conversion to latex is about the only conversion that always works 
perfectly. Conversions to pdf, dvi and  postscript goes through latex 
and is normally perfect. But documents using special features may fail 
in some of these conversions. For example, dvi does not support
pstricks.

All other formats have less than perfect conversions.

ASCII obviously looses most of the formatting, as it doesn't support
fonts and images. But then, nobody expects more from ASCII.

Not all features are supported in HTML, so some things may be missing.
Still, LyX can be ok for writing html if you avoid some features.

opendocument/rtf/word is particularly troublesome. The three are 
compatible, and therefore all have the same problems. This is a word 
processor format with a simpler feature set than LyX, so a perfect
conversion will never be possible. In particular, any such conversion 
will loose the good line and page breaking and the hyphenation that LyX 
does so well. After conversion, a document can merely look like a
word document, not better.

Also, this converter is far from finished. Much better conversion to 
word is _possible_, but it looks like nobody/few is interested in 
working on that for free. Developers tend to want to improve LyX itself 
rather than the converters, removing the need for word rather than 
adding compatibility.

Helge Hafting
//


---
[1] http://www.mail-archive.com/lyx-us...@lists.lyx.org/msg79685.html
and http://www.mail-archive.com/lyx-us...@lists.lyx.org/msg79699.html

[2] http://www.lyx.org/Features


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


Re: #6574: ChkTeX selects entire paragraph, rather than just line where error occurs.

2010-03-03 Thread Tommaso Cucinotta

LyX Ticket Tracker wrote:

 2) Press F8 to activate ChkTeX.
  
Thanks for highlighting this tool, I didn't know there was something 
like that.

 In 2.0.0svn the entire paragraph is selected, the Good the Bad and the
 Ugly. In LyX 1.6.x, only the line containing "Good" is selected. This bug
 makes it considerably harder to find the offending text when dealing with
 a long paragraph.

 Reverting change r31263 by tommaso fixes this bug, but I am not sure how
 important change 31263 is ("OutputParams.linelen now controls line-width
 also for LaTeX exports, additionally to plaintext ones").
  
Also applying the attached patch should fix it (simply setting linelen 
to the default value in lyxrc [instead of 0]) when invoking chktex.


If it works for you, I can commit the patch.

   T.
Index: src/Buffer.cpp
===
--- src/Buffer.cpp	(revisione 33612)
+++ src/Buffer.cpp	(copia locale)
@@ -1607,6 +1607,7 @@
 	OutputParams runparams(().encoding());
 	runparams.flavor = OutputParams::LATEX;
 	runparams.nice = false;
+	runparams.linelen = lyxrc.plaintext_linelen;
 	makeLaTeXFile(FileName(name), org_path, runparams);
 
 	TeXErrors terr;


LyX ignorant of \listofs defined in document-class

2010-03-03 Thread Manoj Rajagopalan
Hi lyx-devel,

   I am building a layout for the new REVTeX 4.1 document class and the 
associated revtex4-1.cls defines a new float-type called video. It therefore 
makes available the \listofvideos command which should list all videos much 
like \listoftables and \listoffigures.

   I am attaching the .layout file where I have created a new video float and 
have assigned ListName = "List of Videos". As expected, this shows up in 
Insert -> List/TOC and clicking this also inserts the expected inset. But the 
latex source shows "%% unknown builtin inset". The failure is being caused in 
InsetFloatList::latex() which only checks for float-inset type "table" 
and "figure".

   Since the video float is being defined in the document class, I have also 
assigned LaTeXBuiltin = true. Is this correct? If so, then LyX should parse 
the document class to extract info about new floats.

   Another solution might be introducing a new LaTeXListName parameter which, 
in this case, should be assigned "listofvideos". In the case of the 
TODO-notes module, this parameter could be "listoftodos". And LyX can take 
care of inserting \

Thanks,
Manoj


Re: LyX ignorant of \listofs defined in document-class

2010-03-03 Thread rgheck

On 03/03/2010 04:48 PM, Manoj Rajagopalan wrote:

Hi lyx-devel,

I am building a layout for the new REVTeX 4.1 document class and the
associated revtex4-1.cls defines a new float-type called video. It therefore
makes available the \listofvideos command which should list all videos much
like \listoftables and \listoffigures.

I am attaching the .layout file where I have created a new video float and
have assigned ListName = "List of Videos". As expected, this shows up in
Insert ->  List/TOC and clicking this also inserts the expected inset. But the
latex source shows "%% unknown builtin inset". The failure is being caused in
InsetFloatList::latex() which only checks for float-inset type "table"
and "figure".

   
I'm not sure exactly how this is handled, but I'd check how the list of 
algorithms works. Isn't that done the same way, basically?


rh



Re: Warning the user if the file is modified externally.

2010-03-03 Thread Pavel Sanda
John McCabe-Dansted wrote:
> Below I present very preliminary support for warning the user when
> their LyX file is externally modified. Does the following approach
> sound worthwhile?

this has even some bug number. the reason why its not implementeed
yet is that its not easy to find a point where to trigger such
check. for example you definitely dont want it to be checked after
each typing keystroke inside markdirty. you avoided it, but for the
price that you'll never check this once editing file started. 
also i would like to have this check on one point not at 10 different
places...

> When the buffer is marked dirty it checks if the file is modified
> externally. This may avoid the need to merge at all. I suggest that we
> also:
> 1) Checks every 1 minute if the file has been modified (Even if a
> merge is required, the sooner the easier)

that is one possibility. i felt somewhat uncomfortable to have such
asynchronous events in the code, but now i realized it might be possible
to attach it to the code for automatical file saves...

secondly it should be possible to turn it off (maybe even by the
automatical save option?). there are rare but regular reports
about problems when file are saved over network, and it should
be possible to avoid automatical saves/polling for such users.

> 2) Checks if the file is modified when the Buffer gains (like kwrite)

dont understand this.

> Finally, I was thinking that when the file is under version control
> LyX could poll the version control about every half hour to see if
> there is a remote update. This should be subject to various

how do you imagine such svn poll technically?

pavel


Re: LyX's import/export capabilities advertised in the "Features" web-page

2010-03-03 Thread Pavel Sanda
??  wrote:
> My opinion about LyX's import/export capabilities is to super-compress
> Helge's words, keep the positive stuff and replace/alter the text in the
> "Features" web-page [2] that currently leaves the impression that
> everything works out of the box.

my feeling was that untrivial part of the problem was your unability to
setup convertors on your box, not that the convertors do not work at all.
there are much more things in the features page, which wont work out of
the box too, you have to setup them.

> to get more users isn't only to self-improve LyX. It's also to make it
> really cross-platform and interoperable. This will attract a _lot_ more

i'm all for it :) do you have some patch in the pipe? :)

> I hope that you see my "sceptical point of view" than just say "another
> complain from a simple user...". Thank you for your attention,

i dont see anything sceptical, the convertors to office-like formats
principally cant work without flaws. 

pavel


Re: LyX ignorant of \listofs defined in document-class [Patch]

2010-03-03 Thread Manoj Rajagopalan


On Wednesday 03 March 2010 04:58:19 pm rgheck wrote:
> On 03/03/2010 04:48 PM, Manoj Rajagopalan wrote:
> > Hi lyx-devel,
> >
> > I am building a layout for the new REVTeX 4.1 document class and the
> > associated revtex4-1.cls defines a new float-type called video. It
> > therefore makes available the \listofvideos command which should list all
> > videos much like \listoftables and \listoffigures.
> >
> > I am attaching the .layout file where I have created a new video
> > float and have assigned ListName = "List of Videos". As expected, this
> > shows up in Insert ->  List/TOC and clicking this also inserts the
> > expected inset. But the latex source shows "%% unknown builtin inset".
> > The failure is being caused in InsetFloatList::latex() which only checks
> > for float-inset type "table" and "figure".
>
> I'm not sure exactly how this is handled, but I'd check how the list of
> algorithms works. Isn't that done the same way, basically?
>
> rh


My bad: actually, lyx does in fact successfully parse the documentclass. Only, 
during latex export, it doesn't allow any \listofs except for table 
and figure - at this point in InsetFloatList::latex(), these are the only two 
builtin floats.

But the Customization manual describes the LaTeXBuiltin parameter for custom 
floats to be true if the documentclass defines the float - if not, LyX will 
emit latex code to define the new float.

Therefore, all floats defined by the documentclass should be allowed to emit 
\listofs as built-ins if this command is defined. Currently, LyX even 
performs this check. I am attaching a patch that fixes this problem. Requires 
only one additional line.

Patch created from within src/insets

I have tested this with my REVTeX 4.1 layout and it works fine: the 
\listofvideos is properly emitted.

Thanks,
Manoj
Index: InsetFloatList.cpp
===
--- InsetFloatList.cpp	(revision 33612)
+++ InsetFloatList.cpp	(working copy)
@@ -128,6 +128,7 @@
 os << "\\listoffigures\n";
 			} else {
 os << "%% unknown builtin float\n";
+os << "\\listof" << type.c_str() << "s\n";
 			}
 		} else {
 			os << "\\listof{" << getParam("type") << "}{"


Re: Greek text mixed with English [on/off-topic]

2010-03-03 Thread Νίκος Αλεξανδρής
On Mon, 2010-03-01 at 01:28 +0100, Νίκος Αλεξανδρής wrote:
> On Sun, 2010-02-28 at 23:47 +, Liviu Andronic wrote:
> > Hello
> > 
> > On 2/28/10, Νίκος Αλεξανδρής  
> > wrote:
> > >  I read almost all of the posts in http://www.mail-archive.com. I will
> > >  eventually register myself in lyx-dev but dunno if its worth it for only
> > >  one thread.
> > >
> > You could register for the thread, and unsubscribe when it's done.
> > Liviu
> 
> Done!

And... undone :-)

I'll try to follow the thread (hopefully there will be more on this in
the future). Thank you for your time folks,

Nikos


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


Re: trunk crash (missing Addsec*)

2010-03-03 Thread Guenter Milde
On 2010-03-02, Jürgen Spitzmüller wrote:
> Guenter Milde wrote:
>> when I tried to open Document>Settings on a file containing

> Could you post this file?

Yes.

The crash happens in lyx-svn but not in the release version.

It disappeared after manually deleting the Addsec* part.

Günter


#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\textclass article
\use_default_options false
\language german
\inputencoding auto
\font_roman lmodern
\font_sans lmss
\font_typewriter lmtt
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder true
\pdf_colorlinks true
\pdf_backref section
\pdf_pdfusetitle true
\papersize a4paper
\use_geometry false
\use_amsmath 1
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author "" 
\author "" 
\end_header

\begin_body

\begin_layout Addsec*

\series bold
\lang greek
Με μια ματιά...
\end_layout

\begin_layout Itemize

\lang greek
Λήψη πλακιδίων από τον πανευρωπαϊκό χάρτη CORINE
\end_layout

\begin_layout Itemize

\lang greek
Λήψη ακτογραμμών από την διαδικτυακή υπηρεσία του Οργανισμού NOAA coastline
 extractor
\end_layout

\begin_layout Itemize

\lang greek
Δημιουργία τοποθεσίας (LOCATION) στο GRASS βάσει του datum 
\emph on
WGS84
\emph default
 και εισαγωγή των ακτογραμμών στην βάση δεδομένων
\end_layout

\begin_layout Itemize

\lang greek
Επεξεργασία των ακτογραμμών για τη δημιουργία ενός χάρτη-μάσκας που καλύπτει
 την υπό μελέτη περιοχή
\end_layout

\end_body
\end_document



Re: Greek text mixed with English

2010-03-03 Thread Guenter Milde
On 2010-03-02, Jürgen Spitzmüller wrote:
> Guenter Milde wrote:

> The following minimal document

> -

> \documentclass[greek]{article}
> \usepackage{fontspec}
> \usepackage{babel}

> \usepackage{xunicode}
> \usepackage{xltxtra}
> \begin{document}
> test
> \end{document}

> --

> produces a PDF with the string "τεστ". This proves that transliteration in 
> XeTeX works as in (pdf)latex, contrary to your claim.

With babel, yes.  As the transliteration is done at the font level (it is
a feature of the LGR font encoding), it cannot be kept for
Unicode-encoded fonts.

However, Greek Unicode chars are missing in the output in the
following example if:

a) babel is included, or
b) the \setmainfont line is commented

\documentclass[greek]{article}
\usepackage{fontspec}
\setmainfont{Gentium}

% \usepackage{babel}
% \usepackage{polyglossia}

\begin{document}

Me mia mati'a...

Με μια ματιά...

\end{document}

Babel selects a different font (the missing unicode support is a
consequence of this font change). 

This is one of the reasons why I believe the XeTeX documentation when it
tells that babel and XeTeX are incompatible.

> It does not matter whether or not polyglossia does this different than
> babel.  If you use a different package, you have to be prepared for
> such changes 

Well, I expect changes with the pdftex -> xetex switch, otherwise I would
not switch.

> (although I'd say this is a polyglossia bug *if* polyglossia claims to
> be a drop-in-replacement for babel [which I don't know]. 

It is a replacement but not a drop in. 

> However, if polyglossia changes behaviour, we cannot replace
> babel by it anyway, unless the user explicitely requests this.

We must replace babel by polyglossia, as babel is not compatible with
XeTeX. Selecting XeTeX as output machine is an explicite request for
full, language-independent Unicode support.

We might have to care for possible incompatibilities in supported options
and languages with polyglossia, though.

Günter



Tabular code question

2010-03-03 Thread Uwe Stöhr
I want to fix the vertical alignment bugs in LyX 1.6 and also trunk. To be able to do this, I need 
to calculate the height of the content of the current cell (not the height of the row). How is this 
done?


thanks and regards
Uwe



Re: Warning the user if the file is modified externally.

2010-03-03 Thread John McCabe-Dansted
On Thu, Mar 4, 2010 at 6:05 AM, Pavel Sanda  wrote:
> John McCabe-Dansted wrote:
>> Below I present very preliminary support for warning the user when
>> their LyX file is externally modified. Does the following approach
>> sound worthwhile?
>
> this has even some bug number. the reason why its not implementeed
> yet is that its not easy to find a point where to trigger such
> check. for example you definitely dont want it to be checked after
> each typing keystroke inside markdirty. you avoided it, but for the
> price that you'll never check this once editing file started.
> also i would like to have this check on one point not at 10 different
> places...

Would checking in two or three places (as proposed) seem excessive?

>> When the buffer is marked dirty it checks if the file is modified
>> externally. This may avoid the need to merge at all. I suggest that we
>> also:
>> 1) Checks every 1 minute if the file has been modified (Even if a
>> merge is required, the sooner the easier)
>
> that is one possibility. i felt somewhat uncomfortable to have such
> asynchronous events in the code, but now i realized it might be possible
> to attach it to the code for automatical file saves...
>
> secondly it should be possible to turn it off (maybe even by the
> automatical save option?). there are rare but regular reports
> about problems when file are saved over network, and it should
> be possible to avoid automatical saves/polling for such users.
>
>> 2) Checks if the file is modified when the Buffer gains (like kwrite)
>
> dont understand this.

Sorry, this should have been:
  Checks if the file is modified when the Buffer gains *focus* (like kwrite)

This presumably could be done by listening for Qt "focusChanged"
signals, though I haven't checked how kwrite does this.

>> Finally, I was thinking that when the file is under version control
>> LyX could poll the version control about every half hour to see if
>> there is a remote update. This should be subject to various
>
> how do you imagine such svn poll technically?

Well, for example, when I start LyX I run (attached)
svn-up-to-date.sh &
Polling the server every 30 minutes could reduce further the
possibility that a merge is needed.

-- 
John C. McCabe-Dansted


svn-up-to-date.sh
Description: Bourne shell script


Re: Tabular: call for help

2010-03-03 Thread Uwe Stöhr

In case you didn't notice in the commit logs, I committed a big patch
that changed quite
fundamentally how the tabular inset and its dialog works. There is
still a lot of room for
improvement but I believe we are now in a much saner situation. This
code was so broken and complicated that it was almost funny :-)

So, please hard test this dialog and try to fix remaining bugs (which
is now way easier than before).


You somehow broke the connection between InsetTabular and GuiTabular:

- create a table
- open the table dialog and use the option "apply immediately"
- set the checkbox to make the table a longtable

Result: All longtable settings are still greyed out. (Before your
changes, these options were correctly enabled.)

I cannot figure out the problem because the GuiTabular code wasn't
changed and this code is absolutely correct.

Can you please have a look?

regards Uwe


Re: #6574: ChkTeX selects entire paragraph, rather than just line where error occurs.

2010-03-03 Thread John McCabe-Dansted
On Thu, Mar 4, 2010 at 2:06 AM, Tommaso Cucinotta  wrote:
> LyX Ticket Tracker wrote:
>>
>>  2) Press F8 to activate ChkTeX.
>>
>
> Thanks for highlighting this tool, I didn't know there was something like
> that.

I mostly use it for:
  http://wiki.lyx.org/Tools/LyX-GrammarChecker
which provides regex based checking as well as wraps tools like ChkTex
and languagetool (which supports Italian). At some point I am
intending to translate it into Python so it can be included in LyX.

> Also applying the attached patch should fix it (simply setting linelen to
> the default value in lyxrc [instead of 0]) when invoking chktex.
>
> If it works for you, I can commit the patch.

Great minds think alike?
  http://www.lyx.org/trac/attachment/ticket/6574/Chktex_SelectOnlyLine.patch

Your copia locale looks fine to me ;)

Lets commit it.

-- 
John C. McCabe-Dansted


Re: Warning the user if the file is modified externally.

2010-03-03 Thread Pavel Sanda
John McCabe-Dansted wrote:
> On Thu, Mar 4, 2010 at 6:05 AM, Pavel Sanda  wrote:
> > John McCabe-Dansted wrote:
> >> Below I present very preliminary support for warning the user when
> >> their LyX file is externally modified. Does the following approach
> >> sound worthwhile?
> >
> > this has even some bug number. the reason why its not implementeed
> > yet is that its not easy to find a point where to trigger such
> > check. for example you definitely dont want it to be checked after
> > each typing keystroke inside markdirty. you avoided it, but for the
> > price that you'll never check this once editing file started.
> > also i would like to have this check on one point not at 10 different
> > places...
> 
> Would checking in two or three places (as proposed) seem excessive?

concerning the fact how rarely will be the check in previous patch 
reached... i mean lets try to find place general enough instead of
spilling the code in corner cases. each added place means double the
debugging work in case something goes wrong.

> >> When the buffer is marked dirty it checks if the file is modified
> >> externally. This may avoid the need to merge at all. I suggest that we
> >> also:
> >> 1) Checks every 1 minute if the file has been modified (Even if a
> >> merge is required, the sooner the easier)
> >
> > that is one possibility. i felt somewhat uncomfortable to have such
> > asynchronous events in the code, but now i realized it might be possible
> > to attach it to the code for automatical file saves...
> >
> > secondly it should be possible to turn it off (maybe even by the
> > automatical save option?). there are rare but regular reports
> > about problems when file are saved over network, and it should
> > be possible to avoid automatical saves/polling for such users.
> >
> >> 2) Checks if the file is modified when the Buffer gains (like kwrite)
> >
> > dont understand this.
> 
> Sorry, this should have been:
>   Checks if the file is modified when the Buffer gains *focus* (like kwrite)
> 
> This presumably could be done by listening for Qt "focusChanged"
> signals, though I haven't checked how kwrite does this.

i see, focus-trigger is a better idea. still i feel bit uncomfortable.
in case the network connection disconnects for a while you will freeze
lyx until it gets better again? another place coming into my mind will
be the code for checking if the buffer can be reverted - its get triggered
eg every time you launch file menu. it already touches the active buffer
so no additional harm.

sorry to be so picky about this, but i clearly remember the frustration
i had with ms exploder when he tried to poll network places around every
second (nonrelated) action i did with him. normally you dont recognize,
but if the net by accident goes down or have lags... or we need at least
some setting to turn it off.

> >> Finally, I was thinking that when the file is under version control
> >> LyX could poll the version control about every half hour to see if
> >> there is a remote update. This should be subject to various
> >
> > how do you imagine such svn poll technically?
> 
> Well, for example, when I start LyX I run (attached)
> svn-up-to-date.sh &
> Polling the server every 30 minutes could reduce further the
> possibility that a merge is needed.

you mean this really works for you? to my knowledge svn info touches only the
local checkout not the archive on server.

pavel