Re: middle-button paste no longer works properly

2007-08-19 Thread Darren Freeman
On Thu, 2007-07-26 at 23:04 -0500, Bo Peng wrote:
> On 7/26/07, Bo Peng <[EMAIL PROTECTED]> wrote:
> > > Going the other way is even worse - mark something in
> > > LyX 1.5.0 (released) and you (usually) can't paste it into thunderbird.
> 
> Could you please test the attached patch?
> 
> JMarc and I tried to move numerous haveSelection calls to some
> 'source' locations, and we obviously missed some cases.

I have been testing in the 1.5.x-svn for a while and whilst I haven't
checked if it is a complete fix, I haven't had any new problems either.

Can I revert this patch shortly? I like my working dir to be in sync
with the repository. Is it possible this needs to be propagated from
trunk to 1.5 branch?

Have fun,
Darren

Index: src/insets/InsetTabular.cpp
===
--- src/insets/InsetTabular.cpp (revision 19221)
+++ src/insets/InsetTabular.cpp (working copy)
@@ -3490,6 +3490,7 @@
cell(cur.idx())->dispatch(cur, cmd);
break;
}
+   theSelection().haveSelection(bvcur.selection());
 }
 
 
Index: src/Text3.cpp
===
--- src/Text3.cpp   (revision 19221)
+++ src/Text3.cpp   (working copy)
@@ -1586,6 +1586,7 @@
}
 
needsUpdate |= (cur.pos() != cur.lastpos()) && cur.selection();
+   theSelection().haveSelection(bv->cursor().selection());
 
// FIXME: The cursor flag is reset two lines below
// so we need to check here if some of the LFUN did touch that.




Re: O-T: Anyone had experience with Bazaar (the DVCS)

2007-08-19 Thread Tim Michelsen

Hello,
just for interest:
have you decided which VCS you will use?

Thanks and regards,
Tim



Re: Windows uninstaller

2007-08-19 Thread Paul A. Rubin

Joost Verburg wrote:

Paul A. Rubin wrote:
It doesn't directly me -- I haven't played chess since the time I 
walked into Fool's Mate in two consecutive games, once as white and 
once as black -- but it seems to me that if there's a point to 
installing those classes, the uninstaller should probably not 
de-register them during an upgrade.


You're not using the official installer, right?



Good question.  The 1.5.1-1 installer was official, but I'm pretty sure 
the 1.5.whatever rc2 installer was Uwe's "small" installer.  It didn't 
create a .tmp file to launch LyX, as I recall.


/Paul



Re: Windows uninstaller

2007-08-19 Thread Joost Verburg

Paul A. Rubin wrote:
It doesn't directly me -- I haven't played chess since the time I walked 
into Fool's Mate in two consecutive games, once as white and once as 
black -- but it seems to me that if there's a point to installing those 
classes, the uninstaller should probably not de-register them during an 
upgrade.


You're not using the official installer, right?

Joost



Re: Windows uninstaller

2007-08-19 Thread Paul A. Rubin

Joost Verburg wrote:

Paul A. Rubin wrote:
Having been using 1.5.1-1 for a while now, I just uninstalled 
1.5.0rc2.  I noticed that the uninstaller told MikTeX to remove some 
fonts (?) that LyX apparently installed (including a chess font?).  
Hopefully I won't need them.


LyX only installs private fonts in its own directory. They won't appear 
in other applications.




These weren't screen fonts, they were printing fonts -- if in fact they 
were fonts.  Unfortunately, the uninstaller's message about what it was 
removing scrolled away just as I was reading it.


The uninstaller was causing MikTeX to run initexmf, and I saw several 
things being removed, at least one of which had to do with lyxchess.sty. 
 I just ran 'kpsewhich lyxchess.sty' and came up empty, so maybe the 
LyX uninstaller was just telling MikTeX to de-register the contents of 
the LyX tex folder.


It doesn't directly me -- I haven't played chess since the time I walked 
into Fool's Mate in two consecutive games, once as white and once as 
black -- but it seems to me that if there's a point to installing those 
classes, the uninstaller should probably not de-register them during an 
upgrade.


/Paul



Cleanup (3)

2007-08-19 Thread Martin Vermeer
Now also the dispatch moved to collapsable.

- Martin


Index: InsetCharStyle.cpp
===
--- InsetCharStyle.cpp  (revision 19648)
+++ InsetCharStyle.cpp  (working copy)
@@ -183,37 +183,7 @@
 
 void InsetCharStyle::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
