Re: [13x patch]: lyxpreview2ppm.py

2004-07-15 Thread Jean-Marc Lasgouttes
 Angus == Angus Leeming [EMAIL PROTECTED] writes:

Angus Jean-Marc, attached is a patch to make the script a little more
Angus robust in the face of exceptions raised by a failure to open a
Angus file. It also improves the quality of comments in the code and
Angus in diagnostic messages. Functionality is otherwise unchanged.

Angus OK to apply?

Yes.

JMarc


Re: [13x patch]: lyxpreview2ppm.py

2004-07-15 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:
 Angus Jean-Marc, attached is a patch to make the script a little more
 Angus robust in the face of exceptions raised by a failure to open a
 Angus file. It also improves the quality of comments in the code and
 Angus in diagnostic messages. Functionality is otherwise unchanged.
 
 Angus OK to apply?
 
 Yes.

Great. Done.

The only thing left that I'd like to do with this script is enable it to
run successfully with files containing spaces. MikTeX on Win32 has no
problems with such files, so the script should be able to cope too.

That's not to say that LyX will ever send such a file to the script, but
I'm stress-testing it. I believe that the patch is trivial but will get my
Win32 tester to try it out properly before I suggest including it in the
repository.

Angus

Index: lib/scripts/lyxpreview2ppm.py
===
RCS file:
/usr/local/lyx/cvsroot/lyx-devel/lib/scripts/Attic/lyxpreview2ppm.py,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 lyxpreview2ppm.py
--- lib/scripts/lyxpreview2ppm.py   15 Jul 2004 08:47:36 - 
1.1.2.2
+++ lib/scripts/lyxpreview2ppm.py   15 Jul 2004 08:58:44 -
@@ -307,8 +307,8 @@ def mkstemp():

 def crop_files(pnmcrop, basename):
 t = pipes.Template()
-t.append('%s -left' % pnmcrop, '--')
-t.append('%s -right' % pnmcrop, '--')
+t.append('%s -left' % pnmcrop, '--')
+t.append('%s -right' % pnmcrop, '--')

 for file in glob.glob(%s*.ppm % basename):
 tmp = mkstemp()
@@ -340,7 +340,7 @@ def main(argv):
 pnmcrop = find_exe([pnmcrop], path)

 # Compile the latex file.
-latex_call = '%s %s' % (latex, latex_file)
+latex_call = '%s %s' % (latex, latex_file)

 latex_status, latex_stdout = run_command(latex_call)
 if latex_status != None:
@@ -351,7 +351,7 @@ def main(argv):
 dvi_file = latex_file_re.sub(.dvi, latex_file)
 ps_file  = latex_file_re.sub(.ps,  latex_file)

-dvips_call = '%s -o %s %s' % (dvips, ps_file, dvi_file)
+dvips_call = '%s -o %s %s' % (dvips, ps_file, dvi_file)

 dvips_status, dvips_stdout = run_command(dvips_call)
 if dvips_status != None:
@@ -368,10 +368,10 @@ def main(argv):
 alpha = 2

 # Generate the bitmap images
-gs_call = '%s -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pnmraw ' \
-  '-sOutputFile=%s%%d.ppm ' \
+gs_call = '%s -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pnmraw ' \
+  '-sOutputFile=%s%%d.ppm ' \
   '-dGraphicsAlphaBit=%d -dTextAlphaBits=%d ' \
-  '-r%f %s' \
+  '-r%f %s' \
   % (gs, latex_file_re.sub(, latex_file), \
  alpha, alpha, resolution, ps_file)





Re: [PATCH] Re: Bug: problem when using 'very wide margins'

2004-07-15 Thread Jean-Marc Lasgouttes
 Georg == Georg Baum [EMAIL PROTECTED] writes:

Georg Jean-Marc Lasgouttes wrote:
 Another option that you could explore (in order to avoid to push
 tokens), is to use LyXLex::eatLine() instead of
 LyXLex::nextToken(). This uses the remainder of the line as next
 token. I am not sure whether it will give you correctly an empty
 token when the argument to \paperpackage is missing, but it is
 probably worth trying.

Georg It does give an empty token.

Good.
 
Georg This is almost working, but the token needs still to be pushed
Georg if there is an argument, because getString() removes it. I
Georg think the attached patch is finally safe. OK to apply it?

getString does not remove anything. It happens that findToken does a
next(), which is a rather stupid thing to do, and indeed you need to
use pushToken. I guess that we should have a getToken method that
works like findToken but without a next, but this is overkeill for
1.3.x.

You can commit the version you prefer.

JMarc



crash in lyx 1.3cvs/xforms

2004-07-15 Thread Juergen Spitzmueller
Open the mathpanel and some (e.g. the dots) subdialog. Try to move the 
subdialog with the mouse.

Jürgen.

Configuration
  Host type:  i686-pc-linux-gnu
  Special build flags:warnings assertions xforms-image-loader
  C   Compiler:   gcc
  C   Compiler flags: -g -O2
  C++ Compiler:   g++ (3.3.3)
  C++ Compiler flags: -g -O -W -Wall
  Linker flags:
  Frontend:   xforms
libXpm version:   4.11
libforms version: 1.0.0
  LyX binary dir: /usr/local/bin
  LyX files dir:  /usr/local/share/lyx


Backtrace:

BadDrawable (invalid Pixmap or Window parameter) id: 255

