Re: [ lyxbugs-Patches-228457 ] Small bug when pasting as ascii

2001-11-28 Thread Jean-Marc Lasgouttes

 John == John Levon [EMAIL PROTECTED] writes:

John On Tue, Nov 27, 2001 at 07:40:39AM -0800,
John [EMAIL PROTECTED] wrote:
 John, it seems that your patch has been applied, but the bug is
 still here, isn't it?

John My patch didn't get applied did it ? I never re-worked it the
John last time like Lars wanted it, and it fell by the wayside ...

Yes, I probably looked too lazily at the sources.

JMarc



Re: text.C compile problem

2001-11-28 Thread Jean-Marc Lasgouttes

 John == John Levon [EMAIL PROTECTED] writes:

John On Tue, Nov 27, 2001 at 12:37:38PM -0800, Kayvan A. Sylvan
John wrote:
 text.C:3405: parse error before `+'

John there's nothing wrong with that line :

John string str(string(_(Space below)) +  (

John what compiler are you using ?

So it seems that I corrected one occurence and not the other. gcc
2.95.2 and compaq cxx did not complain, anyway.

JMarc



Re: text.C compile problem

2001-11-28 Thread Jean-Marc Lasgouttes

 Andre == Andre Poenitz [EMAIL PROTECTED] writes:

Andre On Tue, Nov 27, 2001 at 12:37:38PM -0800, Kayvan A. Sylvan
Andre wrote:
 ext.C:1045: warning: #warning Please fix me (Jug!) text.C:1543:
 warning: #warning Something is rotten here! (Jug) text.C:2298:
 warning: #warning Dekel please have a look on this one RTL? (Jug)
 text.C:2299: warning: #warning DEKEL! text.C: In method `void
 LyXText::paintLastRow(LyXText::DrawRowParams )': text.C:3405:
 parse error before `+'

Andre I thought Jean-Marc commited already a fix for this?

You did not tell me there were two occurences of this :)

JMarc



Re: Ghostscript rendering problems with LyX 1.1.6 series

2001-11-28 Thread Jean-Marc Lasgouttes

 John == John Levon [EMAIL PROTECTED] writes:

John With ghostscript 6.xx, up to and including 6.52 (i.e. all GNU
John ghostscript versions), there is a bug :

John I hope this clears things up for some people. Please apply this
John patch

This patch is applied to both trunk and branch.

JMarc



Re: invisible math symbols?

2001-11-28 Thread Jean-Marc Lasgouttes

 Andre == Andre Poenitz [EMAIL PROTECTED] writes:

Andre On Wed, Nov 28, 2001 at 02:50:28AM -0500, Nirmal Govind wrote:
 I'm using RedHat 7.2..

Andre Tea cups are certainly worse than crystal balls in some
Andre cases...

Andre It is strange however, that the number of installations that
Andre cause problems with scalable screenfonts is increasing.

Andre Does anybody know what exactly is going on and why the scaling
Andre does not work?

Since I will have time to play around with my mandrake 8.1-based home
pc soon, I plan to take a serious look at that.

JMarc



[PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Ben Stanley

Andre Poenitz wrote:

On Wed, Nov 28, 2001 at 07:00:14AM +1100, Ben Stanley wrote:

The advantage of putting everything in the deptree is that if you modify
a figure .eps and then do the latex-DVI thing from the menu, then
everything will be re-generated OK.


If that works I owe you a beer...

Andre'

I just went to test this out...

It works - as long as you actually change the included file and don't 
just change the mtime (eg touch it)!

So, it looks like Andre owes me a beer - except I don't drink beer. Bummer.

I found that without the mmap patch, updating the time to update 
dependencies takes forever (73 seconds), because it calculates the CRC 
of *all* the 153 .eps files in my thesis, and a few other things as 
well. Remember, I don't have istreambuf_iterator.

Patch attached (DepTable.patch) for cvs BRANCH_1_1_6 has the following 
features:

* Fast mtime comparison dependency checks after CRC has been calculated.
* Continues to function if you upgrade or downgrade LyX while using
  or *not* using a temporary directory.
* Remakes the output even if you delete the .dvi file (bug in
  LaTeX::run(), not DepTable).
* Re-makes the output if you change an included graphics file (or
  any other kind of included file).
* And even makes coffee... ;-)

If you combine this patch with the mmap-sum.patch you get much improved 
performance for re-building .dvi files using LyX on my system... There 
really is no comparison. Using mmap, the initial dependency update which 
calculates CRCs drops down to 14 sec for the same set of files. All this 
is with lyx compiled with -g -O.

The benefit of these two patches for me is even more than stated here, 
because the old LyX re-computed CRCs on every file in the DepTable after 
every LaTeX run. This used to make doing a View|DVI something of a 
'coffee break' item, but not any more!

Please apply these patches to cvs.

Ben.



--- lyx-devel-orig/src/DepTable.C   Wed Nov 15 14:22:06 2000
+++ lyx-devel/src/DepTable.CWed Nov 28 19:31:21 2001
@@ -18,57 +18,147 @@
 #endif
 
 #include DepTable.h
+#include debug.h
+
 #include support/lyxlib.h
 #include support/filetools.h
+
+#include sys/types.h
+#include sys/stat.h
+#include unistd.h
+
 #include fstream
 
+
 using std::make_pair;
 using std::ofstream;
 using std::ifstream;
 using std::endl;
 
+/** \class DepTable
+   DepTable provides a list of files and information on
+   whether their contents have changed since the last time
+   the file was checked.
+   
+   This is performed internally using CRC computations and mtime checks.
+   
+   Computing the CRC of every file takes 28-33 seconds on my thesis...
+   (That is because a large number of large .eps files get entered into
+   the deptable..., and I do not have istreambuf_iterator :-( )
+   
+   Why does this class use CRC checks instead
+   of using the dates on the files?
+   
+   Well the answer to that is that LaTeX re-writes it's .aux files
+   every time it runs. This will change the modification date/time,
+   but the file might be exactly the same. You have to
+   determine if the new one is different from the old one
+   by doing a CRC or similar.
+   
+   20011126 bstanley If you were to maintain a record of the last modified 
+date/time
+   for each file, and if when you come to check it again and update the CRC,
+   you could avoid re-calculating the CRC if the date/time of the file
+   has not changed This produces a significant time saving,
+   whilst still providing the same functionality to clients. bstanley
+   
+   20011127 bstanley Applied patch by LGB which implements this date based
+   shortcut method. Speedup is significant except when the file is first entered
+   into the deptable. Tested on large thesis with many .eps files, bibliography,
+   glossary, index, etc.
+   
+   20011128 bstanley turns out that was too optimistic - things were being
+   returned as changed when they weren't. Should be fixed now.
+   
+   20011128 bstanley added a flag which is set when something changes,
+   to speed up lookups.
+*/
+
+inline bool DepTable::dep_info::changed() const
+{
+   return mtime_prev != mtime_curr  crc_prev != crc_curr;
+}
+
 void DepTable::insert(string const  fi,
- bool upd,
- unsigned long one,
- unsigned long two)
+ bool upd )
 {
// not quite sure if this is the correct place for MakeAbsPath
string f = MakeAbsPath(fi);
if (deplist.find(f) == deplist.end()) {
+   dep_info di;
+   di.crc_prev = 0;
+   di.mtime_prev = 0;
if (upd) {
-   one = two;
-   two = lyx::sum(f);
+   lyxerr[Debug::DEPEND]   CRC...  flush

[BbMaj7@yahoo.com.au] Feedback from www.lyx.org

2001-11-28 Thread Jean-Marc Lasgouttes


Angus, I guess you are the one who can answer Richard's wish.

JMarc


---BeginMessage---


Richard Andrews ([EMAIL PROTECTED]) entered the 
following feedback message on the LyX home page:



praise

To all the LyX team.

Great work.

This is a fantastic piece of software. I've been using LyX since the 0.10 days (circa 
1997) and even then it was pretty good

I have just finished writing my PhD thesis (image processing) using LyX as the LaTeX 
front end. I used mostly version 1.2.x (from memory) from 1997 through to present day.

Thank you all. I would not have been able to do it on Linux without LyX.

/praise

--


Now that you're all warm and fuzzy I have a feature request.

Having used LyX over several generations for massive document processing spread across 
several files I have found one area which could do with improvement. In particular the 
insertion of citations. I have recently updated to version 1.6fix1 via Mandrake 8.0 (I 
know it isn't the latest but I don't see this fixed in the change log).
It is now no longer possible to _type_ a bibtex reference for a citation, selection 
must be made from a list box. This seems to require that the file being edited has the 
bibliography database included. When dealing with a multi-file document this is not 
going to be the case.

I would like a way to nominate bibliography databases in a LyX file without including 
them for TeX processing. Perhaps an option on BibTeX files to disable typesetting like 
with the include facility. Even better would be a way to group a set of files to use 
common resources, like document options and bibtex databases.

--

P.S. xforms menus have always sucked. Good luck with the GTK front end.


L8r


Rich

--
Richard Andrews
Software Engineer
Open Telecommunications Ltd
Melbourne
Australia




---End Message---


Re: [PATCH] annotate added space

2001-11-28 Thread Juergen Vigna


On 27-Nov-2001 John Levon wrote:

 so how do I tell from setParagraph whether the para is inside an insettext ?

Well this is really easy to do, IMO. EVERY paragraph having an owner IS
inside a InsetText! So when updating the paragraph options you have just
to look if the corresponding paragraphs has an owner() != 0 and then disable
the checkboxes for the pagebreaks!

A second step would be to check pasting text into a InsetText and diable
eventually setted pagebreaks in that case.

  Jug

P.S.: Anyway IMO the patch can go in asis (and I think Jean-Marc did this
  already didn't he?) and then we will address the above problems.

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

It is better to kiss an avocado than to get in a fight with an aardvark.




Re: [BUG] close prefs dialog abort in 1.1.6fix3

2001-11-28 Thread Juergen Vigna


On 27-Nov-2001 Ben Stanley wrote:

 xforms-0.88-3
 
 System is RH7.1

Hmm I had problems with that particular rpm version and therefore installed
xforms-0.88-9, I cannot remember which problems I had thought.

Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Birds and bees have as much to do with the facts of life as black
nightgowns do with keeping warm.
-- Hester Mundis, Powermom




Re: [PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Jean-Marc Lasgouttes

 Ben == Ben Stanley [EMAIL PROTECTED] writes:

Ben Patch attached (DepTable.patch) for cvs BRANCH_1_1_6 has the
Ben following features:

While I'll let Lars state whether he wants this patch in 1.2.0cvs, I
am not going to take it in 1.1.6 because I do not want extensive
changes in there. The rationale is that we have no time to test it
well enough.

However, if you have a few obvious fixes that you can extract from
this patch, I'll be glad to apply them. 

JMarc

PS: note also that changelog entries are really appreciated.



Re: [PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Jean-Marc Lasgouttes

 Lars == Lars Gullik Bjønnes [EMAIL PROTECTED] writes:

Lars I leave it to Jean-Marc to decide if this patch should go in
Lars 1.1.6, but I would be a bit reluctant. 

Yes, I am, as I posted earlier.

Lars Perhaps only the mmap patch since that is a lot smaller and
Lars easier to test.

I have to admit I do not know much about mmap and issues it may have
on some systems. Is that 100% portable?

JMarc



Re: [BbMaj7@yahoo.com.au] Feedback from www.lyx.org

2001-11-28 Thread Angus Leeming

  Richard Andrews ([EMAIL PROTECTED]) entered the 
 following feedback message on the LyX home page:
 --
 praise
 
 To all the LyX team.
 
 Great work.
 
 This is a fantastic piece of software. I've been using LyX since the 0.10 
days (circa 1997) and even then it was pretty good

On behalf of the LyX team: thanks! It's always good to get a pat on the back.

 I have just finished writing my PhD thesis (image processing) using LyX as 
the LaTeX front end. I used mostly version 1.2.x (from memory) from 1997 
through to present day.

Congratulations on finishing that thesis!

 Now that you're all warm and fuzzy I have a feature request.
 
 Having used LyX over several generations for massive document processing 
spread across several files I have found one area which could do with 
improvement. In particular the insertion of citations. I have recently 
updated to version 1.6fix1 via Mandrake 8.0 (I know it isn't the latest but I 
don't see this fixed in the change log).

You really should upgrade to 1.1.6fix3 (rmps available from the LyX ftp 
site). The fix means just that: BUG FIXES! In fact, 1.1.6fix4 is due out any 
day now.

 It is now no longer possible to _type_ a bibtex reference for a citation, 
selection must be made from a list box. This seems to require that the file 
being edited has the bibliography database included. When dealing with a 
multi-file document this is not going to be the case.
 
 I would like a way to nominate bibliography databases in a LyX file without 
including them for TeX processing. Perhaps an option on bibtex files to 
disable typesetting like with the include facility. Even better would be a 
way to group a set of files to use common resources, like document options 
and bibtex databases.

I've been giving the bibliography stuff some thought over the last year or 
so. (It's my fault that you can no longer type in BibTeX references ;-). The 
citaion dialog that you use in 1.1.6 has been extended slightly in the 1.2 
series so that it now supports natbib \citet, \citep commands etc, but the 
basic interface (a browser to select the BibTeX references to cite) remains 
unchanged and will probably remain as it is.

Having said that, I do have test code that stores the BibTeX databases in a 
LyX-wide store, rather than in a per-document store (so that we need store 
the database a maximum of one time, independent of how many documents use 
it.) This won't appear in LyX 1.2.0 because we're currently in feature 
freeze, but is, I believe a step in the direction that you're suggesting.

The final step, to not output 
\bibliographystyle{style}
\bibliography{database}
when exporting to LaTeX should be achievable now if I understand you 
correctly.

I envisage something as simple as a checkbox in the BibTeX database dialog
x export to LaTeX
The user would turn this off if the document was included in a larger 
grouping of documents.

I don't use multi-part docs myself, so you'll have to tell me if that is 
sufficient. Ie, it's the master LyX document that includes all others that 
should contain the BibTeX databases that are exported to LaTeX?

Angus



A word of caution

2001-11-28 Thread Andre Poenitz


Looks like I broke the math parser yesterday. I think I can fix it during
the next few hours, if not I'll revert the last commits.

Just do not try to update _now_ for a thesis due tomorrow!

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: unapplied patches

2001-11-28 Thread Jean-Marc Lasgouttes

 John == John Levon [EMAIL PROTECTED] writes:

John has anyone picked up the FormParagraph patch ? It fixes a crash.

OK, I just applied it.

JMarc



Re: make install problems still

2001-11-28 Thread Jean-Marc Lasgouttes

 Garst == Garst R Reese [EMAIL PROTECTED] writes:

Garst The following should make it obvious 

Garst bash$ ls -l /usr/local/bin/bin

Did you run make distclean? What is the output of your configure
run?

JMarc



Re: make install problems still

2001-11-28 Thread Jean-Marc Lasgouttes

 Jean-Marc == Jean-Marc Lasgouttes [EMAIL PROTECTED] writes:

 Garst == Garst R Reese [EMAIL PROTECTED] writes:
Garst The following should make it obvious

Garst bash$ ls -l /usr/local/bin/bin

Jean-Marc Did you run make distclean? What is the output of your
Jean-Marc configure run?

running ./autogen.sh may be useful too.

JMarc



I'd like to release 1.1.6fix4 this week (status update #3)

2001-11-28 Thread Jean-Marc Lasgouttes


Hello,

Appended as usual is a list of what has been fixed since 1.1.6fix3. I
think that a 1.1.6fix4 release will be useful, especially since I
backported the selection bugfix from 1.2.0. Are there some other
things that should go in 1.1.6fix4? I'd like to release it this week,
since it will be more difficult during month of december.

Please tell me what are the open bugs you consider important for
1.1.6fix4. Also tell me if I forgot some of the changes. Changes since
last time include support for ae fonts and dvipdfm, and fixes to
insertion of error insets.

I may consider including some of the fixes sent by Ben Stanley for
dependency tracking, if I get simple ones _soon_ (today?).

I'd be glad if some of you could take the time to
check it out (or fix a bug or two if you are feeling adventurous). Let
me recall that all these fixes have been checked in the branch
BRANCH_1_1_6, which you can get with the command
 cvs checkout -d lyx-1_1_6 -r BRANCH_1_1_6 lyx-devel

JMarc

What's new
==

** Updates

- add support for latin3, latin4 and latin9 encodings

- change the encoding for estonian from latin4 to latin1, since it
  appears to be more suitable.

- add support for ae fonts (emulation of T1 encoding with OT1 fonts).
  This is useful for creating pdf files in T1 encoding

- add support for dvipdfm

- when passing a file name as argument from command line, the
  extension `.lyx' is added if necessary