-   switch (cmd.action) {
-
-   case LFUN_MOUSE_RELEASE:
-   if (cmd.button() == mouse_button::button3)
-   if (internalStatus() == Open)
-   setStatus(cur, Collapsed);
-   else
-   setStatus(cur, Open);
-   else
-   InsetCollapsable::doDispatch(cur, cmd);
-   break;
-
-   case LFUN_INSET_TOGGLE:
-   if (cmd.argument() == "open")
-   setStatus(cur, Open);
-   else if (cmd.argument() == "close")
-   setStatus(cur, Collapsed);
-   else if (cmd.argument() == "toggle" || cmd.argument().empty())
-   if (internalStatus() == Open)
-   setStatus(cur, Collapsed);
-   else
-   setStatus(cur, Open);
-   else // if assign or anything else
-   cur.undispatched();
-   cur.dispatched();
-   break;
-
-   default:
-   InsetCollapsable::doDispatch(cur, cmd);
-   break;
-   }
+   InsetCollapsable::doDispatch(cur, cmd);
 }
 
 
Index: InsetCollapsable.cpp
===
--- InsetCollapsable.cpp(revision 19648)
+++ InsetCollapsable.cpp(working copy)
@@ -495,9 +495,19 @@
 
case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button3) {
-   // Open the Inset configuration dialog
-   showInsetDialog(&cur.bv());
-   break;
+   if (decoration() == Conglomerate) {
+
+   if (internalStatus() == Open)
+   setStatus(cur, Collapsed);
+   else
+   setStatus(cur, Open);
+   break;
+   } else {
+   // Open the Inset 
+   // configuration dialog
+   showInsetDialog(&cur.bv());
+   break;
+   }
}
 
