Re: SVN Down?

2012-01-22 Thread Vincent van Ravesteijn

Op 22-1-2012 5:22, Richard Heck schreef:

On 01/21/2012 11:06 PM, Richard Heck wrote:


I'm getting an error:

../lyx/lyx-pristine/  svn up
svn: Can't find a temporary directory: Internal error

Google says this is due to a lack of disk space on the server.


Trac is now giving me a similar error when I try to log in:

*Trac detected an internal error:*
OperationalError: database or disk is full


No problems here.  Neither with svn up nor when logging in ti trac.

Vincent


Re: Memory leak ?

2012-01-22 Thread Lars Gullik Bjønnes
Richard Heck rgh...@comcast.net writes:

| On 01/21/2012 08:09 PM, Lars Gullik Bjønnes wrote:
 Richard Heckrgh...@comcast.net  writes:

 | On 01/21/2012 05:36 AM, Jean-Pierre Chrétien wrote:
 Hello,

 A French user tells me privately that he finds a big memeory leak in
 LyX-2.0.2 on an Archlinux LyX distribution (about 1.5Mo/mn).

 On my Debian Squeeze and a simple document, I find about 1.7ko/mn.

 Testing with the Userguide, I find around 19ko/mn with the following
 recipe:
   - open LyX-2.0.2 (English locale)
   - open the UserGuide
   - minimize the window
   - activate a crontab every minute with command ps -o rss= -p
 process_id

 | Below is a log of a test on Fedora 16, Qt 4.8.0, with 2.0.3svn,
 | compiled as for release. As you'll see, there's a jump when the first
 | autosave happens---we may be loading some Qt libraries we weren't
 | otherwise using---but after that, there's not much change.

 My testing so far says the opposite. We are continually using more and
 more memory. Not especially fast, but it is there.

 I see a steady increase.

 Plot the attached with gnuplot
 (plot lyx-leak.dat using 1:2)

 and see for yourself. Snarfed with

 let a=0; while true; do echo -n $a   lyx-leak.dat; ps -o rss=,vsz= -p 
 32013  lyx-leak.dat ; let ++a; sleep 1 ; done
| Hard to know what the difference is here. Was this with branch or trunk?

Trunk.

-- 
   Lgb



Re: SVN Down?

2012-01-22 Thread Lars Gullik Bjønnes
Vincent van Ravesteijn v...@lyx.org writes:

| Op 22-1-2012 5:22, Richard Heck schreef:
 On 01/21/2012 11:06 PM, Richard Heck wrote:

 I'm getting an error:

 ../lyx/lyx-pristine/  svn up
 svn: Can't find a temporary directory: Internal error

 Google says this is due to a lack of disk space on the server.

 Trac is now giving me a similar error when I try to log in:

 *Trac detected an internal error:*
 OperationalError: database or disk is full

| No problems here.  Neither with svn up nor when logging in ti trac.

The dist was pretty full. I cleaned out some.

-- 
   Lgb



PATCH: Bug #7975 and Toggling

2012-01-22 Thread Richard Heck


The attached patch changes LyX's toggling behavior in the way suggested 
by JMarc in earlier discussions of this bug. For EMPH, e.g., we check 
the first letter of the selection and then set the entire selection to 
the opposite. We do the same for all other toggled features.


Comments welcome. I guess maybe I'd suggest this is trunk only, rather 
than changing this kind of thing in a maintenance release.


Richard

From b786b829fc8dbfa55ce5613bae1dfb3b8eeafeee Mon Sep 17 00:00:00 2001
From: Richard Heck rgh...@lyx.org
Date: Sat, 21 Jan 2012 17:33:17 -0500
Subject: [PATCH] Initial work on toggling issue.

---
 src/Text.h|5 +--
 src/Text2.cpp |   66 ++--
 2 files changed, 61 insertions(+), 10 deletions(-)

