Re: History question

2001-10-18 Thread Andre Poenitz

On Wed, Oct 17, 2001 at 03:05:22PM +0200, Juergen Vigna wrote:
 Someone still remembers how someone could export stuff from the old
 1.0.x version from the commandline (as filter?)

There was no change in the --export stuff since its inclusion AFAIR.
In the beginning it worked only under X, though.

Andre'

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



Re: Improving the Systemcalls interface

2001-10-18 Thread Andre Poenitz

On Wed, Oct 17, 2001 at 02:26:34PM +0100, Angus Leeming wrote:
 Comments?

I found it a bit convoluted, too...

What would be really nice is to have some function which takes two strings
(a command name and something that should be used as stdin for this
command) and return the standard output of this programm, such that
the handling of temporary files/pipes/whatever is completely unvisible
from above.

Implementing this as a 'pipe stream' as Lars suggested, of course would
be fine, too.

Andre'

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



text.diff

2001-10-18 Thread Andre Poenitz


I think this is safe to apply.

Andre'

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


Index: lyxtext.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtext.h,v
retrieving revision 1.91
diff -u -p -r1.91 lyxtext.h
--- lyxtext.h   2001/09/27 09:52:06 1.91
+++ lyxtext.h   2001/10/16 13:39:54
@@ -662,9 +662,9 @@ public:
///
Paragraph * ownerParagraph() const;
//
-   Paragraph * ownerParagraph(Paragraph *) const;
+   void ownerParagraph(Paragraph *) const;
// set it searching first for the right owner using the paragraph id
-   Paragraph * ownerParagraph(int id, Paragraph *) const;
+   void ownerParagraph(int id, Paragraph *) const;
 };
 
 
Index: text2.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.170
diff -u -p -r1.170 text2.C
--- text2.C 2001/09/27 10:52:53 1.170
+++ text2.C 2001/10/16 13:39:54
@@ -1137,8 +1137,7 @@ void LyXText::toggleFree(BufferView * bv
 }
 
 