if (decoration() == Minimalistic) {
@@ -538,11 +548,11 @@
else if (cmd.argument() == "close")
setStatus(cur, Collapsed);
else if (cmd.argument() == "toggle" || cmd.argument().empty())
-   if (isOpen()) {
+   if (internalStatus() == Open) {
setStatus(cur, Collapsed);
-   cur.top().forwardPos();
-   }
-   else
+   if (geometry() == ButtonOnly)
+   cur.top().forwardPos();
+   } else
setStatus(cur, Open);
else // if assign or anything else
cur.undispatched();


LyX 1.5.2 patch candidate

2007-08-19 Thread Michael Gerz

Hi,

it seems that it is no longer possible to keep the trunk and the 1.5.X 
branch in sync :-( Therefore, I quickly browsed through all commits to 
the trunk in order to identify potential patches for the stable branch.


AFAICS there are several huge patches that do not qualify for 1.5.X 
simply due to their size and complexity. Below please find a list of 
smaller patches that might be considered.


http://www.lyx.org/trac/changeset/19331 - Deal with a UI bug
http://www.lyx.org/trac/changeset/19332 - Make LYX_ALIGN_LAYOUT always 
be an available layout
http://www.lyx.org/trac/changeset/19398 - Update to latest from boost 
1.34.x branch

http://www.lyx.org/trac/changeset/19409 - Get rid of a few warnings
http://www.lyx.org/trac/changeset/19415 - UserGuide.lyx - add a BibTeX 
bibliography
http://www.lyx.org/trac/changeset/19472 - fix crash after assertion when 
using %s with integer arguments

http://www.lyx.org/trac/changeset/19473 - more verbose message
http://www.lyx.org/trac/changeset/19513 - QLPainter::text():use a pixmap 
cache for word drawing

http://www.lyx.org/trac/changeset/19616 - disable pixmap cache under X11
http://www.lyx.org/trac/changeset/19552 - fix MSVC warning
http://www.lyx.org/trac/changeset/19609 - Fix color of \Omega.
http://www.lyx.org/trac/changeset/19644 - Fix bug 4117
http://www.lyx.org/trac/changeset/19645 - rev 19644: I forgot this
http://www.lyx.org/trac/changeset/19631 - small optimisation: avoid a 
Font copy
http://www.lyx.org/trac/changeset/19632 - cosmetic (MG: To me, it 
doesn't look like cosmetics)
http://www.lyx.org/trac/changeset/19633 - leftMargin, rightMargin, 
labelsep, labelindent, parindent are now docstring
http://www.lyx.org/trac/changeset/19638 - redoParagraph() simplify the 
changed calculation

http://www.lyx.org/trac/changeset/19643 - Fix bug 4123

Regarding documentation, I noticed several differences between trunk and 
branch, too. IMHO we should only work on the stable branch for the 
moment. At a later stage in development, we can copy the documentation 
back to trunk. We should also follow this strategy for the po files (as 
we have done in the past).


Best regards,
Michael



Re: trunk is broken

2007-08-19 Thread Martin Vermeer
On Sun, Aug 19, 2007 at 04:40:22PM +0200, Alfredo Braunstein wrote:
> ../../src/CutAndPaste.cpp: In function 'void
> lyx::cap::switchBetweenClasses(lyx::textclass_type, lyx::textclass_type,
> lyx::InsetText&, lyx::ErrorList&)':
> ../../src/CutAndPaste.cpp:456: error: 'const class
> lyx::InsetCharStyleParams' has no member named 'type'
> 
> 
> Martin it seems you forgot to commit part of the patch.
> 
> A/

Yes you're right, thanks. Should be OK now.

- Martin
 
 


trunk is broken

2007-08-19 Thread Alfredo Braunstein
../../src/CutAndPaste.cpp: In function 'void
lyx::cap::switchBetweenClasses(lyx::textclass_type, lyx::textclass_type,
lyx::InsetText&, lyx::ErrorList&)':
../../src/CutAndPaste.cpp:456: error: 'const class
lyx::InsetCharStyleParams' has no member named 'type'


Martin it seems you forgot to commit part of the patch.

A/




[PATCH - 1.5] Fix bug 4117: Crash when using down cursor in an empty math subscript

2007-08-19 Thread Abdelrazak Younes

http://bugzilla.lyx.org/show_bug.cgi?id=4117
Index: Cursor.cpp
===
--- Cursor.cpp  (revision 19634)
+++ Cursor.cpp  (working copy)
@@ -1482,12 +1482,14 @@
 }
 
 
-void Cursor::fixIfBroken()
+bool Cursor::fixIfBroken()
 {
if (DocIterator::fixIfBroken()) {
clearSelection();
resetAnchor();
+   return true;
}
+   return false;
 }
 
 
Index: Cursor.h
===
--- Cursor.h(revision 19634)
+++ Cursor.h(working copy)
@@ -179,8 +179,9 @@
 * Not using noUpdate() should never be wrong.
 */
void noUpdate();
-   /// fix cursor in circumstances that should never happen
-   void fixIfBroken();
+   /// fix cursor in circumstances that should never happen.
+   /// \retval true if a fix occured.
+   bool fixIfBroken();
 
/// output
friend std::ostream & operator<<(std::ostream & os, Cursor const & cur);
Index: mathed/InsetMathNest.cpp
===
--- mathed/InsetMathNest.cpp(revision 19634)
+++ mathed/InsetMathNest.cpp(working copy)
@@ -568,8 +568,16 @@
// notify left insets and give them chance to set 
update flags
lyx::notifyCursorLeaves(cur.beforeDispatchCursor(), 
cur);
cur.fixIfBroken();
-   }   else
-   cur.undispatched();
+   break;
+   }
+   
+   if (cur.fixIfBroken())
+   // FIXME: Something bad happened. We pass the corrected 
Cursor
+   // instead of letting things go worse.
+   break;
+
+   // We did not manage to move the cursor.
+   cur.undispatched();
break;
}
 


Re: Cleanup (2)

2007-08-19 Thread Martin Vermeer
On Sun, Aug 19, 2007 at 01:06:28PM +0300, Martin Vermeer wrote:
> 
> Will commit presently.
> 
> - Martin

Second part: mostly moving things around charstyle -> collapsble.

One nontrivial change: now autoOpen also affects charstyle
insets. They open up (display the label) when you're inside
them, even if they are set to status collapsed.

This made it necessary to provide a visual cue for what
state the 'internal' status var is in. You can toggle this
with the right mouse as before. It would be confusing not
to show any visual change.

- Martin
 