diff --git a/src/Text.h b/src/Text.h
index c4da020..6068025 100644
--- a/src/Text.h
+++ b/src/Text.h
@@ -71,7 +71,7 @@ public:
 	 *  inset that is alowed inside a font change.
 	 */
 	void setInsetFont(BufferView const  bv, pit_type pit, pos_type pos,
-		Font const  font, bool toggleall = false);
+		Font const  font);
 
 	/// what you expect when pressing \enter\ at cursor position
 	/// \param inverse_logic if false, the same layout is set for the
@@ -104,8 +104,7 @@ public:
 	void setFont(Cursor  cur, Font const , bool toggleall = false);
 	/// Set font from \p begin to \p end and rebreak.
 	void setFont(BufferView const  bv, CursorSlice const  begin,
-		CursorSlice const  end, Font const ,
-		bool toggleall = false);
+		CursorSlice const  end, Font const );
 
 	///
 	void toggleFree(Cursor  cur, Font const , bool toggleall = false);
diff --git a/src/Text2.cpp b/src/Text2.cpp
index 199790c..184de7b 100644
--- a/src/Text2.cpp
+++ b/src/Text2.cpp
@@ -163,7 +163,7 @@ void Text::setCharFont(pit_type pit,
 
 
 void Text::setInsetFont(BufferView const  bv, pit_type pit,
-		pos_type pos, Font const  font, bool toggleall)
+		pos_type pos, Font const  font)
 {
 	Inset * const inset = pars_[pit].getInset(pos);
 	LASSERT(inset  inset-resetFontEdit(), /**/);
@@ -176,7 +176,7 @@ void Text::setInsetFont(BufferView const  bv, pit_type pit,
 			CursorSlice cellend = cs;
 			cellend.pit() = cellend.lastpit();
 			cellend.pos() = cellend.lastpos();
-			text-setFont(bv, cs, cellend, font, toggleall);
+			text-setFont(bv, cs, cellend, font);
 		}
 	}
 }
@@ -321,15 +321,67 @@ void Text::setFont(Cursor  cur, Font const  font, bool toggleall)
 
 	// Ok, we have a selection.
 	cur.recordUndoSelection();