- insert error insets in the documents when there have been unknown
  tokens in the file

- new class `kluwer'; update to hollywood class

- the class encts has been renamed to entcs (stupid typo!) and
  slightly updated

- updates to the russian localisation and the italian user guide

** Bugfixes

- faster loading of large files (should now be proportional to file size)

- fix positionning of error insets when running LaTeX

- fix possible crash when the cursor is between two spaces and a
  selection is begun

- fix reading under unix of lyx files produced under windows (was
  actually not fixed in 1.1.6fix3)

- fix problem where document is marked `changed' when going in/out an
  empty tabular cell

- fix the logic of quote insertion after '-', '[' and '{'

- fix generation of an extra space after an inset in linuxdoc creation

- do not ignore newline/hfill chars when copying to the clipboard

- fix insertion of \Upsilon in the math editor

- fix crash if banner-file was not found

- the `SubSection' layout of the cv class has been renamed to
  `Subsection'

- fix compilation with gcc 2.8.x

- improve the rpm spec file



Re: patches 4 lyx persian support

2001-11-28 Thread Jean-Marc Lasgouttes

 Mehdi ==   [EMAIL PROTECTED] writes:

Mehdi On 22 Nov 2001, Jean-Marc Lasgouttes wrote: hi

Mehdi i add the changes to the file patch.txt 

Sorry, but I did not find this patch.txt file. Where is it?

Mehdi please read it.. also
Mehdi persian encoding is a temporal name and encoding and as soon as
Mehdi possible i will send you new more-flexible source(perhaps next
Mehdi week) but basic changes are these i sent u. thanks a lot. Mehdi
Mehdi Adibi

Against which version are this changes?

JMarc



lyx1.1.6fix3: Menu Einfügen (german)

2001-11-28 Thread Hartmut Haase

The menu Einfügen contains the entries Include Datei and Insert Datei. They 
should be translated.
Regards,
Hartmut Haase

Hungerhilfe: http://www.thehungersite.com

ATTAC - für eine solidarische Weltwirtschaft
gegen neoliberale Globalisierung: http://www.attac-netzwerk.de

 www
(o o)
+---oOO--(_)--OOo---+
| Hartmut Haase   | Tel/Fax:|
| Im Bild 3   | {49|0}7544-3117 |
| D-88697 Bermatingen | |
|---|
|   Dummheit und Stolz sind aus gleichem Holz   |
+---+


Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr! 
Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13





Re: invisible math symbols?

2001-11-28 Thread Shigeru Miyata
In-Reply-To: [EMAIL PROTECTED]

Andre Poenitz [EMAIL PROTECTED] wrote:

 Does anybody know what exactly is going on and why the scaling does not
 work?

1.1.6 assumes that the font of the XLFD name
-*-*-*-*-*-*-*-*-*-*-*-*-adobe-fontspecific
is in the Adobe Symbol encoding.  While 1.2 asssumes
-*-cmmi-*-*-*-*-*-*-*-*-*-*-adobe-fontspecific
-*-msam-*-*-*-*-*-*-*-*-*-*-adobe-fontspecific
-*-msbm-*-*-*-*-*-*-*-*-*-*-adobe-fontspecific
etc. are in some kind of TeX encodings.

However, the last two fields in XLFD (X logical font description)
"charset-encoding" predefine a keyword "adobe-fontspecific" to mean
any character set/encoding pair you want.

It is natural that there are fonts of such XLFD with incompatible
charcter sets/encodings.

Try
lyx -dbg font
on a machine with the symptom.


Regards,
SMiyata


Re: [BUG] close prefs dialog abort in 1.1.6fix3

2001-11-28 Thread Ben Stanley

Juergen Vigna wrote:

On 27-Nov-2001 Ben Stanley wrote:

xforms-0.88-3

System is RH7.1


Hmm I had problems with that particular rpm version and therefore installed
xforms-0.88-9, I cannot remember which problems I had thought.

I just found an xforms-0.88-15 from RH7.0-powertools. So I downloaded it 
and installed it.

Then started lyx 1.1.6fix3, which is dynamically linked to xforms, and 
that is the file which was just upgraded. (checked with ldd)


Now I open my thesis, and while the previews are rendering, I open the 
preferences dialog, change a setting (the temp dir), click save, and get

blah blah
MainLoopUser Event(33,w=0x796 s=14834) ClientMessage
MainLoopUser Event(7,w=0x700017c s=15098) EnterNotify Mode Normal
In EventCallback [events.c 34] Unknown window=0x700017c
Ignored Event(7,w=0x700017c s=15098) EnterNotify Mode Normal
PutbackEvent Event(7,w=0x700017c s=15098) EnterNotify Mode Normal
LyX: This shouldn't happen...
BadWindow (invalid Window parameter)
Aborted (core dumped)

backtrace:

(gdb) where
#0  0x4104d651 in __kill () from /lib/libc.so.6
#1  0x4104d3cd in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x4104ea38 in abort () at ../sysdeps/i386/bits/string.h:230
#3  0x081c163b in fl_set_button ()
#4  0x080ba825 in fl_set_button ()
#5  0x400f7d87 in _XError () from /usr/X11R6/lib/libX11.so.6
#6  0x400f63f3 in _XReply () from /usr/X11R6/lib/libX11.so.6
#7  0x400eca3e in XQueryPointer () from /usr/X11R6/lib/libX11.so.6
#8  0x40068fdd in fl_get_win_mouse () from /usr/X11R6/lib/libforms.so.0.88
#9  0x400324a8 in fl_compress_motion () from /usr/X11R6/lib/libforms.so.0.88
#10 0x400324fe in fl_compress_event () from /usr/X11R6/lib/libforms.so.0.88
#11 0x40040383 in get_next_event () from /usr/X11R6/lib/libforms.so.0.88
#12 0x4003f213 in do_interaction_step () from 
/usr/X11R6/lib/libforms.so.0.88
#13 0x4003fb5d in fl_treat_interaction_events () from 
/usr/X11R6/lib/libforms.so.0.88
#14 0x4003fb9e in fl_check_forms () from /usr/X11R6/lib/libforms.so.0.88
#15 0x08178364 in fl_set_button ()
#16 0x080bb9e4 in fl_set_button ()
#17 0x080bcff4 in fl_set_button ()
#18 0x080e5e2a in fl_set_button ()
#19 0x4103b0ee in __libc_start_main (main=0x80e5d60 
fl_set_button+615424, argc=3,
ubp_av=0xb7d4, init=0x804dd98 _init, fini=0x821e090 _fini,
rtld_fini=0x4100cf28 _dl_fini, stack_end=0xb7cc)
at ../sysdeps/generic/libc-start.c:129

So same as before. Probably still a bug in xforms...

Ben.




Re: [PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Ben Stanley

Jean-Marc Lasgouttes wrote:

Lars == Lars Gullik Bjønnes [EMAIL PROTECTED] writes:


Lars I leave it to Jean-Marc to decide if this patch should go in
Lars 1.1.6, but I would be a bit reluctant. 

Yes, I am, as I posted earlier.

Lars Perhaps only the mmap patch since that is a lot smaller and
Lars easier to test.

I have to admit I do not know much about mmap and issues it may have
on some systems. Is that 100% portable?

JMarc

I don't know - that's what autoconf is for. If autoconf isn't happy with 
mmap, then my implementation defaults back to the fastest kind of 
istream iterator available.

I did notice that gettext already uses mmap (intl/loadmsgcat.c) if it is 
available. They also check HAS_MUNMAP - perhaps I should too.

With the autoconf macros, I don't think you have much to worry about.

Ben.





Re: [BUG] close prefs dialog abort in 1.1.6fix3

2001-11-28 Thread Jose Abilio Oliveira Matos

On Wed, Nov 28, 2001 at 11:38:18PM +1100, Ben Stanley wrote:
 Juergen Vigna wrote:
 
 I just found an xforms-0.88-15 from RH7.0-powertools. So I downloaded it 
 and installed it.

  Known problem, that version of powertools is wrong, since it is
linked against the wrong glibc version.

  Please take the version from Kayvan's site. (I guess that it is also
in the lyx ftp site). The version of the xforms rpm is correct there.

 Then started lyx 1.1.6fix3, which is dynamically linked to xforms, and 
 that is the file which was just upgraded. (checked with ldd)
 
 
 Now I open my thesis, and while the previews are rendering, I open the 
 preferences dialog, change a setting (the temp dir), click save, and get

-- 
José Abílio Matos
LyX and docbook a perfect match. :-)



Re: [PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Ben Stanley

Lars Gullik Bjønnes wrote:

Ben Stanley [EMAIL PROTECTED] writes:

| Andre Poenitz wrote:

On Wed, Nov 28, 2001 at 07:00:14AM +1100, Ben Stanley wrote:

The advantage of putting everything in the deptree is that if you modify
a figure .eps and then do the latex-DVI thing from the menu, then
everything will be re-generated OK.

If that works I owe you a beer...

Andre'

| I just went to test this out...

| It works - as long as you actually change the included file and don't
| just change the mtime (eg touch it)!

| So, it looks like Andre owes me a beer - except I don't drink beer. Bummer.

You posted only the patch to .h...

Actually, it looks like the patch was missing changes to LaTeX.h/LaTeX.C 
. DepTable.h and DepTable.C were there, but they would not have compiled 
without the others... Sorry.

Anyway, I take it from the comments on the code snipped that this 
encouragement to re-work the mmap patch for 1.1.6 and 1.2, and to tidy 
up everything else for 1.2...

I have actually written a large amount of code to support improved error 
reporting of references/labels/citations etc, and preliminary support 
for the gloss package (glossaries), which you guys have not seen yet. 
Right now it all works for me. The problem I seem to have now is to 
break it all up into small enough patches that you guys can 
digest/review/run it, and maybe apply it to whichever branch is 
appropriate... I think it's ready for wider testing. I just came along 
at the wrong time, didn't I? (feature freeze...)

I'd really like to get these changes all sent in, but maybe for now I 
should just try to use my modified LyX for thesis writing (I *require* 
glossary support and improved error reporting). I'm just worried that if 
I leave it a while before submitting patches it will be harder to 
port/apply them...

So, at the moment I'm feeling quite discouraged... :-(  the number of 
patches I must create is large, and the patches have to be so perfect. 
But perhaps I just need to figure out your way of doing things.

So perhaps I made the wrong decision to modify 1.1.6? I need to work 
with a fairly stable LyX, so that's where I started. At least now I have 
a local version of LyX that will support my requirements, and seems stable.

Anyway, I'll try to keep to your style and submit complete patches in 
future!

Ben.





Re: [PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Andre Poenitz

On Wed, Nov 28, 2001 at 11:46:59PM +1100, Ben Stanley wrote:
  Is that 100% portable?

mmap is most certainly not available everywhere, but...

 I don't know - that's what autoconf is for. If autoconf isn't happy with 
 mmap, then my implementation defaults back to the fastest kind of 
 istream iterator available.

... this approach is probably the best thing to do.

And if it really helps it should go into 1.2 at least...

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [BUG] close prefs dialog abort in 1.1.6fix3

2001-11-28 Thread Ben Stanley

Jose Abilio Oliveira Matos wrote:

On Wed, Nov 28, 2001 at 11:38:18PM +1100, Ben Stanley wrote:

Juergen Vigna wrote:

I just found an xforms-0.88-15 from RH7.0-powertools. So I downloaded it 
and installed it.


  Known problem, that version of powertools is wrong, since it is
linked against the wrong glibc version.

  Please take the version from Kayvan's site. (I guess that it is also
in the lyx ftp site). The version of the xforms rpm is correct there.

ftp://ftp.lyx.org/pub/lyx/contrib

has xforms-0.88-3.rpm, which is the one I just replaced. It exhibited 
the same behaviour.

I don't know where Kayvan's site is.

Ben.






Re: [BUG] close prefs dialog abort in 1.1.6fix3

2001-11-28 Thread Jean-Marc Lasgouttes

 Ben == Ben Stanley [EMAIL PROTECTED] writes:

Ben Jose Abilio Oliveira Matos wrote:
 On Wed, Nov 28, 2001 at 11:38:18PM +1100, Ben Stanley wrote:
 Juergen Vigna wrote:
 
 I just found an xforms-0.88-15 from RH7.0-powertools. So I
 downloaded it and installed it.
 
  Known problem, that version of powertools is wrong, since it is
 linked against the wrong glibc version.
 
 Please take the version from Kayvan's site. (I guess that it is
 also in the lyx ftp site). The version of the xforms rpm is correct
 there.
 
Ben ftp://ftp.lyx.org/pub/lyx/contrib

Ben has xforms-0.88-3.rpm, which is the one I just replaced. It
Ben exhibited the same behaviour.

Ben I don't know where Kayvan's site is.

It is ftp.sylvan.com, but the rpm is the same. BTW, I do not think
your problem is what one can see with bad glibc version.

JMarc