Index: InsetCharStyle.cpp
===
--- InsetCharStyle.cpp  (revision 19642)
+++ InsetCharStyle.cpp  (working copy)
@@ -134,18 +134,9 @@
getDrawFont(mi.base.font);
mi.base.font.reduce(Font(Font::ALL_SANE));
mi.base.font.realize(tmpfont);
-   mi.base.textwidth -= 2 * TEXT_TO_INSET_OFFSET;
-   InsetText::metrics(mi, dim);
+   bool changed = InsetCollapsable::metrics(mi, dim);
mi.base.font = tmpfont;
if (status() == Open) {
-   // consider width of the inset label
-   Font font(layout_.labelfont);
-   font.realize(Font(Font::ALL_SANE));
-   font.decSize();
-   font.decSize();
-   int w = 0;
-   int a = 0;
-   int d = 0;
// FIXME UNICODE
docstring s(from_utf8(params_.name));
if (undefined())
@@ -153,21 +144,8 @@
// Chop off prefix:
if (s.find(':') != string::npos)
s = s.substr(s.find(':'));
-   theFontMetrics(font).rectText(s, w, a, d);
-   dim.wid = max(dim.wid, w);
+   layout_.labelstring = s;
}
-   dim.asc += TEXT_TO_INSET_OFFSET;
-   dim.des += TEXT_TO_INSET_OFFSET;
-   dim.wid += 2 * TEXT_TO_INSET_OFFSET;
-   mi.base.textwidth += 2 * TEXT_TO_INSET_OFFSET;
-   if (status() == Open)
-   dim.des += ascent();
-   else {
-   dim.des -= 3;
-   dim.asc -= 3;
-   }
-   bool const changed =  dim_ != dim;
-   dim_ = dim;
return changed;
 }
 
@@ -183,27 +161,8 @@
InsetCollapsable::draw(pi, x, y);
pi.base.font = tmpfont;
 
-   int desc = InsetText::descent();
-   if (status() == Open)
-   desc -= ascent();
-   else
-   desc -= 3;
-
-   pi.pain.line(x, y + desc - 4, x, y + desc, layout_.labelfont.color());
-   pi.pain.line(x, y + desc, x + dim_.wid - 3, y + desc,
-   layout_.labelfont.color());
-   pi.pain.line(x + dim_.wid - 3, y + desc, x + dim_.wid - 3, y + desc - 4,
-   layout_.labelfont.color());
-
// the name of the charstyle. Can be toggled.
if (status() == Open) {
-   Font font(layout_.labelfont);
-   font.realize(Font(Font::ALL_SANE));
-   font.decSize();
-   font.decSize();
-   int w = 0;
-   int a = 0;
-   int d = 0;
// FIXME UNICODE
docstring s(from_utf8(params_.name));
if (undefined())
@@ -211,23 +170,8 @@
// Chop off prefix:
if (s.find(':') != string::npos)
s = s.substr(s.find(':'));
-   theFontMetrics(font).rectText(s, w, a, d);
-   pi.pain.rectText(x + (dim_.wid - w) / 2, y + desc + a,
-   s, font, Color::none, Color::none);
+   layout_.labelstring = s;
}
-
-   // a visual cue when the cursor is inside the inset
-   Cursor & cur = pi.base.bv->cursor();
-   if (cur.isInside(this)) {
-   y -= ascent();
-   y += 3;
-   pi.pain.line(x, y + 4, x, y, layout_.labelfont.color());
-   pi.pain.line(x + 4, y, x, y, layout_.labelfont.color());
-   pi.pain.line(x + dim_.wid - 3, y + 4, x + dim_.wid - 3, y,
-   layout_.labelfont.color());
-   pi.pain.line(x + dim_.wid - 7, y, x + dim_.wid - 3, y,
-   layout_.labelfont.color());
-   }
 }
 
 
@@ -243,7 +187,7 @@
 
case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button3)
-   if (status() == Open)
+   if (internalStatus() == Open)
setStatus(cur, Collapsed);
else
setStatus(cur, Open);
@@ -257,7 +201,7 @@
else if (cmd.argument() == "close")
setStatus(cur, Collapsed);
else if (cmd.argument() == "toggle" || cmd.argument().empty())
-   if (status() == Open)
+   if (internalStatus() == Open)
setStatu

simplify tex2lyx building

2007-08-19 Thread Andre Poenitz

This replaces of wart in the tex2lyx building process (linking certain
files from src) by a smaller wart (one extra #define)

tex2lyx building pulls in quite a bit stuff from src, and tries to keep
dependencies low by replacing Font and Spacing by dummy versions defined
in tex2lyx. This needs a bit non-obvious trickery with include paths and
linked files.

The attached patch makes this replacement more obvious by #including
the replacement headers condionally depending on a C macro 'TEX2LYX'
which is only defined when building tex2lyx. 

Andre'
Index: Spacing.h
===
--- Spacing.h   (revision 19640)
+++ Spacing.h   (working copy)
@@ -12,6 +12,10 @@
 #ifndef SPACING_H
 #define SPACING_H
 
+#ifdef TEX2LYX
+#include "tex2lyx/Spacing.h"
+#else
+
 #include 
 #include 
 
@@ -88,8 +92,9 @@
 bool operator!=(Spacing const & a, Spacing const & b)
 {
return !(a == b);
+}
 
+} // namespace lyx
 