-string
-LyXText::getStringToIndex(BufferView * bview)
+string LyXText::getStringToIndex(BufferView * bview)
 {
string idxstring;

@@ -1170,8 +1169,8 @@ LyXText::getStringToIndex(BufferView * b
return idxstring;
 }
 
-Paragraph::size_type
-LyXText::beginningOfMainBody(Buffer const * buf,
+
+Paragraph::size_type LyXText::beginningOfMainBody(Buffer const * buf,
 Paragraph const * par) const
 {
if (textclasslist.Style(buf-params.textclass,
@@ -1193,7 +1192,7 @@ void LyXText::setParagraph(BufferView * 
   bool pagebreak_top, bool pagebreak_bottom,
   VSpace const  space_top,
   VSpace const  space_bottom,
-   Spacing const  spacing,
+  Spacing const  spacing,
   LyXAlignment align, 
   string labelwidthstring,
   bool noindent) 
@@ -2070,7 +2069,7 @@ bool LyXText::updateInset(BufferView * b
 {
// first check the current paragraph
int pos = cursor.par()-getPositionOfInset(inset);
-   if (pos != -1){
+   if (pos != -1) {
checkParagraph(bview, cursor.par(), pos);
return true;
}
@@ -2080,7 +2079,7 @@ bool LyXText::updateInset(BufferView * b
Paragraph * par = firstParagraph();
do {
pos = par-getPositionOfInset(inset);
-   if (pos != -1){
+   if (pos != -1) {
checkParagraph(bview, par, pos);
return true;
}
@@ -2575,17 +2574,17 @@ Paragraph * LyXText::ownerParagraph() co
 }
 
 
-Paragraph * LyXText::ownerParagraph(Paragraph * p) const
+void LyXText::ownerParagraph(Paragraph * p) const
 {
if (inset_owner) {
inset_owner-paragraph(p);
} else {
bv_owner-buffer()-paragraph = p;
}
-   return 0;
 }
+
 
-Paragraph * LyXText::ownerParagraph(int id, Paragraph * p) const
+void LyXText::ownerParagraph(int id, Paragraph * p) const
 {
Paragraph * op = bv_owner-buffer()-getParFromID(id);
if (op  op-inInset()) {
@@ -2597,7 +2596,6 @@ Paragraph * LyXText::ownerParagraph(int 
bv_owner-buffer()-paragraph = p;
}
}
-   return 0;
 }
 
 



hfills and latex commands

2001-10-18 Thread Herbert Voss

attached the diff against latest cvs for the hfills
and the latex command insets, together with the new files.

the latex command inset is a first step. we should
discuss the sense of this feature. I changed the
insert menu a bit, because there was a double
shortcut. also new is a minitable of used shortcuts
in default.ui for the different menues. 

as I wrote, official developing makes no more sense for me,
too much stuff which hangs around ...
- new feature or not ...
- new 1.3 branch or not ...

Herbert

-- 
http://www.educat.hu-berlin.de/~voss/lyx/
 LtxCommand.tgz


Re: Improving the Systemcalls interface

2001-10-18 Thread Angus Leeming

Thanks for the feedback, Asger.

[snip symmetry argument explanation for the original class structure.]

I still don't buy this argument. It strikes me that if the controlling 
process requires results from a child process, then its design depends 
absolutely on whether the child process is run synchronously or 
asynchronously. It isn't just a case of try one of four options in turn. The 
architect of the code _must_ think carefully about this.

 What I would like to see is a process manager in LyX: In this dialog, you
 would have a list of all child-processes that LyX initiated. For each, you
 could see the invocation command, the status, and manually kill it.

Again, this makes sense only for the case of Fork and NoWait. We don't know 
the PID of the processes launched through system, and, anyway, all future 
input is blocked if we Wait.

Having said that, it's easy to enhance the ForkedcallController to return 
info about the processes it is running and to possibly kill them. I'll have a 
go.

 I think you should read up on the execvp family (the man pages on Linux
 are good), and then document the syscall interfaces in more detail.
 As it is now, you have a hard time to know exactly what it does without
 reading the implementation as well. Also, it would be helpful to explain
 when to use each different facility, in addition to what it does.

Will do (both counts).

Incidentally, I was thinking last night about how to use Fork and NoWait to 
run file conversion. At the moment this is done synchronously and can be a 
real pain in the butt. Indeed, it was a moan about doing so incorrectly and 
thereby effectively hanging LyX that initiated this voyage of discovery.

My idea is to create a new shellstream class. The converters would create a 
small shell script, possibly involving multiple conversions. This would be 
launched as a forked process runnind asynchronously. When the shell script 
was finished and the conversion to the final form had been completed, the 
ForkedcallController would call the callback function and we could, for 
example, launch the viewer or load the graphics into LyX.

I'll have a go at all this as time permits.

Angus



Re: Improving the Systemcalls interface

2001-10-18 Thread Angus Leeming

Morning, André!

On Thursday 18 October 2001 09:09, Andre Poenitz wrote:
 On Wed, Oct 17, 2001 at 02:26:34PM +0100, Angus Leeming wrote:
  Comments?
 
 I found it a bit convoluted, too...

Hmmm. See my comments to Asger's comments!

 What would be really nice is to have some function which takes two strings
 (a command name and something that should be used as stdin for this
 command) and return the standard output of this programm, such that
 the handling of temporary files/pipes/whatever is completely unvisible
 from above.
 
 Implementing this as a 'pipe stream' as Lars suggested, of course would
 be fine, too.

I'm interested in doing something like this. Again, see my comments to 
Asger's comments. I'll come back to the list as the code develops (or not!)

Angus



Re: Improving the Systemcalls interface

2001-10-18 Thread Asger K. Alstrup Nielsen

On Thu, 18 Oct 2001, Angus Leeming wrote:

[Symmetry.]

 I still don't buy this argument. It strikes me that if the controlling 

Well, I don't care much either way. Your solution is fine.

  What I would like to see is a process manager in LyX: In this dialog, you
  would have a list of all child-processes that LyX initiated. For each, you
  could see the invocation command, the status, and manually kill it.
 
 Again, this makes sense only for the case of Fork and NoWait. We don't know 
 the PID of the processes launched through system, and, anyway, all future 
 input is blocked if we Wait.

Hmm, is it not possible to get the PID of child-processes from system in
some way or another? Maybe not. So be it.

 My idea is to create a new shellstream class. The converters would create a 
 small shell script, possibly involving multiple conversions. This would be 
 launched as a forked process runnind asynchronously. When the shell script 
 was finished and the conversion to the final form had been completed, the 
 ForkedcallController would call the callback function and we could, for 
 example, launch the viewer or load the graphics into LyX.

Sounds good to me.

If you go all the way and do the pipe stuff as well, maybe you could also
have a look and see if some of the external material insets could do
without the Python scripts? There is a wrapping Python script which
basically is a safe mini-shell with input/output redirection that
uses execvp.

Greets,

Asger




Re: Improving the Systemcalls interface

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 10:15:38AM +0100, Angus Leeming wrote:
 My idea is to create a new shellstream class. The converters would create a 
 small shell script, possibly involving multiple conversions. This would be 
 launched as a forked process runnind asynchronously. When the shell script 
 was finished and the conversion to the final form had been completed, the 
 ForkedcallController would call the callback function and we could, for 
 example, launch the viewer or load the graphics into LyX.

But this would mean I need to similute synchronous conversion myself.
I think this should be supported directly.

I need it for the math-extern stuff, so asnchronous operation is not
wanted...

Andre'

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



dependencies

2001-10-18 Thread Andre Poenitz


When I change  inset/insettabulars.C  and type 'make' (either in src or in
src/insets) nothing happens. Looks like I have to remove the .lo file
manually?

Is this intended? 

[make in src/ works to rebuilt the binary if any .C file is changend in
src/mathed]

Andre'

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



Re: Mathed bugs and other outstanding problems

2001-10-18 Thread Andre Poenitz

From the bug list

| - File-Exit does not work while editing a math formula; 
|   the same holds for opening/closing a file, changing paragraph layout... 
|   (This must definitely be fixed!)

Should be fixed.

Andre'

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



Re: Improving the Systemcalls interface

2001-10-18 Thread Angus Leeming

On Thursday 18 October 2001 10:52, Andre Poenitz wrote:
 On Thu, Oct 18, 2001 at 10:15:38AM +0100, Angus Leeming wrote:
  My idea is to create a new shellstream class. The converters would create 
a 
  small shell script, possibly involving multiple conversions. This would 
be 
  launched as a forked process runnind asynchronously. When the shell 
script 
  was finished and the conversion to the final form had been completed, the 
  ForkedcallController would call the callback function and we could, for 
  example, launch the viewer or load the graphics into LyX.
 
 But this would mean I need to similute synchronous conversion myself.
 I think this should be supported directly.
 
 I need it for the math-extern stuff, so asnchronous operation is not
 wanted...

No, I don't see that. What I envisage is that the converter class writes a 
shell script containing the conversion calls. How that shell script is then 
invoked is up to you.

I haven't thought this through very far, but the picture I have at the moment 
is:

Rather than:
class Converters {
bool convert(Buffer const * buffer,
 string const  from_file, string const  to_file_base,
 string const  from_format, string const  to_format,
 string  to_file);
};
Have
class Converters {
shellstream  (shellstream , 
 string const  from_file, string const  to_file_base,
 string const  from_format, string const  to_format);
};

string const script_file = converter.sh;
shellstream script(script_file);
converters.buildScript(script, image.eps, /tmp/lyx_xyz, EPS, XPM);
converters.runSynchronous(script);
converters.runAsynchronous(script, callback_func);

Angus



Re: Improving the Systemcalls interface

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 11:18:03AM +0100, Angus Leeming wrote:
  I need it for the math-extern stuff, so asnchronous operation is not
  wanted...
 
 No, I don't see that. What I envisage is that the converter class writes a 
 shell script containing the conversion calls. How that shell script is then 
 invoked is up to you.

I don't want to handle shellscripts in mathed.

I want to be able to say filter content of string x trough external comman
y and give me back its output as a string in one line without caring for
any detail of its implementation.

Alternately, I want to write

vectorstring cmd;
cmd.push_back(external_command);
cmd.push_back(-possibly);
cmd.push_back(with aruments);
  x_stream ps(cmd);
  string in = hallo;
  string out;
  ps  in;
  ps  out;
  

 string const script_file = converter.sh;
 shellstream script(script_file);
 converters.buildScript(script, image.eps, /tmp/lyx_xyz, EPS, XPM);
 converters.runSynchronous(script);

Ok... this is close enough.

Andre'

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



Re: Improving the Systemcalls interface

2001-10-18 Thread Angus Leeming

On Thursday 18 October 2001 11:20, Andre Poenitz wrote:
 On Thu, Oct 18, 2001 at 11:18:03AM +0100, Angus Leeming wrote:
   I need it for the math-extern stuff, so asnchronous operation is not
   wanted...
  
  No, I don't see that. What I envisage is that the converter class writes 
a 
  shell script containing the conversion calls. How that shell script is 
then 
  invoked is up to you.
 
 I don't want to handle shellscripts in mathed.
 
 I want to be able to say filter content of string x trough external comman
 y and give me back its output as a string in one line without caring for
 any detail of its implementation.
 
 Alternately, I want to write
 
   vectorstring cmd;
   cmd.push_back(external_command);
   cmd.push_back(-possibly);
   cmd.push_back(with aruments);
   x_stream ps(cmd);
   string in = hallo;
   string out;
   ps  in;
   ps  out;
   
 
  string const script_file = converter.sh;
  shellstream script(script_file);
  converters.buildScript(script, image.eps, /tmp/lyx_xyz, EPS, XPM);
  converters.runSynchronous(script);
 
 Ok... this is close enough.

No doubt I'll get less woolly about all this as I learn.  Remember, I knew no 
C++ at all when I started with LyX and that was only two years ago. I still 
use fortran a LOT ;-)



Re: About latest reLyX

2001-10-18 Thread Jose Abilio Oliveira Matos

On Wed, Oct 17, 2001 at 01:42:12PM -0400, Amir Karger wrote:
[...]
 I think the simplest way is just to copy and paste it in.
 (I wonder if main::my_fast_abs_path(...) would work?)

  I'll try that. Why do you have doubts about the fast version?
  
  I'm trying to add language support to reLyX. That is both \selectlanguage{}
and \foreignlanguage{}{}, where should I look to? Basic_Lyx.pm?

  Also to support a new page and line, above and bellow, I have to parse
first the paragraph to compute those parameters.

  Should I add both \newpage and \lyxline to syntax.default?
  
 -
 Amir

-- 
José



Re: hfills and latex commands

2001-10-18 Thread Juergen Spitzmueller

Herbert Voss wrote:
 attached the diff against latest cvs for the hfills
 and the latex command insets, together with the new files.

 the latex command inset is a first step. we should
 discuss the sense of this feature. I changed the
 insert menu a bit, because there was a double
 shortcut. also new is a minitable of used shortcuts
 in default.ui for the different menues.

Since you are very well (and fast!) in that stuff now ;-)
What *I* really like to see in LyX eventually is support of normal 
space ('\space') and thin space ('\,') -- I know, I mentioned that 
before...
Maybe you have an idea how this could be implemented in your LaTeX 
stuff (maybe a special popup?)

Regards,

Jürgen

 Herbert



Re: About latest reLyX

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 11:56:06AM +0100, Jose Abilio Oliveira Matos wrote:
   I'll try that. Why do you have doubts about the fast version?

Since you seem to work on reLyX, could you tell me what math-specific stuff
is done in reLyX?

Andre'

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



RE: dependencies

2001-10-18 Thread Juergen Vigna


On 18-Oct-2001 Andre Poenitz wrote:

 When I change  inset/insettabulars.C  and type 'make' (either in src or in
 src/insets) nothing happens. Looks like I have to remove the .lo file
 manually?
 
 Is this intended? 

Here this works as expected, changing a source file recompiles that file!
Maybe you're working on a special filesystem?

   Jürgen

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
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
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Criticism comes easier than craftsmanship.
-- Zeuxis




Re: About latest reLyX

2001-10-18 Thread Jose Abilio Oliveira Matos

On Thu, Oct 18, 2001 at 12:56:14PM +0200, Andre Poenitz wrote:
 On Thu, Oct 18, 2001 at 11:56:06AM +0100, Jose Abilio Oliveira Matos wrote:
I'll try that. Why do you have doubts about the fast version?
 
 Since you seem to work on reLyX, could you tell me what math-specific stuff
 is done in reLyX?

  Amir or John Weiss should have a better answer. I never worked with this
part of the code, but I think that I have a basic grasp of what is going on.

  Reading the comments in source code, it looks like the latex code is
cleaned in CleanTex.pm, where, for example, x^2 = x_{2}, since the mathed
parser is more strict than latex.

  After that stage all the latex math code is passed untouched to mathed.
  
 Andre'
 
 -- 
 André Pönitz .. [EMAIL PROTECTED]

-- 
José



Re: About latest reLyX

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 12:17:06PM +0100, Jose Abilio Oliveira Matos wrote:
   Amir or John Weiss should have a better answer. I never worked with this
 part of the code, but I think that I have a basic grasp of what is going on.
 
   Reading the comments in source code, it looks like the latex code is
 cleaned in CleanTex.pm, where, for example, x^2 = x_{2}, since the mathed
 parser is more strict than latex.

x^2 is fine in current mathed, and so is '$...$', '$$...$$' and '\cal'.

  After that stage all the latex math code is passed untouched to mathed.

Would be nice if all math remains untouched by reLyX...

Andre'

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



Re: dependencies

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 01:04:08PM +0200, Juergen Vigna wrote:
 Here this works as expected, changing a source file recompiles that file!
 Maybe you're working on a special filesystem?

No, not really... as I said, it works in src/mathed... maybe a problem with
timestamps...I'll have a look again.

Andre'

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



Re: Mathed bugs and other outstanding problems

2001-10-18 Thread Michael Schmitt

On Thu, 18 Oct 2001, Andre Poenitz wrote:

 | - File-Exit does not work while editing a math formula;
 |   the same holds for opening/closing a file, changing paragraph layout...
 |   (This must definitely be fixed!)

 Should be fixed.

Just in case the report is still on my list I will remove it (I thought I
have done so some time ago).

I will continue using and testing LyX in a few days. Finally, I
have moved and re-arranged things at my new location and job.

It is good to see that you and Jean Marc are discussing
basic problems such as undo. I definitely encourage you to improve the
code even at the cost of temporary problems. Keeping the existing
showstoppers for an infinite time is not a good idea, either.

Have a nice day, Michael

PS: What is the best (freely available) Linux tool for checking memory
accesses and leaks? I know that nothing compares to Purify but is there
anything better than electric fence?

-- 
==
Michael Schmittphone: +49 451 99 77 410
Glockenhaeuschen 8 eMail: [EMAIL PROTECTED]
DE-54634 Bitburg, Germany  WWW:   http://www.teststep.org
==




Re: Mathed bugs and other outstanding problems

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 01:38:33PM +0200, Michael Schmitt wrote:
 It is good to see that you and Jean Marc are discussing
 basic problems such as undo.

[Are we?]

 PS: What is the best (freely available) Linux tool for checking memory
 accesses and leaks? I know that nothing compares to Purify but is there
 anything better than electric fence?

efence is the only thing I've ever used...

Ander'

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



Re: dependencies

2001-10-18 Thread Juergen Vigna


On 18-Oct-2001 Andre Poenitz wrote:

 No, not really... as I said, it works in src/mathed... maybe a problem with
 timestamps...I'll have a look again.

Please pay attention that if you work on a nfs file system the files are
written with the date/time of the nfs-server machine. Such things happen
if the PC are not time syncronized!

Jürgen

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
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
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

I guess the Little League is even littler than we thought.
-- D. Cavett




Re: Improving the Systemcalls interface

2001-10-18 Thread John Levon

On Thu, Oct 18, 2001 at 11:43:20AM +0200, Lars Gullik Bjønnes wrote:

 | I'm interested in doing something like this. Again, see my comments to 
 | Asger's comments. I'll come back to the list as the code develops (or not!)
 
 So what you need to do is to create:
 
 class process_stream : public iostream;
 class iprocess_stream : public istream; 
 class oprocess_stream : public ostream;
 
 and a class process_buf : public streambuf;
 
 and off you go...
 (and put it under Boost license or LGPL)

please do, I want this in one of my projects too (is the Boost license actually
approved GPL-compatible though ?)

The API would have to be different though, wouldn't it ? Or I suppose the fork()
could happen lazily. At the least I would need an estream as well ...

regards
john

-- 
There are two kinds of fool. One says, 'This is old, and therefore good.' And
one says, 'This is new, and therefore better'.
- John Brunner



Re: Mathed bugs and other outstanding problems

2001-10-18 Thread John Levon

On Thu, Oct 18, 2001 at 01:38:33PM +0200, Michael Schmitt wrote:

 PS: What is the best (freely available) Linux tool for checking memory
 accesses and leaks? I know that nothing compares to Purify but is there
 anything better than electric fence?

I believe the basic Purify techniques are US-patent-encumbered.

However, Boehm's GC in FIND_LEAK mode should work for leaks. I'll see if I
can get it going again ...

regards
john

-- 
There are two kinds of fool. One says, 'This is old, and therefore good.' And
one says, 'This is new, and therefore better'.
- John Brunner



BUGREPORT: lyxpipe deletion

2001-10-18 Thread Moritz Moeller-Herrmann

Hi!

I am using lyx 1.1.6fix3. Sometimes lyx crashes. Probably because xforms
s. No problem.

The problem: lyx does NOT DELETE it's lyxpipe. This causes pybliographer to not
work after this.

The problem has been around for ages (see
http://www.mail-archive.com/lyx-users@lists.lyx.org/msg06804.html)

Will something be done about this? Is there no solution with file locking, that
could automatically delete the lypipe files if lyx starts and no other lyx is
running?

I have to support some less clueful windows user who switched to lkinux because
of me and stuff like this is a nightmare. (Simple, just type ALT + F2 konsole
[Enter] then rm ~/.lyx/lyxpipe.* After this restart lyx and pybliographer,
aren't you glad you left windows?]

Would be cool if an (integrated non hacky) solution would pop up for
lyx-1.1.6fix4 or lyx-1.2 (whenever it is ready)

Thanks a lot!

-- 
Moritz Moeller-Herrmann ICQ #3585990
(wiss. Mitarbeiter, IMGB, Mannheim)



Re: About latest reLyX

2001-10-18 Thread Jose Abilio Oliveira Matos

On Thu, Oct 18, 2001 at 01:20:18PM +0200, Andre Poenitz wrote:
 
 x^2 is fine in current mathed, and so is '$...$', '$$...$$' and '\cal'.

  I can do that.

  What else?
  
   After that stage all the latex math code is passed untouched to mathed.
 
 Would be nice if all math remains untouched by reLyX...

  Would you consider that a bug so that I can insert a new feature? ;-)

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

-- 
José



Re: BUGREPORT: lyxpipe deletion

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 03:21:02PM +0200, Moritz Moeller-Herrmann wrote:
 I have to support some less clueful windows user who switched to lkinux
 because of me and stuff like this is a nightmare. (Simple, just type ALT
 + F2 konsole [Enter] then rm ~/.lyx/lyxpipe.* After this restart lyx and
 pybliographer, aren't you glad you left windows?]

put them 

alias lyx='rm -f ~/.lyx/lyxpipe.* ; lyx'

into .bashrc...


But you certainly have a point here.

Andre'

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



Re: About latest reLyX

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 02:34:07PM +0100, Jose Abilio Oliveira Matos wrote:
 On Thu, Oct 18, 2001 at 01:20:18PM +0200, Andre Poenitz wrote:
  
  x^2 is fine in current mathed, and so is '$...$', '$$...$$' and '\cal'.
 
   I can do that.
 
   What else?

I do know reLyX, so I can't tell you what else ;-}

After that stage all the latex math code is passed untouched to mathed.
  
  Would be nice if all math remains untouched by reLyX...
 
   Would you consider that a bug so that I can insert a new feature? ;-)

Yes. Handling math outside mathed is most certainly a bug ;-)

Andre'

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



Re: configur latest cvs

2001-10-18 Thread Stephan Witt

Andre Poenitz wrote:
 
 On Thu, Oct 18, 2001 at 03:55:29PM +0200, Jean-Marc Lasgouttes wrote:
  Do you have a lyx binary in /usr/bin/X11 (and /usr/bin/X11 in your
  path?). If you do then blame your distributor (SuSE, if I am not
  mistaken) :)
 
 Where should the lyx bineary put by distributors in an ideal world?
 [And why?]

Normally the binary is installed in /usr/X11R6/bin...

The problem is not the real location. SuSE linux
initializes the PATH environment variable with
a clever mechanism: they look for the X11 directory
to use the right one. But they're using a strange
order for that:
/usr/bin/X11,/usr/X11R6/bin,/usr/X11/bin.

Unfortunately they added the symlink 
/usr/bin/X11 - ../X11R6/bin
too... so X11 binaries now are found in /usr/bin/X11.

I have changed the order of the lookup after installing
my linux-laptop in /etc/csh.login.
(I'm root there, I can do it :)
Now the relevant part of /etc/csh.login reads as follows:

if ( -d /usr/X11R6/bin ) then
set _xpath=( /usr/X11R6/bin $_xpath )
else if ( -d /usr/X11/bin ) then
set _xpath=( /usr/X11/bin   $_xpath )
else if ( -d /usr/bin/X11 ) then
set _xpath=( /usr/bin/X11   $_xpath )
endif

I don't like the SuSE default too.

Stephan


[EMAIL PROTECTED] | beusen Solutions GmbH
fon: +49 30 549932-62| Landsberger Allee 366
fax: +49 30 549932-21| 12681 Berlin, Germany





Re: BUGREPORT: lyxpipe deletion

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 03:21:02PM +0200, Moritz Moeller-Herrmann wrote:
 Would be cool if an (integrated non hacky) solution would pop up for
 lyx-1.1.6fix4 or lyx-1.2 (whenever it is ready)

The problem seems to be that calling ::abort in support/abort.C prevents
the LyX server's (and a few more) destructors from running.

I'd just throw some uncaught exception, but than LyX does not want to use
exceptions at all. So I don't know how to work around this.

Andre'

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



Re: dependencies

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 03:32:35PM +0200, Jean-Marc Lasgouttes wrote:
 Andre [make in src/ works to rebuilt the binary if any .C file is
 Andre changend in src/mathed]
 
 Is that new? Which version of autoconf/automake do you have? Did you
 run ./autogen.sh?

Uuh... not manually recently...
Should I?

Andre' 

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



Re: BUGREPORT: lyxpipe deletion

2001-10-18 Thread Moritz Moeller-Herrmann

On Thu, Oct 18, 2001 at 04:45:17PM +0200, Andre Poenitz wrote:
On Thu, Oct 18, 2001 at 03:21:02PM +0200, Moritz Moeller-Herrmann wrote:
 Would be cool if an (integrated non hacky) solution would pop up for
 lyx-1.1.6fix4 or lyx-1.2 (whenever it is ready)

The problem seems to be that calling ::abort in support/abort.C prevents
the LyX server's (and a few more) destructors from running.

I'd just throw some uncaught exception, but than LyX does not want to use
exceptions at all. So I don't know how to work around this.

On startup lyx could check if another lyx process of the same user was running
and if not it could just delete the lypipe.

Or make it the [default] option to delete the lyxpipe if its already there.

-- 
Moritz Moeller-Herrmann ICQ #3585990
(wiss. Mitarbeiter, IMGB, Mannheim)



Re: BUGREPORT: lyxpipe deletion

2001-10-18 Thread John Levon

On Thu, Oct 18, 2001 at 04:45:17PM +0200, Andre Poenitz wrote:

 The problem seems to be that calling ::abort in support/abort.C prevents
 the LyX server's (and a few more) destructors from running.
 
 I'd just throw some uncaught exception, but than LyX does not want to use
 exceptions at all. So I don't know how to work around this.

it's just a matter of explictly calling a destructor or deleting the pipes
in abort handler.

this has been discussed before, check the sourceforge bug

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



workWidth

2001-10-18 Thread John Levon


is this supposed to fix all collapsable insets ?

insert www (indented line). insert footnote, place cursor to the right
of footnote. press return - footnote exceeds workare width

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: Improving the Systemcalls interface

2001-10-18 Thread John Levon

On Thu, Oct 18, 2001 at 03:18:02PM +0200, Lars Gullik Bjønnes wrote:

 Boost has no limitations on what you can do with the code.
 (rewrite, no-source, take money for it etc etc.)

great.

 mmm... it should perhaps be called pstream instead
 (ipstream,opstream,pstream)

yeah

 What is your estream?

stderr for the fork/exec case

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: BUGREPORT: lyxpipe deletion

2001-10-18 Thread Zvezdan Petkovic

On Thu, Oct 18, 2001 at 06:24:28PM +0200, Moritz Moeller-Herrmann wrote:
 On Thu, Oct 18, 2001 at 03:34:27PM +0200, Andre Poenitz wrote:
 On Thu, Oct 18, 2001 at 03:21:02PM +0200, Moritz Moeller-Herrmann wrote:
  I have to support some less clueful windows user who switched to lkinux
  because of me and stuff like this is a nightmare. (Simple, just type ALT
  + F2 konsole [Enter] then rm ~/.lyx/lyxpipe.* After this restart lyx and
  pybliographer, aren't you glad you left windows?]
 
 put them 
 
 alias lyx='rm -f ~/.lyx/lyxpipe.* ; lyx'
 
 into .bashrc...
 
 
 But you certainly have a point here.
 
 This as you point out, does NOT work for KDE desktops. And the people I
 transferred from Windows to KDE have no intention to use xterms :-)
 

Then put in their .profile (or .bash_profile)

[ -p ~/.lyx/lyxpipe.in ]  rm -f ~/.lyx/lyxpipe.in
[ -p ~/.lyx/lyxpipe.out ]  rm -f ~/.lyx/lyxpipe.out

or if they are using (t)csh then in their .login put

if ( -p ~/.lyx/lyxpipe.in ) rm -rf ~/.lyx/lyxpipe.in
if ( -p ~/.lyx/lyxpipe.out ) rm -rf ~/.lyx/lyxpipe.out

-- 
Zvezdan Petkovic [EMAIL PROTECTED]
http://www.cs.wm.edu/~zvezdan/



Re: Lyx Server

2001-10-18 Thread Mike Ressler

Jiri,

I have forwarded this to the LyX developers' list. Hopefully, someone
there who is much more knowledgable than I can explain the current
workings. (I'm just a humble documentor.)

Mike

On Mon, 15 Oct 2001, [iso-8859-1] Jiri Mares wrote:

 Hi Mike,
 I would like to ask you for more information about Lyx
 Server. I am developing Perl program, that read *.lyx
 file containing Mathed equations. The equation
 is translated via regular expression to Perl, then
 appropriate values are substituted and equation is
 calculated.
 The purpose of this program is to create and maintain
 documents, where the mathematical expressions are
 calculated. I have configured my Lyx, so I have in my
 home directory lyxrc file with

 \serverpipe /home/jiri/.lyx/.lyxpipe

 When I write output of my program to .lyxpipe.in, Lyx
 does not react. What
 is the problem? Probably I did not understand the
 princip of Lyx server. Could you give me advice, where
 can I find more information? I tried to find more
 information on some links, they are on oficial Lyx
 page, but without succes.

-- 
Mike Ressler
[EMAIL PROTECTED]
OK, I'm lame: I don't have my own website ...




Infinite table redarws

2001-10-18 Thread John Levon


Can anyone still trigger these ? Is this Juergen's recent changes ?

thanks
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



[PATCH] pipe deletion in emergencies

2001-10-18 Thread John Levon


based on JMarc's comment last time round.

thanks
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 


Index: ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.368
diff -u -r1.368 ChangeLog
--- ChangeLog   2001/10/18 16:49:27 1.368
+++ ChangeLog   2001/10/18 23:59:56
@@ -1,3 +1,10 @@
+2001-10-19  John Levon  [EMAIL PROTECTED]
+
+   * lyxserver.h:
+   * lyxserver.C:
+   * lyx_main.h:
+   * lyx_main.C: add emergencyCleanup (remove pipes on crash)
+
 2001-10-18  Juergen Vigna  [EMAIL PROTECTED]
 
* text.C (workWidth): new function with added Inset * parameter.
Index: lyx_main.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.94
diff -u -r1.94 lyx_main.C
--- lyx_main.C  2001/10/10 16:45:04 1.94
+++ lyx_main.C  2001/10/19 00:00:09
@@ -220,7 +220,7 @@
signal(SIGSEGV, SIG_DFL);
signal(SIGTERM, SIG_DFL);
 
-   bufferlist.emergencyWriteAll();
+   LyX::emergencyCleanup();
 
lyxerr  Bye.  endl;
if (err_sig!= SIGHUP  
@@ -556,6 +556,19 @@
 }
 
 
+void LyX::emergencyCleanup()
+{
+   // what to do about tmpfiles is non-obvious. we would
+   // like to delete any we find, but our lyxdir might
+   // contain documents etc. which might be helpful on
+   // a crash
+ 
+   bufferlist.emergencyWriteAll();
+   if (lyxserver)
+   lyxserver-emergencyCleanup();
+}
+
+ 
 // LyX can optionally take over the handling of deadkeys
 void LyX::deadKeyBindings(kb_keymap * kbmap)
 {
Index: lyx_main.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.h,v
retrieving revision 1.22
diff -u -r1.22 lyx_main.h
--- lyx_main.h  2001/06/28 10:25:13 1.22
+++ lyx_main.h  2001/10/19 00:00:09
@@ -51,6 +51,9 @@
/// Always is useful a destructor
~LyX();
 
+   /// in the case of failure
+   static void emergencyCleanup();
+ 
///
LyXGUI * lyxGUI;  // should be only one of this
 private:
Index: lyxserver.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxserver.C,v
retrieving revision 1.27
diff -u -r1.27 lyxserver.C
--- lyxserver.C 2001/09/09 22:02:11 1.27
+++ lyxserver.C 2001/10/19 00:00:16
@@ -110,195 +110,148 @@
  
if (pipename.empty()) return;
 
-   // --- prepare input pipe ---
+   if ((infd = startPipe(pipename + .in)) == -1)
+   return;
+
+   if ((outfd = startPipe(pipename + .out)) == -1) {
+   endPipe(infd, pipename + .in);
+   return;
+   }
+ 
+   if (fcntl(outfd, F_SETFL, O_NONBLOCK)  0) {
+   lyxerr  LyXComm: Could not set flags on pipe   pipename  .out
+   '\n'  strerror(errno)  endl;
+   return;
+   }
+ 
+   // We made it!
+   ready = true;
+   lyxerr[Debug::LYXSERVER]  LyXComm: Connection established  endl;
+}
+
+   
+/// Close pipes
+void LyXComm::closeConnection()
+{
+   lyxerr[Debug::LYXSERVER]  LyXComm: Closing connection  endl;
+
+   if (pipename.empty()) {
+   return;
+   }
+
+   if (!ready) {
+   lyxerr  LyXComm: Already disconnected  endl;
+   return;
+   }
+ 
+   endPipe(infd, pipename + .in);
+   endPipe(outfd, pipename + .out);
  
-   string tmp = pipename + .in;
-   
+   ready = false;
+}
+
+int LyXComm::startPipe(string const  filename)
+{
+   int fd;
+ 
 #ifdef __EMX__
-   HPIPE fd;
+   HPIPE os2fd;
APIRET rc;
int errnum;
// Try create one instance of named pipe with the mode O_RDONLY|O_NONBLOCK.
// The current emx implementation of access() won't work with pipes.
-   rc = DosCreateNPipe(tmp.c_str(), fd, NP_ACCESS_INBOUND,
+   rc = DosCreateNPipe(filename.c_str(), os2fd, NP_ACCESS_INBOUND,
NP_NOWAIT|0x01, 0600, 0600, 0);
-   if (rc == ERROR_PIPE_BUSY)
-#else
-   if (::access(tmp.c_str(), F_OK) == 0)
-#endif
-   {
-   lyxerr  LyXComm: Pipe   tmp   already exists.\n
+   if (rc == ERROR_PIPE_BUSY) {
+   lyxerr  LyXComm: Pipe   filename   already exists.\n
If no other LyX program is active, please delete
 the pipe by hand and try again.  endl;
pipename.erase();
-   return;
+   return -1;
}
-#ifndef __EMX__
-   if (::mkfifo(tmp.c_str(), 0600)  0) {
-   lyxerr  LyXComm: Could not create pipe   tmp  '\n'
-   strerror(errno)  endl;
-   return;
-   };
- 

Re: About latest reLyX

2001-10-18 Thread Amir Karger

On Thu, Oct 18, 2001 at 01:20:18PM +0200, Andre Poenitz wrote:
 On Thu, Oct 18, 2001 at 12:17:06PM +0100, Jose Abilio Oliveira Matos wrote:
Amir or John Weiss should have a better answer. I never worked with this
  part of the code, but I think that I have a basic grasp of what is going on.

On the other hand, I haven't worked on it in three years.

Reading the comments in source code, it looks like the latex code is
  cleaned in CleanTex.pm, where, for example, x^2 = x_{2}, since the mathed
  parser is more strict than latex.

Pretty much.

 x^2 is fine in current mathed, and so is '$...$', '$$...$$' and '\cal'.
 
   After that stage all the latex math code is passed untouched to mathed.
 
 Would be nice if all math remains untouched by reLyX...

It's great that you've done a lot of work to support the stuff lyx didn't
used to support which required writing these workarounds in the first place.
It seems like some of CleanTeX.pm could probably go away at this point. 

I do think the math translation stuff in syntax.default needs to stay in,
because lots of people use non-standard math in their files, and this
might allow them to translate it.

Btw, the only problem with not translating $..$ and stuff is that the parser
at some point does need to make sure it knows where math begins and ends.
(Btw, there are probably other commands that automatically start math mode
text. Would be nice to handle those, sending them all to whatever that
function is that just copies exactly literally. As long as we're at it,
what's the current support for \mbox? I had this fantasy of finding \mbox'es
in math and translating them into regular LyX)

-Amir



clicking RHS of footnote

2001-10-18 Thread John Levon


The bug happens when there is some text a immediately after a footnote
(tying in with when the drawing width problem happens).

In checkInsetHit :

895 Inset * tmpinset = cursor.par()-getInset(cursor.pos()-1);
896 LyXFont font = text-getFont(buffer_, cursor.par(),
897   cursor.pos() - 1);
898 int const width = tmpinset-width(bv_, font);
899 lyxerr  DITH is   width  endl;
900 int const inset_x = font.isVisibleRightToLeft()
901 ? cursor.x() : cursor.x() - width;
902 lyxerr  inset x is   inset_x  endl;
903 lyxerr  cursor x is   cursor.x()  endl;

cursor.x() is returning what I assume is the magic value 20, giving it
totally the wrong range for x, failing the test below.

What is the 20 actually supposed to do ? Why does the cursor.x() think its
position is 20 ?

john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: Next ERT glitch

2001-10-18 Thread John Levon

On Mon, Oct 15, 2001 at 09:35:28AM +0200, Juergen Vigna wrote:

  When Text is pasted from the outside into an ERT inset it remains black.
  It will be red after the next reload, though...
 
 I already told this to people on the list various time. This is a problem
 I cannot understand and is of class inheritance. In some cases instead
 of calling the right functions inside the class it calls some other functions
 just try to debug it and you'll see what I mean! I also asked for Help and

what functions are we talking about, in which classes ?

thanks
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: multipart doc crash

2001-10-18 Thread John Levon

On Wed, Oct 03, 2001 at 03:32:54PM +1000, Allan Rae wrote:

 You'll get warnings about not being able to find the subparts of the
 document that had absolute paths.  However if you open the Documents menu
 entry you will find all those files listed.  Now, what do you think might
 happen if you select one of those nonexistent documents from the Documents
 menu?

how do I create these subparts so I get that warning ??

thanks
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: edit-tabular-add row doesn't work properly

2001-10-18 Thread John Levon

On Thu, Oct 04, 2001 at 02:42:32PM -0400, Richard E. Hawkins wrote:

 I put a table in a table float,  positioned in the last row, and added 
 a row from the edit menu.  It gave me a separated row, as the new row 
 had both top and bottom lines (add row in the final row should probably 
 have a special behavior--figuring out that it is the last row instead 
 of duplicating the borders as is appropriate elsewhere in the table.
 
 I undid, and then tried to add a row further up the table.  Nothing 
 happened.  I was unable to add at the last row, either.

I can't reproduce this. Are you sure you weren't in a text inset (red box
around cursor ?)

You must be outside of the inner inset to do things like this (yes, that
is definitely bad, but a different bug).

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: Bad bug: spell checker and quotes

2001-10-18 Thread John Levon

On Tue, Oct 09, 2001 at 10:00:47AM -0400, Mark van Rossum wrote:

   The 'OSA is nice'.

the spellchecker for me works, but flags The and nice as
not in the dictionary (and they don't seem to be).

Qt2 frontend

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



[PATCH] emergencyCleanup take 2

2001-10-18 Thread John Levon


I accidentally missed some things from the last one

thanks
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 


diff -u -r1.368 ChangeLog
--- src/ChangeLog   2001/10/18 16:49:27 1.368
+++ src/ChangeLog   2001/10/19 02:04:30
@@ -1,3 +1,10 @@
+2001-10-19  John Levon  [EMAIL PROTECTED]
+
+   * lyxserver.h:
+   * lyxserver.C:
+   * lyx_main.h:
+   * lyx_main.C: add emergencyCleanup (remove pipes on crash)
+
 2001-10-18  Juergen Vigna  [EMAIL PROTECTED]
 
* text.C (workWidth): new function with added Inset * parameter.
diff -u -r1.92 lyx_gui.C
--- src/lyx_gui.C   2001/09/27 09:43:31 1.92
+++ src/lyx_gui.C   2001/10/19 02:04:53
@@ -79,9 +79,8 @@
 static
 int LyX_XErrHandler(Display * display, XErrorEvent * xeev)
 {
-   // emergency save
-   if (!bufferlist.empty())
-   bufferlist.emergencyWriteAll();
+   // emergency cleanup
+   LyX::emergencyCleanup();
 
// Get the reason for the crash.
char etxt[513];
Index: src/lyx_main.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.94
diff -u -r1.94 lyx_main.C
--- src/lyx_main.C  2001/10/10 16:45:04 1.94
+++ src/lyx_main.C  2001/10/19 02:04:55
@@ -220,7 +220,7 @@
signal(SIGSEGV, SIG_DFL);
signal(SIGTERM, SIG_DFL);
 
-   bufferlist.emergencyWriteAll();
+   LyX::emergencyCleanup();
 
lyxerr  Bye.  endl;
if (err_sig!= SIGHUP  
@@ -556,6 +556,19 @@
 }
 
 
+void LyX::emergencyCleanup()
+{
+   // what to do about tmpfiles is non-obvious. we would
+   // like to delete any we find, but our lyxdir might
+   // contain documents etc. which might be helpful on
+   // a crash
+ 
+   bufferlist.emergencyWriteAll();
+   if (lyxserver)
+   lyxserver-emergencyCleanup();
+}
+
+ 
 // LyX can optionally take over the handling of deadkeys
 void LyX::deadKeyBindings(kb_keymap * kbmap)
 {
Index: src/lyx_main.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.h,v
retrieving revision 1.22
diff -u -r1.22 lyx_main.h
--- src/lyx_main.h  2001/06/28 10:25:13 1.22
+++ src/lyx_main.h  2001/10/19 02:04:55
@@ -51,6 +51,9 @@
/// Always is useful a destructor
~LyX();
 
+   /// in the case of failure
+   static void emergencyCleanup();
+ 
///
LyXGUI * lyxGUI;  // should be only one of this
 private:
diff -u -r1.27 lyxserver.C
--- src/lyxserver.C 2001/09/09 22:02:11 1.27
+++ src/lyxserver.C 2001/10/19 02:05:03
@@ -110,195 +110,148 @@
  
if (pipename.empty()) return;
 
-   // --- prepare input pipe ---
+   if ((infd = startPipe(pipename + .in)) == -1)
+   return;
+
+   if ((outfd = startPipe(pipename + .out)) == -1) {
+   endPipe(infd, pipename + .in);
+   return;
+   }
+ 
+   if (fcntl(outfd, F_SETFL, O_NONBLOCK)  0) {
+   lyxerr  LyXComm: Could not set flags on pipe   pipename  .out
+   '\n'  strerror(errno)  endl;
+   return;
+   }
+ 
+   // We made it!
+   ready = true;
+   lyxerr[Debug::LYXSERVER]  LyXComm: Connection established  endl;
+}
+
+   
+/// Close pipes
+void LyXComm::closeConnection()
+{
+   lyxerr[Debug::LYXSERVER]  LyXComm: Closing connection  endl;
+
+   if (pipename.empty()) {
+   return;
+   }
+
+   if (!ready) {
+   lyxerr  LyXComm: Already disconnected  endl;
+   return;
+   }
+ 
+   endPipe(infd, pipename + .in);
+   endPipe(outfd, pipename + .out);
  
-   string tmp = pipename + .in;
-   
+   ready = false;
+}
+
+int LyXComm::startPipe(string const  filename)
+{
+   int fd;
+ 
 #ifdef __EMX__
-   HPIPE fd;
+   HPIPE os2fd;
APIRET rc;
int errnum;
// Try create one instance of named pipe with the mode O_RDONLY|O_NONBLOCK.
// The current emx implementation of access() won't work with pipes.
-   rc = DosCreateNPipe(tmp.c_str(), fd, NP_ACCESS_INBOUND,
+   rc = DosCreateNPipe(filename.c_str(), os2fd, NP_ACCESS_INBOUND,
NP_NOWAIT|0x01, 0600, 0600, 0);
-   if (rc == ERROR_PIPE_BUSY)
-#else
-   if (::access(tmp.c_str(), F_OK) == 0)
-#endif
-   {
-   lyxerr  LyXComm: Pipe   tmp   already exists.\n
+   if (rc == ERROR_PIPE_BUSY) {
+   lyxerr  LyXComm: Pipe   filename   already exists.\n
If no other LyX program is active, please delete
 the pipe by hand and try again.  endl;
pipename.erase();
-   return;
+   return -1;
}
-#ifndef __EMX__
-   if 

Re: Updated bug lists

2001-10-18 Thread John Levon

On Tue, Oct 02, 2001 at 02:51:59PM +0200, Michael Schmitt wrote:

 *

Hi Michael.

 - Insert a math inset into a table cell. Then, move the cursor along the current 
   row. The lines at the bottom of other cells are erased (on screen)

bug 472633

 - The spell checker opens ERT insets (even though this is not needed)

I doubt this will be fixed any time soon.

 - When inside a description/itemize paragraph, the box of a footnote inset 
   expands beyond the right border of the main LyX window (it does not do so
   in a normal text paragraph - unless it is at the beginning of the par)

this is one case of a specific problem with collapsable insets and width. I
throw my hands up at the code :(

 - Angus: Start LyX, open buffer, close buffer, have a look at the minibuffer

hmm, thre are several lyxfuncs called after LFUN_CLOSEBUFFER. What can we do
about this ???

 - In the cross/citation reference dialog, it is possible to add an
   empty reference; this should be disallowed, shouldn't it?

why ? I might want to fill in refs later.

   my files. Why? In that context, could somebody please explain why
   there is a need for an external material inset to handle xfig graphics?

it's just an old feature ...

 - You cannot delete empty LyX code paragraphs with the backspace key;
   however, you can select an empty paragraph and cut it with the delete key

known bug #224411

 - There are still infinite table repaintings if the width of the table
   is almost equal to the LyX window size (for details see SourceForge)

still ?

 - The scroll button of a wheel mouse does not work with insets as the cursor
   is blocked (hangs) at some position; the problem
   seems to occur if the cursor is set right after an inset (BTW: pressing
   CursorDown repetitively works! I thought this is equivalent???)

no, they are different events.

 Bugs that probably won't be fixed for 1.2.0 :-(
 
 - Graphics dialog: 
- It is not a good idea to clear the width and height fields if scale 
  is chosen (and vice versa); IMHO new buttons for the three sections
  default/height+width/scale should be added and the Width/Height/
  Scale labels should become grey if deselected 
- The insertion of a graphic should be delayed until OK is pressed 
- What's the difference between OK and Apply? It seems to be
  impossible to add a second, third,... graphic with the same
  dialog (cf. reference dialogs)

what is the status of this ?

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: Back to the future (1.1.6fix4, status update #1)

2001-10-18 Thread leif halvard silli

Allan and Jean-Marc wrote:
On 16 Oct 2001, Jean-Marc Lasgouttes wrote:

 Hello,

Hello!

 I think that a 1.1.6fix4 release _might_ be useful, especially since I
 backported the selection bugfix from 1.2.0 (could somebody confirm
 that it works?). Are there some other things that should go in
 1.1.6fix4? Note that I am not implying that this fix version will
 actually exist. Let's see what we have to put in there first.

If you want other things to go in then the GUII work, at least as far
as the reorganization/cleanup of dialogs goes, could be a candidate.

May I suggest making rpm packages of 1.1.6fix4 which do not need 
'libforms.so.0.89', since most of the current PPC-distros only seem 
to have  versio '*.0.88'.

Please see the thread about 'Re: New PPC-builds of 1.1.6 needed for 
PPC' also.

-- 
leif



Re: History question

2001-10-18 Thread Andre Poenitz

On Wed, Oct 17, 2001 at 03:05:22PM +0200, Juergen Vigna wrote:
> Someone still remembers how someone could export stuff from the old
> 1.0.x version from the commandline (as filter?)

There was no change in the --export stuff since its inclusion AFAIR.
In the beginning it worked only under X, though.

Andre'

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



Re: Improving the Systemcalls interface

2001-10-18 Thread Andre Poenitz

On Wed, Oct 17, 2001 at 02:26:34PM +0100, Angus Leeming wrote:
> Comments?

I found it a bit convoluted, too...

What would be really nice is to have some function which takes two strings
(a command name and something that should be used as stdin for this
command) and return the standard output of this programm, such that
the handling of temporary files/pipes/whatever is completely unvisible
from "above".

Implementing this as a 'pipe stream' as Lars suggested, of course would
be fine, too.

Andre'

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



text.diff

2001-10-18 Thread Andre Poenitz


I think this is safe to apply.

Andre'

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


Index: lyxtext.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtext.h,v
retrieving revision 1.91
diff -u -p -r1.91 lyxtext.h
--- lyxtext.h   2001/09/27 09:52:06 1.91
+++ lyxtext.h   2001/10/16 13:39:54
@@ -662,9 +662,9 @@ public:
///
Paragraph * ownerParagraph() const;
//
-   Paragraph * ownerParagraph(Paragraph *) const;
+   void ownerParagraph(Paragraph *) const;
// set it searching first for the right owner using the paragraph id
-   Paragraph * ownerParagraph(int id, Paragraph *) const;
+   void ownerParagraph(int id, Paragraph *) const;
 };
 
 
Index: text2.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.170
diff -u -p -r1.170 text2.C
--- text2.C 2001/09/27 10:52:53 1.170
+++ text2.C 2001/10/16 13:39:54
@@ -1137,8 +1137,7 @@ void LyXText::toggleFree(BufferView * bv
 }
 
 
-string
-LyXText::getStringToIndex(BufferView * bview)
+string LyXText::getStringToIndex(BufferView * bview)
 {
string idxstring;

@@ -1170,8 +1169,8 @@ LyXText::getStringToIndex(BufferView * b
return idxstring;
 }
 
-Paragraph::size_type
-LyXText::beginningOfMainBody(Buffer const * buf,
+
+Paragraph::size_type LyXText::beginningOfMainBody(Buffer const * buf,
 Paragraph const * par) const
 {
if (textclasslist.Style(buf->params.textclass,
@@ -1193,7 +1192,7 @@ void LyXText::setParagraph(BufferView * 
   bool pagebreak_top, bool pagebreak_bottom,
   VSpace const & space_top,
   VSpace const & space_bottom,
-   Spacing const & spacing,
+  Spacing const & spacing,
   LyXAlignment align, 
   string labelwidthstring,
   bool noindent) 
@@ -2070,7 +2069,7 @@ bool LyXText::updateInset(BufferView * b
 {
// first check the current paragraph
int pos = cursor.par()->getPositionOfInset(inset);
-   if (pos != -1){
+   if (pos != -1) {
checkParagraph(bview, cursor.par(), pos);
return true;
}
@@ -2080,7 +2079,7 @@ bool LyXText::updateInset(BufferView * b
Paragraph * par = firstParagraph();
do {
pos = par->getPositionOfInset(inset);
-   if (pos != -1){
+   if (pos != -1) {
checkParagraph(bview, par, pos);
return true;
}
@@ -2575,17 +2574,17 @@ Paragraph * LyXText::ownerParagraph() co
 }
 
 
-Paragraph * LyXText::ownerParagraph(Paragraph * p) const
+void LyXText::ownerParagraph(Paragraph * p) const
 {
if (inset_owner) {
inset_owner->paragraph(p);
} else {
bv_owner->buffer()->paragraph = p;
}
-   return 0;
 }
+
 
-Paragraph * LyXText::ownerParagraph(int id, Paragraph * p) const
+void LyXText::ownerParagraph(int id, Paragraph * p) const
 {
Paragraph * op = bv_owner->buffer()->getParFromID(id);
if (op && op->inInset()) {
@@ -2597,7 +2596,6 @@ Paragraph * LyXText::ownerParagraph(int 
bv_owner->buffer()->paragraph = p;
}
}
-   return 0;
 }
 
 



hfills and latex commands

2001-10-18 Thread Herbert Voss

attached the diff against latest cvs for the hfills
and the latex command insets, together with the new files.

the latex command inset is a first step. we should
discuss the sense of this feature. I changed the
insert menu a bit, because there was a double
shortcut. also new is a minitable of used shortcuts
in default.ui for the different menues. 

as I wrote, official developing makes no more sense for me,
too much stuff which hangs around ...
- new feature or not ...
- new 1.3 branch or not ...

Herbert

-- 
http://www.educat.hu-berlin.de/~voss/lyx/
 LtxCommand.tgz


Re: Improving the Systemcalls interface

2001-10-18 Thread Angus Leeming

Thanks for the feedback, Asger.

[snip symmetry argument explanation for the original class structure.]

I still don't buy this argument. It strikes me that if the controlling 
process requires results from a child process, then its design depends 
absolutely on whether the child process is run synchronously or 
asynchronously. It isn't just a case of try one of four options in turn. The 
architect of the code _must_ think carefully about this.

> What I would like to see is a process manager in LyX: In this dialog, you
> would have a list of all child-processes that LyX initiated. For each, you
> could see the invocation command, the status, and manually kill it.

Again, this makes sense only for the case of Fork and NoWait. We don't know 
the PID of the processes launched through system, and, anyway, all future 
input is blocked if we Wait.

Having said that, it's easy to enhance the ForkedcallController to return 
info about the processes it is running and to possibly kill them. I'll have a 
go.

> I think you should read up on the execvp family (the man pages on Linux
> are good), and then document the syscall interfaces in more detail.
> As it is now, you have a hard time to know exactly what it does without
> reading the implementation as well. Also, it would be helpful to explain
> when to use each different facility, in addition to what it does.

Will do (both counts).

Incidentally, I was thinking last night about how to use Fork and NoWait to 
run file conversion. At the moment this is done synchronously and can be a 
real pain in the butt. Indeed, it was a moan about doing so incorrectly and 
thereby effectively hanging LyX that initiated this voyage of discovery.

My idea is to create a new shellstream class. The converters would create a 
small shell script, possibly involving multiple conversions. This would be 
launched as a forked process runnind asynchronously. When the shell script 
was finished and the conversion to the final form had been completed, the 
ForkedcallController would call the callback function and we could, for 
example, launch the viewer or load the graphics into LyX.

I'll have a go at all this as time permits.

Angus



Re: Improving the Systemcalls interface

2001-10-18 Thread Angus Leeming

Morning, André!

On Thursday 18 October 2001 09:09, Andre Poenitz wrote:
> On Wed, Oct 17, 2001 at 02:26:34PM +0100, Angus Leeming wrote:
> > Comments?
> 
> I found it a bit convoluted, too...

Hmmm. See my comments to Asger's comments!

> What would be really nice is to have some function which takes two strings
> (a command name and something that should be used as stdin for this
> command) and return the standard output of this programm, such that
> the handling of temporary files/pipes/whatever is completely unvisible
> from "above".
> 
> Implementing this as a 'pipe stream' as Lars suggested, of course would
> be fine, too.

I'm interested in doing something like this. Again, see my comments to 
Asger's comments. I'll come back to the list as the code develops (or not!)

Angus



Re: Improving the Systemcalls interface

2001-10-18 Thread Asger K. Alstrup Nielsen

On Thu, 18 Oct 2001, Angus Leeming wrote:

[Symmetry.]

> I still don't buy this argument. It strikes me that if the controlling 

Well, I don't care much either way. Your solution is fine.

> > What I would like to see is a process manager in LyX: In this dialog, you
> > would have a list of all child-processes that LyX initiated. For each, you
> > could see the invocation command, the status, and manually kill it.
> 
> Again, this makes sense only for the case of Fork and NoWait. We don't know 
> the PID of the processes launched through system, and, anyway, all future 
> input is blocked if we Wait.

Hmm, is it not possible to get the PID of child-processes from system in
some way or another? Maybe not. So be it.

> My idea is to create a new shellstream class. The converters would create a 
> small shell script, possibly involving multiple conversions. This would be 
> launched as a forked process runnind asynchronously. When the shell script 
> was finished and the conversion to the final form had been completed, the 
> ForkedcallController would call the callback function and we could, for 
> example, launch the viewer or load the graphics into LyX.

Sounds good to me.

If you go all the way and do the pipe stuff as well, maybe you could also
have a look and see if some of the external material insets could do
without the Python scripts? There is a wrapping Python script which
basically is a safe mini-shell with input/output redirection that
uses execvp.

Greets,

Asger




Re: Improving the Systemcalls interface

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 10:15:38AM +0100, Angus Leeming wrote:
> My idea is to create a new shellstream class. The converters would create a 
> small shell script, possibly involving multiple conversions. This would be 
> launched as a forked process runnind asynchronously. When the shell script 
> was finished and the conversion to the final form had been completed, the 
> ForkedcallController would call the callback function and we could, for 
> example, launch the viewer or load the graphics into LyX.

But this would mean I need to similute synchronous conversion myself.
I think this should be supported directly.

I need it for the math-extern stuff, so asnchronous operation is not
wanted...

Andre'

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



dependencies

2001-10-18 Thread Andre Poenitz


When I change  inset/insettabulars.C  and type 'make' (either in src or in
src/insets) nothing happens. Looks like I have to remove the .lo file
manually?

Is this intended? 

[make in src/ works to rebuilt the binary if any .C file is changend in
src/mathed]

Andre'

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



Re: Mathed bugs and other outstanding problems

2001-10-18 Thread Andre Poenitz

>From the bug list

| - "File->Exit" does not work while editing a math formula; 
|   the same holds for opening/closing a file, changing paragraph layout... 
|   (This must definitely be fixed!)

Should be fixed.

Andre'

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



Re: Improving the Systemcalls interface

2001-10-18 Thread Angus Leeming

On Thursday 18 October 2001 10:52, Andre Poenitz wrote:
> On Thu, Oct 18, 2001 at 10:15:38AM +0100, Angus Leeming wrote:
> > My idea is to create a new shellstream class. The converters would create 
a 
> > small shell script, possibly involving multiple conversions. This would 
be 
> > launched as a forked process runnind asynchronously. When the shell 
script 
> > was finished and the conversion to the final form had been completed, the 
> > ForkedcallController would call the callback function and we could, for 
> > example, launch the viewer or load the graphics into LyX.
> 
> But this would mean I need to similute synchronous conversion myself.
> I think this should be supported directly.
> 
> I need it for the math-extern stuff, so asnchronous operation is not
> wanted...

No, I don't see that. What I envisage is that the converter class writes a 
shell script containing the conversion calls. How that shell script is then 
invoked is up to you.

I haven't thought this through very far, but the picture I have at the moment 
is:

Rather than:
class Converters {
bool convert(Buffer const * buffer,
 string const & from_file, string const & to_file_base,
 string const & from_format, string const & to_format,
 string & to_file);
};
Have
class Converters {
shellstream & (shellstream &, 
 string const & from_file, string const & to_file_base,
 string const & from_format, string const & to_format);
};

string const script_file = "converter.sh";
shellstream script(script_file);
converters.buildScript(script, "image.eps", "/tmp/lyx_xyz", "EPS", "XPM");
converters.runSynchronous(script);
converters.runAsynchronous(script, callback_func);

Angus



Re: Improving the Systemcalls interface

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 11:18:03AM +0100, Angus Leeming wrote:
> > I need it for the math-extern stuff, so asnchronous operation is not
> > wanted...
> 
> No, I don't see that. What I envisage is that the converter class writes a 
> shell script containing the conversion calls. How that shell script is then 
> invoked is up to you.

I don't want to handle shellscripts in mathed.

I want to be able to say "filter content of string x trough external comman
y and give me back its output as a string" in one line without caring for
any detail of its implementation.

Alternately, I want to write

vector cmd;
cmd.push_back("external_command");
cmd.push_back("-possibly");
cmd.push_back("with aruments");
  x_stream ps(cmd);
  string in = "hallo";
  string out;
  ps << in;
  ps >> out;
  

> string const script_file = "converter.sh";
> shellstream script(script_file);
> converters.buildScript(script, "image.eps", "/tmp/lyx_xyz", "EPS", "XPM");
> converters.runSynchronous(script);

Ok... this is close enough.

Andre'

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



Re: Improving the Systemcalls interface

2001-10-18 Thread Angus Leeming

On Thursday 18 October 2001 11:20, Andre Poenitz wrote:
> On Thu, Oct 18, 2001 at 11:18:03AM +0100, Angus Leeming wrote:
> > > I need it for the math-extern stuff, so asnchronous operation is not
> > > wanted...
> > 
> > No, I don't see that. What I envisage is that the converter class writes 
a 
> > shell script containing the conversion calls. How that shell script is 
then 
> > invoked is up to you.
> 
> I don't want to handle shellscripts in mathed.
> 
> I want to be able to say "filter content of string x trough external comman
> y and give me back its output as a string" in one line without caring for
> any detail of its implementation.
> 
> Alternately, I want to write
> 
>   vector cmd;
>   cmd.push_back("external_command");
>   cmd.push_back("-possibly");
>   cmd.push_back("with aruments");
>   x_stream ps(cmd);
>   string in = "hallo";
>   string out;
>   ps << in;
>   ps >> out;
>   
> 
> > string const script_file = "converter.sh";
> > shellstream script(script_file);
> > converters.buildScript(script, "image.eps", "/tmp/lyx_xyz", "EPS", "XPM");
> > converters.runSynchronous(script);
> 
> Ok... this is close enough.

No doubt I'll get less woolly about all this as I learn.  Remember, I knew no 
C++ at all when I started with LyX and that was only two years ago. I still 
use fortran a LOT ;-)



Re: About latest reLyX

2001-10-18 Thread Jose Abilio Oliveira Matos

On Wed, Oct 17, 2001 at 01:42:12PM -0400, Amir Karger wrote:
[...]
> I think the simplest way is just to copy and paste it in.
> (I wonder if "main::my_fast_abs_path(...)" would work?)

  I'll try that. Why do you have doubts about the fast version?
  
  I'm trying to add language support to reLyX. That is both \selectlanguage{}
and \foreignlanguage{}{}, where should I look to? Basic_Lyx.pm?

  Also to support a new page and line, above and bellow, I have to parse
first the paragraph to compute those parameters.

  Should I add both \newpage and \lyxline to syntax.default?
  
> -
> Amir

-- 
José



Re: hfills and latex commands

2001-10-18 Thread Juergen Spitzmueller

Herbert Voss wrote:
> attached the diff against latest cvs for the hfills
> and the latex command insets, together with the new files.
>
> the latex command inset is a first step. we should
> discuss the sense of this feature. I changed the
> insert menu a bit, because there was a double
> shortcut. also new is a minitable of used shortcuts
> in default.ui for the different menues.

Since you are very well (and fast!) in that stuff now ;-)
What *I* really like to see in LyX eventually is support of normal 
space ('\') and thin space ('\,') -- I know, I mentioned that 
before...
Maybe you have an idea how this could be implemented in your LaTeX 
stuff (maybe a special popup?)

Regards,

Jürgen

> Herbert



Re: About latest reLyX

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 11:56:06AM +0100, Jose Abilio Oliveira Matos wrote:
>   I'll try that. Why do you have doubts about the fast version?

Since you seem to work on reLyX, could you tell me what math-specific stuff
is done in reLyX?

Andre'

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



RE: dependencies

2001-10-18 Thread Juergen Vigna


On 18-Oct-2001 Andre Poenitz wrote:

> When I change  inset/insettabulars.C  and type 'make' (either in src or in
> src/insets) nothing happens. Looks like I have to remove the .lo file
> manually?
> 
> Is this intended? 

Here this works as expected, changing a source file recompiles that file!
Maybe you're working on a special filesystem?

   Jürgen

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
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
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Criticism comes easier than craftsmanship.
-- Zeuxis




Re: About latest reLyX

2001-10-18 Thread Jose Abilio Oliveira Matos

On Thu, Oct 18, 2001 at 12:56:14PM +0200, Andre Poenitz wrote:
> On Thu, Oct 18, 2001 at 11:56:06AM +0100, Jose Abilio Oliveira Matos wrote:
> >   I'll try that. Why do you have doubts about the fast version?
> 
> Since you seem to work on reLyX, could you tell me what math-specific stuff
> is done in reLyX?

  Amir or John Weiss should have a better answer. I never worked with this
part of the code, but I think that I have a basic grasp of what is going on.

  Reading the comments in source code, it looks like the latex code is
"cleaned" in CleanTex.pm, where, for example, x^2 => x_{2}, since the mathed
parser is more strict than latex.

  After that stage all the latex math code is passed untouched to mathed.
  
> Andre'
> 
> -- 
> André Pönitz .. [EMAIL PROTECTED]

-- 
José



Re: About latest reLyX

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 12:17:06PM +0100, Jose Abilio Oliveira Matos wrote:
>   Amir or John Weiss should have a better answer. I never worked with this
> part of the code, but I think that I have a basic grasp of what is going on.
> 
>   Reading the comments in source code, it looks like the latex code is
> "cleaned" in CleanTex.pm, where, for example, x^2 => x_{2}, since the mathed
> parser is more strict than latex.

x^2 is fine in current mathed, and so is '$...$', '$$...$$' and '\cal'.

>  After that stage all the latex math code is passed untouched to mathed.

Would be nice if all math remains untouched by reLyX...

Andre'

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



Re: dependencies

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 01:04:08PM +0200, Juergen Vigna wrote:
> Here this works as expected, changing a source file recompiles that file!
> Maybe you're working on a special filesystem?

No, not really... as I said, it works in src/mathed... maybe a problem with
timestamps...I'll have a look again.

Andre'

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



Re: Mathed bugs and other outstanding problems

2001-10-18 Thread Michael Schmitt

On Thu, 18 Oct 2001, Andre Poenitz wrote:

> | - "File->Exit" does not work while editing a math formula;
> |   the same holds for opening/closing a file, changing paragraph layout...
> |   (This must definitely be fixed!)
>
> Should be fixed.

Just in case the report is still on my list I will remove it (I thought I
have done so some time ago).

I will continue using and testing LyX in a few days. Finally, I
have moved and re-arranged things at my new location and job.

It is good to see that you and Jean Marc are discussing
basic problems such as "undo". I definitely encourage you to improve the
code even at the cost of temporary problems. Keeping the existing
showstoppers for an infinite time is not a good idea, either.

Have a nice day, Michael

PS: What is the best (freely available) Linux tool for checking memory
accesses and leaks? I know that nothing compares to Purify but is there
anything better than electric fence?

-- 
==
Michael Schmittphone: +49 451 99 77 410
Glockenhaeuschen 8 eMail: [EMAIL PROTECTED]
DE-54634 Bitburg, Germany  WWW:   http://www.teststep.org
==




Re: Mathed bugs and other outstanding problems

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 01:38:33PM +0200, Michael Schmitt wrote:
> It is good to see that you and Jean Marc are discussing
> basic problems such as "undo".

[Are we?]

> PS: What is the best (freely available) Linux tool for checking memory
> accesses and leaks? I know that nothing compares to Purify but is there
> anything better than electric fence?

efence is the only thing I've ever used...

Ander'

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



Re: dependencies

2001-10-18 Thread Juergen Vigna


On 18-Oct-2001 Andre Poenitz wrote:

> No, not really... as I said, it works in src/mathed... maybe a problem with
> timestamps...I'll have a look again.

Please pay attention that if you work on a nfs file system the files are
written with the date/time of the nfs-server machine. Such things happen
if the PC are not time syncronized!

Jürgen

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
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
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

I guess the Little League is even littler than we thought.
-- D. Cavett




Re: Improving the Systemcalls interface

2001-10-18 Thread John Levon

On Thu, Oct 18, 2001 at 11:43:20AM +0200, Lars Gullik Bjønnes wrote:

> | I'm interested in doing something like this. Again, see my comments to 
> | Asger's comments. I'll come back to the list as the code develops (or not!)
> 
> So what you need to do is to create:
> 
> class process_stream : public iostream;
> class iprocess_stream : public istream; 
> class oprocess_stream : public ostream;
> 
> and a class process_buf : public streambuf;
> 
> and off you go...
> (and put it under Boost license or LGPL)

please do, I want this in one of my projects too (is the Boost license actually
approved GPL-compatible though ?)

The API would have to be different though, wouldn't it ? Or I suppose the fork()
could happen lazily. At the least I would need an estream as well ...

regards
john

-- 
"There are two kinds of fool. One says, 'This is old, and therefore good.' And
one says, 'This is new, and therefore better'."
- John Brunner



Re: Mathed bugs and other outstanding problems

2001-10-18 Thread John Levon

On Thu, Oct 18, 2001 at 01:38:33PM +0200, Michael Schmitt wrote:

> PS: What is the best (freely available) Linux tool for checking memory
> accesses and leaks? I know that nothing compares to Purify but is there
> anything better than electric fence?

I believe the basic Purify techniques are US-patent-encumbered.

However, Boehm's GC in FIND_LEAK mode should work for leaks. I'll see if I
can get it going again ...

regards
john

-- 
"There are two kinds of fool. One says, 'This is old, and therefore good.' And
one says, 'This is new, and therefore better'."
- John Brunner



BUGREPORT: lyxpipe deletion

2001-10-18 Thread Moritz Moeller-Herrmann

Hi!

I am using lyx 1.1.6fix3. Sometimes lyx crashes. Probably because xforms
s. No problem.

The problem: lyx does NOT DELETE it's lyxpipe. This causes pybliographer to not
work after this.

The problem has been around for ages (see
http://www.mail-archive.com/lyx-users@lists.lyx.org/msg06804.html)

Will something be done about this? Is there no solution with file locking, that
could automatically delete the lypipe files if lyx starts and no other lyx is
running?

I have to support some less clueful windows user who switched to lkinux because
of me and stuff like this is a nightmare. ("Simple, just type ALT + F2 konsole
[Enter] then rm ~/.lyx/lyxpipe.* After this restart lyx and pybliographer,
aren't you glad you left windows?"]

Would be cool if an (integrated non hacky) solution would pop up for
lyx-1.1.6fix4 or lyx-1.2 (whenever it is ready)

Thanks a lot!

-- 
Moritz Moeller-Herrmann ICQ #3585990
(wiss. Mitarbeiter, IMGB, Mannheim)



Re: About latest reLyX

2001-10-18 Thread Jose Abilio Oliveira Matos

On Thu, Oct 18, 2001 at 01:20:18PM +0200, Andre Poenitz wrote:
> 
> x^2 is fine in current mathed, and so is '$...$', '$$...$$' and '\cal'.

  I can do that.

  What else?
  
> >  After that stage all the latex math code is passed untouched to mathed.
> 
> Would be nice if all math remains untouched by reLyX...

  Would you consider that a bug so that I can insert a new feature? ;-)

> Andre'
> 
> -- 
> André Pönitz .. [EMAIL PROTECTED]

-- 
José



Re: BUGREPORT: lyxpipe deletion

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 03:21:02PM +0200, Moritz Moeller-Herrmann wrote:
> I have to support some less clueful windows user who switched to lkinux
> because of me and stuff like this is a nightmare. ("Simple, just type ALT
> + F2 konsole [Enter] then rm ~/.lyx/lyxpipe.* After this restart lyx and
> pybliographer, aren't you glad you left windows?"]

put them 

alias lyx='rm -f ~/.lyx/lyxpipe.* ; lyx'

into .bashrc...


But you certainly have a point here.

Andre'

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



Re: About latest reLyX

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 02:34:07PM +0100, Jose Abilio Oliveira Matos wrote:
> On Thu, Oct 18, 2001 at 01:20:18PM +0200, Andre Poenitz wrote:
> > 
> > x^2 is fine in current mathed, and so is '$...$', '$$...$$' and '\cal'.
> 
>   I can do that.
> 
>   What else?

I do know reLyX, so I can't tell you what else ;-}

> > >  After that stage all the latex math code is passed untouched to mathed.
> > 
> > Would be nice if all math remains untouched by reLyX...
> 
>   Would you consider that a bug so that I can insert a new feature? ;-)

Yes. Handling math outside mathed is most certainly a bug ;-)

Andre'

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



Re: configur latest cvs

2001-10-18 Thread Stephan Witt

Andre Poenitz wrote:
> 
> On Thu, Oct 18, 2001 at 03:55:29PM +0200, Jean-Marc Lasgouttes wrote:
> > Do you have a lyx binary in /usr/bin/X11 (and /usr/bin/X11 in your
> > path?). If you do then blame your distributor (SuSE, if I am not
> > mistaken) :)
> 
> Where should the lyx bineary put by distributors in an ideal world?
> [And why?]

Normally the binary is installed in /usr/X11R6/bin...

The problem is not the real location. SuSE linux
initializes the PATH environment variable with
a clever mechanism: they look for the X11 directory
to use the "right" one. But they're using a strange
order for that:
/usr/bin/X11,/usr/X11R6/bin,/usr/X11/bin.

Unfortunately they added the symlink 
/usr/bin/X11 -> ../X11R6/bin
too... so X11 binaries now are found in /usr/bin/X11.

I have changed the order of the lookup after installing
my linux-laptop in /etc/csh.login.
(I'm root there, I can do it :)
Now the relevant part of /etc/csh.login reads as follows:

if ( -d /usr/X11R6/bin ) then
set _xpath=( /usr/X11R6/bin $_xpath )
else if ( -d /usr/X11/bin ) then
set _xpath=( /usr/X11/bin   $_xpath )
else if ( -d /usr/bin/X11 ) then
set _xpath=( /usr/bin/X11   $_xpath )
endif

I don't like the SuSE default too.

Stephan


<[EMAIL PROTECTED]> | beusen Solutions GmbH
fon: +49 30 549932-62| Landsberger Allee 366
fax: +49 30 549932-21| 12681 Berlin, Germany





Re: BUGREPORT: lyxpipe deletion

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 03:21:02PM +0200, Moritz Moeller-Herrmann wrote:
> Would be cool if an (integrated non hacky) solution would pop up for
> lyx-1.1.6fix4 or lyx-1.2 (whenever it is ready)

The problem seems to be that calling ::abort in support/abort.C prevents
the LyX server's (and a few more) destructors from running.

I'd just throw some uncaught exception, but than LyX does not want to use
exceptions at all. So I don't know how to work around this.

Andre'

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



Re: dependencies

2001-10-18 Thread Andre Poenitz

On Thu, Oct 18, 2001 at 03:32:35PM +0200, Jean-Marc Lasgouttes wrote:
> Andre> [make in src/ works to rebuilt the binary if any .C file is
> Andre> changend in src/mathed]
> 
> Is that new? Which version of autoconf/automake do you have? Did you
> run ./autogen.sh?

Uuh... not manually recently...
Should I?

Andre' 

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



Re: BUGREPORT: lyxpipe deletion

2001-10-18 Thread Moritz Moeller-Herrmann

On Thu, Oct 18, 2001 at 04:45:17PM +0200, Andre Poenitz wrote:
>On Thu, Oct 18, 2001 at 03:21:02PM +0200, Moritz Moeller-Herrmann wrote:
>> Would be cool if an (integrated non hacky) solution would pop up for
>> lyx-1.1.6fix4 or lyx-1.2 (whenever it is ready)
>
>The problem seems to be that calling ::abort in support/abort.C prevents
>the LyX server's (and a few more) destructors from running.
>
>I'd just throw some uncaught exception, but than LyX does not want to use
>exceptions at all. So I don't know how to work around this.

On startup lyx could check if another lyx process of the same user was running
and if not it could just delete the lypipe.

Or make it the [default] option to delete the lyxpipe if its already there.

-- 
Moritz Moeller-Herrmann ICQ #3585990
(wiss. Mitarbeiter, IMGB, Mannheim)



Re: BUGREPORT: lyxpipe deletion

2001-10-18 Thread John Levon

On Thu, Oct 18, 2001 at 04:45:17PM +0200, Andre Poenitz wrote:

> The problem seems to be that calling ::abort in support/abort.C prevents
> the LyX server's (and a few more) destructors from running.
> 
> I'd just throw some uncaught exception, but than LyX does not want to use
> exceptions at all. So I don't know how to work around this.

it's just a matter of explictly calling a destructor or deleting the pipes
in abort handler.

this has been discussed before, check the sourceforge bug

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



workWidth

2001-10-18 Thread John Levon


is this supposed to fix all collapsable insets ?

insert "www" (indented line). insert footnote, place cursor to the right
of footnote. press return -> footnote exceeds workare width

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: Improving the Systemcalls interface

2001-10-18 Thread John Levon

On Thu, Oct 18, 2001 at 03:18:02PM +0200, Lars Gullik Bjønnes wrote:

> Boost has no limitations on what you can do with the code.
> (rewrite, no-source, take money for it etc etc.)

great.

> mmm... it should perhaps be called pstream instead
> (ipstream,opstream,pstream)

yeah

> What is your estream?

stderr for the fork/exec case

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: BUGREPORT: lyxpipe deletion

2001-10-18 Thread Zvezdan Petkovic

On Thu, Oct 18, 2001 at 06:24:28PM +0200, Moritz Moeller-Herrmann wrote:
> On Thu, Oct 18, 2001 at 03:34:27PM +0200, Andre Poenitz wrote:
> >On Thu, Oct 18, 2001 at 03:21:02PM +0200, Moritz Moeller-Herrmann wrote:
> >> I have to support some less clueful windows user who switched to lkinux
> >> because of me and stuff like this is a nightmare. ("Simple, just type ALT
> >> + F2 konsole [Enter] then rm ~/.lyx/lyxpipe.* After this restart lyx and
> >> pybliographer, aren't you glad you left windows?"]
> >
> >put them 
> >
> >alias lyx='rm -f ~/.lyx/lyxpipe.* ; lyx'
> >
> >into .bashrc...
> >
> >
> >But you certainly have a point here.
> 
> This as you point out, does NOT work for KDE desktops. And the people I
> transferred from Windows to KDE have no intention to use xterms :-)
> 

Then put in their .profile (or .bash_profile)

[ -p ~/.lyx/lyxpipe.in ] && rm -f ~/.lyx/lyxpipe.in
[ -p ~/.lyx/lyxpipe.out ] && rm -f ~/.lyx/lyxpipe.out

or if they are using (t)csh then in their .login put

if ( -p ~/.lyx/lyxpipe.in ) rm -rf ~/.lyx/lyxpipe.in
if ( -p ~/.lyx/lyxpipe.out ) rm -rf ~/.lyx/lyxpipe.out

-- 
Zvezdan Petkovic <[EMAIL PROTECTED]>
http://www.cs.wm.edu/~zvezdan/



Re: Lyx Server

2001-10-18 Thread Mike Ressler

Jiri,

I have forwarded this to the LyX developers' list. Hopefully, someone
there who is much more knowledgable than I can explain the current
workings. (I'm just a humble documentor.)

Mike

On Mon, 15 Oct 2001, [iso-8859-1] Jiri Mares wrote:

> Hi Mike,
> I would like to ask you for more information about Lyx
> Server. I am developing Perl program, that read *.lyx
> file containing Mathed equations. The equation
> is translated via regular expression to Perl, then
> appropriate values are substituted and equation is
> calculated.
> The purpose of this program is to create and maintain
> documents, where the mathematical expressions are
> calculated. I have configured my Lyx, so I have in my
> home directory lyxrc file with
>
> \serverpipe "/home/jiri/.lyx/.lyxpipe"
>
> When I write output of my program to .lyxpipe.in, Lyx
> does not react. What
> is the problem? Probably I did not understand the
> princip of Lyx server. Could you give me advice, where
> can I find more information? I tried to find more
> information on some links, they are on oficial Lyx
> page, but without succes.

-- 
Mike Ressler
[EMAIL PROTECTED]
OK, I'm lame: I don't have my own website ...




Infinite table redarws

2001-10-18 Thread John Levon


Can anyone still trigger these ? Is this Juergen's recent changes ?

thanks
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



[PATCH] pipe deletion in emergencies

2001-10-18 Thread John Levon


based on JMarc's comment last time round.

thanks
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 


Index: ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.368
diff -u -r1.368 ChangeLog
--- ChangeLog   2001/10/18 16:49:27 1.368
+++ ChangeLog   2001/10/18 23:59:56
@@ -1,3 +1,10 @@
+2001-10-19  John Levon  <[EMAIL PROTECTED]>
+
+   * lyxserver.h:
+   * lyxserver.C:
+   * lyx_main.h:
+   * lyx_main.C: add emergencyCleanup (remove pipes on crash)
+
 2001-10-18  Juergen Vigna  <[EMAIL PROTECTED]>
 
* text.C (workWidth): new function with added Inset * parameter.
Index: lyx_main.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.94
diff -u -r1.94 lyx_main.C
--- lyx_main.C  2001/10/10 16:45:04 1.94
+++ lyx_main.C  2001/10/19 00:00:09
@@ -220,7 +220,7 @@
signal(SIGSEGV, SIG_DFL);
signal(SIGTERM, SIG_DFL);
 
-   bufferlist.emergencyWriteAll();
+   LyX::emergencyCleanup();
 
lyxerr << "Bye." << endl;
if (err_sig!= SIGHUP && 
@@ -556,6 +556,19 @@
 }
 
 
+void LyX::emergencyCleanup()
+{
+   // what to do about tmpfiles is non-obvious. we would
+   // like to delete any we find, but our lyxdir might
+   // contain documents etc. which might be helpful on
+   // a crash
+ 
+   bufferlist.emergencyWriteAll();
+   if (lyxserver)
+   lyxserver->emergencyCleanup();
+}
+
+ 
 // LyX can optionally take over the handling of deadkeys
 void LyX::deadKeyBindings(kb_keymap * kbmap)
 {
Index: lyx_main.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.h,v
retrieving revision 1.22
diff -u -r1.22 lyx_main.h
--- lyx_main.h  2001/06/28 10:25:13 1.22
+++ lyx_main.h  2001/10/19 00:00:09
@@ -51,6 +51,9 @@
/// Always is useful a destructor
~LyX();
 
+   /// in the case of failure
+   static void emergencyCleanup();
+ 
///
LyXGUI * lyxGUI;  // should be only one of this
 private:
Index: lyxserver.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxserver.C,v
retrieving revision 1.27
diff -u -r1.27 lyxserver.C
--- lyxserver.C 2001/09/09 22:02:11 1.27
+++ lyxserver.C 2001/10/19 00:00:16
@@ -110,195 +110,148 @@
  
if (pipename.empty()) return;
 
-   // --- prepare input pipe ---
+   if ((infd = startPipe(pipename + ".in")) == -1)
+   return;
+
+   if ((outfd = startPipe(pipename + ".out")) == -1) {
+   endPipe(infd, pipename + ".in");
+   return;
+   }
+ 
+   if (fcntl(outfd, F_SETFL, O_NONBLOCK) < 0) {
+   lyxerr << "LyXComm: Could not set flags on pipe " << pipename << ".out"
+  << '\n' << strerror(errno) << endl;
+   return;
+   }
+ 
+   // We made it!
+   ready = true;
+   lyxerr[Debug::LYXSERVER] << "LyXComm: Connection established" << endl;
+}
+
+   
+/// Close pipes
+void LyXComm::closeConnection()
+{
+   lyxerr[Debug::LYXSERVER] << "LyXComm: Closing connection" << endl;
+
+   if (pipename.empty()) {
+   return;
+   }
+
+   if (!ready) {
+   lyxerr << "LyXComm: Already disconnected" << endl;
+   return;
+   }
+ 
+   endPipe(infd, pipename + ".in");
+   endPipe(outfd, pipename + ".out");
  
-   string tmp = pipename + ".in";
-   
+   ready = false;
+}
+
+int LyXComm::startPipe(string const & filename)
+{
+   int fd;
+ 
 #ifdef __EMX__
-   HPIPE fd;
+   HPIPE os2fd;
APIRET rc;
int errnum;
// Try create one instance of named pipe with the mode O_RDONLY|O_NONBLOCK.
// The current emx implementation of access() won't work with pipes.
-   rc = DosCreateNPipe(tmp.c_str(), , NP_ACCESS_INBOUND,
+   rc = DosCreateNPipe(filename.c_str(), , NP_ACCESS_INBOUND,
NP_NOWAIT|0x01, 0600, 0600, 0);
-   if (rc == ERROR_PIPE_BUSY)
-#else
-   if (::access(tmp.c_str(), F_OK) == 0)
-#endif
-   {
-   lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n"
+   if (rc == ERROR_PIPE_BUSY) {
+   lyxerr << "LyXComm: Pipe " << filename << " already exists.\n"
   << "If no other LyX program is active, please delete"
" the pipe by hand and try again." << endl;
pipename.erase();
-   return;
+   return -1;
}
-#ifndef __EMX__
-   if (::mkfifo(tmp.c_str(), 0600) < 0) {
-   lyxerr << "LyXComm: Could not create pipe " << tmp << 

Re: About latest reLyX

2001-10-18 Thread Amir Karger

On Thu, Oct 18, 2001 at 01:20:18PM +0200, Andre Poenitz wrote:
> On Thu, Oct 18, 2001 at 12:17:06PM +0100, Jose Abilio Oliveira Matos wrote:
> >   Amir or John Weiss should have a better answer. I never worked with this
> > part of the code, but I think that I have a basic grasp of what is going on.

On the other hand, I haven't worked on it in three years.

> >   Reading the comments in source code, it looks like the latex code is
> > "cleaned" in CleanTex.pm, where, for example, x^2 => x_{2}, since the mathed
> > parser is more strict than latex.

Pretty much.

> x^2 is fine in current mathed, and so is '$...$', '$$...$$' and '\cal'.
> 
> >  After that stage all the latex math code is passed untouched to mathed.
> 
> Would be nice if all math remains untouched by reLyX...

It's great that you've done a lot of work to support the stuff lyx didn't
used to support which required writing these workarounds in the first place.
It seems like some of CleanTeX.pm could probably go away at this point. 

I do think the math translation stuff in syntax.default needs to stay in,
because lots of people use non-"standard" math in their files, and this
might allow them to translate it.

Btw, the only problem with not translating $..$ and stuff is that the parser
at some point does need to make sure it knows where math begins and ends.
(Btw, there are probably other commands that automatically start math mode
text. Would be nice to handle those, sending them all to whatever that
function is that just copies exactly literally. As long as we're at it,
what's the current support for \mbox? I had this fantasy of finding \mbox'es
in math and translating them into regular LyX)

-Amir



clicking RHS of footnote

2001-10-18 Thread John Levon


The bug happens when there is some text "a" immediately after a footnote
(tying in with when the drawing width problem happens).

In checkInsetHit :

895 Inset * tmpinset = cursor.par()->getInset(cursor.pos()-1);
896 LyXFont font = text->getFont(buffer_, cursor.par(),
897   cursor.pos() - 1);
898 int const width = tmpinset->width(bv_, font);
899 lyxerr << "DITH is " << width << endl;
900 int const inset_x = font.isVisibleRightToLeft()
901 ? cursor.x() : cursor.x() - width;
902 lyxerr << "inset x is " << inset_x << endl;
903 lyxerr << "cursor x is " << cursor.x() << endl;

cursor.x() is returning what I assume is the magic value "20", giving it
totally the wrong range for x, failing the test below.

What is the 20 actually supposed to do ? Why does the cursor.x() think its
position is 20 ?

john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: Next ERT glitch

2001-10-18 Thread John Levon

On Mon, Oct 15, 2001 at 09:35:28AM +0200, Juergen Vigna wrote:

> > When Text is pasted from the outside into an ERT inset it remains black.
> > It will be red after the next reload, though...
> 
> I already told this to people on the list various time. This is a problem
> I cannot understand and is of class inheritance. In some cases instead
> of calling the right functions inside the class it calls some other functions
> just try to debug it and you'll see what I mean! I also asked for Help and

what functions are we talking about, in which classes ?

thanks
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: multipart doc crash

2001-10-18 Thread John Levon

On Wed, Oct 03, 2001 at 03:32:54PM +1000, Allan Rae wrote:

> You'll get warnings about not being able to find the subparts of the
> document that had absolute paths.  However if you open the Documents menu
> entry you will find all those files listed.  Now, what do you think might
> happen if you select one of those nonexistent documents from the Documents
> menu?

how do I create these subparts so I get that warning ??

thanks
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: edit-tabular-add row doesn't work properly

2001-10-18 Thread John Levon

On Thu, Oct 04, 2001 at 02:42:32PM -0400, Richard E. Hawkins wrote:

> I put a table in a table float,  positioned in the last row, and added 
> a row from the edit menu.  It gave me a separated row, as the new row 
> had both top and bottom lines (add row in the final row should probably 
> have a special behavior--figuring out that it is the last row instead 
> of duplicating the borders as is appropriate elsewhere in the table.
> 
> I undid, and then tried to add a row further up the table.  Nothing 
> happened.  I was unable to add at the last row, either.

I can't reproduce this. Are you sure you weren't in a text inset (red box
around cursor ?)

You must be outside of the inner inset to do things like this (yes, that
is definitely bad, but a different bug).

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: Bad bug: spell checker and quotes

2001-10-18 Thread John Levon

On Tue, Oct 09, 2001 at 10:00:47AM -0400, Mark van Rossum wrote:

>   The 'OSA is nice'.

the spellchecker for me "works", but flags "The" and "nice" as
not in the dictionary (and they don't seem to be).

Qt2 frontend

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



[PATCH] emergencyCleanup take 2

2001-10-18 Thread John Levon


I accidentally missed some things from the last one

thanks
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 


diff -u -r1.368 ChangeLog
--- src/ChangeLog   2001/10/18 16:49:27 1.368
+++ src/ChangeLog   2001/10/19 02:04:30
@@ -1,3 +1,10 @@
+2001-10-19  John Levon  <[EMAIL PROTECTED]>
+
+   * lyxserver.h:
+   * lyxserver.C:
+   * lyx_main.h:
+   * lyx_main.C: add emergencyCleanup (remove pipes on crash)
+
 2001-10-18  Juergen Vigna  <[EMAIL PROTECTED]>
 
* text.C (workWidth): new function with added Inset * parameter.
diff -u -r1.92 lyx_gui.C
--- src/lyx_gui.C   2001/09/27 09:43:31 1.92
+++ src/lyx_gui.C   2001/10/19 02:04:53
@@ -79,9 +79,8 @@
 static
 int LyX_XErrHandler(Display * display, XErrorEvent * xeev)
 {
-   // emergency save
-   if (!bufferlist.empty())
-   bufferlist.emergencyWriteAll();
+   // emergency cleanup
+   LyX::emergencyCleanup();
 
// Get the reason for the crash.
char etxt[513];
Index: src/lyx_main.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.94
diff -u -r1.94 lyx_main.C
--- src/lyx_main.C  2001/10/10 16:45:04 1.94
+++ src/lyx_main.C  2001/10/19 02:04:55
@@ -220,7 +220,7 @@
signal(SIGSEGV, SIG_DFL);
signal(SIGTERM, SIG_DFL);
 
-   bufferlist.emergencyWriteAll();
+   LyX::emergencyCleanup();
 
lyxerr << "Bye." << endl;
if (err_sig!= SIGHUP && 
@@ -556,6 +556,19 @@
 }
 
 
+void LyX::emergencyCleanup()
+{
+   // what to do about tmpfiles is non-obvious. we would
+   // like to delete any we find, but our lyxdir might
+   // contain documents etc. which might be helpful on
+   // a crash
+ 
+   bufferlist.emergencyWriteAll();
+   if (lyxserver)
+   lyxserver->emergencyCleanup();
+}
+
+ 
 // LyX can optionally take over the handling of deadkeys
 void LyX::deadKeyBindings(kb_keymap * kbmap)
 {
Index: src/lyx_main.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.h,v
retrieving revision 1.22
diff -u -r1.22 lyx_main.h
--- src/lyx_main.h  2001/06/28 10:25:13 1.22
+++ src/lyx_main.h  2001/10/19 02:04:55
@@ -51,6 +51,9 @@
/// Always is useful a destructor
~LyX();
 
+   /// in the case of failure
+   static void emergencyCleanup();
+ 
///
LyXGUI * lyxGUI;  // should be only one of this
 private:
diff -u -r1.27 lyxserver.C
--- src/lyxserver.C 2001/09/09 22:02:11 1.27
+++ src/lyxserver.C 2001/10/19 02:05:03
@@ -110,195 +110,148 @@
  
if (pipename.empty()) return;
 
-   // --- prepare input pipe ---
+   if ((infd = startPipe(pipename + ".in")) == -1)
+   return;
+
+   if ((outfd = startPipe(pipename + ".out")) == -1) {
+   endPipe(infd, pipename + ".in");
+   return;
+   }
+ 
+   if (fcntl(outfd, F_SETFL, O_NONBLOCK) < 0) {
+   lyxerr << "LyXComm: Could not set flags on pipe " << pipename << ".out"
+  << '\n' << strerror(errno) << endl;
+   return;
+   }
+ 
+   // We made it!
+   ready = true;
+   lyxerr[Debug::LYXSERVER] << "LyXComm: Connection established" << endl;
+}
+
+   
+/// Close pipes
+void LyXComm::closeConnection()
+{
+   lyxerr[Debug::LYXSERVER] << "LyXComm: Closing connection" << endl;
+
+   if (pipename.empty()) {
+   return;
+   }
+
+   if (!ready) {
+   lyxerr << "LyXComm: Already disconnected" << endl;
+   return;
+   }
+ 
+   endPipe(infd, pipename + ".in");
+   endPipe(outfd, pipename + ".out");
  
-   string tmp = pipename + ".in";
-   
+   ready = false;
+}
+
+int LyXComm::startPipe(string const & filename)
+{
+   int fd;
+ 
 #ifdef __EMX__
-   HPIPE fd;
+   HPIPE os2fd;
APIRET rc;
int errnum;
// Try create one instance of named pipe with the mode O_RDONLY|O_NONBLOCK.
// The current emx implementation of access() won't work with pipes.
-   rc = DosCreateNPipe(tmp.c_str(), , NP_ACCESS_INBOUND,
+   rc = DosCreateNPipe(filename.c_str(), , NP_ACCESS_INBOUND,
NP_NOWAIT|0x01, 0600, 0600, 0);
-   if (rc == ERROR_PIPE_BUSY)
-#else
-   if (::access(tmp.c_str(), F_OK) == 0)
-#endif
-   {
-   lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n"
+   if (rc == ERROR_PIPE_BUSY) {
+   lyxerr << "LyXComm: Pipe " << filename << " already exists.\n"
   << "If no other LyX program is active, please delete"
" the pipe by hand and try again." << endl;
pipename.erase();
-  

Re: Updated bug lists

2001-10-18 Thread John Levon

On Tue, Oct 02, 2001 at 02:51:59PM +0200, Michael Schmitt wrote:

> *

Hi Michael.

> - Insert a math inset into a table cell. Then, move the cursor along the current 
>   row. The lines at the bottom of other cells are erased (on screen)

bug 472633

> - The spell checker opens ERT insets (even though this is not needed)

I doubt this will be fixed any time soon.

> - When inside a "description"/"itemize" paragraph, the box of a footnote inset 
>   expands beyond the right border of the main LyX window (it does not do so
>   in a normal text paragraph - unless it is at the beginning of the par)

this is one case of a specific problem with collapsable insets and width. I
throw my hands up at the code :(

> - Angus: Start LyX, open buffer, close buffer, have a look at the minibuffer

hmm, thre are several lyxfuncs called after LFUN_CLOSEBUFFER. What can we do
about this ???

> - In the cross/citation reference dialog, it is possible to add an
>   empty reference; this should be disallowed, shouldn't it?

why ? I might want to fill in refs later.

>   my files. Why? In that context, could somebody please explain why
>   there is a need for an "external material" inset to handle xfig graphics?

it's just an old feature ...

> - You cannot delete empty LyX code paragraphs with the backspace key;
>   however, you can select an empty paragraph and cut it with the delete key

known bug #224411

> - There are still infinite table repaintings if the width of the table
>   is almost equal to the LyX window size (for details see SourceForge)

still ?

> - The scroll button of a wheel mouse does not work with insets as the cursor
>   is blocked ("hangs") at some position; the problem
>   seems to occur if the cursor is set right after an inset (BTW: pressing
>   CursorDown repetitively works! I thought this is equivalent???)

no, they are different events.

> Bugs that probably won't be fixed for 1.2.0 :-(
> 
> - Graphics dialog: 
>- It is not a good idea to clear the width and height fields if "scale" 
>  is chosen (and vice versa); IMHO new buttons for the three sections
>  default/height+width/scale should be added and the "Width"/"Height"/
>  "Scale" labels should become grey if deselected 
>- The insertion of a graphic should be delayed until "OK" is pressed 
>- What's the difference between OK and Apply? It seems to be
>  impossible to add a second, third,... graphic with the same
>  dialog (cf. reference dialogs)

what is the status of this ?

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 



Re: Back to the future (1.1.6fix4, status update #1)

2001-10-18 Thread leif halvard silli

Allan and Jean-Marc wrote:
>On 16 Oct 2001, Jean-Marc Lasgouttes wrote:
>
>> Hello,
>
>Hello!
>
>> I think that a 1.1.6fix4 release _might_ be useful, especially since I
>> backported the selection bugfix from 1.2.0 (could somebody confirm
>> that it works?). Are there some other things that should go in
>> 1.1.6fix4? Note that I am not implying that this fix version will
>> actually exist. Let's see what we have to put in there first.
>
>If you want other things to go in then the GUII work, at least as far
>as the reorganization/cleanup of dialogs goes, could be a candidate.

May I suggest making rpm packages of 1.1.6fix4 which do not need 
'libforms.so.0.89', since most of the current PPC-distros only seem 
to have  versio '*.0.88'.

Please see the thread about 'Re: New PPC-builds of 1.1.6 needed for 
PPC' also.

-- 
leif