Re: [PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Jean-Marc Lasgouttes

 Ben == Ben Stanley [EMAIL PROTECTED] writes:

Ben Anyway, I take it from the comments on the code snipped that
Ben this encouragement to re-work the mmap patch for 1.1.6 and 1.2,
Ben and to tidy up everything else for 1.2...

As far as 1.1.6 is concerned, I will be happy to take any simple and
safe patches. If everybody tells me that the mmap patch is safe, I'll
apply it (my concern is that I do not really understand it, so I have
to rely on others).

Ben I have actually written a large amount of code to support
Ben improved error reporting of references/labels/citations etc, and
Ben preliminary support for the gloss package (glossaries), which you
Ben guys have not seen yet. 

This is very good stuff. We need something like that.

Ben I'd really like to get these changes all sent in, but maybe for
Ben now I should just try to use my modified LyX for thesis writing
Ben (I *require* glossary support and improved error reporting). I'm
Ben just worried that if I leave it a while before submitting patches
Ben it will be harder to port/apply them...

As far as 1.1.6 is concerned, it will not be possible to get
everything in. For 1.2.0, I guess it depends on what s in the patches
and Lars has the final word. The patches will certainly be welcome for
post-1.2.0 (judging from the quality of the patches I have seen).

Ben So, at the moment I'm feeling quite discouraged... :-( 

Please don't...

Ben the number of patches I must create is large, and the patches
Ben have to be so perfect. But perhaps I just need to figure out your
Ben way of doing things.

The patches have to be architecturally good to go in main branch and
have to be safe to go in 1.1.6.

Ben So perhaps I made the wrong decision to modify 1.1.6? 

It was the good decision in the sense that you need them for your
work. However, they will have to be ported to 1.2.0cvs.

JMarc



Re: [PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Jean-Marc Lasgouttes

 Ben == Ben Stanley [EMAIL PROTECTED] writes:

Ben I don't know - that's what autoconf is for. If autoconf isn't
Ben happy with mmap, then my implementation defaults back to the
Ben fastest kind of istream iterator available.

Agreed.

Ben I did notice that gettext already uses mmap (intl/loadmsgcat.c)
Ben if it is available. They also check HAS_MUNMAP - perhaps I should
Ben too.

Ben With the autoconf macros, I don't think you have much to worry
Ben about.

OK. So since everybody agrees, I'll accept a patch with the mmap stuff
in. Could you please check that it still compiles when HAS_MMP is
false?

JMarc





Re: [PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Ben Stanley

| Lars Gullik Bjønnes wrote:



istreambuf_iterator:
time ./test_crc /boot/vmlinuz-2.4.9-13
CRC: 2642954630

real0m0.252s
user0m0.130s
sys 0m0.000s


istream_iterator:
 time ./test_crc /boot/vmlinuz-2.4.9-13
CRC: 2642954630

real0m0.550s
user0m0.260s
sys 0m0.010s

(box compiling LyX at the time so there was a bit of load...)


Lars,

would you mind sending me the source of that test program, and I'll test 
out this patch with the two different implementations and compare results?

I think the biggest issue with this patch is portability, which is also 
looked after by autoconf, so if I can  regression test it against the 
previous implementation and make it all come out the same we should be OK.

Lars Gullik Bjønnes wrote:


| +// Figure out what iterator implementation we are going to use...
| +// This currently selects mmap over istreambuf_iterator.
| +#ifdef HAVE_MMAP
| +#ifdef __GNUC__

Hmm WITH_WARNINGS exist in 1.1.6 too.



| +#warning lyx::sum() using mmap (lightning fast but untested)
| +#endif
| +#define USE_MMAP
| +#elif HAVE_DECL_ISTREAMBUF_ITERATOR
| +#ifdef __GNUC__
| +#warning lyx::sum() using istreambuf_iterator (fast)
| +#endif
| +#define USE_ISTREAMBUF_ITER
| +#define USE_STREAM
| +#else
| +#ifdef __GNUC__
| +#warning lyx::sum() using istream_iterator (slow as a snail)
| +#endif
| +#define USE_ISTREAM_ITER
| +#define USE_STREAM
| +#endif

And why are these new defines needed? Can't we just use

HAVE_MMAP, HAVE_DECL_ISTREAMBUF_ITERATOR directly?

This seemed simpler... to decide which implementation to use when you 
may have more than one available. Extending the original scheme would 
have been *really* ugly, with #if defined(this)  !defined(that) all 
over the place.

It also simplifies the macros when you have to check multiple things eg 
I have now discovered I should check HAVE_MMAP and HAVE_MUNMAP, as well 
as possibly one other macro. With this arrangement, I only have to 
change it in *one* place. It also allows me to conveniently control 
inclusion of header files, without writing
#if blah blah blah
everywhere and risking not changing them all in a future mod.

I'd rather keep this.



| +char *beg = (char*)mm;
| +char *end = ((char*)mm)+info.st_size;

Ok, I know I used c-style cast in my example, but here we should use
C++-style casts. static_cast or reinterpret_cast here.

OK, I'm figuring out which one we should use.


And we should find a way to avoid this much ifdef clutter.  

I'm thinking of breaking it into two separate implementations, one for 
mmap and one for streams, controlled by #ifdefs. It's looking much tidier.

Lars, thanks for taking the time to make comments.

Ben.






Re: Read this

2001-11-28 Thread Jean-Marc Lasgouttes

 Lars == Lars Gullik Bjønnes [EMAIL PROTECTED] writes:

Lars In regard to some of the discussions that we have had lately:

Lars http://fuzzy.snakeden.org/intj/

So you _are_ God, aren't you?

JMarc



Re: [PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Jean-Marc Lasgouttes

 Ben == Ben Stanley [EMAIL PROTECTED] writes:

  And we should find a way to avoid this much ifdef clutter.
Ben I'm thinking of breaking it into two separate implementations,
Ben one for mmap and one for streams, controlled by #ifdefs. It's
Ben looking much tidier.

That's what I was about to suggest :)

JMarc



Re: Read this

2001-11-28 Thread Andre Poenitz

On Wed, Nov 28, 2001 at 02:34:02PM +0100, Lars Gullik Bjønnes wrote:
 In regard to some of the discussions that we have had lately:
 http://fuzzy.snakeden.org/intj/

But you would not go as far as assigning names to the roles by any chance,
would you ;-}

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [BUG] close prefs dialog abort in 1.1.6fix3

2001-11-28 Thread Juergen Vigna


On 28-Nov-2001 Ben Stanley wrote:

Hmm I had problems with that particular rpm version and therefore installed
xforms-0.88-9, I cannot remember which problems I had thought.

 I just found an xforms-0.88-15 from RH7.0-powertools. So I downloaded it 
 and installed it.

No now that I remember it was that version in RH7.0-powertools which was
wrong! Sorry if I just remember now. I don't know if the one I use does
have the same problem as yours (probably).

  Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

The kind of danger people most enjoy is the kind they can watch from
a safe place.




still crashing

2001-11-28 Thread Andre Poenitz


There is still some serious problem in text.C...

The attached example crashes my lyx (current cvs) if I simply scroll to the
end. If I take out a few more lines from the file, it renders nicely.

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]


#LyX 1.2 created this file. For more info see http://www.lyx.org/
\lyxformat 220
\textclass article
\begin_preamble
\usepackage{bbm}
\usepackage{epsfig}
\usepackage{psfrag}

\newcommand{\ds}{\displaystyle}
\newcommand{\uu}{\mbox{ü}}
\newcommand{\oo}{\mbox{ö}}
\newcommand{\sss}{\mbox{ß}}


\DeclareMathSizes{10.95}{10}{7.4}{6}
\end_preamble
\options draft|final
\language german
\inputencoding latin1
\fontscheme default
\graphics default
\float_placement htbp
\paperfontsize 11
\spacing single 
\papersize Default
\paperpackage widemarginsa4
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 1
\paperorientation portrait
\secnumdepth 2
\tocdepth 2
\paragraph_separation skip
\defskip medskip
\quotes_language german
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Title


Abbildungen
\layout Itemize

aber Konverter definierbar
\layout Itemize

direkt mit dem neuen Graphik-Inset
\layout Standard


\layout Itemize

auch floats möglich:
\layout Standard


\begin_inset Float figure
placement t
wide false
collapsed false

\layout Standard


\hfill 

\begin_inset Figure size 238 155
file loesung.eps
subcaption Zweites Bild
width 3 40
flags 9
subfigure

\end_inset 


\layout Caption

Lösung
\end_inset 


\layout Section

Minipages
\layout Itemize

ziemlich wackelig
\layout Itemize

Probleme bei der Anzeige
\layout Standard


\begin_inset Minipage
position 1
inner_position 0
height 
width 40%
collapsed false

\layout Standard

\end_inset 


\hfill 

\begin_inset Minipage
position 0
inner_position 0
height 
width 40%
collapsed false

\layout Standard
\end_inset 


\the_end



cvs compile error in BRANCH_1_1_6

2001-11-28 Thread Ben Stanley

make[3]: Entering directory 
`/share/install/linux/extras/lyx/lyx-BRANCH_1_1_6/lyx-devel/src'
g++ -DHAVE_CONFIG_H -I. -I. -I. -I.. -I.. -I../boost-isystem 
/usr/X11R6/include  -g -O -fno-exceptions -W -Wall -c BufferView2.C
In file included from BufferView2.C:24:
LyXView.h:38: using directive `Object' introduced ambiguous type
`_ObjectRec *'

inserting #include sigc++/object.h at the top of LyXView.h fixes this one.

It seems to me that you need to #include the defn of Object to get this 
to compile - there is no way around having the definition of that object 
before inheriting from it.

same problem with
src/minibuffer.h, except that inserting the #include doesn't fix that ?!?

Ben.





[PATCH] mmap CRC checking 1.1.6

2001-11-28 Thread Ben Stanley

I have now tested this. First number is mmap CRC. Second number is 
istream_iterator CRC. They seem to fail differently on directories - in 
this case, I think that istream_iterator version is wrong.

This patch only applies to BRANCH_1_1_6. I will send another for 1.2.

I haven't compiled the whole of LyX with this because cvs is broken atm 
(see my other mail), but I have compiled it in 2 different ways as per 
JML's request.

$ checkCRC /boot/*
/boot/boot.0300 1729887102 1729887102 OK
/boot/boot.b 2073074794 2073074794 OK
/boot/chain.b 361202963 361202963 OK
/boot/kernel.h 1951086079 1951086079 OK
/boot/kernel.h-2.4.2 1951086079 1951086079 OK
/boot/lost+found 0 4294967295 FAIL
/boot/map 0 0 OK
/boot/message 4218120946 4218120946 OK
/boot/module-info 3046675311 3046675311 OK
/boot/module-info-2.4.2-2 3046675311 3046675311 OK
/boot/os2_d.b 679864059 679864059 OK
/boot/System.map 3662491832 3662491832 OK
/boot/System.map-2.4.2-2 3542708047 3542708047 OK
/boot/System.map-2.4.4 279845350 279845350 OK
/boot/System.map-2.4.5-ac5 1886247741 1886247741 OK
/boot/System.map-2.4.6 3662491832 3662491832 OK
/boot/System.map.old 583674341 583674341 OK
/boot/vmlinux-2.4.2-2 3009846913 3009846913 OK
/boot/vmlinuz 1730371782 1730371782 OK
/boot/vmlinuz-2.4.2-2 3873679430 3873679430 OK
/boot/vmlinuz-2.4.4 1055800826 1055800826 OK
/boot/vmlinuz-2.4.5-ac5 3968027610 3968027610 OK
/boot/vmlinuz-2.4.6 1730371782 1730371782 OK
/boot/vmlinuz.old 3071668570 3071668570 OK
There was 1 failure.
/boot/lost+found

$ cat checkCRC
#!/bin/sh
# Runs the lyxsum programs on every file given in the argument list and
# records any failures.

PROG1=lyxsum.mmap
PROG2=lyxsum.istream_iterator

FAILCOUNT=0;
FAILLIST=

for file in $@
do
  CRC1=`$PROG1 $file | awk -- '{print $2}'`
  CRC2=`$PROG2 $file | awk -- '{print $2}'`

  if [ $CRC1 -eq $CRC2 ]
  then
  RESULT=OK
  else
  RESULT=FAIL
  FAILCOUNT=`echo $FAILCOUNT + 1 | bc`
  FAILLIST=$FAILLIST $file
  fi
  echo $file $CRC1 $CRC2 $RESULT
done

if [ $FAILCOUNT -ne 0 ]
then
if [ $FAILCOUNT -eq 1 ]
then
echo There was 1 failure.
else
echo There were $FAILCOUNT failures.
fi
echo $FAILLIST
else
echo All tests passed
fi



--- lyx-devel-orig/src/support/lyxsum.C Wed Jun  6 02:52:55 2001
+++ lyx-devel/src/support/lyxsum.C  Thu Nov 29 02:01:41 2001
@@ -1,7 +1,7 @@
 /* This file is part of
  * ==
- * 
- *   LyX, The Document Processor
+ *
+ *   LyX, The Document Processor
  *
  *The function lyx::sum is taken from GNU textutill-1.22
  *and is there part of the program chsum. The chsum program
@@ -15,14 +15,8 @@
 
 #include config.h
 
-#include fstream
-#include iterator
-
 #include support/lyxlib.h
 
-using std::ifstream;
-using std::ios;
-
 // DO _NOT_ CHANGE _ANYTHING_ IN THIS TABLE
 static
 unsigned long const crctab[256] =
@@ -83,7 +77,7 @@
 
 /* Calculate the checksum of file FILE.
Return crc if successful, 0 if an error occurs. */
- 
+
 templatetypename InputIterator
 static inline
 unsigned long do_crc(InputIterator first, InputIterator last)
@@ -104,23 +98,86 @@
 }
 
 
-// And this would be the file interface.
-unsigned long lyx::sum(string const  file)
-{
-   std::ifstream ifs(file.c_str());
-   if (!ifs) return 0;
-   
-#ifdef HAVE_DECL_ISTREAMBUF_ITERATOR
-   // This is a lot faster...
-   std::istreambuf_iteratorchar beg(ifs);
-   std::istreambuf_iteratorchar end;
+// Various implementations of lyx::sum(), depending on what methods
+// are available. Order is faster to slowest.
+#if defined(HAVE_MMAP)  defined(HAVE_MUNMAP)
+   #ifdef WITH_WARNINGS
+   #warning lyx::sum() using mmap (lightning fast but untested)
+   #endif
+
+   #include sys/types.h
+   #include sys/stat.h
+   #include fcntl.h
+   #include unistd.h
+   #include sys/mman.h
+
+   unsigned long lyx::sum(string const  file)
+   {
+   int fd = open(file.c_str(), O_RDONLY);
+   if( !fd ) return 0;
+
+   struct stat info;
+   fstat(fd, info);
+
+   void * mm = mmap(0, info.st_size, PROT_READ,
+MAP_PRIVATE, fd, 0);
+   if (mm == MAP_FAILED) {
+   close(fd);
+   return 0;
+   }
+   char *beg = static_castchar*(mm);
+   char *end = beg + info.st_size;
+
+   unsigned long result = do_crc(beg,end);
+
+   munmap( mm, info.st_size );
+   close(fd);
+
+   return result;
+   }
 #else
-   // than this.
-   ifs.unsetf(std::ios::skipws);
-   std::istream_iteratorchar beg(ifs);
-   std::istream_iteratorchar end;
+   #include fstream
+   #include iterator
+
+   #if HAVE_DECL_ISTREAMBUF_ITERATOR
+   #ifdef WITH_WARNINGS
+   #warning lyx::sum() 

Re: cvs compile error in BRANCH_1_1_6

2001-11-28 Thread Jean-Marc Lasgouttes

 Ben == Ben Stanley [EMAIL PROTECTED] writes:

Ben make[3]: Entering directory
Ben `/share/install/linux/extras/lyx/lyx-BRANCH_1_1_6/lyx-devel/src'
Ben g++ -DHAVE_CONFIG_H -I. -I. -I. -I.. -I.. -I../boost -isystem
Ben /usr/X11R6/include -g -O -fno-exceptions -W -Wall -c
Ben BufferView2.C In file included from BufferView2.C:24:
Ben LyXView.h:38: using directive `Object' introduced ambiguous type
Ben `_ObjectRec *'

Ben inserting #include sigc++/object.h at the top of LyXView.h
Ben fixes this one.

Ben It seems to me that you need to #include the defn of Object to
Ben get this to compile - there is no way around having the
Ben definition of that object before inheriting from it.

Ben same problem with src/minibuffer.h, except that inserting the
Ben #include doesn't fix that ?!?

This is a symptom of having a bad xforms-0.88 rpm (the header is wrong
in fact). Make sure you use the one from ftp.lyx.org.

JMarc





[PATCH] mmap CRC checking 1.1.6

2001-11-28 Thread Ben Stanley

I have now tested this. First number is mmap CRC. Second number is 
istream_iterator CRC. They seem to fail differently on directories - in 
this case, I think that istream_iterator version is wrong.

This patch only applies to BRANCH_1_1_6. I will send another for 1.2.

I haven't compiled the whole of LyX with this because cvs is broken atm 
(see my other mail), but I have compiled it in 2 different ways as per 
JML's request.

$ checkCRC /boot/*
/boot/boot.0300 1729887102 1729887102 OK
/boot/boot.b 2073074794 2073074794 OK
/boot/chain.b 361202963 361202963 OK
/boot/kernel.h 1951086079 1951086079 OK
/boot/kernel.h-2.4.2 1951086079 1951086079 OK
/boot/lost+found 0 4294967295 FAIL
/boot/map 0 0 OK
/boot/message 4218120946 4218120946 OK
/boot/module-info 3046675311 3046675311 OK
/boot/module-info-2.4.2-2 3046675311 3046675311 OK
/boot/os2_d.b 679864059 679864059 OK
/boot/System.map 3662491832 3662491832 OK
/boot/System.map-2.4.2-2 3542708047 3542708047 OK
/boot/System.map-2.4.4 279845350 279845350 OK
/boot/System.map-2.4.5-ac5 1886247741 1886247741 OK
/boot/System.map-2.4.6 3662491832 3662491832 OK
/boot/System.map.old 583674341 583674341 OK
/boot/vmlinux-2.4.2-2 3009846913 3009846913 OK
/boot/vmlinuz 1730371782 1730371782 OK
/boot/vmlinuz-2.4.2-2 3873679430 3873679430 OK
/boot/vmlinuz-2.4.4 1055800826 1055800826 OK
/boot/vmlinuz-2.4.5-ac5 3968027610 3968027610 OK
/boot/vmlinuz-2.4.6 1730371782 1730371782 OK
/boot/vmlinuz.old 3071668570 3071668570 OK
There was 1 failure.
/boot/lost+found

$ cat checkCRC
#!/bin/sh
# Runs the lyxsum programs on every file given in the argument list and
# records any failures.

PROG1=lyxsum.mmap
PROG2=lyxsum.istream_iterator

FAILCOUNT=0;
FAILLIST=

for file in $@
do
  CRC1=`$PROG1 $file | awk -- '{print $2}'`
  CRC2=`$PROG2 $file | awk -- '{print $2}'`

  if [ $CRC1 -eq $CRC2 ]
  then
  RESULT=OK
  else
  RESULT=FAIL
  FAILCOUNT=`echo $FAILCOUNT + 1 | bc`
  FAILLIST=$FAILLIST $file
  fi
  echo $file $CRC1 $CRC2 $RESULT
done

if [ $FAILCOUNT -ne 0 ]
then
if [ $FAILCOUNT -eq 1 ]
then
echo There was 1 failure.
else
echo There were $FAILCOUNT failures.
fi
echo $FAILLIST
else
echo All tests passed
fi



--- lyx-devel-orig/src/support/lyxsum.C Wed Jun  6 02:52:55 2001
+++ lyx-devel/src/support/lyxsum.C  Thu Nov 29 02:01:41 2001
@@ -1,7 +1,7 @@
 /* This file is part of
  * ==
- * 
- *   LyX, The Document Processor
+ *
+ *   LyX, The Document Processor
  *
  *The function lyx::sum is taken from GNU textutill-1.22
  *and is there part of the program chsum. The chsum program
@@ -15,14 +15,8 @@
 
 #include config.h
 
-#include fstream
-#include iterator
-
 #include support/lyxlib.h
 
-using std::ifstream;
-using std::ios;
-
 // DO _NOT_ CHANGE _ANYTHING_ IN THIS TABLE
 static
 unsigned long const crctab[256] =
@@ -83,7 +77,7 @@
 
 /* Calculate the checksum of file FILE.
Return crc if successful, 0 if an error occurs. */
- 
+
 templatetypename InputIterator
 static inline
 unsigned long do_crc(InputIterator first, InputIterator last)
@@ -104,23 +98,86 @@
 }
 
 
-// And this would be the file interface.
-unsigned long lyx::sum(string const  file)
-{
-   std::ifstream ifs(file.c_str());
-   if (!ifs) return 0;
-   
-#ifdef HAVE_DECL_ISTREAMBUF_ITERATOR
-   // This is a lot faster...
-   std::istreambuf_iteratorchar beg(ifs);
-   std::istreambuf_iteratorchar end;
+// Various implementations of lyx::sum(), depending on what methods
+// are available. Order is faster to slowest.
+#if defined(HAVE_MMAP)  defined(HAVE_MUNMAP)
+   #ifdef WITH_WARNINGS
+   #warning lyx::sum() using mmap (lightning fast but untested)
+   #endif
+
+   #include sys/types.h
+   #include sys/stat.h
+   #include fcntl.h
+   #include unistd.h
+   #include sys/mman.h
+
+   unsigned long lyx::sum(string const  file)
+   {
+   int fd = open(file.c_str(), O_RDONLY);
+   if( !fd ) return 0;
+
+   struct stat info;
+   fstat(fd, info);
+
+   void * mm = mmap(0, info.st_size, PROT_READ,
+MAP_PRIVATE, fd, 0);
+   if (mm == MAP_FAILED) {
+   close(fd);
+   return 0;
+   }
+   char *beg = static_castchar*(mm);
+   char *end = beg + info.st_size;
+
+   unsigned long result = do_crc(beg,end);
+
+   munmap( mm, info.st_size );
+   close(fd);
+
+   return result;
+   }
 #else
-   // than this.
-   ifs.unsetf(std::ios::skipws);
-   std::istream_iteratorchar beg(ifs);
-   std::istream_iteratorchar end;
+   #include fstream
+   #include iterator
+
+   #if HAVE_DECL_ISTREAMBUF_ITERATOR
+   #ifdef WITH_WARNINGS
+   #warning lyx::sum() 

Re: [PATCH] mmap CRC checking 1.1.6

2001-11-28 Thread Jean-Marc Lasgouttes

 Ben == Ben Stanley [EMAIL PROTECTED] writes:

Ben I have now tested this. First number is mmap CRC. Second number
Ben is istream_iterator CRC. They seem to fail differently on
Ben directories - in this case, I think that istream_iterator version
Ben is wrong.

I think we do not need crc of directories, anyway.

Ben This patch only applies to BRANCH_1_1_6. I will send another for
Ben 1.2.

OK, I will apply that and ask everybody who can to test it.

Ben I haven't compiled the whole of LyX with this because cvs is
Ben broken atm (see my other mail), but I have compiled it in 2
Ben different ways as per JML's request.

Thanks.

A chagelog entry would be great, too.

JMarc



Re: [PATCH] mmap CRC checking 1.1.6

2001-11-28 Thread Ben Stanley

Ben Stanley wrote:

 I have now tested this. First number is mmap CRC. Second number is 
 istream_iterator CRC. They seem to fail differently on directories - 
 in this case, I think that istream_iterator version is wrong.

 This patch only applies to BRANCH_1_1_6. I will send another for 1.2.

 I haven't compiled the whole of LyX with this because cvs is broken 
 atm (see my other mail), but I have compiled it in 2 different ways as 
 per JML's request.

Sorry, this one didn't have the Changelog. I sent it again, with the 
changelog.





Some bug fixes

2001-11-28 Thread Juergen Vigna

 - Loading a document with a very large table (125 rows x 5 columns) causes the
   following console message(s):  Actcell not equal to actual cell!  (document by
   request)

Fixed (actually this is only a warning for internal reasons I left it there
but with lyxerr[INSETTEXT] ;)

 - Juergen V.: There is still a way to provoke infinite table repaintings (at least
   theoretically). But Juergen knows how to fix them. 

Well * hack-fix * please try but I'll put there a #warning that this should
be fixed in a better way! So now we don't have crashes but we may have wrong
painting, but I think that is better than a crash ;)

 - Insert a minipage or footnote into an empty document; select the right border
   of the LyX main window and reduce its size (with KDE 2, the window is updated
   repetitively as you move the mouse); at some threshold, the size of the inset
   is not updated anymore such that it is painted past the right border of the 
   main window (virtually, of course :-))