-} // namespace lyx
-}
-#endif
+#endif // TEX2LYX
+#endif // SPACING_H
Index: Font.h
===
--- Font.h  (revision 19640)
+++ Font.h  (working copy)
@@ -15,6 +15,10 @@
 #ifndef FONT_H
 #define FONT_H
 
+#ifdef TEX2LYX
+#include "tex2lyx/Font.h"
+#else
+
 #include "Color.h"
 #include "support/docstream.h"
 
@@ -422,4 +426,5 @@
 
 } // namespace lyx
 
+#endif // TEX2LYX
 #endif
Index: tex2lyx/Font.h
===
--- tex2lyx/Font.h  (revision 19640)
+++ tex2lyx/Font.h  (working copy)
@@ -14,8 +14,8 @@
  *
  */
 
-#ifndef LYXFONT_H
-#define LYXFONT_H
+#ifndef TEX2LYX_FONT_H
+#define TEX2LYX_FONT_H
 
 namespace lyx {
 
@@ -40,4 +40,4 @@
 
 } // namespace lyx
 
-#endif // NOT LYXFONT_H
+#endif // TEX2LYX_FONT_H
Index: tex2lyx/Makefile.am
===
--- tex2lyx/Makefile.am (revision 19640)
+++ tex2lyx/Makefile.am (working copy)
@@ -1,8 +1,9 @@
 include $(top_srcdir)/config/common.am
 
-EXTRA_DIST = tex2lyx.man pch.h test-structure.tex test-insets.tex
+EXTRA_DIST = tex2lyx.man test-structure.tex test-insets.tex
+EXTRA_DIST += pch.h
 
-DISTCLEANFILES += tex2lyx.1 $(LINKED_FILES)
+DISTCLEANFILES += tex2lyx.1
 
 #noinst_LTLIBRARIES = libtexparser.la
 #
@@ -16,19 +17,28 @@
 
 bin_PROGRAMS = tex2lyx
 
-AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES)
+DEFAULT_INCLUDES = 
 
+AM_CPPFLAGS += \
+   -DTEX2LYX \
+   $(PCH_FLAGS) \
+   -I$(top_srcdir)/src/tex2lyx \
+   -I$(top_srcdir)/src  \
+   -I$(top_builddir)/src \
+   $(BOOST_INCLUDES)
+
+
 LINKED_FILES = \
-   FloatList.cpp \
-   Floating.cpp \
-   Counters.cpp \
-   Layout.h \
-   Layout.cpp \
-   TextClass.cpp \
-   TextClass.h \
-   Lexer.cpp 
+   ../FloatList.cpp \
+   ../Floating.cpp \
+   ../Counters.cpp \
+   ../Layout.h \
+   ../Layout.cpp \
+   ../TextClass.cpp \
+   ../TextClass.h \
+   ../Lexer.cpp 
 
-BUILT_SOURCES = $(PCH_FILE) $(LINKED_FILES)
+BUILT_SOURCES = $(PCH_FILE)
 
 tex2lyx_SOURCES = \
$(LINKED_FILES) \
@@ -54,12 +64,5 @@
$(top_builddir)/boost/liblyxboost.la \
$(LIBICONV) @LIBS@
 
-$(LINKED_FILES) :
-   @rm -f $@ ; \
-   $(LN_S) $(top_srcdir)/src/$@ .
-
-rm_link_files:
-   rm -f $(LINKED_FILES)
-
 tex2lyx.1:
cp -p $(srcdir)/tex2lyx.man tex2lyx.1
Index: tex2lyx/Spacing.h
===
--- tex2lyx/Spacing.h   (revision 19640)
+++ tex2lyx/Spacing.h   (working copy)
@@ -13,8 +13,8 @@
  * re-invent the wheel.
  */
 
-#ifndef SPACING_H
-#define SPACING_H
+#ifndef TEX2LYX_SPACING_H
+#define TEX2LYX_SPACING_H
 
 #include 
 
@@ -40,4 +40,4 @@
 
 } // namespace lyx
 
-#endif // NOT SPACING_H
+#endif // TEX2LYX_SPACING_H