+	Font newfont = font;
+
+	if (toggleall) {	
+		// Toggling behaves as follows: We check the first character of the
+		// selection. If it's (say) got EMPH on, then we set to off; if off,
+		// then to on. With families and the like, we set it to INHERIT, if
+		// we already have it.
+		CursorSlice const  sl = cur.selBegin();
+		Text const  text = *sl.text();
+		Paragraph const  par = text.getPar(sl.pit());
+	
+		// get font at the position
+		Font oldfont = par.getFont(cur.bv().buffer().params(), sl.pos(),
+			text.outerFont(sl.pit()));
+		FontInfo const  oldfi = oldfont.fontInfo();
+	
+		FontInfo  newfi = newfont.fontInfo();
+	
+		FontFamily newfam = newfi.family();
+		if (newfam !=	INHERIT_FAMILY  newfam != IGNORE_FAMILY 
+newfam == oldfi.family())
+			newfi.setFamily(INHERIT_FAMILY);
+		
+		FontSeries newser = newfi.series();
+		if (newser == BOLD_SERIES  oldfi.series() == BOLD_SERIES)
+			newfi.setSeries(INHERIT_SERIES);
+	
+		FontShape newshp = newfi.shape();
+		if (newshp !=	INHERIT_SHAPE  newshp != IGNORE_SHAPE 
+newshp == oldfi.shape())
+			newfi.setShape(INHERIT_SHAPE);
+
+		ColorCode newcol = newfi.color();
+		if (newcol != Color_none  newcol != Color_inherit 
+		 newcol != Color_ignore  newcol == oldfi.color())
+			newfi.setColor(Color_none);
+
+		// ON/OFF ones
+		if (newfi.emph() == FONT_TOGGLE)
+			newfi.setEmph(oldfi.emph() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.underbar() == FONT_TOGGLE)
+			newfi.setUnderbar(oldfi.underbar() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.strikeout() == FONT_TOGGLE)
+			newfi.setStrikeout(oldfi.strikeout() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.uuline() == FONT_TOGGLE)
+			newfi.setUuline(oldfi.uuline() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.uwave() == FONT_TOGGLE)
+			newfi.setUwave(oldfi.uwave() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.noun() == FONT_TOGGLE)
+			newfi.setNoun(oldfi.noun() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.number() == FONT_TOGGLE)
+			newfi.setNumber(oldfi.number() == FONT_OFF ? FONT_ON : FONT_OFF);
+	}
 
 	setFont(cur.bv(), cur.selectionBegin().top(), 
-		cur.selectionEnd().top(), font, toggleall);
+		cur.selectionEnd().top(), newfont);
 }
 
 
 void Text::setFont(BufferView const  bv, CursorSlice const  begin,
-		CursorSlice const  end, Font const  font,
-		bool toggleall)
+		CursorSlice const  end, Font const  font)
 {
 	Buffer const  buffer = bv.buffer();
 
@@ -347,11 +399,11 @@ void Text::setFont(BufferView const  bv, CursorSlice 

Re: Memory leak ?

2012-01-22 Thread Jean-Marc Lasgouttes

Le 22/01/12 02:09, Lars Gullik Bjønnes a écrit :

My testing so far says the opposite. We are continually using more and
more memory. Not especially fast, but it is there.


A good tool to know where memory goes is the massif tool of valgrind.

JMarc



Re: SVN Down?

2012-01-22 Thread Jean-Marc Lasgouttes

Le 22/01/12 14:00, Lars Gullik Bjønnes a écrit :

| No problems here.  Neither with svn up nor when logging in ti trac.

The dist was pretty full. I cleaned out some.


Last time I saw that, it was because of the svn dumps (I removed some at 
that time). Can we make sure we keep less of these, in order to use less 
disk? Unlss you found another good source of useless bits, of course.


BTW, is our svn db backuped somewhere else?

JMarc



Re: PATCH: Bug #7975 and Toggling

2012-01-22 Thread Jack Tanner
Richard Heck rgheck at comcast.net writes:

 
 Comments welcome. I guess maybe I'd suggest this is trunk only, rather 
 than changing this kind of thing in a maintenance release.

The current behavior is so bizarre, I never use the toggle feature. I'd be happy
to see it on branch.



Re: SVN Down?

2012-01-22 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes lasgout...@lyx.org writes:

| Le 22/01/12 14:00, Lars Gullik Bjønnes a écrit :
 | No problems here.  Neither with svn up nor when logging in ti trac.

 The dist was pretty full. I cleaned out some.

| Last time I saw that, it was because of the svn dumps (I removed some
| at that time). Can we make sure we keep less of these, in order to use
| less disk?

Yes, this time I will really fix it.

| Unlss you found another good source of useless bits, of
| course.

| BTW, is our svn db backuped somewhere else?

I do a back from time to time, and I have the git conversion that is
continously updated.

-- 
   Lgb



Re: r40662 - lyx-devel/trunk/lib

2012-01-22 Thread Richard Heck

On 01/22/2012 08:11 PM, uwesto...@lyx.org wrote:

Author: uwestoehr
Date: Mon Jan 23 02:11:13 2012
New Revision: 40662
URL: http://www.lyx.org/trac/changeset/40662

Log:
chkconfig.ltx: add check for wasy; is necessary because LyX supports the math 
command \brokenvert - OK for branch too?

Sure, why not?

rh


Modified:
lyx-devel/trunk/lib/chkconfig.ltx

Modified: lyx-devel/trunk/lib/chkconfig.ltx
==
--- lyx-devel/trunk/lib/chkconfig.ltx   Sun Jan 22 23:47:58 2012(r40661)
+++ lyx-devel/trunk/lib/chkconfig.ltx   Mon Jan 23 02:11:13 2012(r40662)
@@ -315,6 +315,7 @@
  \TestPackage{units}
  \TestPackage{url}
  \TestPackage{varioref}
+\TestPackage{wasy}
  \TestPackage{wasysym}
  \TestPackage{wrapfig}
  \TestPackage{xargs}




Re: SVN Down?

2012-01-22 Thread Vincent van Ravesteijn

Op 22-1-2012 5:22, Richard Heck schreef:

On 01/21/2012 11:06 PM, Richard Heck wrote:


I'm getting an error:

../lyx/lyx-pristine/ > svn up
svn: Can't find a temporary directory: Internal error

Google says this is due to a lack of disk space on the server.


Trac is now giving me a similar error when I try to log in:

*Trac detected an internal error:*
OperationalError: database or disk is full


No problems here.  Neither with svn up nor when logging in ti trac.

Vincent


Re: Memory leak ?

2012-01-22 Thread Lars Gullik Bjønnes
Richard Heck  writes:

| On 01/21/2012 08:09 PM, Lars Gullik Bjønnes wrote:
>> Richard Heck  writes:
>>
>> | On 01/21/2012 05:36 AM, Jean-Pierre Chrétien wrote:
 Hello,

 A French user tells me privately that he finds a big memeory leak in
 LyX-2.0.2 on an Archlinux LyX distribution (about 1.5Mo/mn).

 On my Debian Squeeze and a simple document, I find about 1.7ko/mn.

 Testing with the Userguide, I find around 19ko/mn with the following
 recipe:
   - open LyX-2.0.2 (English locale)
   - open the UserGuide
   - minimize the window
   - activate a crontab every minute with command ps -o rss= -p
 

>> | Below is a log of a test on Fedora 16, Qt 4.8.0, with 2.0.3svn,
>> | compiled as for release. As you'll see, there's a jump when the first
>> | autosave happens---we may be loading some Qt libraries we weren't
>> | otherwise using---but after that, there's not much change.
>>
>> My testing so far says the opposite. We are continually using more and
>> more memory. Not especially fast, but it is there.
>>
>> I see a steady increase.
>>
>> Plot the attached with gnuplot
>> (plot "lyx-leak.dat" using 1:2)
>>
>> and see for yourself. Snarfed with
>>
>> let a=0; while true; do echo -n "$a ">>  lyx-leak.dat; ps -o rss=,vsz= -p 
>> 32013>>  lyx-leak.dat ; let ++a; sleep 1 ; done
| Hard to know what the difference is here. Was this with branch or trunk?

Trunk.

-- 
   Lgb



Re: SVN Down?

2012-01-22 Thread Lars Gullik Bjønnes
Vincent van Ravesteijn  writes:

| Op 22-1-2012 5:22, Richard Heck schreef:
>> On 01/21/2012 11:06 PM, Richard Heck wrote:
>>>
>>> I'm getting an error:
>>>
>>> ../lyx/lyx-pristine/ > svn up
>>> svn: Can't find a temporary directory: Internal error
>>>
>>> Google says this is due to a lack of disk space on the server.
>>>
>> Trac is now giving me a similar error when I try to log in:
>>
>> *Trac detected an internal error:*
>> OperationalError: database or disk is full
>>
| No problems here.  Neither with svn up nor when logging in ti trac.

The dist was pretty full. I cleaned out some.

-- 
   Lgb



PATCH: Bug #7975 and Toggling

2012-01-22 Thread Richard Heck


The attached patch changes LyX's toggling behavior in the way suggested 
by JMarc in earlier discussions of this bug. For EMPH, e.g., we check 
the first letter of the selection and then set the entire selection to 
the opposite. We do the same for all other toggled features.


Comments welcome. I guess maybe I'd suggest this is trunk only, rather 
than changing this kind of thing in a maintenance release.


Richard

>From b786b829fc8dbfa55ce5613bae1dfb3b8eeafeee Mon Sep 17 00:00:00 2001
From: Richard Heck 
Date: Sat, 21 Jan 2012 17:33:17 -0500
Subject: [PATCH] Initial work on toggling issue.

---
 src/Text.h|5 +--
 src/Text2.cpp |   66 ++--
 2 files changed, 61 insertions(+), 10 deletions(-)

diff --git a/src/Text.h b/src/Text.h
index c4da020..6068025 100644
--- a/src/Text.h
+++ b/src/Text.h
@@ -71,7 +71,7 @@ public:
 	 *  inset that is alowed inside a font change.
 	 */
 	void setInsetFont(BufferView const & bv, pit_type pit, pos_type pos,
-		Font const & font, bool toggleall = false);
+		Font const & font);
 
 	/// what you expect when pressing \ at cursor position
 	/// \param inverse_logic if false, the same layout is set for the
@@ -104,8 +104,7 @@ public:
 	void setFont(Cursor & cur, Font const &, bool toggleall = false);
 	/// Set font from \p begin to \p end and rebreak.
 	void setFont(BufferView const & bv, CursorSlice const & begin,
-		CursorSlice const & end, Font const &,
-		bool toggleall = false);
+		CursorSlice const & end, Font const &);
 
 	///
 	void toggleFree(Cursor & cur, Font const &, bool toggleall = false);