Program received signal SIGABRT, Aborted.
0xe410 in ?? ()
(gdb) bt
#0  0xe410 in ?? ()
#1  0xbfffe73c in ?? ()
#2  0x0006 in ?? ()
#3  0x40357f79 in abort () from /lib/tls/libc.so.6
#4  0x0843d5ff in lyx::abort () at abort.C:9
#5  0x0835fbc7 in LyX_XErrHandler (display=0x85b8820, xeev=0xbfffeae0)
at lyx_gui.C:118
#6  0x4018aeac in _XError () from /usr/X11R6/lib/libX11.so.6
#7  0x4018c9b6 in _XReply () from /usr/X11R6/lib/libX11.so.6
#8  0x40171d0a in XGetGeometry () from /usr/X11R6/lib/libX11.so.6
#9  0x400f240c in fl_get_winsize () from /usr/X11R6/lib/libforms.so.1
#10 0x400cc2f4 in fl_treat_interaction_events ()
   from /usr/X11R6/lib/libforms.so.1
#11 0x400cc4fb in fl_check_forms () from /usr/X11R6/lib/libforms.so.1
#12 0x08360a7c in lyx_gui::start ([EMAIL PROTECTED], [EMAIL PROTECTED])
at lyx_gui.C:298
#13 0x0812ba42 in LyX (this=0xb080, [EMAIL PROTECTED], argv=0xb164)
at ../src/lyx_main.C:166
#14 0x08185baa in main (argc=1, argv=0xb164) at ../src/main.C:31


Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Angus Leeming
Juergen Spitzmueller wrote:

 Open the mathpanel and some (e.g. the dots) subdialog. Try to move the
 subdialog with the mouse.

No problems here. 

An id of 255 is indeed suspicious. Looks horribly like an int to me. Usual
question applies: is the xforms library the same as the one you compiled
lyx against (ie do header file and library match).

-- 
Angus



Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Juergen Spitzmueller
Angus Leeming wrote:
 Usual
 question applies: is the xforms library the same as the one you compiled
 lyx against (ie do header file and library match).

Yes, both from the SuSE 9.1 distro (xforms 1.0). I'm just checking if a clean 
rebuild helps...

Jürgen.


Re: 'find' portability problem

2004-07-15 Thread Jean-Marc Lasgouttes
 Stephan == Stephan Witt [EMAIL PROTECTED] writes:

Stephan as far as I know I would do it like that:

Stephan find path-name-list \( -name foo -o -name bar \) -print

Indeed, thanks. Nirmal, would
  find src \( -name '*.[Cch]' -or -name '*.C.in' \)
work? If it does, I will use that.

JMarc



Re: 'find' portability problem

2004-07-15 Thread Bennett Helm
On Jul 15, 2004, at 9:10 AM, Jean-Marc Lasgouttes wrote:
Stephan == Stephan Witt [EMAIL PROTECTED] writes:
Stephan as far as I know I would do it like that:
Stephan find path-name-list \( -name foo -o -name bar \) -print
Indeed, thanks. Nirmal, would
  find src \( -name '*.[Cch]' -or -name '*.C.in' \)
work? If it does, I will use that.
It works for me.
Bennett


Re: 'find' portability problem

2004-07-15 Thread Jean-Marc Lasgouttes
 Bennett == Bennett Helm [EMAIL PROTECTED] writes:

Bennett On Jul 15, 2004, at 9:10 AM, Jean-Marc Lasgouttes wrote:
 Stephan == Stephan Witt [EMAIL PROTECTED] writes:

Stephan as far as I know I would do it like that:

Stephan find path-name-list \( -name foo -o -name bar \) -print
  Indeed, thanks. Nirmal, would find src \( -name '*.[Cch]' -or
 -name '*.C.in' \) work? If it does, I will use that.

Bennett It works for me.

Thanks. I will have a go at it when I come back in august.

JMarc


Re: 'find' portability problem

2004-07-15 Thread Stephan Witt
Jean-Marc Lasgouttes wrote:
Bennett == Bennett Helm [EMAIL PROTECTED] writes:

Bennett On Jul 15, 2004, at 9:10 AM, Jean-Marc Lasgouttes wrote:
Stephan == Stephan Witt [EMAIL PROTECTED] writes:

Stephan as far as I know I would do it like that:
Stephan find path-name-list \( -name foo -o -name bar \) -print
Indeed, thanks. Nirmal, would find src \( -name '*.[Cch]' -or
-name '*.C.in' \) work? If it does, I will use that.

Bennett It works for me.
Hello JMarc, hello Bennett,
if you call me a nit-picker... maybe, you're right. But:
I wrote find path-name-list \( -name foo -o -name bar \) -print.
The command find src \( -name '*.[Cch]' -or -name '*.C.in' \)
is a (unneeded) GNU-ism. The standard Unix find doesn't like the -or.
You have to use the -o here in case it should stay portable.
Greets,
Stephan


Re: 'find' portability problem

2004-07-15 Thread Jean-Marc Lasgouttes
 Stephan == Stephan Witt [EMAIL PROTECTED] writes:

Stephan if you call me a nit-picker... maybe, you're right. But:

Stephan I wrote find path-name-list \( -name foo -o -name bar \)
Stephan -print.

Stephan The command find src \( -name '*.[Cch]' -or -name '*.C.in'
Stephan \) is a (unneeded) GNU-ism. The standard Unix find doesn't
Stephan like the -or. You have to use the -o here in case it
Stephan should stay portable.

No, you are not a nitpicker , since the problem we have right now is
related to portability. So we shall use -o.

What about -print? Is it really necessary?

JMarc


Re: 'find' portability problem

2004-07-15 Thread Stephan Witt
Jean-Marc Lasgouttes wrote:
Stephan == Stephan Witt [EMAIL PROTECTED] writes:

Stephan if you call me a nit-picker... maybe, you're right. But:
Stephan I wrote find path-name-list \( -name foo -o -name bar \)
Stephan -print.
Stephan The command find src \( -name '*.[Cch]' -or -name '*.C.in'
Stephan \) is a (unneeded) GNU-ism. The standard Unix find doesn't
Stephan like the -or. You have to use the -o here in case it
Stephan should stay portable.
No, you are not a nitpicker , since the problem we have right now is
related to portability. So we shall use -o.
Thanks. Some people get nervous when I tell them such things. :)
What about -print? Is it really necessary?
I think so. The find command on Solaris 2.7 prints all files otherwise.
I'm not sure if this makes sense in any case, but it is like that.
Old BSD find did nothing when no action like -print or -ls was missing.
I would use -print. It's save and documented.
Greets,
Stephan


Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Juergen Spitzmueller
Juergen Spitzmueller wrote:
 I'm just checking if a clean
 rebuild helps...

Does not help. BTW autogen.sh gives these errors (automake 1.7.6, autoconf 
2.57):

Building Makefile templates...
.
Can't locate object method path via package Autom4te::Request 
at /usr/bin/autom4te line 81, GEN1 line 391.
configure.ac: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE,
configure.ac: that aclocal.m4 is present in the top-level directory,
configure.ac: and that aclocal.m4 was recently regenerated (using aclocal).
automake: no `Makefile.am' found or specified
lib/reLyX

Jürgen.


wrong link on bugzilla start page

2004-07-15 Thread Georg Baum
The link Bugs changed in the last month on http://bugzilla.lyx.org/ is
wrong. It points to the bugs changed in last week. Can somebody fix this,
please?


Georg



LyX converter online?

2004-07-15 Thread Asger Kunuk Ottar Alstrup
Hi,

Inspired by http://www.oooconv.de/ which is an online service to convert
an open office document to a number of other formats like PDF, Word, HTML
and what not, I figured such a service would be very nice to have to LyX
as well.

So, at the developer's conference, how about making a new page on the
web-site which does this?

The user can upload a LyX or LaTeX file, and get it out as LyX, PDF, HTML,
ascii, LaTeX or PS right away.

Such a feature would lower the barrier to entry: now, everybody can just
send out a .lyx file to someone else, and provide a link to the converter
page in case they do not have LyX or LaTeX installed.

If you want to get fancy, the web page could also be used to invoke
lyx2lyx to convert between LyX formats.

It should be a fairly easy hack to do...

Regards,
Asger



Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Juergen Spitzmueller
Juergen Spitzmueller wrote:
  I'm just checking if a clean
  rebuild helps...

 Does not help.

I just installed xforms 1.0.90 from source and did a rebuild. Did not help 
either.

Jürgen.


Re: LyX converter online?

2004-07-15 Thread Angus Leeming
Asger Kunuk Ottar Alstrup wrote:

 Hi,
 
 Inspired by http://www.oooconv.de/ which is an online service to convert
 an open office document to a number of other formats like PDF, Word, HTML
 and what not, I figured such a service would be very nice to have to LyX
 as well.

[snip...]

 If you want to get fancy, the web page could also be used to invoke
 lyx2lyx to convert between LyX formats.
 
 It should be a fairly easy hack to do...

...and it's a cl idea. However, some questions arise:

1. (tex - lyx) and (lyx - lyx) should be easy, but how to handle
conversion to an output format (ps, pdf etc) of a lyx file with multiple
included files. (Other lyx files, graphics etc). Require the user to
upload a tar file containing all necessary data?

2. Similarly, how to present multiple output files to the user? Create a
.tar.gz archive?

-- 
Angus



Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Angus Leeming
Juergen Spitzmueller wrote:

 Juergen Spitzmueller wrote:
  I'm just checking if a clean
  rebuild helps...

 Does not help.
 
 I just installed xforms 1.0.90 from source and did a rebuild. Did not
 help either.

I'm stumped. I take it that it is only these math panel sub dialogs that
crash. What about the color picker dialog that can be launched from the
preferences dialog? And the fiel browser dialog that can be lauched from a
'Browse...' button?

Does this crash occur for all the dialogs lauched from the math panel, or
only a subset of them?

Again, I reiterate that all works as expected here.

Does valgrind tell you anything interesting?

-- 
Angus



Re: LyX converter online?

2004-07-15 Thread Asger Kunuk Ottar Alstrup
On Thu, 15 Jul 2004, Angus Leeming wrote:

 1. (tex - lyx) and (lyx - lyx) should be easy, but how to handle
 conversion to an output format (ps, pdf etc) of a lyx file with multiple
 included files. (Other lyx files, graphics etc). Require the user to
 upload a tar file containing all necessary data?

The open office gadget does not support this, but it would be an obvious
feature to include.

 2. Similarly, how to present multiple output files to the user? Create a
 .tar.gz archive?

The open office machine does this, so that's a no-brainer.

But, as we know, perfect is the enemy of good.

A simple single-file to single-file converter would be great for
starters. Then more fancy stuff can come later.

Having such a facility is great: This allows you to actually use LyX for
something useful without having to install LaTeX. You write your document,
and then done, send it to the online converter.

As a later patch, you can provide the online converter as a built-in
feature in LyX itself: When the user clicks Preview, it sends the file to
the web, gets the result back, and displays it to the user. See, no hands!

Regards,
Asger


Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Juergen Spitzmueller
Angus Leeming wrote:
 I'm stumped. I take it that it is only these math panel sub dialogs that
 crash. 

yes.

 What about the color picker dialog that can be launched from the 
 preferences dialog? And the fiel browser dialog that can be lauched from a
 'Browse...' button?

No and no.

 Does this crash occur for all the dialogs lauched from the math panel, or
 only a subset of them?

All but arrows, greek, AMS relations and AMS negations. Also the crashing ones 
look odd (see screenshot).

 Again, I reiterate that all works as expected here.

Maybe it has something to do with the window manager (kwin from kde 3.2.3)... 
Indeed, I cannot reproduce with another wm.

 Does valgrind tell you anything interesting?

Not interesting for me, but maybe for you?

==29550== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux.
==29550== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==29550== Using valgrind-2.0.0, a program supervision framework for x86-linux.
==29550== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==29550== Estimated CPU clock rate is 996 MHz
==29550== For more details, rerun with: -v
==29550==
==29550== Source and destination overlap in strncpy(0x4033425d, 0x4033425d, 
20)
==29550==at 0x40023A87: strncpy (in /usr/lib/valgrind/vgskin_memcheck.so)
==29550==by 0x402E825A: fl_get_resource (flresource.c:606)
==29550==by 0x402E94B7: get_app_resource (flresource.c:1103)
==29550==by 0x402E94FC: fl_get_app_resources (flresource.c:1113)
==29550==
==29550== Source and destination overlap in strncpy(0x4033425d, 0x4033425d, 
20)
==29550==at 0x40023A87: strncpy (in /usr/lib/valgrind/vgskin_memcheck.so)
==29550==by 0x402E825A: fl_get_resource (flresource.c:606)
==29550==by 0x402E94B7: get_app_resource (flresource.c:1103)
==29550==by 0x402E9519: fl_get_app_resources (flresource.c:1118)
==29550==
==29550== Syscall param write(buf) contains uninitialised or unaddressable 
byte(s)
==29550==at 0x405F1058: __GI___libc_write (in /lib/libc.so.6)
==29550==by 0x403C05AE: _X11TransWrite (in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x403A3765: _XFlushInt (in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x403A3819: _XReply (in /usr/X11R6/lib/libX11.so.6.2)
==29550==Address 0x41D32FEE is 938 bytes inside a block of size 16384 
alloc'd
==29550==at 0x4002B132: calloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==29550==by 0x40392CC2: XOpenDisplay (in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x402E8899: fl_initialize (flresource.c:830)
==29550==by 0x835FC00: lyx_gui::parse_init(int, char**) (lyx_gui.C:144)
==29550==
==29550== Syscall param writev(vector[...]) contains uninitialised or 
unaddressable byte(s)
==29550==at 0x40187AD1: vgAllRoadsLeadToRome_writev 
(in /usr/lib/valgrind/valgrind.so)
==29550==by 0x40187B0D: __writev (in /usr/lib/valgrind/valgrind.so)
==29550==by 0x403C0F9D: _X11TransSocketWritev 
(in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x403C060E: _X11TransWritev (in /usr/X11R6/lib/libX11.so.6.2)
==29550==Address 0x43B9E68A is 850 bytes inside a block of size 247080 
alloc'd
==29550==at 0x4002ACB4: malloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==29550==by 0x403A1184: _XAllocScratch (in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x40397112: PutSubImage (in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x40397672: XPutImage (in /usr/X11R6/lib/libX11.so.6.2)
BadDrawable (invalid Pixmap or Window parameter) id: 255

Jürgen
attachment: dots.png

bug in the File/Save when Disk is full

2004-07-15 Thread Gama, Nicolas
Yesterday, the Hard/Disk where I was writing a report with lyx was full, and lyx 
couldn't save it.
it emptied the  old .lyx file before to tell that it was impossible to write the new 
one, and when I closed lyx, I lost everything.

is it possible to rename the old lyx before beginning to write the new one ?

Nicolas


Re: LyX converter online?

2004-07-15 Thread Christian Ridderström
On Thu, 15 Jul 2004, Angus Leeming wrote:

  It should be a fairly easy hack to do...
 
 ...and it's a cl idea.

I agree, it *is* a cool idea. When I played around with allowing latex on
wiki pages in order to write equations, I thought about this. The problem
is unfortunately the same -- security.

Since the lyx file can contain ERT, and I think you can do most anything
with latex, you leave a big security hole :-(

To be honest though, I think the risk of being hacked via latex code is 
small...   using a chroot:ed environment might be enough, I don't know.

Anyway, it is a cool project and I'd be happy to help in integrating it 
with the wiki if that seems like a good way to do it.

/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Angus Leeming
Juergen Spitzmueller wrote:
 All but arrows, greek, AMS relations and AMS negations. Also the crashing
 ones look odd (see screenshot).

Going out on a limb. What happens if you set your language environment to
English. These dialogs were designed in English and this weird sizing
suggests that the resizing has gone wrong...

 Maybe it has something to do with the window manager (kwin from kde
 3.2.3)... Indeed, I cannot reproduce with another wm.

I'm using kwin here too.

$ kwin --version
Qt: 3.1.2
KDE: 3.1.4-5 Red Hat
KWin: 0.95

 Does valgrind tell you anything interesting?
 Not interesting for me, but maybe for you?

Nah, nothing interesting.
-- 
Angus



Away for two weeks

2004-07-15 Thread Jean-Marc Lasgouttes

Now is vacation time. I will be back at the beginning of august.

Have fun.

JMarc


Re: [13x patch]: lyxpreview2ppm.py

2004-07-15 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> Jean-Marc, attached is a patch to make the script a little more
Angus> robust in the face of exceptions raised by a failure to open a
Angus> file. It also improves the quality of comments in the code and
Angus> in diagnostic messages. Functionality is otherwise unchanged.

Angus> OK to apply?

Yes.

JMarc


Re: [13x patch]: lyxpreview2ppm.py

2004-07-15 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:
> Angus> Jean-Marc, attached is a patch to make the script a little more
> Angus> robust in the face of exceptions raised by a failure to open a
> Angus> file. It also improves the quality of comments in the code and
> Angus> in diagnostic messages. Functionality is otherwise unchanged.
> 
> Angus> OK to apply?
> 
> Yes.

Great. Done.

The only thing left that I'd like to do with this script is enable it to
run successfully with files containing spaces. MikTeX on Win32 has no
problems with such files, so the script should be able to cope too.

That's not to say that LyX will ever send such a file to the script, but
I'm stress-testing it. I believe that the patch is trivial but will get my
Win32 tester to try it out properly before I suggest including it in the
repository.

Angus

Index: lib/scripts/lyxpreview2ppm.py
===
RCS file:
/usr/local/lyx/cvsroot/lyx-devel/lib/scripts/Attic/lyxpreview2ppm.py,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 lyxpreview2ppm.py
--- lib/scripts/lyxpreview2ppm.py   15 Jul 2004 08:47:36 - 
1.1.2.2
+++ lib/scripts/lyxpreview2ppm.py   15 Jul 2004 08:58:44 -
@@ -307,8 +307,8 @@ def mkstemp():

 def crop_files(pnmcrop, basename):
 t = pipes.Template()
-t.append('%s -left' % pnmcrop, '--')
-t.append('%s -right' % pnmcrop, '--')
+t.append('"%s" -left' % pnmcrop, '--')
+t.append('"%s" -right' % pnmcrop, '--')

 for file in glob.glob("%s*.ppm" % basename):
 tmp = mkstemp()
@@ -340,7 +340,7 @@ def main(argv):
 pnmcrop = find_exe(["pnmcrop"], path)

 # Compile the latex file.
-latex_call = '%s %s' % (latex, latex_file)
+latex_call = '"%s" "%s"' % (latex, latex_file)

 latex_status, latex_stdout = run_command(latex_call)
 if latex_status != None:
@@ -351,7 +351,7 @@ def main(argv):
 dvi_file = latex_file_re.sub(".dvi", latex_file)
 ps_file  = latex_file_re.sub(".ps",  latex_file)

-dvips_call = '%s -o %s %s' % (dvips, ps_file, dvi_file)
+dvips_call = '"%s" -o "%s" "%s"' % (dvips, ps_file, dvi_file)

 dvips_status, dvips_stdout = run_command(dvips_call)
 if dvips_status != None:
@@ -368,10 +368,10 @@ def main(argv):
 alpha = 2

 # Generate the bitmap images
-gs_call = '%s -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pnmraw ' \
-  '-sOutputFile=%s%%d.ppm ' \
+gs_call = '"%s" -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pnmraw ' \
+  '-sOutputFile="%s%%d.ppm" ' \
   '-dGraphicsAlphaBit=%d -dTextAlphaBits=%d ' \
-  '-r%f %s' \
+  '-r%f "%s"' \
   % (gs, latex_file_re.sub("", latex_file), \
  alpha, alpha, resolution, ps_file)





Re: [PATCH] Re: Bug: problem when using 'very wide margins'

2004-07-15 Thread Jean-Marc Lasgouttes
> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes:

Georg> Jean-Marc Lasgouttes wrote:
>> Another option that you could explore (in order to avoid to push
>> tokens), is to use LyXLex::eatLine() instead of
>> LyXLex::nextToken(). This uses the remainder of the line as next
>> token. I am not sure whether it will give you correctly an empty
>> token when the argument to \paperpackage is missing, but it is
>> probably worth trying.

Georg> It does give an empty token.

Good.
 
Georg> This is almost working, but the token needs still to be pushed
Georg> if there is an argument, because getString() removes it. I
Georg> think the attached patch is finally safe. OK to apply it?

getString does not remove anything. It happens that findToken does a
next(), which is a rather stupid thing to do, and indeed you need to
use pushToken. I guess that we should have a getToken method that
works like findToken but without a next, but this is overkeill for
1.3.x.

You can commit the version you prefer.

JMarc



crash in lyx 1.3cvs/xforms

2004-07-15 Thread Juergen Spitzmueller
Open the mathpanel and some (e.g. the "dots") subdialog. Try to move the 
subdialog with the mouse.

Jürgen.

Configuration
  Host type:  i686-pc-linux-gnu
  Special build flags:warnings assertions xforms-image-loader
  C   Compiler:   gcc
  C   Compiler flags: -g -O2
  C++ Compiler:   g++ (3.3.3)
  C++ Compiler flags: -g -O -W -Wall
  Linker flags:
  Frontend:   xforms
libXpm version:   4.11
libforms version: 1.0.0
  LyX binary dir: /usr/local/bin
  LyX files dir:  /usr/local/share/lyx


Backtrace:

BadDrawable (invalid Pixmap or Window parameter) id: 255

Program received signal SIGABRT, Aborted.
0xe410 in ?? ()
(gdb) bt
#0  0xe410 in ?? ()
#1  0xbfffe73c in ?? ()
#2  0x0006 in ?? ()
#3  0x40357f79 in abort () from /lib/tls/libc.so.6
#4  0x0843d5ff in lyx::abort () at abort.C:9
#5  0x0835fbc7 in LyX_XErrHandler (display=0x85b8820, xeev=0xbfffeae0)
at lyx_gui.C:118
#6  0x4018aeac in _XError () from /usr/X11R6/lib/libX11.so.6
#7  0x4018c9b6 in _XReply () from /usr/X11R6/lib/libX11.so.6
#8  0x40171d0a in XGetGeometry () from /usr/X11R6/lib/libX11.so.6
#9  0x400f240c in fl_get_winsize () from /usr/X11R6/lib/libforms.so.1
#10 0x400cc2f4 in fl_treat_interaction_events ()
   from /usr/X11R6/lib/libforms.so.1
#11 0x400cc4fb in fl_check_forms () from /usr/X11R6/lib/libforms.so.1
#12 0x08360a7c in lyx_gui::start ([EMAIL PROTECTED], [EMAIL PROTECTED])
at lyx_gui.C:298
#13 0x0812ba42 in LyX (this=0xb080, [EMAIL PROTECTED], argv=0xb164)
at ../src/lyx_main.C:166
#14 0x08185baa in main (argc=1, argv=0xb164) at ../src/main.C:31


Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Angus Leeming
Juergen Spitzmueller wrote:

> Open the mathpanel and some (e.g. the "dots") subdialog. Try to move the
> subdialog with the mouse.

No problems here. 

An id of 255 is indeed suspicious. Looks horribly like an int to me. Usual
question applies: is the xforms library the same as the one you compiled
lyx against (ie do header file and library match).

-- 
Angus



Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Juergen Spitzmueller
Angus Leeming wrote:
> Usual
> question applies: is the xforms library the same as the one you compiled
> lyx against (ie do header file and library match).

Yes, both from the SuSE 9.1 distro (xforms 1.0). I'm just checking if a clean 
rebuild helps...

Jürgen.


Re: 'find' portability problem

2004-07-15 Thread Jean-Marc Lasgouttes
> "Stephan" == Stephan Witt <[EMAIL PROTECTED]> writes:

Stephan> as far as I know I would do it like that:

Stephan> find path-name-list \( -name foo -o -name bar \) -print

Indeed, thanks. Nirmal, would
  find src \( -name '*.[Cch]' -or -name '*.C.in' \)
work? If it does, I will use that.

JMarc



Re: 'find' portability problem

2004-07-15 Thread Bennett Helm
On Jul 15, 2004, at 9:10 AM, Jean-Marc Lasgouttes wrote:
"Stephan" == Stephan Witt <[EMAIL PROTECTED]> writes:
Stephan> as far as I know I would do it like that:
Stephan> find path-name-list \( -name foo -o -name bar \) -print
Indeed, thanks. Nirmal, would
  find src \( -name '*.[Cch]' -or -name '*.C.in' \)
work? If it does, I will use that.
It works for me.
Bennett


Re: 'find' portability problem

2004-07-15 Thread Jean-Marc Lasgouttes
> "Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:

Bennett> On Jul 15, 2004, at 9:10 AM, Jean-Marc Lasgouttes wrote:
>>> "Stephan" == Stephan Witt <[EMAIL PROTECTED]> writes:
>>
Stephan> as far as I know I would do it like that:
>>
Stephan> find path-name-list \( -name foo -o -name bar \) -print
>>  Indeed, thanks. Nirmal, would find src \( -name '*.[Cch]' -or
>> -name '*.C.in' \) work? If it does, I will use that.

Bennett> It works for me.

Thanks. I will have a go at it when I come back in august.

JMarc


Re: 'find' portability problem

2004-07-15 Thread Stephan Witt
Jean-Marc Lasgouttes wrote:
"Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:

Bennett> On Jul 15, 2004, at 9:10 AM, Jean-Marc Lasgouttes wrote:
"Stephan" == Stephan Witt <[EMAIL PROTECTED]> writes:

Stephan> as far as I know I would do it like that:
Stephan> find path-name-list \( -name foo -o -name bar \) -print
Indeed, thanks. Nirmal, would find src \( -name '*.[Cch]' -or
-name '*.C.in' \) work? If it does, I will use that.

Bennett> It works for me.
Hello JMarc, hello Bennett,
if you call me a nit-picker... maybe, you're right. But:
I wrote "find path-name-list \( -name foo -o -name bar \) -print".
The command "find src \( -name '*.[Cch]' -or -name '*.C.in' \)"
is a (unneeded) GNU-ism. The standard Unix find doesn't like the "-or".
You have to use the "-o" here in case it should stay portable.
Greets,
Stephan


Re: 'find' portability problem

2004-07-15 Thread Jean-Marc Lasgouttes
> "Stephan" == Stephan Witt <[EMAIL PROTECTED]> writes:

Stephan> if you call me a nit-picker... maybe, you're right. But:

Stephan> I wrote "find path-name-list \( -name foo -o -name bar \)
Stephan> -print".

Stephan> The command "find src \( -name '*.[Cch]' -or -name '*.C.in'
Stephan> \)" is a (unneeded) GNU-ism. The standard Unix find doesn't
Stephan> like the "-or". You have to use the "-o" here in case it
Stephan> should stay portable.

No, you are not a nitpicker , since the problem we have right now is
related to portability. So we shall use -o.

What about -print? Is it really necessary?

JMarc


Re: 'find' portability problem

2004-07-15 Thread Stephan Witt
Jean-Marc Lasgouttes wrote:
"Stephan" == Stephan Witt <[EMAIL PROTECTED]> writes:

Stephan> if you call me a nit-picker... maybe, you're right. But:
Stephan> I wrote "find path-name-list \( -name foo -o -name bar \)
Stephan> -print".
Stephan> The command "find src \( -name '*.[Cch]' -or -name '*.C.in'
Stephan> \)" is a (unneeded) GNU-ism. The standard Unix find doesn't
Stephan> like the "-or". You have to use the "-o" here in case it
Stephan> should stay portable.
No, you are not a nitpicker , since the problem we have right now is
related to portability. So we shall use -o.
Thanks. Some people get nervous when I tell them such things. :)
What about -print? Is it really necessary?
I think so. The find command on Solaris 2.7 prints all files otherwise.
I'm not sure if this makes sense in any case, but it is like that.
Old BSD find did nothing when no action like "-print" or "-ls" was missing.
I would use "-print". It's save and documented.
Greets,
Stephan


Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Juergen Spitzmueller
Juergen Spitzmueller wrote:
> I'm just checking if a clean
> rebuild helps...

Does not help. BTW autogen.sh gives these errors (automake 1.7.6, autoconf 
2.57):

Building Makefile templates...
.
Can't locate object method "path" via package "Autom4te::Request" 
at /usr/bin/autom4te line 81,  line 391.
configure.ac: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE,
configure.ac: that aclocal.m4 is present in the top-level directory,
configure.ac: and that aclocal.m4 was recently regenerated (using aclocal).
automake: no `Makefile.am' found or specified
lib/reLyX