This is a general problem and IMO also a KDE problem when you can resize the
windows with seeing the contents. IMO we won't fix this with the actual xforms
library!

 - Place 10 collapsed footnotes after each other and move the cursor between them 
 - the cursor position becomes more and more incorrect from left to right

Fixed!

 - Even though _a_spell dies, the message The _i_spell process has died is printed

Fixed!

 - Cosmetics: If the spell checker dies, an error dialog is shown in which 
   the OK button touches the last line of the error description

Should be fixed!

 - The spell checker ignores table cells! (#229140)

Fixed! (who did introduce the allowSpellcheck() function was it myself?)

That's all I could do with my sparetime today ;)

 Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

You will not be elected to public office this year.




Re: cvs compile error in BRANCH_1_1_6

2001-11-28 Thread Jean-Marc Lasgouttes

 Ben == Ben Stanley [EMAIL PROTECTED] writes:

Ben Jean-Marc Lasgouttes wrote:
 Ben == Ben Stanley [EMAIL PROTECTED] writes:
 
  This is a symptom of having a bad xforms-0.88 rpm (the header is
 wrong in fact). Make sure you use the one from ftp.lyx.org.
 
 JMarc
 
Ben Ben dutifuly downgrades his xforms installation... Lo and behold,
Ben LyX compiles again (without the hacks).

Actually, it is not really a downgrade. The redhat powertools rpm is
buggy.

JMarc





Re: Some bug fixes

2001-11-28 Thread Jean-Marc Lasgouttes

 Juergen == Juergen Vigna [EMAIL PROTECTED] writes:

 - Loading a document with a very large table (125 rows x 5 columns)
 causes the following console message(s): Actcell not equal to
 actual cell! (document by request)

Juergen Fixed (actually this is only a warning for internal reasons I
Juergen left it there but with lyxerr[INSETTEXT] ;)

Did you manage in reproducing it? I would be interested to see why it
happens. I'm not sure what I am supposed to do to this 125x5 tabular
to get the message.

JMarc



[BUG] HEAD cvs InsetNote() causes assert failure

2001-11-28 Thread Ben Stanley

This constructor passes an un-initialised pos to insertStringAsLines. I 
presume it should be initialised to 0?

This causes an assert failure down in Pragraph::pimpl::insertChar().

// This constructor is used for reading old InsetInfo
InsetNote::InsetNote(Buffer const * buf, string const  contents,
 bool collapsed)
: InsetCollapsable(collapsed)
{
init();

Paragraph * par = inset.paragraph();
LyXFont font(LyXFont::ALL_INHERIT, buf-params.language);

// Since XForms doesn't support RTL, we can assume that old notes
// in RTL documents are written in English.
if (font.language()-RightToLeft())
font.setLanguage(default_language);

lyx::pos_type pos;
buf-insertStringAsLines(par, pos, font, strip(contents, '\n'));
}





Re: [BUG] HEAD cvs InsetNote() causes assert failure

2001-11-28 Thread Andre Poenitz

On Thu, Nov 29, 2001 at 03:47:50AM +1100, Ben Stanley wrote:
 This constructor passes an un-initialised pos to insertStringAsLines. I 
 presume it should be initialised to 0?

Gasp! Yes. Certainly. And it used to be. My fault.

I can even explain how this evolved... but I'll try to fix it first.

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [BUG] HEAD cvs InsetNote() causes assert failure

2001-11-28 Thread Andre Poenitz

On Thu, Nov 29, 2001 at 03:47:50AM +1100, Ben Stanley wrote:
 This constructor passes an un-initialised pos to insertStringAsLines. I 
 presume it should be initialised to 0?

And now to the explanation: I saw the useless variable, removed it. Then
noticed that the parameter was passed by (non-const) reference, and
re-introduced it. And of course forgot that there was a initilization in
the beginning.

I hope this is the explantion for all those sudden crashes that came up
suspiciously soon after the introduction of lyx::pos_type...

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [BUG] HEAD cvs InsetNote() causes assert failure

2001-11-28 Thread Ben Stanley

Andre Poenitz wrote:

On Thu, Nov 29, 2001 at 03:47:50AM +1100, Ben Stanley wrote:

This constructor passes an un-initialised pos to insertStringAsLines. I 
presume it should be initialised to 0?


And now to the explanation: I saw the useless variable, removed it. Then
noticed that the parameter was passed by (non-const) reference, and
re-introduced it. And of course forgot that there was a initilization in
the beginning.

I hope this is the explantion for all those sudden crashes that came up
suspiciously soon after the introduction of lyx::pos_type...

Andre'

I propose a grep for lyx::pos_type and a double check...

Where one bug has been found, similar ones usually lurk...

Ben.





Re: Removing optimisation while debugging

2001-11-28 Thread Jean-Marc Lasgouttes

 Ben == Ben Stanley [EMAIL PROTECTED] writes:

Ben I like to use kdevelop (or some other program with a debugger)
Ben for investigating LyX. In fact I utilise the debugger quite
Ben heavily.

Ben While I was working in my private tree doing my big mods, I
Ben actually removed the -O from the command line for the development
Ben build. This allows the debugger to be more useful - no code
Ben motion, easier to deal with templates (no inlining), better
Ben correspondence between source and machine code.

With 1.2.0cvs, you can do ./configure --disable-optimization.

Ben What do people think of doing this in the main tree?

I seem to remember that some compilation warnings are only reported
when doing an optimized build.

JMarc



Re: Removing optimisation while debugging

2001-11-28 Thread Ben Stanley

Jean-Marc Lasgouttes wrote:

Ben == Ben Stanley [EMAIL PROTECTED] writes:


Ben I like to use kdevelop (or some other program with a debugger)
Ben for investigating LyX. In fact I utilise the debugger quite
Ben heavily.

Ben While I was working in my private tree doing my big mods, I
Ben actually removed the -O from the command line for the development
Ben build. This allows the debugger to be more useful - no code
Ben motion, easier to deal with templates (no inlining), better
Ben correspondence between source and machine code.

With 1.2.0cvs, you can do ./configure --disable-optimization.

Ben What do people think of doing this in the main tree?

I seem to remember that some compilation warnings are only reported
when doing an optimized build.

JMarc

OK, that's what I needed to know.

Ben.






Re: [BUG] HEAD cvs InsetNote() causes assert failure

2001-11-28 Thread Andre Poenitz

On Thu, Nov 29, 2001 at 04:15:29AM +1100, Ben Stanley wrote:
 I propose a grep for lyx::pos_type and a double check...

Guess what I did the last ten minutes...

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Coding Questions (FormParagraph)

2001-11-28 Thread Juergen Spitzmueller

Hi all,

I'm currently trying to implement new fields/choices to the paragraph 
dialog as suggested by John.
These are additional fields for Space Above/Below: Length (Stretch 
and Shrink), which we need to read/ create files with paragraph 
spaces like 1cm+3em-2.5in.
I have two questions:

(1) Until now, we pass the content of the field/choice with the command:

string const length =
getLengthFromWidgets(dialog_-input_space_above,
 dialog_-choice_value_space_above);
space_top =
VSpace(LyXGlueLength(length));

What needs to be done here? Should I get the other lengths the same way 
and combine those three at the end to VSpace?
Furthermore we have the problem that shrink is a negative value in the 
file but should be displayed/ entered as positive value in the dialog 
(IMHO. E.g. 2cm+3em-2.5em should be displayed in the GUI as Value: 2 
cm - Stretch: 3 em - Shrink: 2.5 em). Is it possible to convert 
this?

(2.) Vice versa, we use the following commands to read the values and 
update the fields and choices:

string const default_unit = cm;
string const length =  par_-params().spaceTop().length().asString();
updateWidgetsFromLengthString(dialog_-input_space_above,
  dialog_-choice_value_space_above,
  length, default_unit);

What do I have to change here to implement the new fields and choices? 
How do I handle values like 3cm-2em (where there's no Stretch value)?

I hope the problem is clear. If you feel like hacking yourself, I can 
send a patch with what I've done until now (this is the design work and 
the implementation into FormParagraph.C and all the SetEnable stuff. 
What needs to be done is only solve the problems I've described). But 
of course I would appreciate instructions and do it myself ;-)

Thanks,

Jürgen.
 



Re: Coding Questions (FormParagraph)

2001-11-28 Thread Angus Leeming

On Wednesday 28 November 2001 5:40 pm, Juergen Spitzmueller wrote:
 Hi all,
 
 I'm currently trying to implement new fields/choices to the paragraph 
 dialog as suggested by John.
 These are additional fields for Space Above/Below: Length (Stretch 
 and Shrink), which we need to read/ create files with paragraph 
 spaces like 1cm+3em-2.5in.
 I have two questions:
 
 (1) Until now, we pass the content of the field/choice with the command:
 
   string const length =
   getLengthFromWidgets(dialog_-input_space_above,
dialog_-choice_value_space_above);
   space_top =
   VSpace(LyXGlueLength(length));
 
Ouch! You propose storing a string in the paragraph parameters?
string some_length = 2cm+3em-2.5em;
and then would like to parse this in the GUI to turn it into 6 separate bits 
of info?
Why not store it in paragraph parameters as 6 separate pieces of info? (ie, 
as 3 VSpaces)?

Or have I got the wrong end of your stick (misunderstood what you are trying 
to do)?

 What needs to be done here? Should I get the other lengths the same way 
 and combine those three at the end to VSpace?
 Furthermore we have the problem that shrink is a negative value in the 
 file but should be displayed/ entered as positive value in the dialog 
 (IMHO. E.g. 2cm+3em-2.5em should be displayed in the GUI as Value: 2 
 cm - Stretch: 3 em - Shrink: 2.5 em). Is it possible to convert 
 this?

Only allow the user to input +ve values in the GUI. Their position 
(stretch/shrink) tells you the sign


 (2.) Vice versa, we use the following commands to read the values and 
 update the fields and choices:
 
   string const default_unit = cm;
   string const length =  par_-params().spaceTop().length().asString();
   updateWidgetsFromLengthString(dialog_-input_space_above,
 dialog_-choice_value_space_above,
 length, default_unit);

Actually, this strikes me as perverse. paragraphParams::spaceTop() will 
already give us the info we desire directly. Why do we want to convert it to 
a string and then parse that string to separate the value and the unit?

I think that it's clear that you should modify spaceTop() so that it returns 
a new struct:
struct SomeSensibleName {
VSpace value;
VSpace stretch;
VSpace shrink;
};

Then we can access the data we require direct (and modify it easily!)

Am I  making sense?
Angus


 What do I have to change here to implement the new fields and choices? 
 How do I handle values like 3cm-2em (where there's no Stretch value)?
 
 I hope the problem is clear. If you feel like hacking yourself, I can 
 send a patch with what I've done until now (this is the design work and 
 the implementation into FormParagraph.C and all the SetEnable stuff. 
 What needs to be done is only solve the problems I've described). But 
 of course I would appreciate instructions and do it myself ;-)
 
 Thanks,
 
 Jürgen.
  
 
 

-- 
Dr Angus Leeming
Dept. of Bioengineering
Imperial College
London SW7 2BX

Tel +44 (0) 20 7594 5186
Fax +44 (0) 20 7584 6897



xforms-GUI

2001-11-28 Thread Rainer Dorsch


Hello,

we are using lyx here for relatively large documents (one was even ported from 
Word, using word2tex and relyx!). And even LaTeX-newbies can work reasonably 
with the LyX (and we mentioned lyx in the preface).

Congratulation to all of you!

For me lyx is also an very stable tool. I only see crashes from time to time 
when I edit tables (and lyx crashes sometimes during editing or later on 
during saving the document). But the newbie users seem to be able to crash lyx 
very frequently (they consider word a much more stable tool than lyx, although 
they are impressed about the resulting document). Most likely this is because 
sometimes lyx takes a second in order to do something and they continue 
clicking around.

I have the impression that these bugs are xform problems to a large extend and 
therefore I am looking forward to see a GTK- or QT-version of lyx. I am very 
happy about the GUI-I, but at the same time, it is progressing very slowly. To 
my understanding

- currently a large part is ported to GUI-I
- some parts are still xforms hardcoded, prohibiting to do something else than 
xforms
- hard coding another GUI is not that difficult (at least I think to remember 
that kLyX was build within a few days)

Therefore I am wondering, why not the few hard coded xforms parts are ported 
to QT or GTK (I don't mind which one, both are probably ways better than 
xforms) and the GUI-I QT or GTK is used for the rest.

Thanks.

Rainer.
-- 
Rainer Dorsch
Abt. Rechnerarchitektur  e-mail:[EMAIL PROTECTED]
Uni StuttgartTel.: +49-711-7816-215 / Fax: +49-711-7816-288
Breitwiesenstr. 20-22D-70565 Stuttgart
http://www.ra.informatik.uni-stuttgart.de/~rainer/




Re: Coding Questions (FormParagraph)

2001-11-28 Thread Andre Poenitz

On Wed, Nov 28, 2001 at 06:23:52PM +, Angus Leeming wrote:
 I think that it's clear that you should modify spaceTop() so that it returns 
 a new struct:
   struct SomeSensibleName {
   VSpace value;
   VSpace stretch;
   VSpace shrink;
   };

The problem is, the whole vspace.h thingy is broken. There are too many
concepts packed in some classes. It's no sound base...

Maybe we should try to come up with something better. A class for lengths
as TeX uses them (without percent of textwidth etc). Another class for
value + stretch + shrink.

Then extend this with funny parts like 'percent of nautical miles'...

 Am I  making sense?

Yes.

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



[PATCH] mmap CRC checking 1.2cvs

2001-11-28 Thread Ben Stanley

This is a version of the mmap patch which applies to cvs HEAD.



--- lyx-devel-orig/src/support/lyxsum.C Fri Jun  1 22:10:06 2001
+++ lyx-devel/src/support/lyxsum.C  Thu Nov 29 02:31:01 2001
@@ -10,8 +10,6 @@
 
 #include config.h
 
-#include fstream
-#include iterator
 #include algorithm
 #include boost/crc.hpp
 
@@ -31,23 +29,85 @@
 
 } // namespace
 