diff --git a/src/Text2.cpp b/src/Text2.cpp
index 199790c..184de7b 100644
--- a/src/Text2.cpp
+++ b/src/Text2.cpp
@@ -163,7 +163,7 @@ void Text::setCharFont(pit_type pit,
 
 
 void Text::setInsetFont(BufferView const & bv, pit_type pit,
-		pos_type pos, Font const & font, bool toggleall)
+		pos_type pos, Font const & font)
 {
 	Inset * const inset = pars_[pit].getInset(pos);
 	LASSERT(inset && inset->resetFontEdit(), /**/);
@@ -176,7 +176,7 @@ void Text::setInsetFont(BufferView const & bv, pit_type pit,
 			CursorSlice cellend = cs;
 			cellend.pit() = cellend.lastpit();
 			cellend.pos() = cellend.lastpos();
-			text->setFont(bv, cs, cellend, font, toggleall);
+			text->setFont(bv, cs, cellend, font);
 		}
 	}
 }
@@ -321,15 +321,67 @@ void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
 
 	// Ok, we have a selection.
 	cur.recordUndoSelection();
+	Font newfont = font;
+
+	if (toggleall) {	
+		// Toggling behaves as follows: We check the first character of the
+		// selection. If it's (say) got EMPH on, then we set to off; if off,
+		// then to on. With families and the like, we set it to INHERIT, if
+		// we already have it.
+		CursorSlice const & sl = cur.selBegin();
+		Text const & text = *sl.text();
+		Paragraph const & par = text.getPar(sl.pit());
+	
+		// get font at the position
+		Font oldfont = par.getFont(cur.bv().buffer().params(), sl.pos(),
+			text.outerFont(sl.pit()));
+		FontInfo const & oldfi = oldfont.fontInfo();
+	
+		FontInfo & newfi = newfont.fontInfo();
+	
+		FontFamily newfam = newfi.family();
+		if (newfam !=	INHERIT_FAMILY && newfam != IGNORE_FAMILY &&
+newfam == oldfi.family())
+			newfi.setFamily(INHERIT_FAMILY);
+		
+		FontSeries newser = newfi.series();
+		if (newser == BOLD_SERIES && oldfi.series() == BOLD_SERIES)
+			newfi.setSeries(INHERIT_SERIES);
+	
+		FontShape newshp = newfi.shape();
+		if (newshp !=	INHERIT_SHAPE && newshp != IGNORE_SHAPE &&
+newshp == oldfi.shape())
+			newfi.setShape(INHERIT_SHAPE);
+
+		ColorCode newcol = newfi.color();
+		if (newcol != Color_none && newcol != Color_inherit 
+		&& newcol != Color_ignore && newcol == oldfi.color())
+			newfi.setColor(Color_none);
+
+		// ON/OFF ones
+		if (newfi.emph() == FONT_TOGGLE)
+			newfi.setEmph(oldfi.emph() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.underbar() == FONT_TOGGLE)
+			newfi.setUnderbar(oldfi.underbar() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.strikeout() == FONT_TOGGLE)
+			newfi.setStrikeout(oldfi.strikeout() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.uuline() == FONT_TOGGLE)
+			newfi.setUuline(oldfi.uuline() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.uwave() == FONT_TOGGLE)
+			newfi.setUwave(oldfi.uwave() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.noun() == FONT_TOGGLE)
+			newfi.setNoun(oldfi.noun() == FONT_OFF ? FONT_ON : FONT_OFF);
+		if (newfi.number() == FONT_TOGGLE)
+			newfi.setNumber(oldfi.number() == FONT_OFF ? FONT_ON : FONT_OFF);
+	}
 
 	setFont(cur.bv(), cur.selectionBegin().top(), 
-		cur.selectionEnd().top(), font, toggleall);
+		cur.selectionEnd().top(), newfont);
 }
 
 
 void Text::setFont(BufferView const & bv, CursorSlice const & begin,
-		CursorSlice const & end, Font const & font,
-		bool toggleall)
+		CursorSlice const & end, Font const & font)
 {
 	Buffer const & buffer = bv.buffer();
 
@@ -347,11 +399,11 @@ 

Re: Memory leak ?

2012-01-22 Thread Jean-Marc Lasgouttes

Le 22/01/12 02:09, Lars Gullik Bjønnes a écrit :

My testing so far says the opposite. We are continually using more and
more memory. Not especially fast, but it is there.


A good tool to know where memory goes is the massif tool of valgrind.

JMarc



Re: SVN Down?

2012-01-22 Thread Jean-Marc Lasgouttes

Le 22/01/12 14:00, Lars Gullik Bjønnes a écrit :

| No problems here.  Neither with svn up nor when logging in ti trac.

The dist was pretty full. I cleaned out some.


Last time I saw that, it was because of the svn dumps (I removed some at 
that time). Can we make sure we keep less of these, in order to use less 
disk? Unlss you found another good source of useless bits, of course.


BTW, is our svn db backuped somewhere else?

JMarc



Re: PATCH: Bug #7975 and Toggling

2012-01-22 Thread Jack Tanner
Richard Heck  comcast.net> writes:

> 
> Comments welcome. I guess maybe I'd suggest this is trunk only, rather 
> than changing this kind of thing in a maintenance release.

The current behavior is so bizarre, I never use the toggle feature. I'd be happy
to see it on branch.



Re: SVN Down?

2012-01-22 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes  writes:

| Le 22/01/12 14:00, Lars Gullik Bjønnes a écrit :
>> | No problems here.  Neither with svn up nor when logging in ti trac.
>>
>> The dist was pretty full. I cleaned out some.
>
| Last time I saw that, it was because of the svn dumps (I removed some
| at that time). Can we make sure we keep less of these, in order to use
| less disk?

Yes, this time I will really fix it.

| Unlss you found another good source of useless bits, of
| course.
>
| BTW, is our svn db backuped somewhere else?

I do a back from time to time, and I have the git conversion that is
continously updated.

-- 
   Lgb



Re: r40662 - lyx-devel/trunk/lib

2012-01-22 Thread Richard Heck

On 01/22/2012 08:11 PM, uwesto...@lyx.org wrote:

Author: uwestoehr
Date: Mon Jan 23 02:11:13 2012
New Revision: 40662
URL: http://www.lyx.org/trac/changeset/40662

Log:
chkconfig.ltx: add check for wasy; is necessary because LyX supports the math 
command \brokenvert - OK for branch too?

Sure, why not?

rh


Modified:
lyx-devel/trunk/lib/chkconfig.ltx

Modified: lyx-devel/trunk/lib/chkconfig.ltx
==
--- lyx-devel/trunk/lib/chkconfig.ltx   Sun Jan 22 23:47:58 2012(r40661)
+++ lyx-devel/trunk/lib/chkconfig.ltx   Mon Jan 23 02:11:13 2012(r40662)
@@ -315,6 +315,7 @@
  \TestPackage{units}
  \TestPackage{url}
  \TestPackage{varioref}
+\TestPackage{wasy}
  \TestPackage{wasysym}
  \TestPackage{wrapfig}
  \TestPackage{xargs}