Re: Replacement for -I-

2007-08-19 Thread Andre Poenitz
On Sun, Aug 19, 2007 at 01:41:32PM +0200, Andre Poenitz wrote:
> 
> Does anybody know what is nowadays the most fashionable way to remove the
> directory of the current file from the list of paths gcc searches for
> includes?
> 
> The option -I- did that some time ago, but now gcc spits at me 'cc1plus:
> note: obsolete option -I- used, please use -iquote instead'. Of course,
> -iquote works for part of what -I- does, but forgets about removing the
> directory of the current file. So 'it does not work'.
> 
> [I was looking into simplifying the building of tex2lyx. The linking of
> files from src/ can be omitted if -I- is used, but 'modern gcc' think it
> is unfashionable...]

Hm, seems -ignore-source-dir is intended to fill this gap. Pending gcc
patch since 2006...

Andre'


Re: Ignoring text in spell-check

2007-08-19 Thread Mael Hilléreau

Le 17 août 07 à 12:34, Dov Feldstern a écrit :

It's not just a matter of convenience --- I'm still not convinced  
that insets are *conceptually* right in this case.


An inset conveys to me the following idea: I have the main text,  
and then inside it is something which is a *break* from the normal  
flow. It may be an integral part of the text, but it's still a  
break in some *textual* sense. Notes, footnotes, equations --- in  
fact, nearly all of the insets we currently have --- fit into this  
category.


Then the question is: *should* they all fit into this category? I see  
no particular reason for that constraint. Besides, does a note and an  
equation really constitute comparable breaks? What about ERTs, notes  
and spaces which are insets? (Do they really constitute a textual  
break?) What about lists (and layouts in general) which are not  
insets? (Don't they constitute textual breaks?)


I don't think that ignore-spellcheck fits into this model. It is  
not a textual break --- it doesn't really have any textual  
significance. It's more of a technical thing. I think this fits in  
better in a slightly different concept, which is that of "marking  
off" regions of the text.


It has a "technical" significance indeed (even though it may be used  
for delimitating natural and technical languages). Nevertheless it  
responds to a user need among all other needs (textual among others),  
even if it has no consequence into the output (BTW, this is true also  
for notes).


Can I clearly delineate when something should be an inset and when  
a region? No. There are probably many gray areas, and whether a  
region or an inset is preferred in these cases is mainly a matter  
of taste.


Why do you feel the need to delineate?


But I'll try anyhow to give some guidelines which make sense to me:

An inset is the right idea when everything inside of it --- without  
even knowing what's going to be inside it --- should inherit  
whatever property the inset is endowing. So for example, when I  
insert a Note, then I'm saying that everything inside is not part  
of the text, it's notes to the author. Even if I insert a footnote,  
or a graphic, or whatever, these should all not be displayed. Or,  
if I insert an image in a footnote, then I want that image to  
appear inside the footnote, not in the main text.


With a "NoSpellcheck" inset, everything inside it is not  
spellchecked, unless you use a "Spellcheck" inset at some point  
inside. This behavior is not bad, as not unclear to the user IMO.


A region should be preferred when that kind of guarantee can't be  
made. For example, when I say that part of the text should be  
\emph, does that mean that also a footnote from within that text  
should be \emph? I don't think so.[*] Same with language: the fact  
that I switch languages within a text does not mean that everything  
"within" this language will also be of the same language.


Then, if you put a footnote inside a foreign language region, what  
should be the language of this footnote? Perhaps you (as me) have no  
answer to this. I think this is normal because it depends on the  
context (the kind of document you're writing).


Of course, one could implement virtually all these situations with  
either only insets or only regions. But the fact is, there is a  
conceptual difference between the two, and it makes sense to  
support both concepts at the implementation level.


What about merging those two things? What you call a "conceptual  
difference" is only a slightly different behavior, and an internal  
property in my vision. This property doesn't have to be known by the  
user, despite it should be specified at implementation level. The  
user shouldn't have to think of such things.


Getting back to spell-checker, IMO spell-checking belongs more to  
the region concept than to the inset concept. Obviously, not  
everyone agrees with this ;).


If you looked at my last patch, you can imbricate "NoSpellcheck" and  
"Spellcheck" insets. So obviously, I agree with this behavior ;)  
However, insets and regions could be the same thing: a delimited area  
of text having some properties useful to the user. This area could be  
drawn on screen in many different ways.


But portraying things as if we're just trying to do what's easiest,  
without thinking of the concepts, is not really fair...