-
-// And this would be the file interface.
-unsigned long lyx::sum(string const  file)
+// Various implementations of lyx::sum(), depending on what methods
+// are available. Order is faster to slowest.
+#if defined(HAVE_MMAP)  defined(HAVE_MUNMAP)
+   #ifdef WITH_WARNINGS
+   #warning lyx::sum() using mmap (lightning fast but untested)
+   #endif
+
+   #include sys/types.h
+   #include sys/stat.h
+   #include fcntl.h
+   #include unistd.h
+   #include sys/mman.h
+
+   unsigned long lyx::sum(string const  file)
+   {
+   int fd = open(file.c_str(), O_RDONLY);
+   if( !fd ) return 0;
+
+   struct stat info;
+   fstat(fd, info);
+
+   void * mm = mmap(0, info.st_size, PROT_READ,
+MAP_PRIVATE, fd, 0);
+   if (mm == MAP_FAILED) {
+   close(fd);
+   return 0;
+   }
+   char *beg = static_castchar*(mm);
+   char *end = beg + info.st_size;
+
+   unsigned long result = do_crc(beg,end);
+
+   munmap( mm, info.st_size );
+   close(fd);
+
+   return result;
+   }
+#else // No mmap
+   #include fstream
+   #include iterator
+
+   #if HAVE_DECL_ISTREAMBUF_ITERATOR
+   #ifdef WITH_WARNINGS
+   #warning lyx::sum() using istreambuf_iterator (fast)
+   #endif
+   unsigned long lyx::sum(string const  file)
+   {
+   std::ifstream ifs(file.c_str());
+   if (!ifs) return 0;
+
+   std::istreambuf_iteratorchar beg(ifs);
+   std::istreambuf_iteratorchar end;
+
+   return do_crc(beg,end);
+   }
+   #else
+   #ifdef WITH_WARNINGS
+   #warning lyx::sum() using istream_iterator (slow as a snail)
+   #endif
+   unsigned long lyx::sum(string const  file)
+   {
+   std::ifstream ifs(file.c_str());
+   if (!ifs) return 0;
+
+   ifs.unsetf(std::ios::skipws);
+   std::istream_iteratorchar beg(ifs);
+   std::istream_iteratorchar end;
+
+   return do_crc(beg,end);
+   }
+   #endif
+#endif // mmap
+
+#if 0
+#include iostream
+int main(int /*argc*/, char * argv[])
 {
-   std::ifstream ifs(file.c_str());
-   if (!ifs) return 0;
-   
-#ifdef HAVE_DECL_ISTREAMBUF_ITERATOR
-   // This is a lot faster...
-   std::istreambuf_iteratorchar beg(ifs);
-   std::istreambuf_iteratorchar end;
-#else
-   // than this.
-   ifs.unsetf(std::ios::skipws);
-   std::istream_iteratorchar beg(ifs);
-   std::istream_iteratorchar end;
-#endif
+   std::string const fil(argv[1]);
 
-   return do_crc(beg, end);
+   std::cout  CRC:   lyx::sum(fil)  std::endl;
 }
+#endif
--- lyx-devel-orig/src/support/ChangeLogThu Nov 29 03:01:18 2001
+++ lyx-devel/src/support/ChangeLog Thu Nov 29 05:38:31 2001
@@ -1,3 +1,8 @@
+2001-11-29  Ben Stanley [EMAIL PROTECTED]
+
+   * lyxsum.C: Added mmap version of CRC and made it selected 
+   by default where available.
+   
 2001-11-28  André Pönitz [EMAIL PROTECTED]

* Makefile.am: put types.h in



Re: Coding Questions (FormParagraph)

2001-11-28 Thread Juergen Spitzmueller

Angus Leeming wrote:
 Ouch! You propose storing a string in the paragraph parameters?
   string some_length = 2cm+3em-2.5em;
 and then would like to parse this in the GUI to turn it into 6
 separate bits of info?
 Why not store it in paragraph parameters as 6 separate pieces of
 info? (ie, as 3 VSpaces)?

I'm don't know the Paragraph implementation very well.
But the problem is, that you can enter 2cm+3em-2.5em in LyX 1.1.6 and 
this seems to work! Try it out. Don't we get problems reading old files 
when we split the parameters now?

 Or have I got the wrong end of your stick (misunderstood what you are
 trying to do)?

What I'm trying to do is to do what John requested ;-) I didn't know 
that it was possible to enter those values, but if we don't implement 
then in the GUI, it is broken if someone wants to open a 1.1.6-file 
where he used this.

  What needs to be done here? Should I get the other lengths the same
  way and combine those three at the end to VSpace?
  Furthermore we have the problem that shrink is a negative value in
  the file but should be displayed/ entered as positive value in the
  dialog (IMHO. E.g. 2cm+3em-2.5em should be displayed in the GUI
  as Value: 2 cm - Stretch: 3 em - Shrink: 2.5 em). Is it
  possible to convert this?

 Only allow the user to input +ve values in the GUI. Their position
 (stretch/shrink) tells you the sign

And how do I pass it then? -ShrinkParam? Vice versa, if I have 
something like -2em, how do I convert it to 2em for the GUI?

  (2.) Vice versa, we use the following commands to read the values
  and update the fields and choices:
 
  string const default_unit = cm;
  string const length = 
  par_-params().spaceTop().length().asString();
  updateWidgetsFromLengthString(dialog_-input_space_above,
  dialog_-choice_value_space_above,
length, default_unit);

 Actually, this strikes me as perverse. paragraphParams::spaceTop()
 will already give us the info we desire directly. Why do we want to
 convert it to a string and then parse that string to separate the
 value and the unit?

See above. Only for backwards compatibility reasons. But I might be 
wrong of course.

 I think that it's clear that you should modify spaceTop() so that it
 returns a new struct:
   struct SomeSensibleName {
   VSpace value;
   VSpace stretch;
   VSpace shrink;
   };

 Then we can access the data we require direct (and modify it easily!)

 Am I  making sense?

I guess you do. But I do not get the sense (yet).

Thanks,
Juergen

 Angus




Re: Coding Questions (FormParagraph)

2001-11-28 Thread Juergen Spitzmueller

Andre Poenitz wrote:
 The problem is, the whole vspace.h thingy is broken. There are too
 many concepts packed in some classes. It's no sound base...

 Maybe we should try to come up with something better. A class for
 lengths as TeX uses them (without percent of textwidth etc).
 Another class for value + stretch + shrink.

 Then extend this with funny parts like 'percent of nautical miles'...

If somebody wants to do that, I will wait with the dialog. I cannot do 
this unfortunately, the knowledge for this is missing.

Jürgen

 Andre'



header dependencies, Part II

2001-11-28 Thread Andre Poenitz


new types 'lyx::layout_type' and 'lyx::textclass_type' instead of
SomeClass::SomeObscureContainer::size_type.

LyXView.h does not depend on layout.h anymore. Of course, touching
layout.h still triggers almost a full re-compile of everything...

Note that I put some debug code into support/types.h to get stricter type
checking than available for simple typedefs. It is disabled by default, but
could be activated every few month to check that everything is still ok.
[And yes, there was one  layout_type - textclass_type mismatch somewhere.
Nothing serious, though...]

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



urmpf

2001-11-28 Thread Andre Poenitz


-- 
André Pönitz .. [EMAIL PROTECTED]



types.diff.gz
Description: application/gunzip


Re: Coding Questions (FormParagraph)

2001-11-28 Thread Andre Poenitz

On Wed, Nov 28, 2001 at 07:42:41PM +0100, Juergen Spitzmueller wrote:
 And how do I pass it then? -ShrinkParam? Vice versa, if I have 
 something like -2em, how do I convert it to 2em for the GUI?

Try to find some interface that gives you -2 and em seperately...

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: header dependencies, Part II

2001-11-28 Thread Andre Poenitz

On Wed, Nov 28, 2001 at 07:46:02PM +0100, Andre Poenitz wrote:
 LyXView.h does not depend on layout.h anymore. Of course, touching
 layout.h still triggers almost a full re-compile of everything...

Some figures: 'time make' in src is 7:24 min  down from  8:29 min  after
touching layout.h on my machine with this patch applied.

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: text.C compile problem

2001-11-28 Thread John Levon