Jürgen.


wrong link on bugzilla start page

2004-07-15 Thread Georg Baum
The link "Bugs changed in the last month" on http://bugzilla.lyx.org/ is
wrong. It points to the bugs changed in last week. Can somebody fix this,
please?


Georg



LyX converter online?

2004-07-15 Thread Asger Kunuk Ottar Alstrup
Hi,

Inspired by http://www.oooconv.de/ which is an online service to convert
an open office document to a number of other formats like PDF, Word, HTML
and what not, I figured such a service would be very nice to have to LyX
as well.

So, at the developer's conference, how about making a new page on the
web-site which does this?

The user can upload a LyX or LaTeX file, and get it out as LyX, PDF, HTML,
ascii, LaTeX or PS right away.

Such a feature would lower the barrier to entry: now, everybody can just
send out a .lyx file to someone else, and provide a link to the converter
page in case they do not have LyX or LaTeX installed.

If you want to get fancy, the web page could also be used to invoke
lyx2lyx to convert between LyX formats.

It should be a fairly easy hack to do...

Regards,
Asger



Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Juergen Spitzmueller
Juergen Spitzmueller wrote:
> > I'm just checking if a clean
> > rebuild helps...
>
> Does not help.

I just installed xforms 1.0.90 from source and did a rebuild. Did not help 
either.