Well, you cannot make me forget that replacing one info by another  
info and two processes for each of comment, note and unselected  
branches, is not a good thing (due to maintainability). Perhaps,  
nothing but the font and character themselves should be stored into a  
font or character property.


[*] Actually, in this case in LyX we *do* currently make the text  
of the footnote \emph. I think the rationale for doing this is one  
of user experience: generally speaking, I think the user expects  
the font attributes to remain as they are, until explicitly  
changed. However, in this specific cas

Replacement for -I-

2007-08-19 Thread Andre Poenitz

Does anybody know what is nowadays the most fashionable way to remove the
directory of the current file from the list of paths gcc searches for
includes?

The option -I- did that some time ago, but now gcc spits at me 'cc1plus:
note: obsolete option -I- used, please use -iquote instead'. Of course,
-iquote works for part of what -I- does, but forgets about removing the
directory of the current file. So 'it does not work'.

[I was looking into simplifying the building of tex2lyx. The linking of
files from src/ can be omitted if -I- is used, but 'modern gcc' think it
is unfashionable...]

Andre'


Re: Windows uninstaller

2007-08-19 Thread Joost Verburg

Paul A. Rubin wrote:
Having been using 1.5.1-1 for a while now, I just uninstalled 1.5.0rc2. 
 I noticed that the uninstaller told MikTeX to remove some fonts (?) 
that LyX apparently installed (including a chess font?).  Hopefully I 
won't need them.


LyX only installs private fonts in its own directory. They won't appear 
in other applications.


Joost



[Patch - 1.5] fix bug 4123: crash when closing LyX window with document tabs

2007-08-19 Thread Abdelrazak Younes

http://bugzilla.lyx.org/show_bug.cgi?id=4123

This fix is already in trunk. This is the patch for 1.5. Who decides now 
that Juergen and JMarc are off?


Abdel.
Index: GuiView.cpp
===
--- GuiView.cpp (revision 19634)
+++ GuiView.cpp (working copy)
@@ -295,13 +295,14 @@
 
theApp()->gui().unregisterView(id());
if (!theApp()->gui().viewIds().empty()) {
-   quitting = true;
// Just close the window and do nothing else if this is not the
// last window.
close_event->accept();
return;
}
 
+   quitting = true;
+
if (view()->buffer()) {
// save cursor position for opened files to .lyx/session
// only bottom (whole doc) level pit and pos is saved.
@@ -566,6 +567,9 @@
 
 void GuiView::update_view_state_qt()
 {
+   if (!hasFocus())
+   return;
+   theLyXFunc().setLyXView(this);
statusBar()->showMessage(toqstr(theLyXFunc().viewStatusMessage()));
statusbar_timer_.stop();
 }


Re: Re: Branches [was: One BufferView per Buffer]

2007-08-19 Thread Michael Gerz

Abdelrazak Younes schrieb:
Right now, if I may summarize the opinion of the lead developers: you 
will have to rebase all your work on trunk step by step, logical 
change by logical change. It's obviously a waste of time and most of 
the time invested in your branch is basically lost. I will discourage 
anyone trying to work in branch.
I agree 100%. Working on the "change tracking" branch was a waste of 
time, too. I almost had to do the same work twice.


Michael



MSVC/CMAke: Cannot build BRANCH_1_5_X

2007-08-19 Thread Abdelrazak Younes

I get this with -Dnls=0 or 1, -Dmerge=0 or 1:

intl.lib(dcigettext.obj) : error LNK2019: unresolved external symbol 
__nl_language_preferences_default referenced in function 
_guess_category_value
D:\devel\lyx\BRANCH_1_5_X\development\cmake\bin\Debug\lyx-qt4.exe : 
fatal error LNK1120: 1 unresolved externals


Any idea Peter?

Abdel.



Cleanup

2007-08-19 Thread Martin Vermeer

Will commit presently.

- Martin

Index: InsetCharStyle.h
===
--- InsetCharStyle.h(revision 19640)
+++ InsetCharStyle.h(working copy)
@@ -27,17 +27,7 @@
///
void read(Lexer & lex);
///
-   std::string type;
-   ///
-   std::string latextype;
-   ///
-   std::string latexname;
-   ///
-   std::string latexparam;
-   ///
-   Font font;
-   ///
-   Font labelfont;
+   std::string name;
 };
 
 
