Re: POT file generation is broken!
Michael Schmitt wrote: > something is wrong which the POT file creation! I can't believe that two > fifth of all messages have gone during the code cleanup It can be. Possibly the boost_format change has eliminated a lot of repetitions... Alfredo
Re: tex2lyx and optional arguments
On Thursday 13 November 2003 20:56, Georg Baum wrote: > Problem: > > Solution 2: > Create a list of commands that take optional arguments and only serach for > them when they are expected. The drawback is of course the hardcoding of > commands. > > > I don't like either solution. Does anybody have a Solution 3 that is > better? If not, which solution do you prefer? Solution 4: Have those commands inside an external file, and/or allow other files with such commands to be passed as arguments to tex2lyx. > Georg -- José Abílio LyX and docbook, a perfect match. :-)
Re: Latest CVS Edit->Paragraph Settings inoperative
Kayvan A. Sylvan wrote: >> LCursor::dispatch: >> >> trying to dispatch to main text 0x100b2cd0 >> LyXText::dispatch: cmd: action: 123 arg: '' x: 0 y: 0 >>result: 0 >> ### NOT DISPATCHED BY Cursor::dispatch() ### >> BufferView::Pimpl::fitCursor. > > Is anyone looking into this? Martin Vermeer has just committed a fix to a similar problem in which the inset contents were not being updated on return from their dialogs. In that case the fix was simply to move the LFUN-handling code from BufferView::Pimpl::dispatch to LyxText::dispatch. I suspect that your probelm will have a similiarly easy solution. No, I'm unable to investigate further at the moment. Don't have a checked-out tree here. -- Angus
Re: tex2lyx and optional arguments
Jose' Matos wrote: > On Thursday 13 November 2003 20:56, Georg Baum wrote: >> Problem: >> >> Solution 2: >> Create a list of commands that take optional arguments and only >> serach for them when they are expected. The drawback is of course >> the hardcoding of commands. >> >> >> I don't like either solution. Does anybody have a Solution 3 that >> is better? If not, which solution do you prefer? > > Solution 4: > Have those commands inside an external file, and/or allow other > files with such commands to be passed as arguments to tex2lyx. This is essentially the approach adopted by reLyX. See lib/reLyX/syntax.default. How does TeX approach this problem? (Note that André is away for a few days.) -- Angus
Re: [patch] selection
Alfredo Braunstein wrote: > This patch sanitizes selection handling. > Basically removes all InsetText special case selection-handling code > and adjust the LyXText code a bit to handle also insets. > Comments? Between you, you are making this stuff understandable. I'm not sure I approve. -- Angus
Re: Linking time
> "Michael" == Michael Schmitt <[EMAIL PROTECTED]> writes: Michael> I did not ask to make -gstabs the default debug option. But Michael> for people who have to build the lyx binary many, many times, Michael> it can be a big relief. What we could do is, like for the --enable-optimization=-O3 switch, add the possibility to say --enable-debug=-gstabs. Would that make everybody happy? JMarc
Re: [patch] selection
Angus Leeming wrote: > Alfredo Braunstein wrote: > >> This patch sanitizes selection handling. >> Basically removes all InsetText special case selection-handling code >> and adjust the LyXText code a bit to handle also insets. > >> Comments? > > Between you, you are making this stuff understandable. I'm not sure I > approve. I'm not sure I understand what you are saying. Let me re-explain the purpose of the patch: LFUN_MOUSE_* are handled independently by InsetText (on insets) and LyXText (on the main text) by two similar code pieces of code. The event belongs clearly to LyXText, so I think that the InsetText code is redundant, modulo generalizing the LyXText code a bit. Is this reasonable? Said that, I recently realized that this patch is not fully correct, (a problem with absolute vs. relative coordinates). In any case, I still think that the idea is feasible. What do you think? Alfredo
Re: [patch] selection
Alfredo Braunstein wrote: > Angus Leeming wrote: > >> Alfredo Braunstein wrote: >> >>> This patch sanitizes selection handling. >>> Basically removes all InsetText special case selection-handling >>> code and adjust the LyXText code a bit to handle also insets. >> >>> Comments? >> >> Between you, you are making this stuff understandable. I'm not sure >> I approve. > > I'm not sure I understand what you are saying. I was being silly. It's Friday. > Let me re-explain the purpose of the patch: LFUN_MOUSE_* are handled > independently by InsetText (on insets) and LyXText (on the main > text) by two similar code pieces of code. > The event belongs clearly to LyXText, so I think that the InsetText > code is redundant, modulo generalizing the LyXText code a bit. Is > this reasonable? Entirely. Hence "you are making this stuff understandable". > Said that, I recently realized that this patch is not fully correct, > (a problem with absolute vs. relative coordinates). In any case, I > still think that the idea is feasible. What do you think? I agree with you. Moreover, this last problem will just go away when you go down the "use absolute coords for this sort of stuff internally" route that you proposed the other day. -- Angus
Re: [patch] selection
Angus Leeming wrote: >> I'm not sure I understand what you are saying. > I was being silly. It's Friday. Doh! Sorry ;-) > I agree with you. Moreover, this last problem will just go away when > you go down the "use absolute coords for this sort of stuff > internally" route that you proposed the other day. Exactly. [For the moment though, I think it's not a big deal to workaround] Thanks Angus. I will prepare a better (preferably working this time ;-) ) version of the patch maybe tonight. Alfredo
[Patch] Re: XML sanitation ;-)
On Tue, Nov 11, 2003 at 10:05:45AM +, Jose' Matos spake thusly: > On Sunday 09 November 2003 14:27, Martin Vermeer wrote: ... > > LatexParam"4|revnumber" ... > > Does this make sense? > > Completly. :-) > > > - Martin > > -- > José Abílio Patch attached. I'll check it in later today if no objections come up. (Pity André's not around, I think even the whitespace is OK) - Martin -- Martin Vermeer [EMAIL PROTECTED] Helsinki University of Technology Dept. of Surveying, Inst. of Geodesy P.O. Box 1200, FIN-02015 HUT, Finland :wq Index: lib/layouts/db_stdsections.inc === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/layouts/db_stdsections.inc,v retrieving revision 1.4 diff -u -p -r1.4 db_stdsections.inc --- lib/layouts/db_stdsections.inc 15 Sep 2003 15:20:18 - 1.4 +++ lib/layouts/db_stdsections.inc 14 Nov 2003 11:00:21 - @@ -1,8 +1,9 @@ # Textclass definition file for docbook. # Author : José Abílio Oliveira Matos <[EMAIL PROTECTED]> +# Modified by Martin Vermeer <[EMAIL PROTECTED]> # This file is the counterpart of stdsections.inc -# It is desireable, as far as possible, to have the same look and feeling for +# It is desirable, as far as possible, to have the same look and feel for # related layouts in latex and docbook. Input stdsections.inc @@ -10,47 +11,55 @@ Input stdsections.inc Style Part LatexType Command LatexName part - LatexParam"0|" + InnerTag "title" + CommandDepth 0 End Style Chapter LatexType Command LatexName chapter - LatexParam"1|" + InnerTag "title" + CommandDepth 1 End Style Section LatexType Command LatexName sect1 - LatexParam"2|" + InnerTag "title" + CommandDepth 2 End Style Subsection LatexType Command LatexName sect2 - LatexParam"3|" + InnerTag "title" + CommandDepth 3 End Style Subsubsection LatexType Command LatexName sect3 - LatexParam"4|" + InnerTag "title" + CommandDepth 4 End Style Paragraph LatexType Command LatexName sect4 - LatexParam"5|" + InnerTag "title" + CommandDepth 5 End Style Subparagraph LatexType Command LatexName sect5 - LatexParam"6|" + InnerTag "title" + CommandDepth 6 End + Index: lib/layouts/db_stdtitle.inc === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/layouts/db_stdtitle.inc,v retrieving revision 1.7 diff -u -p -r1.7 db_stdtitle.inc --- lib/layouts/db_stdtitle.inc 15 Sep 2003 15:20:18 - 1.7 +++ lib/layouts/db_stdtitle.inc 14 Nov 2003 11:00:21 - @@ -1,8 +1,9 @@ # Textclass definition file for docbook. # Author : José Abílio Oliveira Matos <[EMAIL PROTECTED]> - -# This file is the counterpart of stdstile.inc -# It is desireable, as far as possible, to have the same look and feeling for +# Modified Martin Vermeer <[EMAIL PROTECTED]> +# +# This file is the counterpart of stdstyle.inc +# It is desireable, as far as possible, to have the same look and feel for # related layouts in latex and docbook. Input stdtitle.inc @@ -11,7 +12,8 @@ Input stdtitle.inc Style Title LatexType Command LatexName articleinfo - LatexParam"2|" + CommandDepth 2 + InnerTag "title" End Index: src/lyxlayout.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxlayout.C,v retrieving revision 1.22 diff -u -p -r1.22 lyxlayout.C --- src/lyxlayout.C 6 Oct 2003 15:42:26 - 1.22 +++ src/lyxlayout.C 14 Nov 2003 11:00:21 - @@ -33,6 +33,7 @@ enum LayoutTags { LT_ALIGNPOSSIBLE, LT_MARGIN, LT_BOTTOMSEP, + LT_COMMANDDEPTH, LT_COPYSTYLE, LT_DEPENDSON, LT_OBSOLETEDBY, @@ -80,7 +81,8 @@ enum LayoutTags { LT_SPACING, LT_TOPSEP, LT_TOCLEVEL, - LT_INTITLE + LT_INNERTAG, + LT_INTITLE // keep this last! }; / @@ -118,6 +120,7 @@ LyXLayout::LyXLayout () pass_thru = false; is_environment = false; toclevel = 0; + commanddepth = 0; } @@ -129,6 +132,7 @@ bool LyXLayout::Read(LyXLex & lexrc, LyX { "align", LT_ALIGN }, { "alignpossible", LT_ALIGNPOS
Re: Latin1 in strings (awk hacker help needed!)
> "Alfredo" == Alfredo Braunstein <[EMAIL PROTECTED]> writes: Alfredo> Jean-Marc Lasgouttes wrote: >> and these ones which come from the math panel Û ± ´ £ @ S ò !(£ >> @) (can these be replaced with real icons?) Alfredo> Can't we make these non-translatable at all? I know there was Alfredo> a reason, but I can't remember. I took a look at what is needed to make these strings non-translatable. A typical entry that we want to skip looks like: class: FL_BUTTON type: NORMAL_BUTTON box: 5 105 50 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: 15 size: 0 lcol: FL_BLACK label: S ò shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_varsize callback: C_FormBaseInputCB argument: 0 The important part here is the "style: 15" entry, which indicates symbol font. The algorithm that needs to be implemented that each style entry should set a 'skip' variable to true if style is 15 and false otherwise. Then, when "label:" is encountered, it should be skipped according to the 'skip' variable. The way to do this would be to add awk magic to the following makefile target: $(srcdir)/xforms_l10n.pot: $(top_srcdir)/src/frontends/xforms/forms/*.fd awk ' \ BEGIN { \ print "#, fuzzy"; \ print "msgid \"\""; \ print "msgstr \"\""; \ print "\"Content-Type: text/plain; charset=ISO-8859-1\\n\""; \ print "\"Content-Transfer-Encoding: 8bit\\n\""; \ print "\n"; \ } \ /label: / { \ if (NF > 1) { \ line=$$0;\ sub(/label: /,"",line);\ printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", FILENAME, FNR, line);\ }\ }' \ `find $(top_srcdir)/src/frontends/xforms/forms -name \*.fd` > $@ Unfortunately, I know nothing about awk. Any taker? JMarc
Re: Latest CVS Edit->Paragraph Settings inoperative
Angus Leeming wrote: > Kayvan A. Sylvan wrote: >>> LCursor::dispatch: >>> >>> trying to dispatch to main text 0x100b2cd0 >>> LyXText::dispatch: cmd: action: 123 arg: '' x: 0 y: 0 >>>result: 0 >>> ### NOT DISPATCHED BY Cursor::dispatch() ### >>> BufferView::Pimpl::fitCursor. >> >> Is anyone looking into this? > > Martin Vermeer has just committed a fix to a similar problem in which > the inset contents were not being updated on return from their > dialogs. In that case the fix was simply to move the LFUN-handling > code from BufferView::Pimpl::dispatch to LyxText::dispatch. I suspect > that your probelm will have a similiarly easy solution. > > No, I'm unable to investigate further at the moment. Don't have a > checked-out tree here. Are we trying to eliminate BufferView::dispatch, moving all LFUNS to LyXText? If I understand correctly, BufferView::dispatch gets never called, and this is the reason we get a lot of unhandled lfuns. Wouldn't a solution like this (call the bv distatch at the end of the dispatch line) be more appropriate instead? Alfredo Index: cursor.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v retrieving revision 1.21 diff -u -p -u -r1.21 cursor.C --- cursor.C13 Nov 2003 13:43:38 - 1.21 +++ cursor.C14 Nov 2003 11:30:40 - @@ -104,6 +104,14 @@ DispatchResult LCursor::dispatch(FuncReq lyxerr << "trying to dispatch to main text " << bv_->text << endl; DispatchResult res = bv_->text->dispatch(cmd); lyxerr << " result: " << res.val() << endl; + + if (!res.dispatched()) { + lyxerr << "trying to dispatch to bv " << bv_ << endl; + bool sucess = bv_->dispatch(cmd); + lyxerr << " result: " << sucess << endl; + res.dispatched(sucess); + } + return res; }
Re: [Patch] Re: XML sanitation ;-)
On Friday 14 November 2003 11:25, Martin Vermeer wrote: > > Patch attached. I support your patch. This effectively means that now there are at least 2 persons who understand this code. :-) And, as Einstein said once, I don't know who is the third. ;-) > I'll check it in later today if no objections come up. Jean-Marc, any objection? > (Pity André's not around, I think even the whitespace is OK) Aha, good try. ;-) The entries for the new tags in LyXLayout::Read are not aligned with those bellow and above. :-) > - Martin -- José Abílio
Re: Latin1 in strings (awk hacker help needed!)
Jean-Marc Lasgouttes wrote: > The way to do this would be to add awk magic to the following > makefile target: > > $(srcdir)/xforms_l10n.pot: > $(top_srcdir)/src/frontends/xforms/forms/*.fd > awk ' \ >BEGIN { \ >print "#, fuzzy"; \ >print "msgid \"\""; \ >print "msgstr \"\""; \ >print "\"Content-Type: text/plain; >charset=ISO-8859-1\\n\""; \ print >"\"Content-Transfer-Encoding: 8bit\\n\""; \ >print "\n"; \ >} \ >/label: / { \ >if (NF > 1) { \ >line=$$0;\ >sub(/label: /,"",line);\ >printf("#: %s:%d\nmsgid >\"%s\"\nmsgstr \"\"\n\n", FILENAME, >FNR, line);\ >}\ >}' \ > `find $(top_srcdir)/src/frontends/xforms/forms -name > \*.fd` > $@ > > Unfortunately, I know nothing about awk. Any taker? Me neither, but how about style=0; \ /style: / { \ if (NF > 1) { \ style=$$0;\ sub(/style: /,"",style);\ }\ }' \ /label: / { \ if (NF > 1 && style == 15) { \ -- Angus
Re: Latin1 in strings (awk hacker help needed!)
Angus Leeming wrote: > Jean-Marc Lasgouttes wrote: >> The way to do this would be to add awk magic to the following >> makefile target: >> >> $(srcdir)/xforms_l10n.pot: >> $(top_srcdir)/src/frontends/xforms/forms/*.fd >> awk ' \ >>BEGIN { \ >>print "#, fuzzy"; \ >>print "msgid \"\""; \ >>print "msgstr \"\""; \ >>print "\"Content-Type: text/plain; >>charset=ISO-8859-1\\n\""; \ print >>"\"Content-Transfer-Encoding: 8bit\\n\""; \ >>print "\n"; \ >>} \ >>/label: / { \ >>if (NF > 1) { \ >>line=$$0;\ >>sub(/label: /,"",line);\ >>printf("#: %s:%d\nmsgid >>\"%s\"\nmsgstr \"\"\n\n", FILENAME, >>FNR, line);\ >>}\ >>}' \ >> `find $(top_srcdir)/src/frontends/xforms/forms -name >> \*.fd` > $@ >> >> Unfortunately, I know nothing about awk. Any taker? > > Me neither, but how about > style=0; \ > /style: / { \ > if (NF > 1) { \ > style=$$0;\ > sub(/style: /,"",style);\ > }\ > }' \ > /label: / { \ > if (NF > 1 && style == 15) { \ > That style=0 bit should be in the BEGIN block... Also /label: / { \ if (NF > 1 && style == 15) { \ could become style != 15 && /label: / && NF > 1 { \ (I think, from a quick scan of O'Reilly's Unix in a nutshell.) Angus
Re: Latest CVS Edit->Paragraph Settings inoperative
Alfredo Braunstein wrote: > Are we trying to eliminate BufferView::dispatch, moving all LFUNS to > LyXText? No. LFUNs should be handled by the appropriate dispatch function. Martin's move of LFUN_INSET_APPLY, LFUN_INSET_INSERT from BufferView to LyXText was the right thing to do because these LFUNs aren't anything to do with the BufferView. Kayvan's reported problem, that a mouse click doesn't get translated to a command to open up the paragraph settings dialog is a problem with an LFUN that IMO does indeed belong to BufferView::dispatch. > If I understand correctly, BufferView::dispatch gets never called, > and this is the reason we get a lot of unhandled lfuns. > > Wouldn't a solution like this (call the bv distatch at the end of > the dispatch line) be more appropriate instead? Yes. -- Angus
Re: Latest CVS Edit->Paragraph Settings inoperative
Angus Leeming wrote: > No. LFUNs should be handled by the appropriate dispatch function. > Martin's move of LFUN_INSET_APPLY, LFUN_INSET_INSERT from BufferView > to LyXText was the right thing to do because these LFUNs aren't > anything to do with the BufferView. Ah, thanks. > Kayvan's reported problem, that a mouse click doesn't get translated > to a command to open up the paragraph settings dialog is a problem > with an LFUN that IMO does indeed belong to BufferView::dispatch. I think it's not a mouse click, but Edit->Paragraphs settings from the menus. Maybe also this one should be moved to LyXText? (it's related to the cursor position after all) Is there a good rule about what should be handled where? For instance, why change tracking & thesaurus but not s&r, etc)? >> If I understand correctly, BufferView::dispatch gets never called, >> and this is the reason we get a lot of unhandled lfuns. >> >> Wouldn't a solution like this (call the bv distatch at the end of >> the dispatch line) be more appropriate instead? > > Yes. Should I apply this bit? Will make life easier to those people using 1.4.0cvs (change tracking, goto bookmark, goto ref etc are also handled in BufferView::dispatch...) ;-) Alternatively, we can call bv::dispatch from LyXFunc dispatch, right after calling LCursor::dispatch. Or call directly bv::dispatch from lyxfunc (instead of LCursor), and in bv::dispatch call LCursor::dispatch as a very first thing. But I'm disgressing... Alfredo
Re: Latest CVS Edit->Paragraph Settings inoperative
Alfredo Braunstein wrote: >> Kayvan's reported problem, that a mouse click doesn't get >> translated to a command to open up the paragraph settings dialog is >> a problem with an LFUN that IMO does indeed belong to >> BufferView::dispatch. > > I think it's not a mouse click, but Edit->Paragraphs settings from > the menus. Maybe also this one should be moved to LyXText? (it's > related to the cursor position after all) > Is there a good rule about what should be handled where? For > instance, why change tracking & thesaurus but not s&r, etc)? I think that the rule is "handle the LFUN in the most appropriate dispatch" but it has never been enforced strictly. Having a single BufferView means that things tend to "just work". In Kayvan's case, the appropriate dispatch would clearly be that of LyXView since that owns the menubars... -- Angus
Re: [Patch] Re: XML sanitation ;-)
> "Jose'" == Jose' Matos <[EMAIL PROTECTED]> writes: Jose'> On Friday 14 November 2003 11:25, Martin Vermeer wrote: >> Patch attached. Jose'> I support your patch. This effectively means that now there Jose'> are at least 2 persons who understand this code. :-) And, as Jose'> Einstein said once, I don't know who is the third. ;-) >> I'll check it in later today if no objections come up. Jose'> Jean-Marc, any objection? No, go ahead. JMarc
Re: Latin1 in strings (awk hacker help needed!)
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: >> Unfortunately, I know nothing about awk. Any taker? Angus> Me neither, but how about [...] I knew you could not resist, Angus... It did not work, but a variation on that did work. I'll send a complete patch once I am satisfied that it works, but here is the Makefile patch snippet. JMarc Index: po/Makefile.in.in === RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/Makefile.in.in,v retrieving revision 1.28.2.2 diff -u -p -r1.28.2.2 Makefile.in.in --- po/Makefile.in.in 27 May 2003 12:45:51 - 1.28.2.2 +++ po/Makefile.in.in 14 Nov 2003 13:41:07 - @@ -218,13 +218,18 @@ $(srcdir)/xforms_l10n.pot: $(top_srcdir) print "\"Content-Type: text/plain; charset=ISO-8859-1\\n\""; \ print "\"Content-Transfer-Encoding: 8bit\\n\""; \ print "\n"; \ + skip=0; \ } \ + /style: 15/ { \ + skip=1; \ + } \ /label: / { \ - if (NF > 1) { \ + if (NF > 1 && skip == 0) { \ line=$$0;\ sub(/label: /,"",line);\ printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", FILENAME, FNR, line);\ }\ + skip=0; \ }' \ `find $(top_srcdir)/src/frontends/xforms/forms -name \*.fd` > $@
Re: Latin1 in strings (awk hacker help needed!)
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: >> "Alfredo" == Alfredo Braunstein <[EMAIL PROTECTED]> writes: | The way to do this would be to add awk magic to the following | makefile target: > | $(srcdir)/xforms_l10n.pot: $(top_srcdir)/src/frontends/xforms/forms/*.fd | awk ' \ |BEGIN { \ |print "#, fuzzy"; \ |print "msgid \"\""; \ |print "msgstr \"\""; \ |print "\"Content-Type: text/plain; charset=ISO-8859-1\\n\""; \ |print "\"Content-Transfer-Encoding: 8bit\\n\""; \ |print "\n"; \ |} \ |/label: / { \ |if (NF > 1) { \ |line=$$0;\ |sub(/label: /,"",line);\ |printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", FILENAME, FNR, line);\ |}\ |}' \ | `find $(top_srcdir)/src/frontends/xforms/forms -name \*.fd` > $@ > > | Unfortunately, I know nothing about awk. Any taker? So it is not possible to use images for these? or is it really hard? -- Lgb
Re: Latin1 in strings (awk hacker help needed!)
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> So it is not possible to use images for these? or is it really Lars> hard? No it would not be hard if only somebody did it. I figured this solution would be easier and indeed it works. I'll post a patch soon. JMarc
Re: [Patch] Re: XML sanitation ;-)
On Fri, Nov 14, 2003 at 02:03:40PM +0100, Jean-Marc Lasgouttes spake thusly: > Jose'> Jean-Marc, any objection? > > No, go ahead. > > JMarc So done. (I was a bit in a hurry, in less than an hour our mail system goes down for the weekend. Installing new spam/virus pumps :-( ) - Martin pgp0.pgp Description: PGP signature
[PATCH] remove non-ascii in translatable strings
The following patch for 1.3.4cvs (should be easy to port to 1.4.0cvs) remove all use of non-ascii characters in strings seen by gettext. Here is a detailed view of the changes: - the strings in symbol font from xforms dialogs are not translatable anymore - removed on occurence of \frac (because of \f) - use <> instead of «text». If english users find this too ugly, we may have to provide a en.po (translators to any language are free to use real guillemets if they can) - use "90 deg" instead of "90°". This is the part I do not like much and ideas are welcome - also change the string "Greek" in symbol font with "abg" in xforms math panel. Unless somebody has objections, I think this can be applied. Of course, a better solution for "90 deg" would be welcome. JMarc ? po/xforms_l10n.pot-save Index: po/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/ChangeLog,v retrieving revision 1.156.2.42 diff -u -p -r1.156.2.42 ChangeLog --- po/ChangeLog 4 Nov 2003 11:52:02 - 1.156.2.42 +++ po/ChangeLog 14 Nov 2003 14:07:52 - @@ -1,3 +1,8 @@ +2003-11-14 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * Makefile.in.in (xforms_l10n.pot): skip entries in symbol font + (we do not want to translate them...) + 2003-11-03 Claus Hindsgaul <[EMAIL PROTECTED]> * da.po: update Index: po/Makefile.in.in === RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/Makefile.in.in,v retrieving revision 1.28.2.2 diff -u -p -r1.28.2.2 Makefile.in.in --- po/Makefile.in.in 27 May 2003 12:45:51 - 1.28.2.2 +++ po/Makefile.in.in 14 Nov 2003 14:07:52 - @@ -218,13 +218,18 @@ $(srcdir)/xforms_l10n.pot: $(top_srcdir) print "\"Content-Type: text/plain; charset=ISO-8859-1\\n\""; \ print "\"Content-Transfer-Encoding: 8bit\\n\""; \ print "\n"; \ + skip=0; \ } \ + /style: 15/ { \ + skip=1; \ + } \ /label: / { \ - if (NF > 1) { \ + if (NF > 1 && skip == 0) { \ line=$$0;\ sub(/label: /,"",line);\ printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", FILENAME, FNR, line);\ }\ + skip=0; \ }' \ `find $(top_srcdir)/src/frontends/xforms/forms -name \*.fd` > $@ Index: src/frontends/qt2/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v retrieving revision 1.389.2.38 diff -u -p -r1.389.2.38 ChangeLog --- src/frontends/qt2/ChangeLog 4 Nov 2003 11:52:03 - 1.389.2.38 +++ src/frontends/qt2/ChangeLog 14 Nov 2003 14:07:52 - @@ -1,3 +1,12 @@ +2003-11-14 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * ui/QMathDialogBase.ui: remove mention of \frac in tooltip, since + \f is interpreted by gettext as a special sequence. + + * QDocument.C (build_dialog): + * ui/QTabularDialogBase.ui: remove use of latin1 in + some translatable strings. It confuses gettext. + 2003-10-22 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> * lyx_gui.C (needs_ugly_metrics_hack): new function. Returns true Index: src/frontends/qt2/QDocument.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QDocument.C,v retrieving revision 1.33.2.4 diff -u -p -r1.33.2.4 QDocument.C --- src/frontends/qt2/QDocument.C 13 Nov 2003 15:51:44 - 1.33.2.4 +++ src/frontends/qt2/QDocument.C 14 Nov 2003 14:07:52 - @@ -89,8 +89,8 @@ void QDocument::build_dialog() dialog_->langModule->quoteStyleCO->insertItem(qt_("''text''")); dialog_->langModule->quoteStyleCO->insertItem(qt_(",,text``")); dialog_->langModule->quoteStyleCO->insertItem(qt_(",,text''")); - dialog_->langModule->quoteStyleCO->insertItem(qt_("«text»")); - dialog_->langModule->quoteStyleCO->insertItem(qt_("»text«")); + dialog_->langModule->quoteStyleCO->insertItem(qt_("<>")); + dialog_->langModule->quoteStyleCO->insertItem(qt_(">>text<<")); // packages for (int n = 0; tex_graphics[n][0]; ++n) { Index: src/frontends/qt2/ui/QMathDialogBase.ui === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ui/QMathDialogBase.ui,v retrieving revision 1.1 diff -u -p -r1.1 QMathDialogBase.ui --- src/frontends/qt2/ui/QMathDialogBase.ui 13 Jan 2003 10:33:22 - 1.1 +++ src/frontends/qt2/ui/QMathDialogBase.ui 14 Nov 2003 14:07:52 - @@ -210,7 +210,7 @@ toolTip -Insert fraction (\frac) +Insert fraction Index: src/frontends/qt2/ui/QTabularDialogBa
Re: POT file generation is broken!
> "Michael" == Michael Schmitt <[EMAIL PROTECTED]> writes: Michael> Hi, something is wrong which the POT file creation! I can't Michael> believe that two fifth of all messages have gone during the Michael> code cleanup It would be nice to try to find out what messages are missing. JMarc
Re: [PATCH] ugly, but...
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: | So Lars, given these crummy explanations, what shall I do? Lars> Is it possible to keep the ugliness inside the qt dir? Or must Lars> it be visible outside? (to other frontends?) Lars? I did not keep my answer to your question, but basically it was: the code is such a special-casing that I do not know how to do it without replicating code in all frontends. JMarc
Re: [PATCH] ugly, but...
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: >> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: > | | So Lars, given these crummy explanations, what shall I do? > | Lars> Is it possible to keep the ugliness inside the qt dir? Or must | Lars> it be visible outside? (to other frontends?) > | Lars? I did not keep my answer to your question, but basically it was: | the code is such a special-casing that I do not know how to do it | without replicating code in all frontends. I cannot remember the case at all... -- Lgb
Re: [PATCH] ugly, but...
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> I cannot remember the case at all... Basically, I applied the patch below to 1.3.x, but it is so ugly that I ask for your approval before checking it in 1.4.0cvs. JMarc Index: src/frontends/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/ChangeLog,v retrieving revision 1.148 diff -u -p -r1.148 ChangeLog --- src/frontends/ChangeLog 14 Jan 2003 21:51:33 - 1.148 +++ src/frontends/ChangeLog 22 Oct 2003 15:36:59 - @@ -1,3 +1,7 @@ +2003-10-22 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * lyx_gui.h: add need_ugly_metrics_hack + 2003-01-11 Juergen Spitzmueller <[EMAIL PROTECTED]> * FileDialog.h: implement opendir (browse directory) [bug 824] Index: src/frontends/lyx_gui.h === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/lyx_gui.h,v retrieving revision 1.15 diff -u -p -r1.15 lyx_gui.h --- src/frontends/lyx_gui.h 18 Dec 2002 14:24:31 - 1.15 +++ src/frontends/lyx_gui.h 22 Oct 2003 15:36:59 - @@ -84,6 +84,13 @@ void set_read_callback(int fd, LyXComm * */ void remove_read_callback(int fd); +/** + * tells whether a special metrics hack is needed by mathed. Currently + * only Qt/Mac requires it. The name has been chosen to be horrible + * enough to get someone to fix the fonts :) + */ +bool needs_ugly_metrics_hack(); + } // namespace lyx_gui #endif // LYX_GUI_H Index: src/frontends/qt2/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v retrieving revision 1.389.2.37 diff -u -p -r1.389.2.37 ChangeLog --- src/frontends/qt2/ChangeLog 3 Oct 2003 13:34:39 - 1.389.2.37 +++ src/frontends/qt2/ChangeLog 22 Oct 2003 15:37:01 - @@ -1,3 +1,8 @@ +2003-10-22 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * lyx_gui.C (needs_ugly_metrics_hack): new function. Returns true + only for Qt/Mac. + 2003-10-02 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> * qfont_loader.C: add an #include Index: src/frontends/qt2/lyx_gui.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/lyx_gui.C,v retrieving revision 1.30.2.1 diff -u -p -r1.30.2.1 lyx_gui.C --- src/frontends/qt2/lyx_gui.C 7 Feb 2003 16:49:20 - 1.30.2.1 +++ src/frontends/qt2/lyx_gui.C 22 Oct 2003 15:37:01 - @@ -243,3 +243,17 @@ void lyx_gui::remove_read_callback(int f io_callbacks.erase(it); } } + + +bool lyx_gui::needs_ugly_metrics_hack() +{ +// There is some bug (in our fonts) which make the metrics of things +// like \sum wrong under Qt/Mac. The only solution we have for now is +// to add this ugly function, so that MathSymbolInset::metrics can do +// the right thing +#ifdef Q_WS_MAC + return true; +#else + return false; +#endif +} Index: src/frontends/xforms/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v retrieving revision 1.661.2.10 diff -u -p -r1.661.2.10 ChangeLog --- src/frontends/xforms/ChangeLog 21 Jul 2003 13:06:37 - 1.661.2.10 +++ src/frontends/xforms/ChangeLog 22 Oct 2003 15:37:01 - @@ -1,3 +1,7 @@ +2003-10-22 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * lyx_gui.C (needs_ugly_metrics_hack): new method, returns false + 2003-07-11 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> * xfont_loader.C (addFontPath): condition message to Debug::FONT Index: src/frontends/xforms/lyx_gui.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/lyx_gui.C,v retrieving revision 1.31 diff -u -p -r1.31 lyx_gui.C --- src/frontends/xforms/lyx_gui.C 18 Dec 2002 14:24:32 - 1.31 +++ src/frontends/xforms/lyx_gui.C 22 Oct 2003 15:37:01 - @@ -388,3 +388,9 @@ void lyx_gui::remove_read_callback(int f { fl_remove_io_callback(fd, FL_READ, C_read_callback); } + + +bool lyx_gui::needs_ugly_metrics_hack() +{ + return false; +} Index: src/mathed/math_symbolinset.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_symbolinset.C,v retrieving revision 1.52.2.1 diff -u -p -r1.52.2.1 math_symbolinset.C --- src/mathed/math_symbolinset.C 22 Sep 2003 14:40:40 - 1.52.2.1 +++ src/mathed/math_symbolinset.C 22 Oct 2003 15:37:01 - @@ -12,6 +12,9 @@ #include "LaTeXFeatures.h" #include "debug.h" +// needed for the metrics hack +#include "frontends/lyx_gui.h" + MathSymbolInset::MathSymbolInset(const latexkeys * l) : sym_(l), h_(0) {} @@ -51,24 +54,25 @@ void MathSymbolInset::metrics(MathMetric MathFontSetChanger dummy(mi.base, sym_->inset.c_str()); mathed_string_dim(mi.base.font, sym_->draw, dim_); // correct height for broken cmex and wasy font -#if defined(__
Re: [PATCH] remove non-ascii in translatable strings
Jean-Marc Lasgouttes wrote: > - use <> instead of «text». If english users find > this too ugly, we may have to provide a en.po (translators > to any language are free to use real guillemets if they can) > > - use "90 deg" instead of "90°". This is the part I do not like much > and ideas are welcome So, en.po would contain about 10 entries or so? That seems do-able. -- Angus
Re: [PATCH] remove non-ascii in translatable strings
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: Angus> Jean-Marc Lasgouttes wrote: >> - use <> instead of «text». If english users find this too >> ugly, we may have to provide a en.po (translators to any >> language are free to use real guillemets if they can) >> >> - use "90 deg" instead of "90°". This is the part I do not like >> much and ideas are welcome Angus> So, en.po would contain about 10 entries or so? That seems Angus> do-able. Of course, you will be so ashamed to see it at the bottom of the "LyX i18n" page that you'll want to translate all the entries (a sed script?)... arc
Re: [PATCH] remove non-ascii in translatable strings
Jean-Marc Lasgouttes wrote: > Angus> So, en.po would contain about 10 entries or so? That seems > Angus> do-able. > > Of course, you will be so ashamed to see it at the bottom of the > "LyX i18n" page that you'll want to translate all the entries (a sed > script?)... Not me. I have no pride in such things. -- Angus
Re: [PATCH] remove non-ascii in translatable strings
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: >> Of course, you will be so ashamed to see it at the bottom of the >> "LyX i18n" page that you'll want to translate all the entries (a >> sed script?)... Angus> Not me. I have no pride in such things. No pride in writing silly sed scripts? But why do you do it, then? JMarc
Re: [PATCH] remove non-ascii in translatable strings
Jean-Marc Lasgouttes wrote: >> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: > >>> Of course, you will be so ashamed to see it at the bottom of the >>> "LyX i18n" page that you'll want to translate all the entries (a >>> sed script?)... > > Angus> Not me. I have no pride in such things. > > No pride in writing silly sed scripts? But why do you do it, then? For fun. -- Angus
Re: [patch] reduce number of updates
> Andre Poenitz <[EMAIL PROTECTED]> writes: > > | E.g just one instead of three per . >> > | Plus removal of deleteLyXText >> > | Plus caching 'beginOfBodyPos'. >> > | We should be faster than 1.3 now.. > > You do so much reindetation that it is impossible to see what you are > actually changing. > > but I noticed that you have conflict markers in text3.C Ups. Sorry. I though it was compiling but then I might have commited from the wrong machine (again). Was a bit in a hurry. Sorry. Could anybody please try to fix that? I won't get access to the sources before Monday. Andre'
Re: tex2lyx and optional arguments
> Problem: > tex2lyx currently cannot handle commands with optional arguments, > because the brackets are translated to normal text. LyX then produces > {[} instead of [. One example where this happens is the userguide. > > Solution 1: > Call something like > > string opts; > string opt = p.getOpt(); > while (opt.size()) { > opts += opt; > opt = p.getOpt(); > } > > after every command and after every closing brace (because we can have > stupid things like \psfrag{tag}[pos][pspos][scale][rot]{text}). This > works well with one exception: If a opening bracket follows a command > that does not take optional arguments like in > > \necommand{\foo}{bar} > \foo [more text > > the parser goes to the end of the file while searching for the matching > closing bracket. Things are only slightly better if there is a > matching closing bracket, because then a false optional argument is > created. > > > Solution 2: > Create a list of commands that take optional arguments and only serach > for them when they are expected. The drawback is of course the > hardcoding of commands. > > > I don't like either solution. Does anybody have a Solution 3 that is > better? If not, which solution do you prefer? Solution 2 1/2. The #hardcoding' should be done by using an external plain text file which contains the 'known' commands. Does do reLyX something similar? Andre' PS: In case I did not mention that so far: Thanks for cleaning up this tex2lyx mess behind me...
[patch] selection2.diff
This path is the previous + - fixed an abolute/relative coords wicked bug in rowPainter that is present at least from oct 23, that makes selection on insets [not on the first page of text] to lose the intermediate part of the selection, i.e. to show as selected only the first and last line of selection. - dispatch to BufferView after dispatching to the cursor (as discussed) The main idea needed to make LyXText handle MOUSE_* events coming from insets is that now these events (that are the only ones having meaningful coordinates, btw) are sent to LyXText in the LyXText's own coordinates (and no more in screen coordinates). There are two known remaining bugs, that I recall: - LFUN_MOUSE_RELEASE events get dispatched to the pointer position, and so when selecting inside an inset and finishing the selection with the pointer outside we get funny behaviour (for instance, if you finish over a button, the button dialog pops) - selections are not cleared out when the cursor gets out of an inset by clicking (I suppose that was done in insetUnlock or something). As a workaround, I've patched the painting code to not paint a selection if the cursor is not in that inset (trivial). It would remain to clear the selection when the cursor enters the inset: I've not done this because I don't know if this is the way to go. It would be very nice if someone else could give it a test. Regards, Alfredo Index: BufferView_pimpl.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.463 diff -u -p -u -r1.463 BufferView_pimpl.C --- BufferView_pimpl.C 13 Nov 2003 20:16:33 - 1.463 +++ BufferView_pimpl.C 14 Nov 2003 17:45:20 - @@ -891,8 +891,28 @@ namespace { bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd) { switch (cmd.action) { + case LFUN_MOUSE_MOTION: { + FuncRequest cmd1(cmd, bv_); + UpdatableInset * inset = bv_->cursor().innerInset(); + DispatchResult res; + if (inset) { + cmd1.x -= inset->x(); + cmd1.y -= inset->y(); + res = inset->dispatch(cmd1); + } else { + cmd1.y += bv_->top_y(); + res = bv_->cursor().innerText()->dispatch(cmd1); + } + + if (bv_->fitCursor() || res.update()) { + bv_->update(); + bv_->cursor().updatePos(); + } + + return true; + } + case LFUN_MOUSE_PRESS: - case LFUN_MOUSE_MOTION: case LFUN_MOUSE_RELEASE: case LFUN_MOUSE_DOUBLE: case LFUN_MOUSE_TRIPLE: { @@ -920,7 +940,7 @@ bool BufferView::Pimpl::workAreaDispatch if (inset) { FuncRequest cmd2 = cmd1; lyxerr << "dispatching action " << cmd2.action -<< " to inset " << inset << endl; + << " to inset " << inset << endl; cmd2.x -= inset->x(); cmd2.y -= inset->y(); res = inset->dispatch(cmd2); @@ -953,6 +973,7 @@ bool BufferView::Pimpl::workAreaDispatch << " to surrounding LyXText " << theTempCursor.innerText() << endl; bv_->cursor() = theTempCursor; + cmd1.y += bv_->top_y(); res = bv_->cursor().innerText()->dispatch(cmd1); if (bv_->fitCursor() || res.update()) bv_->update(); Index: cursor.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v retrieving revision 1.21 diff -u -p -u -r1.21 cursor.C --- cursor.C 13 Nov 2003 13:43:38 - 1.21 +++ cursor.C 14 Nov 2003 17:45:20 - @@ -104,6 +104,14 @@ DispatchResult LCursor::dispatch(FuncReq lyxerr << "trying to dispatch to main text " << bv_->text << endl; DispatchResult res = bv_->text->dispatch(cmd); lyxerr << " result: " << res.val() << endl; + + if (!res.dispatched()) { + lyxerr << "trying to dispatch to bv " << bv_ << endl; + bool sucess = bv_->dispatch(cmd); + lyxerr << " result: " << sucess << endl; + res.dispatched(sucess); + } + return res; } Index: rowpainter.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.C,v retrieving revision 1.89 diff -u -p -u -r1.89 rowpainter.C --- rowpainter.C 13 Nov 2003 13:43:39 - 1.89 +++ rowpainter.C 14 Nov 2003 17:45:22 - @@ -14,6 +14,7 @@ #include "rowpainter.h" #include "buffer.h" +#include "cursor.h" #include "debug.h" #include "bufferparams.h" #include "BufferView.h" @@ -389,11 +390,12 @@ void RowPainter::paintSelection() RowList::iterator endrow = endpit->getRow(text_.selection.end.pos()); int const h = row_.height(); + int const row_y = pit_->y + row_.y_offset(); + if (text_.bidi.same_direction()) { int x; int y = yo_; int w; - if (startrow == rit_ && endrow == rit_) { if (startx < endx) { x = int(xo_) + startx; @@ -411,7 +413,8 @@ void RowPainter::paintSelection() int const x = is_rtl ? int(xo_ + endx) : int(xo_); int const w = is_rtl ? (width_ - endx) : endx; pain_.fillRectangle(x, y, w, h, LColor::selection); - } else if (y_ > starty && y_ < endy) { + } else if (row_y > starty && row
Re: [Patch] Re: XML sanitation ;-)
> On Tue, Nov 11, 2003 at 10:05:45AM +, Jose' Matos spake thusly: > >> On Sunday 09 November 2003 14:27, Martin Vermeer wrote: > > ... > >> > LatexParam"4|revnumber" > > ... > >> > Does this make sense? >> >> Completly. :-) >> >> > - Martin >> >> -- >> José Abílio > > > Patch attached. > > I'll check it in later today if no objections come up. > > (Pity André's not around, I think even the whitespace is OK) Even if I were you would not win in the whitespace arena. Andre'
Re: [patch] reduce number of updates
Andre Poenitz wrote: > Ups. Sorry. I though it was compiling but then I might have commited from > the wrong machine (again). Was a bit in a hurry. Sorry. > > Could anybody please try to fix that? I won't get access to the sources > before Monday. Maybe you sent the patch from the wrong machine, but commit from the good one... in any case, the markers didn't went in. Alfredo