Jürgen.


Re: LyX converter online?

2004-07-15 Thread Angus Leeming
Asger Kunuk Ottar Alstrup wrote:

> Hi,
> 
> Inspired by http://www.oooconv.de/ which is an online service to convert
> an open office document to a number of other formats like PDF, Word, HTML
> and what not, I figured such a service would be very nice to have to LyX
> as well.

[snip...]

> If you want to get fancy, the web page could also be used to invoke
> lyx2lyx to convert between LyX formats.
> 
> It should be a fairly easy hack to do...

...and it's a cl idea. However, some questions arise:

1. (tex -> lyx) and (lyx -> lyx) should be easy, but how to handle
conversion to an output format (ps, pdf etc) of a lyx file with multiple
included files. (Other lyx files, graphics etc). Require the user to
upload a tar file containing all necessary data?

2. Similarly, how to present multiple output files to the user? Create a
.tar.gz archive?

-- 
Angus



Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Angus Leeming
Juergen Spitzmueller wrote:

> Juergen Spitzmueller wrote:
>> > I'm just checking if a clean
>> > rebuild helps...
>>
>> Does not help.
> 
> I just installed xforms 1.0.90 from source and did a rebuild. Did not
> help either.

I'm stumped. I take it that it is only these math panel sub dialogs that
crash. What about the color picker dialog that can be launched from the
preferences dialog? And the fiel browser dialog that can be lauched from a
'Browse...' button?