Index: InsetCharStyle.cpp
===
--- InsetCharStyle.cpp  (revision 19640)
+++ InsetCharStyle.cpp  (working copy)
@@ -56,7 +56,7 @@
 InsetCharStyle::InsetCharStyle(BufferParams const & bp, string const s)
: InsetCollapsable(bp, Collapsed)
 {
-   params_.type = s;
+   params_.name = s;
setUndefined();
init();
 }
@@ -66,7 +66,7 @@
CharStyles::iterator cs)
: InsetCollapsable(bp, Collapsed)
 {
-   params_.type = cs->name;
+   params_.name = cs->name;
setDefined(cs);
init();
 }
@@ -87,28 +87,24 @@
 
 bool InsetCharStyle::undefined() const
 {
-   return params_.latexname.empty();
+   return layout_.latexname.empty();
 }
 
 
 void InsetCharStyle::setUndefined()
 {
-   params_.latextype.clear();
-   params_.latexname.clear();
-   params_.latexparam.clear();
-   params_.font = Font(Font::ALL_INHERIT);
-   params_.labelfont = Font(Font::ALL_INHERIT);
-   params_.labelfont.setColor(Color::error);
+   layout_.latextype.clear();
+   layout_.latexname.clear();
+   layout_.latexparam.clear();
+   layout_.font = Font(Font::ALL_INHERIT);
+   layout_.labelfont = Font(Font::ALL_INHERIT);
+   layout_.labelfont.setColor(Color::error);
 }
 
 
 void InsetCharStyle::setDefined(CharStyles::iterator cs)
 {
-   params_.latextype = cs->latextype;
-   params_.latexname = cs->latexname;
-   params_.latexparam = cs->latexparam;
-   params_.font = cs->font;
-   params_.labelfont = cs->labelfont;
+   layout_ = *cs;
 }
 
 
@@ -143,7 +139,7 @@
mi.base.font = tmpfont;
if (status() == Open) {
// consider width of the inset label
-   Font font(params_.labelfont);
+   Font font(layout_.labelfont);
font.realize(Font(Font::ALL_SANE));
font.decSize();
font.decSize();
@@ -151,7 +147,7 @@
int a = 0;
int d = 0;
// FIXME UNICODE
-   docstring s(from_utf8(params_.type));
+   docstring s(from_utf8(params_.name));
if (undefined())
s = _("Undef: ") + s;
// Chop off prefix:
@@ -193,15 +189,15 @@
else
desc -= 3;
 
-   pi.pain.line(x, y + desc - 4, x, y + desc, params_.labelfont.color());
+   pi.pain.line(x, y + desc - 4, x, y + desc, layout_.labelfont.color());
pi.pain.line(x, y + desc, x + dim_.wid - 3, y + desc,
-   params_.labelfont.color());
+   layout_.labelfont.color());
pi.pain.line(x + dim_.wid - 3, y + desc, x + dim_.wid - 3, y + desc - 4,
-   params_.labelfont.color());
+   layout_.labelfont.color());
 
// the name of the charstyle. Can be toggled.
if (status() == Open) {
-   Font font(params_.labelfont);
+   Font font(layout_.labelfont);
font.realize(Font(Font::ALL_SANE));
font.decSize();
font.decSize();
@@ -209,7 +205,7 @@
int a = 0;
int d = 0;
// FIXME UNICODE
-   docstring s(from_utf8(params_.type));
+   docstring s(from_utf8(params_.name));
if (undefined())
s = _("Undef: ") + s;
// Chop off prefix:
@@ -225,19 +221,19 @@
if (cur.isInside(this)) {
y -= ascent();
y += 3;
-   pi.pain.line(x, y + 4, x, y, params_.labelfont.color());
-   pi.pain.line(x + 4, y, x, y, params_.labelfont.color());
+   pi.pain.line(x, y + 4, x, y, layout_.labelfont.color());
+   pi.pain.line(x + 4, y, x, y, layout_.labelfont.color());
pi.pain.line(x + dim_.wid - 3, y + 4, x + dim_.wid - 3, y,
-   params_.labelfont.color());
+   layout_.labelfont.color());
pi.pain.line(x + dim_.wid - 7, y, x + dim_.wid - 3, y,
-   params_.labelfont.color());
+   layout_.labelfont.color());
}
 }
 
 
 void InsetCharStyle::getDrawFont(Font & font) const
 {
-   font = params_.font;
+   font = layout_.font;
 }
 
 
@@ -299,9 +295,9 @@
 {
if (!undefined()) {
// FIXM