On Wed, Nov 28, 2001 at 06:37:45AM +0100, Andre Poenitz wrote:

  string str(string(_(Space below)) +  (
 
 Uh... there might be. This could be read as function declaration followed
 by a spurious '+'. I have not yet managed to dig through the Standard,
 though.
 
 Write that as
 
  string str = string(_(Space below)) +  (
 
 and all compilers are happy.

ok, thanks for the lesson !

john

-- 
By the way, it's not binaries, it's Perl code. Sometimes they look confusingly
similar.
- Pavel Roskin



Re: [BUG] close prefs dialog abort in 1.1.6fix3

2001-11-28 Thread John Levon

On Wed, Nov 28, 2001 at 11:38:18PM +1100, Ben Stanley wrote:

 blah blah
 MainLoopUser Event(33,w=0x796 s=14834) ClientMessage
 MainLoopUser Event(7,w=0x700017c s=15098) EnterNotify Mode Normal
 In EventCallback [events.c 34] Unknown window=0x700017c

this is really bad. the ClientMessage is gs saying it has finished rendering
an image.

Luckily I can reproduce it.

How it is an unknown window I don't know. Let me look.

thanks
john

 So same as before. Probably still a bug in xforms...

quite possibly.

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Re: still crashing

2001-11-28 Thread John Levon

On Wed, Nov 28, 2001 at 03:36:32PM +0100, Andre Poenitz wrote:

 The attached example crashes my lyx (current cvs) if I simply scroll to the
 end. If I take out a few more lines from the file, it renders nicely.

It doesn't for me. Can you back out my changes to text.C and try again ?

What's the backtrace ?

regards
john

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Re: Coding Questions (FormParagraph)

2001-11-28 Thread John Levon

On Wed, Nov 28, 2001 at 06:23:52PM +, Angus Leeming wrote:

 I think that it's clear that you should modify spaceTop() so that it returns 
 a new struct:
   struct SomeSensibleName {
   VSpace value;
   VSpace stretch;
   VSpace shrink;
   };
 
 Then we can access the data we require direct (and modify it easily!)

You might like to check out LyxGlueLength::plusValue() and friends ;)

Also check out kde/qt2 code for this.

regards
john

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Re: Coding Questions (FormParagraph)

2001-11-28 Thread John Levon

On Wed, Nov 28, 2001 at 07:42:41PM +0100, Juergen Spitzmueller wrote:

 And how do I pass it then? -ShrinkParam? Vice versa, if I have 
 something like -2em, how do I convert it to 2em for the GUI?

create a VSpace temporary, and use a LyXGlueLength temporary,and pass
the values and units in the constructor for it.

f.e. frontends/kde/paradlg.C::getBelowLength(), and how that is called.

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Re: BUG new math stuff

2001-11-28 Thread John Levon

On Tue, Nov 13, 2001 at 11:44:01PM -0400, Garst R. Reese wrote:

 If I click on Insert-Math
 I get a very nice menu :)
 But then the toolbar (I think that's what it's called) looks a bit weird
 after TeX.

you mean to the right of the TeX icon ? It looks fine for me.

regards
john

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Re: error box inside minipage

2001-11-28 Thread John Levon

On Tue, Nov 13, 2001 at 06:51:40PM +0100, Michael Schmitt wrote:

  Err, how did you manage to get an error box /inside/ a minipage inset?
 
 Just change the document class of an existing document to a class that 
 is not installed on your machine.

for example ? I can't find an article type that isn't installed, or fails in the right
way.

An example file that gives an error inside a minipage would be great.

thanks
john
-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Re: [BUG] close prefs dialog abort in 1.1.6fix3

2001-11-28 Thread John Levon

On Wed, Nov 28, 2001 at 11:38:18PM +1100, Ben Stanley wrote:

 Now I open my thesis, and while the previews are rendering, I open the 
 preferences dialog, change a setting (the temp dir), click save, and get
 
 blah blah
 MainLoopUser Event(33,w=0x796 s=14834) ClientMessage
 MainLoopUser Event(7,w=0x700017c s=15098) EnterNotify Mode Normal
 In EventCallback [events.c 34] Unknown window=0x700017c

now I /can't/ reproduce it. How annoying.

Can you add :

410 lyxerr  Canvas ID   fl_get_canvas_id(figinset_canvas)  
endl;
411 fl_set_preemptive_callback(fl_get_canvas_id(figinset_canvas), 
GhostscriptMsg, 0);

the lyxerr line into insets/figinset.C ?

Check that the canvas id and the ClientMessage window are the same.

regards
john

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Re: reliability of par-getInset()

2001-11-28 Thread John Levon

On Fri, Nov 23, 2001 at 10:25:20AM +0100, Juergen Vigna wrote:

 I'm very nearly sure that the crashes are connected to access a LyXText
 which already freed and reallocated row stuff. There are some pointers
 in LyXText which hold pointerss to rows for update stuff. This pointers
 are not valid anymore in some cases I did not discover right now.

When you fix this, please tell me how you did it, and what was wrong. I completely
lost amongst getLyXText()s and cpar(bv)s and cached_text etc.

It looks like the cpar(bv) is broken, because its freed. But it could be the cursor,
or the LyXText, or the InsetText :(

john

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Error inset deletion

2001-11-28 Thread John Levon


I think the patch below fixes the error-in-minipage problem (I tested by copying
an InsetError into a minipage then runnning delete all error boxes).

Michael, can you please test this ?

thanks
john

Index: src/BufferView2.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView2.C,v
retrieving revision 1.95
diff -u -r1.95 BufferView2.C
--- src/BufferView2.C   2001/10/01 15:31:57 1.95
+++ src/BufferView2.C   2001/11/22 17:06:21
@@ -102,23 +102,23 @@
 
 bool BufferView::removeAutoInsets()
 {
-   Paragraph * par = buffer()-paragraph;
-
LyXCursor tmpcursor = text-cursor;
LyXCursor cursor;
-
-   bool a = false;
+   bool flag = false;
+   bool found = false;
 
-   while (par) {
+   ParIterator end = buffer()-par_iterator_end();
+   for (ParIterator it = buffer()-par_iterator_begin();
+it != end; ++it) {
+   Paragraph * par = *it;
// this has to be done before the delete
text-setCursor(this, cursor, par, 0);
-   if (par-autoDeleteInsets()){
-   a = true;
+   if (par-autoDeleteInsets()) {
+   found = true;
text-redoParagraphs(this, cursor,
 cursor.par()-next());
text-fullRebreak(this);
}
-   par = par-next();
}
 
// avoid forbidden cursor positions caused by error removing
@@ -127,7 +127,7 @@
 
text-setCursorIntern(this, tmpcursor.par(), tmpcursor.pos());
 
-   return a;
+   return found;
 }
 
 



Re: Bug list - Update

2001-11-28 Thread John Levon

There is a patch below I would like people to look at !

On Sun, Nov 25, 2001 at 09:31:42AM +0100, Michael Schmitt wrote:

 - Load file scary_eqns.lyx and try to click at the last subscript 0 in a formula 
called philinear
 - the cursor is positioned past the formula 

can I have this file please ?

 - In the paragraph layout dialog, it is impossible to enter negative vertical spaces;
   if you enabled them again, please check whether they are displayed correctly on 
screen
   (in former lyx versions, negative values have been displayed as positive value)

fixed.

 - Loading a document with a very large table (125 rows x 5 columns) causes the
   following console message(s):  Actcell not equal to actual cell!  (document by 
request)
 
 - Juergen V.: There is still a way to provoke infinite table repaintings (at least
   theoretically). But Juergen knows how to fix them. 

fixed by Juergen.

 - Insert a minipage into an empty document; insert a few characters in front of the
   (open) minipage - the minipage is moved past the right border of the LyX main 
window

fixed by Allan.

 - Insert a minipage or footnote into an empty document; select the right border
   of the LyX main window and reduce its size (with KDE 2, the window is updated
   repetitively as you move the mouse); at some threshold, the size of the inset
   is not updated anymore such that it is painted past the right border of the 
   main window (virtually, of course :-))

this is #444641 I reckon.

 - Remove all error boxes does not remove error boxes from within minipages
   (you can produce them by changing the document class to a class not installed)

I think I've fixed this !

 - Place 10 collapsed footnotes after each other and move the cursor between them 
 - the cursor position becomes more and more incorrect from left to right

fixed by Juergen.

 - Herbert says: insert an url with any text; close it; open it with click on
   the url button; do anything; close it - you get a second url

can't reproduce - I think it's dead.

 - Even though _a_spell dies, the message The _i_spell process has died is printed
 - Cosmetics: If the spell checker dies, an error dialog is shown in which 
   the OK button touches the last line of the error description
 - The spell checker ignores table cells! (#229140)

fixed by Juergen.

 - Open a new document; insert a note inset with two pars (e.g., letters a and b);
   cut the pars and place them in front of the note (separate paragraph!);
   cut the note; move the cursor upwards

This now infinite loops for me with :

InsetText   is 0x43257ef4
inset_owner is (nil)

 - When selecting plain text with an embedded formula, the formula is not 
   highlighted
 
 - If a footnote is used inside a tabular which is 1) outside floats
   2) not in a minipage 3) no long-tabular, the following two lines have to be 
   inserted to the preamble (according to Dekel):
  \usepackage{footnote}
  \makesavenoteenv{tabular}
   Else you get a footnote symbol but no footnote text.

so  anyone ?

 - An hfill is just drawn as a vertical bar if no text is following it. This is not
   correct for the case where there is more than one hfill in a line.

Is the rule: if there is an hfill aty the end of the row, then it doesn't count, unless
there is /another/ hfill on that line ?

try this (other people: is it right ?)

diff -u -r1.202 text.C
--- text.C  2001/11/27 15:05:32 1.202
+++ text.C  2001/11/28 22:21:31
@@ -1162,8 +1182,16 @@
return false;

// at the end of a row it does not count
-   if (pos = rowLast(row_ptr))
-   return false;
+   // unless another hfill exists on the line
+   if (pos = rowLast(row_ptr)) {
+   pos_type i = row_ptr-pos();
+   while (i  pos  !row_ptr-par()-isHfill(i)) {
+   ++i;
+   }
+   if (i == pos) {
+   return false;
+   }
+   } 

// at the beginning of a row it does not count, if it is not 
// the first row of a paragaph


 - Create a note inset in a large document and fill it with text until its 
   content cannot be fully displayed on screen.
   Then move the cursor in front of the note, press CursorDown (you are now
   scrolling past the note), press CursorUp (you are back in front of the note),
   and press CursorLeft - you enter the note but again the document is scrolled, 
   this time totally unnecessarily. Too much scrolling is really confusing!
 
 - PageDown (only 5 lines downwards) and PageUp (movement to either the last
   or one but last line) do not work in a (large) note inset (#457384)

the first looks like a duplicate of the second here ?

 - Delete the first row of a 5x5 table (where the cells in the first two rows have 
   a single letter as content) (#458165?)
 
   Freed memory access! (Backtrace of 2001/11/24)
 
   #0  Paragraph::getLayout (this=0x6f2e8fdc) at 

Table delete row crashes

2001-11-28 Thread John Levon


OK, it seems that the lyxtext of the new cell is OK, but its cursor
is still pointing to the wrong row/par.

How can this situation come about ? My attempts to reset the lt's cursor
all crash fairly soon after. I can unlock the full table inset on delete row,
but when I click back into it, you get similar crashes with wrong cursors.

Just a couple of pointers (no pun intended) would be good ...

This locking_inset vs. cursor multitude vs lockInsetinInset, lockInset etc. stuff
is /really/ unclear - I really think some sourcedocs for it would help more than
a little :(

regards
john

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



[PATCH] fix for a crash, sort of

2001-11-28 Thread John Levon


Start a new doc, insert a footnote, go to Documents and select the same doc - crash.

Because colapsable::edit() doesn't consider that the inset may be already locked, it 
ends
up trying to lock an inset at pos 0 *inside* the footnote, thinking that 
bv-theLockingInset()
exists inside the footnote.

Patch to fix the crash is below, but first some questions.

1) shouldn't ::buffer() check to see if we are really switching buffers :

if (buffer == b) {
return;
}

2) how does the slept inset stay locked between the insetSleep and the insetWakeup ? I 
can't
see why the inset doesn't unlock properly in insetSleep ...

3) insettext and insettabular also have this problem (turn on -dbg insets to see !), 
but the
locking_inset stuff there is FAR too confusing for me to understand. I think they 
survive by
the skin of their teeth.

Please advise !

thanks
john


Index: insets/insetcollapsable.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.94
diff -u -r1.94 insetcollapsable.C
--- insets/insetcollapsable.C   2001/10/03 14:28:02 1.94
+++ insets/insetcollapsable.C   2001/11/29 00:06:02
@@ -246,7 +246,7 @@
bv-updateInset(this, false);
inset.edit(bv);
} else {
-   if (!bv-lockInset(this))
+   if (bv-theLockingInset() != this  !bv-lockInset(this))
return;
if (yp = button_bottom_y) {
inset.edit(bv);
@@ -274,7 +274,7 @@
bv-updateInset(this, false);
inset.edit(bv, front);
} else {
-   if (!bv-lockInset(this))
+   if (bv-theLockingInset() != this  !bv-lockInset(this))
return;
inset.edit(bv, front);
}



Re: xforms-GUI

2001-11-28 Thread Allan Rae

On Wed, 28 Nov 2001, Rainer Dorsch wrote:

 Hello,

Hello.

[...]
 therefore I am looking forward to see a GTK- or QT-version of lyx. I am very
 happy about the GUI-I, but at the same time, it is progressing very slowly. To
 my understanding

 - currently a large part is ported to GUI-I
 - some parts are still xforms hardcoded, prohibiting to do something else than
 xforms
 - hard coding another GUI is not that difficult (at least I think to remember
 that kLyX was build within a few days)

...by people who live and breathe Qt/KDE.  See further below.

 Therefore I am wondering, why not the few hard coded xforms parts are ported
 to QT or GTK (I don't mind which one, both are probably ways better than
 xforms) and the GUI-I QT or GTK is used for the rest.

As GUII progresses people want to switch from hard-coded xforms to
hard-coded Qt (GTK would be a waste of time at the moment because its
dialogs don't even compile because that frontend has been unmaintained
for some months).  This gets more tempting as time goes by, however,
we have working xforms code so switching to GUII xforms is actually
fairly simple since we reuse a large part of the code -- just move it
around and separate it out with some signals.

What will anyone gain by switching to a different toolkit for the
hard-coded sections of code?

I'll tell you:  bugs, and a broken lyx until the new hard-coding
works.  Then you still have to do the GUII work.  After Matthias
Ettrich complained about the progress of the GUII work I suggested he
get a group together to rapidly port LyX to Qt in much the same
fashion as you are suggesting.  Given that Matthias is both the
founder of the LyX project and KDE and works for Trolltech he
shouldn't have had any problem getting a competent team together to do
such a port.  His response?  Silence for the last twelve months.
However, Kalle Dalheimer has been involved from time to time porting
some of the Qt2 dialogs.  Volunteers work on what they can when they
can -- progress has actually been exceptionally fast in the last 12
months IMO.

GUII porters have, however, reduced their work on the frontend to try
to help fix bugs in the core and in particular in the insets
hierarchy.  In addition the goal for 1.2.0 was to get all the dialogs
GUII for the xforms port -- as you will see from the GUII status page
this has been achieved.

I personally want to get 1.2.0 out ASAP but we have several major bugs
to fix and they take priority over GUII and other new features IMHO.


If you can provide us with bug reports (preferably including
backtraces of crashes) we will do our best to fix them.  Please
remember to include full details in such reports including the version
numbers of LyX, C++ library, C library, compiler, xforms, Xpm and OS.

Allan. (ARRae)




Re: error box inside minipage

2001-11-28 Thread Allan Rae

On Wed, 28 Nov 2001, John Levon wrote:

 On Tue, Nov 13, 2001 at 06:51:40PM +0100, Michael Schmitt wrote:

   Err, how did you manage to get an error box /inside/ a minipage inset?
 
  Just change the document class of an existing document to a class that
  is not installed on your machine.

 for example ? I can't find an article type that isn't installed, or fails in the 
right
 way.

 An example file that gives an error inside a minipage would be great.

All you need is two document classes that don't share at least one
paragraph type.  For example, article doesn't have Chapters but book
does.  LyX will insert an error box at paragraphs that couldn't be
converted -- because the paragraph type didn't exist in the new
document class.

Allan. (ARRae)




[PATCH] recreation of .tex/.dvi 1.1.6

2001-11-28 Thread Ben Stanley

Here is a minimalist patch which addresses just this problem.

I even remembered the ChangeLog this time...

This patch works on 1.1.6. I'll make up another for 1.2.

Ben.



--- lyx-devel-orig/src/LaTeX.h  Sun Feb 11 20:51:17 2001
+++ lyx-devel/src/LaTeX.h   Thu Nov 29 12:44:26 2001
@@ -206,6 +206,9 @@
 
/// used by scanLogFile
int num_errors;
+   
+   /// The name of the final output file.
+   string output_file;
 };
 
 #endif