Does this crash occur for all the dialogs lauched from the math panel, or
only a subset of them?

Again, I reiterate that all works as expected here.

Does valgrind tell you anything interesting?

-- 
Angus



Re: LyX converter online?

2004-07-15 Thread Asger Kunuk Ottar Alstrup
On Thu, 15 Jul 2004, Angus Leeming wrote:

> 1. (tex -> lyx) and (lyx -> lyx) should be easy, but how to handle
> conversion to an output format (ps, pdf etc) of a lyx file with multiple
> included files. (Other lyx files, graphics etc). Require the user to
> upload a tar file containing all necessary data?

The open office gadget does not support this, but it would be an obvious
feature to include.

> 2. Similarly, how to present multiple output files to the user? Create a
> .tar.gz archive?

The open office machine does this, so that's a no-brainer.

But, as we know, perfect is the enemy of good.

A simple single-file to single-file converter would be great for
starters. Then more fancy stuff can come later.

Having such a facility is great: This allows you to actually use LyX for
something useful without having to install LaTeX. You write your document,
and then done, send it to the online converter.

As a later patch, you can provide the online converter as a built-in
feature in LyX itself: When the user clicks Preview, it sends the file to
the web, gets the result back, and displays it to the user. See, no hands!

Regards,
Asger


Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Juergen Spitzmueller
Angus Leeming wrote:
> I'm stumped. I take it that it is only these math panel sub dialogs that
> crash. 