--- lyx-devel-orig/src/LaTeX.C  Fri Jul  6 04:17:28 2001
+++ lyx-devel/src/LaTeX.C   Thu Nov 29 12:52:03 2001
@@ -74,8 +74,12 @@
 {
num_errors = 0;
depfile = file + .dep;
-   if (prefixIs(cmd, pdf)) // Do we use pdflatex ?
+   if (prefixIs(cmd, pdf)) { // Do we use pdflatex ?
depfile += -pdf;
+   output_file = ChangeExtension(file,.pdf);
+   } else {
+   output_file = ChangeExtension(file,.dvi);
+   }
 }
 
 
@@ -152,12 +156,19 @@
head.read(depfile);
// Update the checksums
head.update();
-   if (!head.sumchange()) {
+   // can't just check if anything has changed because it might have 
+aborted
+   // on error last time... in which case we need to re-run latex
+   // and collect the error messages (even if they are the same).
+   if (!FileInfo(output_file).exist()) {
+   lyxerr[Debug::DEPEND]
+re-running latex because output file doesn't 
+exist.  endl;
+   } else if (!head.sumchange()) {
lyxerr[Debug::DEPEND]  return no_change  endl;
return LaTeX::NO_CHANGE;
+   } else {
+   lyxerr[Debug::DEPEND]
+Dependency file has changed  endl;
}
-   lyxerr[Debug::DEPEND]
-Dependency file has changed  endl;
 
if (head.extchanged(.bib) || head.extchanged(.bst))
run_bibtex = true;
--- lyx-devel-orig/ChangeLogWed Nov 28 20:05:21 2001
+++ lyx-devel/ChangeLog Thu Nov 29 13:12:54 2001
@@ -1,3 +1,9 @@
+2001-11-29 Ben Stanley [EMAIL PROTECTED]
+
+   * src/LaTeX.C
+   * src/LaTeX.h Fixed bug in LaTeX class where it would not
+   re-run latex if no depfiles were changed, but the .dvi was removed.
+
 2001-11-28  John Levon  [EMAIL PROTECTED]
 
* README: fix ghostscript comment



[BUG] lots of black in preview images with -shared 1.1.6fix3

2001-11-28 Thread Ben Stanley

I'm getting very dark/black preview images when I run under -shared. Not 
all of them are black, but it does tend to be the 
photographs/screenshots that do it. (Also some output from QCad does it).

It's usually background colours or transparent parts of the image that 
get turned to black.

What mechanism allocates colours for preview figures?

I have ghostscript 5.50-15 installed from RH7.1

Ben.




[PATCH] recreation of .tex/.dvi 1.2

2001-11-28 Thread Ben Stanley

Here is the same patch for 1.2. Dunno why the other one didn't apply 
straight - they are pretty much the same.

Ben.



--- lyx-devel-orig/src/LaTeX.h  Sun Feb 11 20:51:17 2001
+++ lyx-devel/src/LaTeX.h   Thu Nov 29 12:44:26 2001
@@ -206,6 +206,9 @@
 
/// used by scanLogFile
int num_errors;
+   
+   /// The name of the final output file.
+   string output_file;
 };
 
 #endif
--- lyx-devel-orig/src/LaTeX.C  Fri Jul  6 04:17:28 2001
+++ lyx-devel/src/LaTeX.C   Thu Nov 29 12:52:03 2001
@@ -74,8 +74,12 @@
 {
num_errors = 0;
depfile = file + .dep;
-   if (prefixIs(cmd, pdf)) // Do we use pdflatex ?
+   if (prefixIs(cmd, pdf)) { // Do we use pdflatex ?
depfile += -pdf;
+   output_file = ChangeExtension(file,.pdf);
+   } else {
+   output_file = ChangeExtension(file,.dvi);
+   }
 }
 
 
@@ -154,12 +158,19 @@
head.read(depfile);
// Update the checksums
head.update();
-   if (!head.sumchange()) {
+   // Can't just check if anything has changed because it might have 
+aborted
+   // on error last time... in which cas we need to re-run latex
+   // and collect the error messages (even if they are the same).
+   if (!FileInfo(output_file).exist()) {
+   lyxerr[Debug::DEPEND]
+re-running LaTeX because output file doesn't 
+exist.  endl;
+   } else if (!head.sumchange()) {
lyxerr[Debug::DEPEND]  return no_change  endl;
return NO_CHANGE;
+   } else {
+   lyxerr[Debug::DEPEND]
+Dependency file has changed  endl;
}
-   lyxerr[Debug::DEPEND]
-Dependency file has changed  endl;
 
if (head.extchanged(.bib) || head.extchanged(.bst))
run_bibtex = true;
--- lyx-devel-orig/ChangeLogWed Nov 28 20:05:21 2001
+++ lyx-devel/ChangeLog Thu Nov 29 13:12:54 2001
@@ -1,3 +1,9 @@
+2001-11-29 Ben Stanley [EMAIL PROTECTED]
+
+   * src/LaTeX.C
+   * src/LaTeX.h Fixed bug in LaTeX class where it would not
+   re-run latex if no depfiles were changed, but the .dvi was removed.
+
 2001-11-28  John Levon  [EMAIL PROTECTED]
 
* README: fix ghostscript comment



Re: error box inside minipage

2001-11-28 Thread John Levon

On Thu, Nov 29, 2001 at 12:45:50PM +1000, Allan Rae wrote:

 All you need is two document classes that don't share at least one
 paragraph type.  For example, article doesn't have Chapters but book
 does.  LyX will insert an error box at paragraphs that couldn't be
 converted -- because the paragraph type didn't exist in the new
 document class.

This doesn't work inside minipages - no complaint is made. And Chapter in
a minipage is totally screwed drawing :(

john

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Re: [PATCH] fix for a crash, sort of

2001-11-28 Thread Allan Rae

On Thu, 29 Nov 2001, John Levon wrote:

 Start a new doc, insert a footnote, go to Documents and select the same doc - crash.

 Because colapsable::edit() doesn't consider that the inset may be already locked, it 
ends
 up trying to lock an inset at pos 0 *inside* the footnote, thinking that 
bv-theLockingInset()
 exists inside the footnote.

 Patch to fix the crash is below, but first some questions.

This patch also fixes the crash I reported the other day triggered
by being inside an inset and opening/closing another document.  An
interesting point here is that the cursor is always placed at the
start of the inset irrespective of where it was when I changed buffers
(even if it was inside an inset in an inset).

 1) shouldn't ::buffer() check to see if we are really switching buffers :

   if (buffer == b) {
   return;
   }

Isn't this what it used to do at some stage?

 2) how does the slept inset stay locked between the insetSleep and the insetWakeup ? 
I can't
   see why the inset doesn't unlock properly in insetSleep ...

 3) insettext and insettabular also have this problem (turn on -dbg insets to see !), 
but the
 locking_inset stuff there is FAR too confusing for me to understand. I think they 
survive by
 the skin of their teeth.

Good questions.  I know less about this stuff than you do.

Allan. (ARRae)




Re: error box inside minipage

2001-11-28 Thread Allan Rae

On Thu, 29 Nov 2001, John Levon wrote:

 On Thu, Nov 29, 2001 at 12:45:50PM +1000, Allan Rae wrote:

  All you need is two document classes that don't share at least one
  paragraph type.  For example, article doesn't have Chapters but book
  does.  LyX will insert an error box at paragraphs that couldn't be
  converted -- because the paragraph type didn't exist in the new
  document class.

 This doesn't work inside minipages - no complaint is made. And Chapter in
 a minipage is totally screwed drawing :(

Hmmm... I'm sure I've triggered exactly this inside a minipage
switching from IEICE-article to book.  But that was a fortnight ago
maybe the code has changed (but I don't think so).

Allan. (ARRae)




[PATCH] disable pagebreaks in insets

2001-11-28 Thread John Levon


thanks for the hint Juergen.

please apply.

john

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.


Index: frontends/xforms/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v
retrieving revision 1.202
diff -u -r1.202 ChangeLog
--- frontends/xforms/ChangeLog  2001/11/28 11:04:31 1.202
+++ frontends/xforms/ChangeLog  2001/11/29 04:04:40
@@ -1,3 +1,7 @@
+2001-11-29  John Levon  [EMAIL PROTECTED]
+
+   * FormParagraph.C: disallow page breaks in insets
+ 
 2001-11-23  John Levon  [EMAIL PROTECTED]
 
* FormParagraph.C: allow signed space above/below, actually
Index: frontends/xforms/FormParagraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormParagraph.C,v
retrieving revision 1.41
diff -u -r1.41 FormParagraph.C
--- frontends/xforms/FormParagraph.C2001/11/28 11:04:31 1.41
+++ frontends/xforms/FormParagraph.C2001/11/29 04:04:41
@@ -348,6 +348,10 @@
 setEnabled(dialog_-radio_align_left,   bool(alignpos  LYX_ALIGN_LEFT));
 setEnabled(dialog_-radio_align_right,  bool(alignpos  LYX_ALIGN_RIGHT));
 
+// no inset-text-owned paragraph may have pagebreaks
+setEnabled(dialog_-check_pagebreaks_top, !par_-inInset());
+setEnabled(dialog_-check_pagebreaks_bottom, !par_-inInset());
+
 fl_set_button(dialog_-check_lines_top,
  par_-params().lineTop());
 fl_set_button(dialog_-check_lines_bottom,



[RFC] Automatic preview picture updating

2001-11-28 Thread Ben Stanley

I just tried to get LyX to re-render a figure that I changed, and short 
of changing the file name to a bogus name and pressing OK and then 
changing it back I can't get the figure re-drawn.

I've been thinking a little about automatic preview picture updating 
when the file on disk has changed.

My recent installation of KDE utilises fam to monitor when files or 
directories have changed, and will subsequently update them in the file 
manager (Konqueror) when they have been changed by any external mechanism.

The fam page:
http://oss.sgi.com/projects/fam/

fam is implemented efficiently by utilising a kernel mechanism (imon) 
which provides the initial callback notification that a file has changed.

I propose that we could use this mechanism to automatically update the 
preview figures in LyX when they are changed on disk. This would be done 
by modifying InsetFigure to register the file it is displaying with fam. 
If fam notifies LyX that the file has changed, the figure would be re-drawn.

Of course this would have to be a --with-fam option to configure,  since 
fam is not available everywhere nor widely installed. However it could 
also be auto-detected by configure with a suitable macro.

I suppose there should also be an update button in the Figure dialog so 
that people without fam can still see new figures. :-)

RFC?

Ben.





Re: [RFC] Automatic preview picture updating

2001-11-28 Thread John Levon

On Thu, Nov 29, 2001 at 03:47:27PM +1100, Ben Stanley wrote:

 http://oss.sgi.com/projects/fam/
 
 fam is implemented efficiently by utilising a kernel mechanism (imon) 
 which provides the initial callback notification that a file has changed.
 
 I propose that we could use this mechanism to automatically update the 
 preview figures in LyX when they are changed on disk. This would be done 
 by modifying InsetFigure to register the file it is displaying with fam. 
 If fam notifies LyX that the file has changed, the figure would be re-drawn.

this makes good sense to me (I assume it uses dnotify API on Linux ?)

Note that InsetFigure is dead though ;)

regards
john

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Re: [RFC] Automatic preview picture updating

2001-11-28 Thread Ben Stanley

The thought had struck me that fam might help with the DepTab problem 
too, but having thought about it I have decided it doesn't help 
significantly with that problem.

Ben.




Re: [RFC] Automatic preview picture updating

2001-11-28 Thread Michael Koziarski

I like the sound of this,  Nautilus under GNOME also uses fam to
redraw the preview images and there's no noticeable preformance
penalty.




-- 

| Michael Koziarski   |Conventional wisdom is often   |
| Data Engineer, Linux user   | long on convention and short   |
|  Objectivist.  | on wisdom --  |
| http://www.koziarski.com| Warren E. Buffett, BRK.A   |




Re: [RFC] Automatic preview picture updating

2001-11-28 Thread Ben Stanley

While we are on the topic of figure previews, what do people think of 
using *nice* on the gs processes? My machine gets really bogged for 
several minutes when I open my thesis... When you have lots of figures 
to preview, this would make a big difference.

Another alternative would be to render the preview when the figure is 
exposed on screen for the first time (or for extra points, render the 
preview when the part of the document visible in the window is getting 
close to the position of the figure).

There isn't really any need to render most of the figure previews in my 
thesis when I'm only working on one part of it.

Ben.





Re: [BUG] close prefs dialog abort in 1.1.6fix3

2001-11-28 Thread Ben Stanley

John Levon wrote:

On Wed, Nov 28, 2001 at 11:38:18PM +1100, Ben Stanley wrote:

Now I open my thesis, and while the previews are rendering, I open the 
preferences dialog, change a setting (the temp dir), click save, and get

blah blah
MainLoopUser Event(33,w=0x796 s=14834) ClientMessage
MainLoopUser Event(7,w=0x700017c s=15098) EnterNotify Mode Normal
In EventCallback [events.c 34] Unknown window=0x700017c


now I /can't/ reproduce it. How annoying.

Can you add :

410 lyxerr  Canvas ID   fl_get_canvas_id(figinset_canvas) 
 endl;
411 fl_set_preemptive_callback(fl_get_canvas_id(figinset_canvas), 
GhostscriptMsg, 0);

the lyxerr line into insets/figinset.C ?

Yes, I added it (and double checked)



Check that the canvas id and the ClientMessage window are the same.

We must be barking up the wrong tree - I didn't see it.

I started lyx with

lyx -shared -sync

then loaded my thesis and while figures were rendering I toggled the tmp 
dir option in the prefs dlg, and clicked Save.

kaboom.

(see also extra test after output)
Here's the output

MainLoop Event(6,w=0xb400166 s=15345) MotionNotify Mode Hint
MainLoop Event(4,w=0xb400166 s=15468) ButtonPress
MainLoop Event(5,w=0xb400166 s=15495) ButtonRelease button: 1
In MapColor [flcolor.c 739] Changing reserved color
In MapColor [flcolor.c 739] Changing reserved color
In fl_mapcolor [flcolor.c 780] mapping 0 (0,0,0)
In MapColor [flcolor.c 739] Changing reserved color
In fl_mapcolor [flcolor.c 780] mapping 258 (0,0,0)
In fl_mapcolor [flcolor.c 780] mapping 258 (0,0,0)
In Canvas [canvas.c 397] FL_DRAW
In Canvas [canvas.c 397] FL_DRAW
In drw_text_beside [xtext.c 472] align request is inside
In Canvas [canvas.c 397] FL_DRAW
Eaten Event(7,w=0xb40017c s=17301) EnterNotify Mode Normal
Eaten Event(8,w=0xb40017c s=18069) LeaveNotify Mode Normal
Eaten Event(18,w=0xb40017c s=19945) UnmapNotify
Eaten Event(17,w=0xb40017c s=19947) DestroyNotify
CanvasIntecept Event(17,w=0xb40017d s=19947) DestroyNotify
Eaten Event(6,w=0xb400166 s=17287) MotionNotify Mode Hint
Eaten Event(8,w=0xb400166 s=17301) LeaveNotify Mode Normal
Eaten Event(8,w=0xb400166 s=18069) LeaveNotify Mode Normal
Eaten Event(18,w=0xb400166 s=19980) UnmapNotify
Eaten Event(17,w=0xb400166 s=19982) DestroyNotify
CanvasIntecept Event(17,w=0xb400167 s=19982) DestroyNotify
MainLoopUser Event(33,w=0xb400096 s=15596) ClientMessage
MainLoopUser Event(33,w=0xb400096 s=15769) ClientMessage
MainLoopUser Event(7,w=0xb40017e s=17301) EnterNotify Mode Normal
In EventCallback [events.c 34] Unknown window=0xb40017e
Ignored Event(7,w=0xb40017e s=17301) EnterNotify Mode Normal
PutbackEvent Event(7,w=0xb40017e s=17301) EnterNotify Mode Normal
LyX: This shouldn't happen...
lyx: Attempting to save document 
/home/ben/Documents/PhD_Thesis/Document/main.lyx as...
  /home/ben/Documents/PhD_Thesis/Document/main.lyx.emergency
  Save seems successful. Phew.
BadWindow (invalid Window parameter)
Aborted (core dumped)
ben [15:54:23] 
/share/install/linux/extras/lyx/lyx-BRANCH_1_1_6/lyx-devel-JL/src $ X 
Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  53 (X_CreatePixmap)
  Resource id in failed request:  0xb400096
  Serial number of failed request:  42
ben [15:54:23] 
/share/install/linux/extras/lyx/lyx-BRANCH_1_1_6/lyx-devel-JL/src $




And another stack trace

(gdb) where
#0  0x4104d651 in __kill () from /lib/libc.so.6
#1  0x4104d3cd in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x4104ea38 in abort () at ../sysdeps/i386/bits/string.h:230
#3  0x082548b7 in lyx::abort () at abort.C:9
#4  0x080ed3a5 in LyX_XErrHandler (display=0x833bb60, xeev=0xb2e8)
at lyx_gui.C:95
#5  0x400fbd87 in _XError () from /usr/X11R6/lib/libX11.so.6
#6  0x400fa3f3 in _XReply () from /usr/X11R6/lib/libX11.so.6
#7  0x400f0a3e in XQueryPointer () from /usr/X11R6/lib/libX11.so.6
#8  0x40068156 in fl_get_win_mouse () from /usr/X11R6/lib/libforms.so.0.88
#9  0x40032227 in fl_compress_motion () from /usr/X11R6/lib/libforms.so.0.88
#10 0x40032273 in fl_compress_event () from /usr/X11R6/lib/libforms.so.0.88
#11 0x4004037e in get_next_event () from /usr/X11R6/lib/libforms.so.0.88
#12 0x4003f1fc in do_interaction_step () from 
/usr/X11R6/lib/libforms.so.0.88
#13 0x4003fb49 in fl_treat_interaction_events ()
   from /usr/X11R6/lib/libforms.so.0.88
#14 0x4003fb84 in fl_check_forms () from /usr/X11R6/lib/libforms.so.0.88
#15 0x081f68c4 in GUIRunTime::runTime () at GUIRunTime.C:79
#16 0x080eee68 in LyXGUI::runTime (this=0x8334f58) at lyx_gui.C:419
#17 0x080f0ff3 in LyX::LyX (this=0xb690, argc=0xb6d0, 
argv=0xb734)
at ../src/lyx_main.C:168
#18 0x08138529 in main (argc=1, argv=0xb734) at ../src/main.C:40
#19 0x4103b0ee in __libc_start_main (main=0x8138390 main, argc=3,
ubp_av=0xb734, init=0x804f2a0 _init, fini=0x82c3738 _fini,
rtld_fini=0x4100cf28 _dl_fini, stack_end=0xb72c)
at ../sysdeps/generic/libc-start.c:129
(gdb)