yes.

> What about the color picker dialog that can be launched from the 
> preferences dialog? And the fiel browser dialog that can be lauched from a
> 'Browse...' button?

No and no.

> Does this crash occur for all the dialogs lauched from the math panel, or
> only a subset of them?

All but arrows, greek, AMS relations and AMS negations. Also the crashing ones 
look odd (see screenshot).

> Again, I reiterate that all works as expected here.

Maybe it has something to do with the window manager (kwin from kde 3.2.3)... 
Indeed, I cannot reproduce with another wm.

> Does valgrind tell you anything interesting?

Not interesting for me, but maybe for you?

==29550== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux.
==29550== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==29550== Using valgrind-2.0.0, a program supervision framework for x86-linux.
==29550== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==29550== Estimated CPU clock rate is 996 MHz
==29550== For more details, rerun with: -v
==29550==
==29550== Source and destination overlap in strncpy(0x4033425d, 0x4033425d, 
20)
==29550==at 0x40023A87: strncpy (in /usr/lib/valgrind/vgskin_memcheck.so)
==29550==by 0x402E825A: fl_get_resource (flresource.c:606)
==29550==by 0x402E94B7: get_app_resource (flresource.c:1103)
==29550==by 0x402E94FC: fl_get_app_resources (flresource.c:1113)
==29550==
==29550== Source and destination overlap in strncpy(0x4033425d, 0x4033425d, 
20)
==29550==at 0x40023A87: strncpy (in /usr/lib/valgrind/vgskin_memcheck.so)
==29550==by 0x402E825A: fl_get_resource (flresource.c:606)
==29550==by 0x402E94B7: get_app_resource (flresource.c:1103)
==29550==by 0x402E9519: fl_get_app_resources (flresource.c:1118)
==29550==
==29550== Syscall param write(buf) contains uninitialised or unaddressable 
byte(s)
==29550==at 0x405F1058: __GI___libc_write (in /lib/libc.so.6)
==29550==by 0x403C05AE: _X11TransWrite (in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x403A3765: _XFlushInt (in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x403A3819: _XReply (in /usr/X11R6/lib/libX11.so.6.2)
==29550==Address 0x41D32FEE is 938 bytes inside a block of size 16384 
alloc'd
==29550==at 0x4002B132: calloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==29550==by 0x40392CC2: XOpenDisplay (in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x402E8899: fl_initialize (flresource.c:830)
==29550==by 0x835FC00: lyx_gui::parse_init(int&, char**) (lyx_gui.C:144)
==29550==
==29550== Syscall param writev(vector[...]) contains uninitialised or 
unaddressable byte(s)
==29550==at 0x40187AD1: vgAllRoadsLeadToRome_writev 
(in /usr/lib/valgrind/valgrind.so)
==29550==by 0x40187B0D: __writev (in /usr/lib/valgrind/valgrind.so)
==29550==by 0x403C0F9D: _X11TransSocketWritev 
(in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x403C060E: _X11TransWritev (in /usr/X11R6/lib/libX11.so.6.2)
==29550==Address 0x43B9E68A is 850 bytes inside a block of size 247080 
alloc'd
==29550==at 0x4002ACB4: malloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==29550==by 0x403A1184: _XAllocScratch (in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x40397112: PutSubImage (in /usr/X11R6/lib/libX11.so.6.2)
==29550==by 0x40397672: XPutImage (in /usr/X11R6/lib/libX11.so.6.2)
BadDrawable (invalid Pixmap or Window parameter) id: 255

Jürgen
<>

bug in the File/Save when Disk is full

2004-07-15 Thread Gama, Nicolas
Yesterday, the Hard/Disk where I was writing a report with lyx was full, and lyx 
couldn't save it.
it emptied the  old .lyx file before to tell that it was impossible to write the new 
one, and when I closed lyx, I lost everything.

is it possible to rename the old lyx before beginning to write the new one ?

Nicolas


Re: LyX converter online?

2004-07-15 Thread Christian Ridderström
On Thu, 15 Jul 2004, Angus Leeming wrote:

> > It should be a fairly easy hack to do...
> 
> ...and it's a cl idea.

I agree, it *is* a cool idea. When I played around with allowing latex on
wiki pages in order to write equations, I thought about this. The problem
is unfortunately the same -- security.

Since the lyx file can contain ERT, and I think you can do most anything
with latex, you leave a big security hole :-(

To be honest though, I think the risk of being hacked via latex code is 
small...   using a chroot:ed environment might be enough, I don't know.

Anyway, it is a cool project and I'd be happy to help in integrating it 
with the wiki if that seems like a good way to do it.

/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: crash in lyx 1.3cvs/xforms

2004-07-15 Thread Angus Leeming
Juergen Spitzmueller wrote:
> All but arrows, greek, AMS relations and AMS negations. Also the crashing
> ones look odd (see screenshot).

Going out on a limb. What happens if you set your language environment to
English. These dialogs were designed in English and this weird sizing
suggests that the resizing has gone wrong...

> Maybe it has something to do with the window manager (kwin from kde
> 3.2.3)... Indeed, I cannot reproduce with another wm.

I'm using kwin here too.

$ kwin --version
Qt: 3.1.2
KDE: 3.1.4-5 Red Hat
KWin: 0.95

>> Does valgrind tell you anything interesting?
> Not interesting for me, but maybe for you?

Nah, nothing interesting.
-- 
Angus



Away for two weeks

2004-07-15 Thread Jean-Marc Lasgouttes

Now is vacation time. I will be back at the beginning of august.

Have fun.

JMarc