I 

Re: [RFC] Automatic preview picture updating

2001-11-28 Thread John Levon

On Thu, Nov 29, 2001 at 04:14:58PM +1100, Ben Stanley wrote:

 While we are on the topic of figure previews, what do people think of 
 using *nice* on the gs processes? My machine gets really bogged for 
 several minutes when I open my thesis... When you have lots of figures 
 to preview, this would make a big difference.

If you have this problem, just turn off the previewing !

 Another alternative would be to render the preview when the figure is 
 exposed on screen for the first time (or for extra points, render the 
 preview when the part of the document visible in the window is getting 
 close to the position of the figure).

overkill perhaps...

regards
john

-- 
They're talking about a submanifold of space which is a 2-dimensional torus whose 
cross-sectional radii 
 are on the order of a millimeter.  Please make some minimal attempt to understand 
what's being 
 discussed before declaring it 'drivel'.
- AC, /.



Re: [RFC] Automatic preview picture updating

2001-11-28 Thread Ben Stanley

John Levon wrote:

On Thu, Nov 29, 2001 at 04:14:58PM +1100, Ben Stanley wrote:

While we are on the topic of figure previews, what do people think of 
using *nice* on the gs processes? My machine gets really bogged for 
several minutes when I open my thesis... When you have lots of figures 
to preview, this would make a big difference.


If you have this problem, just turn off the previewing !

Hmmm... That kind of misses the point...

Another alternative would be to render the preview when the figure is 
exposed on screen for the first time (or for extra points, render the 
preview when the part of the document visible in the window is getting 
close to the position of the figure).


overkill perhaps...

maybe. I'd do the other one first. It's easy. Probably a one liner, if I 
knew the right line...

Ben.






Re: [ lyxbugs-Patches-228457 ] Small bug when pasting as ascii

2001-11-28 Thread Jean-Marc Lasgouttes

> "John" == John Levon <[EMAIL PROTECTED]> writes:

John> On Tue, Nov 27, 2001 at 07:40:39AM -0800,
John> [EMAIL PROTECTED] wrote:
>> John, it seems that your patch has been applied, but the bug is
>> still here, isn't it?

John> My patch didn't get applied did it ? I never re-worked it the
John> last time like Lars wanted it, and it fell by the wayside ...

Yes, I probably looked too lazily at the sources.

JMarc



Re: text.C compile problem

2001-11-28 Thread Jean-Marc Lasgouttes

> "John" == John Levon <[EMAIL PROTECTED]> writes:

John> On Tue, Nov 27, 2001 at 12:37:38PM -0800, Kayvan A. Sylvan
John> wrote:
>> text.C:3405: parse error before `+'

John> there's nothing wrong with that line :

John> string str(string(_("Space below")) + " ("

John> what compiler are you using ?

So it seems that I corrected one occurence and not the other. gcc
2.95.2 and compaq cxx did not complain, anyway.

JMarc



Re: text.C compile problem

2001-11-28 Thread Jean-Marc Lasgouttes

> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

Andre> On Tue, Nov 27, 2001 at 12:37:38PM -0800, Kayvan A. Sylvan
Andre> wrote:
>> ext.C:1045: warning: #warning Please fix me (Jug!) text.C:1543:
>> warning: #warning Something is rotten here! (Jug) text.C:2298:
>> warning: #warning Dekel please have a look on this one RTL? (Jug)
>> text.C:2299: warning: #warning DEKEL! text.C: In method `void
>> LyXText::paintLastRow(LyXText::DrawRowParams &)': text.C:3405:
>> parse error before `+'

Andre> I thought Jean-Marc commited already a fix for this?

You did not tell me there were two occurences of this :)

JMarc



Re: Ghostscript rendering problems with LyX 1.1.6 series

2001-11-28 Thread Jean-Marc Lasgouttes

> "John" == John Levon <[EMAIL PROTECTED]> writes:

John> With ghostscript 6.xx, up to and including 6.52 (i.e. all GNU
John> ghostscript versions), there is a bug :

John> I hope this clears things up for some people. Please apply this
John> patch

This patch is applied to both trunk and branch.

JMarc



Re: invisible math symbols?

2001-11-28 Thread Jean-Marc Lasgouttes

> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

Andre> On Wed, Nov 28, 2001 at 02:50:28AM -0500, Nirmal Govind wrote:
>> I'm using RedHat 7.2..

Andre> Tea cups are certainly worse than crystal balls in some
Andre> cases...

Andre> It is strange however, that the number of installations that
Andre> cause problems with scalable screenfonts is increasing.

Andre> Does anybody know what exactly is going on and why the scaling
Andre> does not work?

Since I will have time to play around with my mandrake 8.1-based home
pc soon, I plan to take a serious look at that.

JMarc



[PATCH] Re: DepTable is slooooooooowwwwwwwwww

2001-11-28 Thread Ben Stanley

Andre Poenitz wrote:

>On Wed, Nov 28, 2001 at 07:00:14AM +1100, Ben Stanley wrote:
>
>>The advantage of putting everything in the deptree is that if you modify
>>a figure .eps and then do the latex->DVI thing from the menu, then
>>everything will be re-generated OK.
>>
>
>If that works I owe you a beer...
>
>Andre'
>
I just went to test this out...

It works - as long as you actually change the included file and don't 
just change the mtime (eg touch it)!

So, it looks like Andre owes me a beer - except I don't drink beer. Bummer.

I found that without the mmap patch, updating the time to update 
dependencies takes forever (73 seconds), because it calculates the CRC 
of *all* the 153 .eps files in my thesis, and a few other things as 
well. Remember, I don't have istreambuf_iterator.

Patch attached (DepTable.patch) for cvs BRANCH_1_1_6 has the following 
features:

* Fast mtime comparison dependency checks after CRC has been calculated.
* Continues to function if you upgrade or downgrade LyX while using
  or *not* using a temporary directory.
* Remakes the output even if you delete the .dvi file (bug in
  LaTeX::run(), not DepTable).
* Re-makes the output if you change an included graphics file (or
  any other kind of included file).
* And even makes coffee... ;-)

If you combine this patch with the mmap-sum.patch you get much improved 
performance for re-building .dvi files using LyX on my system... There 
really is no comparison. Using mmap, the initial dependency update which 
calculates CRCs drops down to 14 sec for the same set of files. All this 
is with lyx compiled with -g -O.

The benefit of these two patches for me is even more than stated here, 
because the old LyX re-computed CRCs on every file in the DepTable after 
every LaTeX run. This used to make doing a View|DVI something of a 
'coffee break' item, but not any more!

Please apply these patches to cvs.

Ben.



--- lyx-devel-orig/src/DepTable.C   Wed Nov 15 14:22:06 2000
+++ lyx-devel/src/DepTable.CWed Nov 28 19:31:21 2001
@@ -18,57 +18,147 @@
 #endif
 
 #include "DepTable.h"
+#include "debug.h"
+
 #include "support/lyxlib.h"
 #include "support/filetools.h"
+
+#include 
+#include 
+#include 
+
 #include 
 
+
 using std::make_pair;
 using std::ofstream;
 using std::ifstream;
 using std::endl;
 
+/** \class DepTable
+   DepTable provides a list of files and information on
+   whether their contents have changed since the last time
+   the file was checked.
+   
+   This is performed internally using CRC computations and mtime checks.
+   
+   Computing the CRC of every file takes 28-33 seconds on my thesis...
+   (That is because a large number of large .eps files get entered into
+   the deptable..., and I do not have istreambuf_iterator :-( )
+   
+   Why does this class use CRC checks instead
+   of using the dates on the files?
+   
+   Well the answer to that is that LaTeX re-writes it's .aux files
+   every time it runs. This will change the modification date/time,
+   but the file might be exactly the same. You have to
+   determine if the new one is different from the old one
+   by doing a CRC or similar.
+   
+   20011126 bstanley If you were to maintain a record of the last modified 
+date/time
+   for each file, and if when you come to check it again and update the CRC,
+   you could avoid re-calculating the CRC if the date/time of the file
+   has not changed This produces a significant time saving,
+   whilst still providing the same functionality to clients. bstanley
+   
+   20011127 bstanley Applied patch by LGB which implements this date based
+   shortcut method. Speedup is significant except when the file is first entered
+   into the deptable. Tested on large thesis with many .eps files, bibliography,
+   glossary, index, etc.
+   
+   20011128 bstanley turns out that was too optimistic - things were being
+   returned as changed when they weren't. Should be fixed now.
+   
+   20011128 bstanley added a flag which is set when something changes,
+   to speed up lookups.
+*/
+
+inline bool DepTable::dep_info::changed() const
+{
+   return mtime_prev != mtime_curr && crc_prev != crc_curr;
+}
+
 void DepTable::insert(string const & fi,
- bool upd,
- unsigned long one,
- unsigned long two)
+ bool upd )
 {
// not quite sure if this is the correct place for MakeAbsPath
string f = MakeAbsPath(fi);
if (deplist.find(f) == deplist.end()) {
+   dep_info di;
+   di.crc_prev = 0;
+   di.mtime_prev = 0;
if (upd) {
-   one = two;
-   two = lyx::sum(f);
+   

[BbMaj7@yahoo.com.au] Feedback from www.lyx.org

2001-11-28 Thread Jean-Marc Lasgouttes


Angus, I guess you are the one who can answer Richard's wish.

JMarc


--- Begin Message ---


Richard Andrews ([EMAIL PROTECTED]) entered the 
following feedback message on the LyX home page:





To all the LyX team.

Great work.

This is a fantastic piece of software. I've been using LyX since the 0.10 days (circa 
1997) and even then it was pretty good

I have just finished writing my PhD thesis (image processing) using LyX as the LaTeX 
front end. I used mostly version 1.2.x (from memory) from 1997 through to present day.

Thank you all. I would not have been able to do it on Linux without LyX.



--


Now that you're all warm and fuzzy I have a feature request.

Having used LyX over several generations for massive document processing spread across 
several files I have found one area which could do with improvement. In particular the 
insertion of citations. I have recently updated to version 1.6fix1 via Mandrake 8.0 (I 
know it isn't the latest but I don't see this fixed in the change log).
It is now no longer possible to _type_ a bibtex reference for a citation, selection 
must be made from a list box. This seems to require that the file being edited has the 
bibliography database included. When dealing with a multi-file document this is not 
going to be the case.

I would like a way to nominate bibliography databases in a LyX file without including 
them for TeX processing. Perhaps an option on BibTeX files to disable typesetting like 
with the include facility. Even better would be a way to group a set of files to use 
common resources, like document options and bibtex databases.

--

P.S. xforms menus have always sucked. Good luck with the GTK front end.


L8r


Rich

--
Richard Andrews
Software Engineer
Open Telecommunications Ltd
Melbourne
Australia




--- End Message ---


Re: [PATCH] annotate added space

2001-11-28 Thread Juergen Vigna


On 27-Nov-2001 John Levon wrote:

> so how do I tell from setParagraph whether the para is inside an insettext ?

Well this is really easy to do, IMO. EVERY paragraph having an owner IS
inside a InsetText! So when updating the paragraph options you have just
to look if the corresponding paragraphs has an owner() != 0 and then disable
the checkboxes for the pagebreaks!

A second step would be to check pasting text into a InsetText and diable
eventually setted pagebreaks in that case.

  Jug

P.S.: Anyway IMO the patch can go in asis (and I think Jean-Marc did this
  already didn't he?) and then we will address the above problems.

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

It is better to kiss an avocado than to get in a fight with an aardvark.




  1   2   >