Re: [PATCH] Minipage removal
Michael Schmitt wrote: Hm... I think there _is_ a minipage-box conversion available in lyxconvert_224.py. Loading a LyX 1.3.4 document works as expected, at least. So what exactly is missing? OK, short summary: The problem is that the minipage-box conversion happens from 223-224 while 225 and 226 could still produce minipages (via minibuffer and tex2lyx). This means that there might be some documents who are not read in correctly. Try this example file from Kornel: http://marc.theaimsgroup.com/?l=lyx-develm=107072337127639w=2 Without your patch, it is read in as a framebox with wrong values, but at least the content is not lost. The question is: do we care about bleeding edge file formats or not? (the slution would be easy, as proposed by Angus: just move the conversion from lyxconvert_224.py to lyxconvert_227.py). Jürgen.
Re: Most wanted feature: Spell as you type
Christian == Christian Ridderström [EMAIL PROTECTED] writes: Christian It's actually a serious question... IMO we need to Christian distinguish between: Christian * Manual mode where misspelled words are only marked (eg. Christian by a wavy underline) and the user manually corrects Christian spellings. We can do better. Christian * Automatic mode where (minor) misspellings automatically Christian are corrected. We should definitely avoid that. This causes endless frustration. Christian * Semi-automatic mode where misspelled words are marked, Christian but e.g. next to the misspelled word, there are suggested Christian correction that easily can be selected. Christian I don't know how MS-Word behaves, but to keep it simple, Christian I'll focus on the manual mode in my reply below. Word (and emacs flyspell mode) work in this 'semi-automatic' mode. What happens is that the context menu (that we have yet to implement in LyX) contains the list of possible replacements provided by the spellchecker. It is as easy as that. This means that you can replace words with a couple mouse clicks. For the record, I kind of like this feature myself. Christian About the visual feedback... If you type a word that the Christian spellchecker doesn't know about, e.g. let's say you type Christian the work of Shigeo Hirose. Here both 'Shigeo' and Christian 'Hirose' will be marked as misspelled until you have added Christian them to a database or something. - Would you feel Christian distracted by having to add them to the database? - Or Christian would you just ignore the wavy red line for now? (I think a Christian wavy red line would distract me) We need some kind of document-local dictionary (I am sure we have a buzilla entry for that). Christian So... which aspect of flyspelling would you say is more Christian important here... * You just like going back and fixing Christian spelling errors as the occur * You don't like the loss of Christian context associated with a normal spell check There is a case where this is useful: I often transposec haracters when I type. In the case above, correcting is trivial with a flyspell mode, but more complicated with a spell checker. To rephrase this: one advantage of the approach is that you edit in the LyX window, not in some dialog. JMarc
Re: 1.3.x changes
Angus == Angus Leeming [EMAIL PROTECTED] writes: Angus Attached are the changes in my 1.3.x tree. Angus * src/frontends/qt2 intelligent scrolling for Qt. This patch Angus has been in the 1.4.x tree for weeks and no problems have been Angus reported. Yes. Actually I intended to ask for it before 1.3.4. Angus * src/text3.C LFUN_GETLAYOUT currently outputs 1 for all Angus layouts rather than the more useful Title, Standard etc. Angus This one line patch causes it to output the useful data. An Angus identical patch should go in the 1.4.x tree too. Yes. Angus * src/frontends/xforms/xforms_helpers.C output some informative Angus error messages if we fail to open preferences.xform for Angus read/write. This patch should go in the 1.4.x tree too. Yes. However you should consider whether you want to use _() around the strings (what is our policy) and use boost::format. Angus * src/insets/insetgraphics.C escape the name of the external Angus file so that LaTeX can handle (f.ex) Cyrillic file names. This Angus patch should go in the 1.4.x tree too. Yes, provided you are sure it does what you think it does :) JMarc
Re: Most wanted feature: Spell as you type
On Monday 29 December 2003 10:33, Jean-Marc Lasgouttes wrote: Christian * Automatic mode where (minor) misspellings automatically Christian are corrected. We should definitely avoid that. This causes endless frustration. Agree! I want fully control over my own document. This auto-correct features often miss up the documents. Word (and emacs flyspell mode) work in this 'semi-automatic' mode. What happens is that the context menu (that we have yet to implement in LyX) contains the list of possible replacements provided by the spellchecker. It is as easy as that. This means that you can replace words with a couple mouse clicks. Yes! This is exactly what I want. This was what I ment by the cup of cofee and the mouse i my hands. Sorry for not having been clear about it. For the record, I kind of like this feature myself. I am happy to hear that from one of the developers. Christian About the visual feedback... If you type a word that the Christian spellchecker doesn't know about, e.g. let's say you type Christian the work of Shigeo Hirose. Here both 'Shigeo' and Christian 'Hirose' will be marked as misspelled until you have added Christian them to a database or something. - Would you feel Christian distracted by having to add them to the database? - Or Christian would you just ignore the wavy red line for now? (I think a Christian wavy red line would distract me) I would not feel distracted by that. Maybe because I maintain my own additional dictionary (that I from time to time want to submit to the Danish i/apell dictionary). In this way I only have to learn the spell checker the words once (often specific acedemic terms) - and I get fewer wavy lines. To rephrase this: one advantage of the approach is that you edit in the LyX window, not in some dialog. Yup! :-) -j -- Janus Sandsgaard http://janus.dk
Re: Most wanted feature: Spell as you type
On Sun, 28 Dec 2003, Christian Ridderström wrote: People work differently and there's nothing wrong with that... However, the way it works in Word isn't necessarily the best way, so one reason for this discussion is to find out what people _really_ want. E.g., the reason 'used to since MS-Word..' isn't good by itself in IMO, instead we need to figure out why it is useful. Anyway, my questions below are serious. You are right. I know LyX is not a kind of Word. This what I love so much! I was just trying to descibe different subjective motivations for the flyspell-mode I need (and here I am sorry to say that my experiences comes from MS-Word). I do not want it beacuse MS-Word has it, because I find it usefull. * Manual mode where misspelled words are only marked (eg. by a wavy underline) and the user manually corrects spellings. * Automatic mode where (minor) misspellings automatically are corrected. * Semi-automatic mode where misspelled words are marked, but e.g. next to the misspelled word, there are suggested correction that easily can be selected. I am not sure. In OOo Writer it's called AutoSpellcheck, which is what you descibe as Semi-automatic. Here words that are not found in the dictionary gets a red wavy line - and you can correct them (and add words to the database) by doing right-click with the mouse. In addition to this Writer has AutoCorrect which is like the Manual meed you descibe. This is for correcting i - I in English texts etc. I do not use this feature and find it annoying. I guess it can be usefull, but has to be used with care. I think LyX should go for the semi automatic feature. I know we talk about LyX here, and I am just mentioning OOo as a concreat reference to what I would find usefull. - Idea: Would a parallell thread of change tracking be useful to record automatic corrections, that you later can accept? I am not sure I understand this idea. About the visual feedback... If you type a word that the spellchecker doesn't know about, e.g. let's say you type the work of Shigeo Hirose. Here both 'Shigeo' and 'Hirose' will be marked as misspelled until you have added them to a database or something. - Would you feel distracted by having to add them to the database? - Or would you just ignore the wavy red line for now? (I think a wavy red line would distract me) I would not feel distracted by that. Maybe because I maintain my own additional dictionary (that I from time to time want to submit to the Danish i/apell dictionary). In this way I only have to learn the spell checker the words once (often specific acedemic terms) - and I get fewer wavy lines. About changing format and visual feedback... do you simply mean visual feedback, as in that the screen appearance changes when you change the paragraph style? Although in this case it was you that specifically gave a command changed the paragraph style... No, I guess you mean feedback as in a visual error that you then manually go back and correct (I think this would be a distraction for me). I want some wavy red line under the misspelled word (that can easily be turned on and off globaly) with a right-click/context-click option presenting 1) alternatives from the dictionary, and 2) gives me the oportunity to add the word to a costum dictionary (aspell/ispell og similar). I understand about the coffee (albeit I drink tea), but a mouse? How did that get in your coffee ;-) Ok, seriously, what's with the mouse here? Try OOo Writer! :-) You go to a misspell word (with a red line) and right clik with your mouse. A context-menu then gives you alternatives. This can be done when drinking coffee og tea - at you choice ;-) - Slightly related idea: If it feels too much to check the entire document, maybe it would be nice with a function that only checks the current paragraph, or what's in the current LyX window? Could be. For me I just want to be able to turn the feature on and off for the entire document. After a little clean up there won't be many red lines back. Ok, I recognize this... you feel that when you later do the spell check, you no longer remember what a specific paragraph was about? (Making it more difficult to decide what the correct word should be) Yes, it kindda like two different proceses. One is the writing area and the other is a kind of correct the misspellings mode. I do not (don't want to) work this way. Can you think of any other reasons why you like flyspelling? Hmmm don't think so (or: I don't think I am able to formulate clear statements). All I can do is to say that 1) I have spend a lot of time writing reports at university, 2) LyX is the perfect tool for this, and 3) But I am really sorry for the lack of the flyspell-like spell checker. I hope I have made my point more or less clear? Othewise I could be happy to an answer any question. -j -- Janus Sandsgaard http://janus.dk
Re: [PATCH] Minipage removal
Juergen Spitzmueller wrote: about bleeding edge file formats or not? (the slution would be easy, as proposed by Angus: just move the conversion from lyxconvert_224.py to lyxconvert_227.py). My opinion? Move it. -- Angus
Re: [PATCH] Minipage removal
Angus Leeming wrote: My opinion? Move it. I do not much understand lyx2lyx. Is the attached correct? Jürgen. Index: lyxconvert_224.py === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyxconvert_224.py,v retrieving revision 1.14 diff -u -r1.14 lyxconvert_224.py --- lyxconvert_224.py 3 Dec 2003 12:29:42 - 1.14 +++ lyxconvert_224.py 29 Dec 2003 11:22:06 - @@ -105,70 +105,6 @@ return lines[i] = \\end_document - -def convert_minipage(lines): - Convert minipages to the box inset. -We try to use the same order of arguments as lyx does. - -pos = [t,c,b] -inner_pos = [c,t,b,s] - -i = 0 -while 1: -i = find_token(lines, \\begin_inset Minipage, i) -if i == -1: -return - -lines[i] = \\begin_inset Frameless -i = i + 1 - -# convert old to new position using the pos list -if lines[i][:8] == position: -lines[i] = 'position %s' % pos[int(lines[i][9])] -else: -lines.insert(i, 'position %s' % pos[0]) -i = i + 1 - -lines.insert(i, 'hor_pos c') -i = i + 1 -lines.insert(i, 'has_inner_box 1') -i = i + 1 - -# convert the inner_position -if lines[i][:14] == inner_position: -lines[i] = 'inner_pos %s' % inner_pos[int(lines[i][15])] -else: -lines.insert('inner_pos %s' % inner_pos[0]) -i = i + 1 - -# We need this since the new file format has a height and width -# in a different order. -if lines[i][:6] == height: -height = lines[i][6:] -# test for default value of 221 and convert it accordingly -if height == ' 0pt': -height = ' 1pt' -del lines[i] -else: -height = ' 1pt' - -if lines[i][:5] == width: -width = lines[i][5:] -del lines[i] -else: -width = ' 0' - -lines.insert(i, 'use_parbox 0') -i = i + 1 -lines.insert(i, 'width' + width) -i = i + 1 -lines.insert(i, 'special none') -i = i + 1 -lines.insert(i, 'height' + height) -i = i + 1 -lines.insert(i, 'height_special totalheight') -i = i + 1 - ## # Convert line and page breaks # Old: @@ -289,7 +225,6 @@ layout2begin_layout(body) end_document(body) table_valignment_middle(body) -convert_minipage(body) convert_breaks(body) if __name__ == __main__: Index: lyxconvert_227.py === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyxconvert_227.py,v retrieving revision 1.4 diff -u -r1.4 lyxconvert_227.py --- lyxconvert_227.py 19 Dec 2003 21:38:07 - 1.4 +++ lyxconvert_227.py 29 Dec 2003 11:22:06 - @@ -16,7 +16,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys -from parser_tools import find_tokens +from parser_tools import find_token, find_tokens def convert_collapsable(lines): i = 0 @@ -51,8 +51,73 @@ i = i + 1 + +def convert_minipage(lines): + Convert minipages to the box inset. +We try to use the same order of arguments as lyx does. + +pos = [t,c,b] +inner_pos = [c,t,b,s] + +i = 0 +while 1: +i = find_token(lines, \\begin_inset Minipage, i) +if i == -1: +return + +lines[i] = \\begin_inset Box Frameless +i = i + 1 + +# convert old to new position using the pos list +if lines[i][:8] == position: +lines[i] = 'position %s' % pos[int(lines[i][9])] +else: +lines.insert(i, 'position %s' % pos[0]) +i = i + 1 + +lines.insert(i, 'hor_pos c') +i = i + 1 +lines.insert(i, 'has_inner_box 1') +i = i + 1 + +# convert the inner_position +if lines[i][:14] == inner_position: +lines[i] = 'inner_pos %s' % inner_pos[int(lines[i][15])] +else: +lines.insert('inner_pos %s' % inner_pos[0]) +i = i + 1 + +# We need this since the new file format has a height and width +# in a different order. +if lines[i][:6] == height: +height = lines[i][6:] +# test for default value of 221 and convert it accordingly +if height == ' 0pt': +height = ' 1pt' +del lines[i] +else: +height = ' 1pt' + +if lines[i][:5] == width: +width = lines[i][5:] +del lines[i] +else: +width = ' 0' + +lines.insert(i, 'use_parbox 0') +i = i + 1 +lines.insert(i, 'width' + width) +i = i + 1 +lines.insert(i, 'special none') +i = i + 1 +lines.insert(i, 'height' + height) +i = i + 1 +lines.insert(i,
Re: [Patch] Moving functionality into layouts
Martin == Martin Vermeer [EMAIL PROTECTED] writes: Martin See the attached. The idea is to make it possible to use Martin LatexParam more flexibly to add attributes to opening tags. Martin Work in progress. Martin OK to commit? What does the # in latexparam mean? Do you really need to use quot;? I'd think that a simple \ would work. Martin Also one thing I still want to do, is make the CharStyle Martin insets (I'm still thinking of them as Element insets :-) Martin enabled only if they are inside the right paragraph style, Martin like Jean-Marc did with ShortTitle. This will structure the Martin situation especially for editing the header. How do you plan to do this? A list of layouts that accept a given CharStyle? JMarc
Re: [PATCH] Minipage removal
On Monday 29 December 2003 11:20, Juergen Spitzmueller wrote: Angus Leeming wrote: My opinion? Move it. I do not much understand lyx2lyx. Is the attached correct? The code look correct and all the individual converter are self-contained. The only thing that could go wrong is come missing import statement, but those seem ok. Does it works? If yes then apply it. :-) Jürgen. -- José Abílio LyX and docbook, a perfect match. :-)
Crash unexpected
Well, I can confirm that something is going wrong with the loading of fonts. I've seen that the ./configure command produce: ... checking for TeX fonts checking [for cmex10]... no checking [for cmmi10]... no checking [for cmr10]... no checking [for cmsy10]... no checking [for eufm10]... no checking [for msam10]... no checking [for msbm10]... no checking [for wasy10]... no mv: cannot stat `xfonts/fonts.dir': No such file or directory mv: cannot stat `xfonts/fonts.dir.new': No such file or directory removing font links configure: configuring in lib/reLyX configure: running /bin/sh './configure' --prefix=/usr/local --cache-file=/dev/null --srcdir=. checking whether to enable maintainer-specific portions of Makefiles... no checking for a BSD-compatible install... /usr/bin/ginstall -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets ${MAKE}... yes checking for a BSD-compatible install... /usr/bin/ginstall -c checking for perl = 5.002... /usr/bin/perl configure: creating ./config.status config.status: creating Makefile config.status: creating reLyX config.status: creating noweb2lyx Configuration Host type: i686-pc-linux-gnu Special build flags:xforms-image-loader C Compiler: gcc C Compiler flags: -g -O2 C++ Compiler: g++ (3.2.3) C++ Compiler flags: -O -fno-exceptions Linker flags: Frontend: xforms libXpm version: 4.11 libforms version: 1.0.0 LyX binary dir: /usr/local/bin LyX files dir: /usr/local/share/lyx Configuration of LyX was successful. Type 'make' to compile the program, and then 'make install' to install it. but I don't know how resolve this problem!!! -- Marco Boni - Viale delle Magnolie, 4 - 50142 - Firenze - Italy Cell.: +39 335 6079353 - Home : +39 055 7398033 Email: [EMAIL PROTECTED] -- My machine is an i686 and running Slackware 9.1 Why don't you try it? --
Re: 1.3.x changes
Jean-Marc Lasgouttes wrote: Angus == Angus Leeming [EMAIL PROTECTED] writes: Angus Attached are the changes in my 1.3.x tree. Angus * src/frontends/qt2 intelligent scrolling for Qt. This patch Angus has been in the 1.4.x tree for weeks and no problems have been Angus reported. Yes. Actually I intended to ask for it before 1.3.4. Ok. Angus * src/text3.C LFUN_GETLAYOUT currently outputs 1 for all Angus layouts rather than the more useful Title, Standard etc. Angus This one line patch causes it to output the useful data. An Angus identical patch should go in the 1.4.x tree too. Yes. Ok. Angus * src/frontends/xforms/xforms_helpers.C output some informative Angus error messages if we fail to open preferences.xform for Angus read/write. This patch should go in the 1.4.x tree too. Yes. However you should consider whether you want to use _() around the strings (what is our policy) and use boost::format. Good idea. I've plumped for lyxerr XformsColor::read( filename )\n _(Failed to open file.) std::endl; Angus * src/insets/insetgraphics.C escape the name of the external Angus file so that LaTeX can handle (f.ex) Cyrillic file names. This Angus patch should go in the 1.4.x tree too. Yes, provided you are sure it does what you think it does :) I'll mull this one over/do some testing. Angus
Re: [PATCH] Minipage removal
Jose' Matos wrote: The code look correct and all the individual converter are self-contained. The only thing that could go wrong is come missing import statement, but those seem ok. Does it works? Yes. It works on Kornel's test file. If yes then apply it. :-) Done. Thanks. IMHO Michael's patch could go in now. Can I apply it? Jürgen.
Re: [PATCH] Minipage removal
Juergen Spitzmueller wrote: IMHO Michael's patch could go in now. Can I apply it? Go for it. -- Angus
InsetExternal usage poll
If you open the External dialog in order to insert a new inset, you're currently faced with the combox of available templates being set to 'RasterImage', thanks to this code in insetexternal.C namespace { string const defaultTemplateName = RasterImage; } // namespace anon InsetExternalParams::InsetExternalParams() : templatename_(defaultTemplateName) {} I have been mulling over the best way to implement André and Konni's desire that the combox be set to 'XFig' and I think that it would be easiest to use the point of application of the inset params: void InsetExternal::setParams(InsetExternalParams const p, Buffer const buffer) { params_ = p; + defaultTemplateName = params_.templatename(); ... } Thus, if you open an existing file containing only XFig external insets or if you 'Apply' an XFig inset from the dialog, then the combox wll be set to 'XFig' the next time that the dialog is opened. It seems to me that this is the generic solution to this type of problem too (since all dialogs use the data in the inset's params struct to set their widgets). Are you all happy with this scheme? -- Angus
Re: [PATCH] Minipage removal
Angus Leeming wrote: Juergen Spitzmueller wrote: IMHO Michael's patch could go in now. Can I apply it? Go for it. I see you did indeed go for it. Could you increase the LyX format by one please (src/buffer.C) and add a note to this effect in development/FORMAT. To that end, it would probably be best to create new lyxconvert/lyxrevert files too... -- Angus
(José) why we copy files to the tmp dir
José, just before Christmas you asked why we always copied external files (graphics, xfig, gnuplot etc) to the tmp directory even when no modifications were needed. I've just remembered an additional reason: LaTeX can't cope with spaces in the path. When we copy the file to the temp directory we rename it in a LaTeX-friendly fashion. -- Angus
Re: [PATCH] Minipage removal
Angus Leeming wrote: Could you increase the LyX format by one please (src/buffer.C) and add a note to this effect in development/FORMAT. To that end, it would probably be best to create new lyxconvert/lyxrevert files too... I don't quite understand why this is necessary here, but anyway. Can you have a look at the attached patch before I apply, please? Thanks, Jürgen. Index: development/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/development/ChangeLog,v retrieving revision 1.40 diff -u -r1.40 ChangeLog --- development/ChangeLog 15 Dec 2003 22:04:31 - 1.40 +++ development/ChangeLog 29 Dec 2003 14:50:25 - @@ -1,3 +1,7 @@ +2003-12-29 Jürgen Spitzmüller [EMAIL PROTECTED] + + * FORMAT: document change to format 229. + 2003-12-15 Angus Leeming [EMAIL PROTECTED] * FORMAT: document change to format 228. Index: development/FORMAT === RCS file: /usr/local/lyx/cvsroot/lyx-devel/development/FORMAT,v retrieving revision 1.20 diff -u -r1.20 FORMAT --- development/FORMAT 15 Dec 2003 22:04:31 - 1.20 +++ development/FORMAT 29 Dec 2003 14:50:25 - @@ -1,6 +1,11 @@ LyX file-format changes --- +2003-12-29 Jürgen Spitzmüller [EMAIL PROTECTED] + + * format incremented to 229. + * Minipages cannot be read anymore. + 2003-12-15 Angus Leeming [EMAIL PROTECTED] * format incremented to 228. Index: lib/lyx2lyx/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/ChangeLog,v retrieving revision 1.16 diff -u -r1.16 ChangeLog --- lib/lyx2lyx/ChangeLog 29 Dec 2003 12:56:09 - 1.16 +++ lib/lyx2lyx/ChangeLog 29 Dec 2003 14:50:28 - @@ -2,6 +2,9 @@ * lyxconvert_224.py (convert_minipage): remove function... * lyxconvert_227.py: ...and place it here. + * lyx2lyx: up the format to 229. + * lyxconvert_228.py: + * lyxrevert_229.py: new files (bare bones). 2003-12-19 Angus Leeming [EMAIL PROTECTED] Index: lib/lyx2lyx/lyx2lyx === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx2lyx,v retrieving revision 1.20 diff -u -r1.20 lyx2lyx --- lib/lyx2lyx/lyx2lyx 15 Dec 2003 22:04:31 - 1.20 +++ lib/lyx2lyx/lyx2lyx 29 Dec 2003 14:50:29 - @@ -40,7 +40,7 @@ format = re.compile(r(\d)[\.,]?(\d\d)) fileformat = re.compile(r\\lyxformat\s*(\S*)) -lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228] +lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228, 229] def usage(): print Usage: lyx2lyx [options] [file] Index: lib/lyx2lyx/lyxconvert_228.py === RCS file: lib/lyx2lyx/lyxconvert_228.py diff -N lib/lyx2lyx/lyxconvert_228.py --- /dev/null 1 Jan 1970 00:00:00 - +++ lib/lyx2lyx/lyxconvert_228.py 29 Dec 2003 14:50:29 - @@ -0,0 +1,24 @@ +# This file is part of lyx2lyx +# Copyright (C) 2003 José Matos [EMAIL PROTECTED] +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + +def convert(header, body): +pass + +if __name__ == __main__: +pass Index: lib/lyx2lyx/lyxrevert_229.py === RCS file: lib/lyx2lyx/lyxrevert_229.py diff -N lib/lyx2lyx/lyxrevert_229.py --- /dev/null 1 Jan 1970 00:00:00 - +++ lib/lyx2lyx/lyxrevert_229.py 29 Dec 2003 14:50:29 - @@ -0,0 +1,24 @@ +# This file is part of lyx2lyx +# Copyright (C) 2003 José Matos [EMAIL PROTECTED] +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Re: [PATCH] Minipage removal
Juergen Spitzmueller wrote: Angus Leeming wrote: Could you increase the LyX format by one please (src/buffer.C) and add a note to this effect in development/FORMAT. To that end, it would probably be best to create new lyxconvert/lyxrevert files too... I don't quite understand why this is necessary here, but anyway. What I meant was that this 'removal of InsetMinipage/conversion of InsetMinipage to InsetBox' is a format change and so should 1 be documented 2 be placed in its own lyx2lyx files, lyxconvert_228.py and lyxrevert_229.py. Can you have a look at the attached patch before I apply, please? The bare bones lyxconvert_228.py and lyxrevert_229.py are pointless (as you say). Personally I'd move the conversion code into them. The more of these tiny files we have, the more likely José is to come up with a versioning system that separates file from format number ;-) Thanks, Jürgen. -- Angus
Re: [PATCH] Minipage removal
Angus Leeming wrote: What I meant was that this 'removal of InsetMinipage/conversion of InsetMinipage to InsetBox' is a format change and so should 1 be documented 2 be placed in its own lyx2lyx files, lyxconvert_228.py and lyxrevert_229.py. Yes, this is certainly much cleaner. The bare bones lyxconvert_228.py and lyxrevert_229.py are pointless (as you say). Personally I'd move the conversion code into them. The more of these tiny files we have, the more likely José is to come up with a versioning system that separates file from format number ;-) Is the attached better? Jürgen. Index: development/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/development/ChangeLog,v retrieving revision 1.40 diff -u -r1.40 ChangeLog --- development/ChangeLog 15 Dec 2003 22:04:31 - 1.40 +++ development/ChangeLog 29 Dec 2003 15:28:00 - @@ -1,3 +1,7 @@ +2003-12-29 Jürgen Spitzmüller [EMAIL PROTECTED] + + * FORMAT: document change to format 229. + 2003-12-15 Angus Leeming [EMAIL PROTECTED] * FORMAT: document change to format 228. Index: development/FORMAT === RCS file: /usr/local/lyx/cvsroot/lyx-devel/development/FORMAT,v retrieving revision 1.20 diff -u -r1.20 FORMAT --- development/FORMAT 15 Dec 2003 22:04:31 - 1.20 +++ development/FORMAT 29 Dec 2003 15:28:01 - @@ -1,6 +1,12 @@ LyX file-format changes --- +2003-12-29 Jürgen Spitzmüller [EMAIL PROTECTED] + + * format incremented to 229. + * Minipages cannot be read anymore. All minipage insets will + be converted to frameless box insets between 228-229. + 2003-12-15 Angus Leeming [EMAIL PROTECTED] * format incremented to 228. Index: lib/lyx2lyx/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/ChangeLog,v retrieving revision 1.16 diff -u -r1.16 ChangeLog --- lib/lyx2lyx/ChangeLog 29 Dec 2003 12:56:09 - 1.16 +++ lib/lyx2lyx/ChangeLog 29 Dec 2003 15:28:04 - @@ -1,7 +1,9 @@ 2003-12-29 Jürgen Spitzmüller [EMAIL PROTECTED] + * lyx2lyx: up the format to 229. * lyxconvert_224.py (convert_minipage): remove function... - * lyxconvert_227.py: ...and place it here. + * lyxconvert_228.py: ...and place it here. + * lyxrevert_229.py: new file (bare bones). 2003-12-19 Angus Leeming [EMAIL PROTECTED] Index: lib/lyx2lyx/lyx2lyx === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx2lyx,v retrieving revision 1.20 diff -u -r1.20 lyx2lyx --- lib/lyx2lyx/lyx2lyx 15 Dec 2003 22:04:31 - 1.20 +++ lib/lyx2lyx/lyx2lyx 29 Dec 2003 15:28:04 - @@ -40,7 +40,7 @@ format = re.compile(r(\d)[\.,]?(\d\d)) fileformat = re.compile(r\\lyxformat\s*(\S*)) -lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228] +lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228, 229] def usage(): print Usage: lyx2lyx [options] [file] Index: lib/lyx2lyx/lyxconvert_227.py === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyxconvert_227.py,v retrieving revision 1.5 diff -u -r1.5 lyxconvert_227.py --- lib/lyx2lyx/lyxconvert_227.py 29 Dec 2003 12:56:10 - 1.5 +++ lib/lyx2lyx/lyxconvert_227.py 29 Dec 2003 15:28:04 - @@ -16,7 +16,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys -from parser_tools import find_token, find_tokens +from parser_tools import find_tokens def convert_collapsable(lines): i = 0 @@ -52,72 +52,8 @@ i = i + 1 -def convert_minipage(lines): - Convert minipages to the box inset. -We try to use the same order of arguments as lyx does. - -pos = [t,c,b] -inner_pos = [c,t,b,s] - -i = 0 -while 1: -i = find_token(lines, \\begin_inset Minipage, i) -if i == -1: -return - -lines[i] = \\begin_inset Box Frameless -i = i + 1 - -# convert old to new position using the pos list -if lines[i][:8] == position: -lines[i] = 'position %s' % pos[int(lines[i][9])] -else: -lines.insert(i, 'position %s' % pos[0]) -i = i + 1 - -lines.insert(i, 'hor_pos c') -i = i + 1 -lines.insert(i, 'has_inner_box 1') -i = i + 1 - -# convert the inner_position -if lines[i][:14] == inner_position: -lines[i] = 'inner_pos %s' % inner_pos[int(lines[i][15])] -else: -lines.insert('inner_pos %s' % inner_pos[0]) -i = i + 1 - -# We need this since the new file format has a height and width -# in a different order. -if lines[i][:6] == height: -height = lines[i][6:] -# test for default value of 221 and convert it
Re: [PATCH] Minipage removal
Juergen Spitzmueller wrote: The bare bones lyxconvert_228.py and lyxrevert_229.py are pointless (as you say). Personally I'd move the conversion code into them. The more of these tiny files we have, the more likely José is to come up with a versioning system that separates file from format number ;-) Is the attached better? My opinion? Yes. -- Angus
Re: [PATCH] Minipage removal
Angus Leeming wrote: Is the attached better? My opinion? If you are in the mood... Yes. OK, then I apply this and hope to close the chapter minipage insets finally. Jürgen.
Fonts patch for LyX/Mac (1.3.4cvs)
The attached patch to 1.3.4cvs -- suggested by Jean-Marc -- lets LyX/Mac find additional fonts in its own application bundle. The addFontPath code works, but does not get called by qfont_loader::available. Instead, Qt finds fonts in the teTeX hierarchy which do the math symbols wrong. The only way I could get the addFontPath code invoked was with the ugly hack to qfont_loader::font_info::font_info. I'd welcome suggestions. Thanks, -- Ronald fonts.patch Description: Binary data
Re: [Patch] Moving functionality into layouts
On Mon, Dec 29, 2003 at 12:29:57PM +0100, Jean-Marc Lasgouttes spake thusly: Martin == Martin Vermeer [EMAIL PROTECTED] writes: Martin See the attached. The idea is to make it possible to use Martin LatexParam more flexibly to add attributes to opening tags. Martin Work in progress. Martin OK to commit? What does the # in latexparam mean? Here the counter expression is substituted. See output_docbook.C (the lines with subst()). Do you really need to use quot;? I'd think that a simple \ would work. This is self-implemented, see lyxlayout.C:338. I did try if \ worked, and it didn't. Still, I'm open to better suggestions, quot; is a bit verbose. Martin Also one thing I still want to do, is make the CharStyle Martin insets (I'm still thinking of them as Element insets :-) Martin enabled only if they are inside the right paragraph style, Martin like Jean-Marc did with ShortTitle. This will structure the Martin situation especially for editing the header. How do you plan to do this? A list of layouts that accept a given CharStyle? Yes... as a parameter within that CharStyle definition. AllowedIn or something, with a comma separated arg list. JMarc - Martin pgp0.pgp Description: PGP signature
Re: Unable to run 1.4cvs qt-lyx
-BEGIN PGP SIGNED MESSAGE- On Sonntag, 21. Dezember 2003 14:32, Atsushi Shimmra wrote: Kornel Benko wrote: Upgrading to SuSE 9.0 (with QT 3.2.1-56 and gcc 3.3.1), I have now problems to launch the qt-lyx. It crashes in call to QFontInfo() in src/frontends/qt2/lyx_gui.C:291 Me , too. Ok, so I was not the only one ... As nobody else cares, I tried to look into this. The problem here is, that QFontInfo(font).family().latin1() returns NULL. The conversion to string afterwards leads to crash. Changing lines return QFontInfo(font).family().latin1(); to const char *x = QFontInfo(font).family().latin1(); return x?x:; gives me at least a working qt-lyx version. May this be of some help to anyone? Kornel - -- Kornel Benko [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iQCVAwUBP/BpPrewfbDGmeqhAQHL6AP/TNVYXybOyGjEk7xWU8kerXfXAEQhqP0P WBLWqhDHzxjODKoHUyr9xv47+c0f+KNpNclCpsNYGHw8lZGg4HDGGskhCZS0T322 H4HS5gGzc3IuAI390tDi0mcMILXg5E4EIFaLsL/tUuycv8zPISWfwxdmMMrjzYTz 04GvkqyLdI4= =Ag/M -END PGP SIGNATURE-
Qt help needed
The patch below prevents a crash in the xforms frontend when launching the File Browser dialog from the External dialog. The problem was that this string, used to specify the file filter: *.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm|xbm) was being modified in ControlExternal to this: *.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm Converting this glob to a regex: .*\.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm lead to boost::regex bailing out (invalid regex --- no closing ')'). Clearly, the code I've removed was put there for a reason, but I think that it is now redundant. Any objections if I simply remove it? However, the main point of this mail is to ask what I need to do to get the Qt frontend to understand the filter *.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm|xbm) Any idea what the Qt-version would need to be? Angus diff -u -p -r1.30 FileDialog.C --- src/frontends/xforms/FileDialog.C 6 Oct 2003 15:42:53 - 1.30 +++ src/frontends/xforms/FileDialog.C 29 Dec 2003 18:20:11 - @@ -65,14 +65,8 @@ FileDialog::Result const FileDialog::ope FileDialog::Result const FileDialog::open(string const path, string const mask, string const suggested) { string filter = mask; - - if (mask.empty()) - filter = _(*); - else { - rsplit(mask, filter, '|'); - if (filter.empty()) - filter = mask; - } + if (filter.empty()) + filter = *; lyxerr[Debug::GUI] filedialog open with path \ path \, mask \ filter \, suggested \ suggested '' endl;
Re: Qt help needed
Angus Leeming wrote: However, the main point of this mail is to ask what I need to do to get the Qt frontend to understand the filter *.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm|xbm) Any idea what the Qt-version would need to be? H. I've just realised that *.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm|xbm) isn't a valid glob. Moreover, Qt uses a (rather elegant) notation, of the form: Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml) Rather than reinvent the wheel, I propose we use this notation ourselves and make the xforms frontend jump through a few hoops. Objections? Angus ps the xforms file dialog code is foul... A
Re: Most wanted feature: Spell as you type
Christian Ridderström wrote: I've _suffered_ this feature in MS-Word... for me, the main problem was the distraction from content. E.g., I frequently found myself spending time on fixing spelling(*) instead of content -- I prefer checking spelling at the end, when the content is there. Well, you can turn it off, right? (honest question). [...] * Not having used Word seriously before, I didn't feel like looking through the menu system in order to disable it. That is quite unusual and not representative for any power user. -- Moritz Moeller-Herrmann [EMAIL PROTECTED] wiss. Mitarbeiter, IMGB La loi, dans un grand souci d'égalité, interdit aux riches comme aux pauvres de coucher sous les ponts, de mendier dans les rues et de voler du pain. (ANATOLE FRANCE)
Re: [PATCH] Minipage removal
Michael Schmitt wrote: > Hm... I think there _is_ a minipage->box conversion available in > lyxconvert_224.py. Loading a LyX 1.3.4 document works as expected, at > least. So what exactly is missing? OK, short summary: The problem is that the minipage->box conversion happens from 223->224 while 225 and 226 could still produce minipages (via minibuffer and tex2lyx). This means that there might be some documents who are not read in correctly. Try this example file from Kornel: http://marc.theaimsgroup.com/?l=lyx-devel=107072337127639=2 Without your patch, it is read in as a framebox with wrong values, but at least the content is not lost. The question is: do we care about bleeding edge file formats or not? (the slution would be easy, as proposed by Angus: just move the conversion from lyxconvert_224.py to lyxconvert_227.py). Jürgen.
Re: Most wanted feature: Spell as you type
> "Christian" == Christian Ridderström <[EMAIL PROTECTED]> writes: Christian> It's actually a serious question... IMO we need to Christian> distinguish between: Christian> * Manual mode where misspelled words are only marked (eg. Christian> by a wavy underline) and the user manually corrects Christian> spellings. We can do better. Christian> * Automatic mode where (minor) misspellings automatically Christian> are corrected. We should definitely avoid that. This causes endless frustration. Christian> * Semi-automatic mode where misspelled words are marked, Christian> but e.g. next to the misspelled word, there are suggested Christian> correction that easily can be selected. Christian> I don't know how MS-Word behaves, but to keep it simple, Christian> I'll focus on the "manual" mode in my reply below. Word (and emacs flyspell mode) work in this 'semi-automatic' mode. What happens is that the context menu (that we have yet to implement in LyX) contains the list of possible replacements provided by the spellchecker. It is as easy as that. This means that you can replace words with a couple mouse clicks. For the record, I kind of like this feature myself. Christian> About the visual feedback... If you type a word that the Christian> spellchecker doesn't know about, e.g. let's say you type Christian> "the work of Shigeo Hirose". Here both 'Shigeo' and Christian> 'Hirose' will be marked as misspelled until you have added Christian> them to a database or something. - Would you feel Christian> distracted by having to add them to the database? - Or Christian> would you just ignore the wavy red line for now? (I think a Christian> wavy red line would distract me) We need some kind of document-local dictionary (I am sure we have a buzilla entry for that). Christian> So... which aspect of "flyspelling" would you say is more Christian> important here... * You just like going back and fixing Christian> spelling errors as the occur * You don't like the loss of Christian> context associated with a "normal" spell check There is a case where this is useful: I often transposec haracters when I type. In the case above, correcting is trivial with a flyspell mode, but more complicated with a spell checker. To rephrase this: one advantage of the approach is that you edit in the LyX window, not in some dialog. JMarc
Re: 1.3.x changes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: Angus> Attached are the changes in my 1.3.x tree. Angus> * src/frontends/qt2 intelligent scrolling for Qt. This patch Angus> has been in the 1.4.x tree for weeks and no problems have been Angus> reported. Yes. Actually I intended to ask for it before 1.3.4. Angus> * src/text3.C LFUN_GETLAYOUT currently outputs "1" for all Angus> layouts rather than the more useful "Title", "Standard" etc. Angus> This one line patch causes it to output the useful data. An Angus> identical patch should go in the 1.4.x tree too. Yes. Angus> * src/frontends/xforms/xforms_helpers.C output some informative Angus> error messages if we fail to open preferences.xform for Angus> read/write. This patch should go in the 1.4.x tree too. Yes. However you should consider whether you want to use _() around the strings (what is our policy) and use boost::format. Angus> * src/insets/insetgraphics.C escape the name of the external Angus> file so that LaTeX can handle (f.ex) Cyrillic file names. This Angus> patch should go in the 1.4.x tree too. Yes, provided you are sure it does what you think it does :) JMarc
Re: Most wanted feature: Spell as you type
On Monday 29 December 2003 10:33, Jean-Marc Lasgouttes wrote: > Christian> * Automatic mode where (minor) misspellings automatically > Christian> are corrected. > > We should definitely avoid that. This causes endless frustration. Agree! I want fully control over my own document. This auto-correct features often miss up the documents. > Word (and emacs flyspell mode) work in this 'semi-automatic' mode. > What happens is that the context menu (that we have yet to implement > in LyX) contains the list of possible replacements provided by the > spellchecker. It is as easy as that. This means that you can replace > words with a couple mouse clicks. Yes! This is exactly what I want. This was what I ment by the cup of cofee and the mouse i my hands. Sorry for not having been clear about it. > For the record, I kind of like this feature myself. I am happy to hear that from one of the developers. > Christian> About the visual feedback... If you type a word that the > Christian> spellchecker doesn't know about, e.g. let's say you type > Christian> "the work of Shigeo Hirose". Here both 'Shigeo' and > Christian> 'Hirose' will be marked as misspelled until you have added > Christian> them to a database or something. - Would you feel > Christian> distracted by having to add them to the database? - Or > Christian> would you just ignore the wavy red line for now? (I think a > Christian> wavy red line would distract me) I would not feel distracted by that. Maybe because I maintain my own additional dictionary (that I from time to time want to submit to the Danish i/apell dictionary). In this way I only have to learn the spell checker the words once (often specific acedemic terms) - and I get fewer wavy lines. > To rephrase this: one advantage of the approach is that you edit in > the LyX window, not in some dialog. Yup! :-) -j -- Janus Sandsgaard http://janus.dk
Re: Most wanted feature: Spell as you type
On Sun, 28 Dec 2003, Christian Ridderström wrote: > People work differently and there's nothing wrong with that... However, the > way it works in Word isn't necessarily the best way, so one reason for this > discussion is to find out what people _really_ want. E.g., the reason 'used > to since MS-Word..' isn't good by itself in IMO, instead we need to figure > out why it is useful. Anyway, my questions below are serious. You are right. I know LyX is not "a kind of Word". This what I love so much! I was just trying to descibe different subjective motivations for the flyspell-mode I need (and here I am sorry to say that my experiences comes from MS-Word). I do not want it beacuse MS-Word has it, because I find it usefull. > * Manual mode where misspelled words are only marked (eg. by a wavy > underline) and the user manually corrects spellings. > * Automatic mode where (minor) misspellings automatically are corrected. > * Semi-automatic mode where misspelled words are marked, but e.g. next > to the misspelled word, there are suggested correction that easily can be > selected. I am not sure. In OOo Writer it's called "AutoSpellcheck", which is what you descibe as "Semi-automatic". Here words that are not found in the dictionary gets a red wavy line - and you can correct them (and add words to the database) by doing right-click with the mouse. In addition to this Writer has "AutoCorrect" which is like the "Manual meed" you descibe. This is for correcting "i" - "I" in English texts etc. I do not use this feature and find it annoying. I guess it can be usefull, but has to be used with care. I think LyX should go for the "semi automatic" feature. I know we talk about LyX here, and I am just mentioning OOo as a concreat reference to what I would find usefull. > - Idea: Would a parallell thread of "change tracking" be useful to record > automatic corrections, that you later can accept? I am not sure I understand this idea. > About the visual feedback... If you type a word that the spellchecker > doesn't know about, e.g. let's say you type "the work of Shigeo Hirose". > Here both 'Shigeo' and 'Hirose' will be marked as misspelled until you have > added them to a database or something. - Would you feel distracted by having > to add them to the database? - Or would you just ignore the wavy red line > for now? (I think a wavy red line would distract me) I would not feel distracted by that. Maybe because I maintain my own additional dictionary (that I from time to time want to submit to the Danish i/apell dictionary). In this way I only have to learn the spell checker the words once (often specific acedemic terms) - and I get fewer wavy lines. > About changing format and visual feedback... do you simply mean visual > feedback, as in that the screen appearance changes when you change the > paragraph style? Although in this case it was you that specifically gave a > command changed the paragraph style... > No, I guess you mean feedback as in a visual "error" that you then manually > go back and correct (I think this would be a distraction for me). I want some wavy red line under the misspelled word (that can easily be turned on and off globaly) with a right-click/context-click option presenting 1) alternatives from the dictionary, and 2) gives me the oportunity to add the word to a costum dictionary (aspell/ispell og similar). > I understand about the coffee (albeit I drink tea), but a mouse? How did > that get in your coffee ;-) Ok, seriously, what's with the mouse here? Try OOo Writer! :-) You go to a misspell word (with a red line) and right clik with your mouse. A context-menu then gives you alternatives. This can be done when drinking coffee og tea - at you choice ;-) > - Slightly related idea: If it feels "too much" to check the entire > document, maybe it would be nice with a function that only checks the > current paragraph, or what's in the current LyX window? Could be. For me I just want to be able to turn the feature on and off for the entire document. After a little clean up there won't be many red lines back. > Ok, I recognize this... you feel that when you later do the spell check, you > no longer remember what a specific paragraph was about? (Making it more > difficult to decide what the correct word should be) Yes, it kindda like two different proceses. One is the writing area and the other is a kind of "correct the misspellings mode". I do not (don't want to) work this way. > Can you think of any other reasons why you like "flyspelling"? Hmmm don't think so (or: I don't think I am able to formulate clear statements). All I can do is to say that 1) I have spend a lot of time writing reports at university, 2) LyX is the perfect tool for this, and 3) But I am really sorry for the lack of the flyspell-like spell checker. I hope I have made my point more or less clear? Othewise I could be happy to an answer any question. -j -- Janus
Re: [PATCH] Minipage removal
Juergen Spitzmueller wrote: > about bleeding edge file formats or not? (the slution would be easy, > as proposed by Angus: just move the conversion from > lyxconvert_224.py to lyxconvert_227.py). My opinion? Move it. -- Angus
Re: [PATCH] Minipage removal
Angus Leeming wrote: > My opinion? Move it. I do not much understand lyx2lyx. Is the attached correct? Jürgen. Index: lyxconvert_224.py === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyxconvert_224.py,v retrieving revision 1.14 diff -u -r1.14 lyxconvert_224.py --- lyxconvert_224.py 3 Dec 2003 12:29:42 - 1.14 +++ lyxconvert_224.py 29 Dec 2003 11:22:06 - @@ -105,70 +105,6 @@ return lines[i] = "\\end_document" - -def convert_minipage(lines): -""" Convert minipages to the box inset. -We try to use the same order of arguments as lyx does. -""" -pos = ["t","c","b"] -inner_pos = ["c","t","b","s"] - -i = 0 -while 1: -i = find_token(lines, "\\begin_inset Minipage", i) -if i == -1: -return - -lines[i] = "\\begin_inset Frameless" -i = i + 1 - -# convert old to new position using the pos list -if lines[i][:8] == "position": -lines[i] = 'position "%s"' % pos[int(lines[i][9])] -else: -lines.insert(i, 'position "%s"' % pos[0]) -i = i + 1 - -lines.insert(i, 'hor_pos "c"') -i = i + 1 -lines.insert(i, 'has_inner_box 1') -i = i + 1 - -# convert the inner_position -if lines[i][:14] == "inner_position": -lines[i] = 'inner_pos "%s"' % inner_pos[int(lines[i][15])] -else: -lines.insert('inner_pos "%s"' % inner_pos[0]) -i = i + 1 - -# We need this since the new file format has a height and width -# in a different order. -if lines[i][:6] == "height": -height = lines[i][6:] -# test for default value of 221 and convert it accordingly -if height == ' "0pt"': -height = ' "1pt"' -del lines[i] -else: -height = ' "1pt"' - -if lines[i][:5] == "width": -width = lines[i][5:] -del lines[i] -else: -width = ' "0"' - -lines.insert(i, 'use_parbox 0') -i = i + 1 -lines.insert(i, 'width' + width) -i = i + 1 -lines.insert(i, 'special "none"') -i = i + 1 -lines.insert(i, 'height' + height) -i = i + 1 -lines.insert(i, 'height_special "totalheight"') -i = i + 1 - ## # Convert line and page breaks # Old: @@ -289,7 +225,6 @@ layout2begin_layout(body) end_document(body) table_valignment_middle(body) -convert_minipage(body) convert_breaks(body) if __name__ == "__main__": Index: lyxconvert_227.py === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyxconvert_227.py,v retrieving revision 1.4 diff -u -r1.4 lyxconvert_227.py --- lyxconvert_227.py 19 Dec 2003 21:38:07 - 1.4 +++ lyxconvert_227.py 29 Dec 2003 11:22:06 - @@ -16,7 +16,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys -from parser_tools import find_tokens +from parser_tools import find_token, find_tokens def convert_collapsable(lines): i = 0 @@ -51,8 +51,73 @@ i = i + 1 + +def convert_minipage(lines): +""" Convert minipages to the box inset. +We try to use the same order of arguments as lyx does. +""" +pos = ["t","c","b"] +inner_pos = ["c","t","b","s"] + +i = 0 +while 1: +i = find_token(lines, "\\begin_inset Minipage", i) +if i == -1: +return + +lines[i] = "\\begin_inset Box Frameless" +i = i + 1 + +# convert old to new position using the pos list +if lines[i][:8] == "position": +lines[i] = 'position "%s"' % pos[int(lines[i][9])] +else: +lines.insert(i, 'position "%s"' % pos[0]) +i = i + 1 + +lines.insert(i, 'hor_pos "c"') +i = i + 1 +lines.insert(i, 'has_inner_box 1') +i = i + 1 + +# convert the inner_position +if lines[i][:14] == "inner_position": +lines[i] = 'inner_pos "%s"' % inner_pos[int(lines[i][15])] +else: +lines.insert('inner_pos "%s"' % inner_pos[0]) +i = i + 1 + +# We need this since the new file format has a height and width +# in a different order. +if lines[i][:6] == "height": +height = lines[i][6:] +# test for default value of 221 and convert it accordingly +if height == ' "0pt"': +height = ' "1pt"' +del lines[i] +else: +height = ' "1pt"' + +if lines[i][:5] == "width": +width = lines[i][5:] +del lines[i] +else: +width = ' "0"' + +lines.insert(i, 'use_parbox 0') +i = i + 1 +lines.insert(i, 'width' + width) +i = i + 1 +lines.insert(i, 'special "none"')
Re: [Patch] Moving functionality into layouts
> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: Martin> See the attached. The idea is to make it possible to use Martin> LatexParam more flexibly to add attributes to opening tags. Martin> Work in progress. Martin> OK to commit? What does the # in latexparam mean? Do you really need to use ? I'd think that a simple \" would work. Martin> Also one thing I still want to do, is make the CharStyle Martin> insets (I'm still thinking of them as Element insets :-) Martin> enabled only if they are inside the right paragraph style, Martin> like Jean-Marc did with ShortTitle. This will structure the Martin> situation especially for editing the header. How do you plan to do this? A list of layouts that accept a given CharStyle? JMarc
Re: [PATCH] Minipage removal
On Monday 29 December 2003 11:20, Juergen Spitzmueller wrote: > Angus Leeming wrote: > > My opinion? Move it. > > I do not much understand lyx2lyx. Is the attached correct? The code look correct and all the individual converter are self-contained. The only thing that could go wrong is come missing import statement, but those seem ok. Does it works? If yes then apply it. :-) > Jürgen. -- José Abílio LyX and docbook, a perfect match. :-)
Crash unexpected
Well, I can confirm that something is going wrong with the loading of fonts. I've seen that the ./configure command produce: ... checking for TeX fonts checking [for cmex10]... no checking [for cmmi10]... no checking [for cmr10]... no checking [for cmsy10]... no checking [for eufm10]... no checking [for msam10]... no checking [for msbm10]... no checking [for wasy10]... no mv: cannot stat `xfonts/fonts.dir': No such file or directory mv: cannot stat `xfonts/fonts.dir.new': No such file or directory removing font links configure: configuring in lib/reLyX configure: running /bin/sh './configure' --prefix=/usr/local --cache-file=/dev/null --srcdir=. checking whether to enable maintainer-specific portions of Makefiles... no checking for a BSD-compatible install... /usr/bin/ginstall -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets ${MAKE}... yes checking for a BSD-compatible install... /usr/bin/ginstall -c checking for perl >= 5.002... /usr/bin/perl configure: creating ./config.status config.status: creating Makefile config.status: creating reLyX config.status: creating noweb2lyx Configuration Host type: i686-pc-linux-gnu Special build flags:xforms-image-loader C Compiler: gcc C Compiler flags: -g -O2 C++ Compiler: g++ (3.2.3) C++ Compiler flags: -O -fno-exceptions Linker flags: Frontend: xforms libXpm version: 4.11 libforms version: 1.0.0 LyX binary dir: /usr/local/bin LyX files dir: /usr/local/share/lyx Configuration of LyX was successful. Type 'make' to compile the program, and then 'make install' to install it. but I don't know how resolve this problem!!! -- Marco Boni - Viale delle Magnolie, 4 - 50142 - Firenze - Italy Cell.: +39 335 6079353 - Home : +39 055 7398033 Email: [EMAIL PROTECTED] -- My machine is an i686 and running Slackware 9.1 Why don't you try it? --
Re: 1.3.x changes
Jean-Marc Lasgouttes wrote: >> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: > > Angus> Attached are the changes in my 1.3.x tree. > > Angus> * src/frontends/qt2 intelligent scrolling for Qt. This patch > Angus> has been in the 1.4.x tree for weeks and no problems have > been Angus> reported. > > Yes. Actually I intended to ask for it before 1.3.4. Ok. > Angus> * src/text3.C LFUN_GETLAYOUT currently outputs "1" for all > Angus> layouts rather than the more useful "Title", "Standard" etc. > Angus> This one line patch causes it to output the useful data. An > Angus> identical patch should go in the 1.4.x tree too. > > Yes. Ok. > Angus> * src/frontends/xforms/xforms_helpers.C output some > informative Angus> error messages if we fail to open > preferences.xform for Angus> read/write. This patch should go in the > 1.4.x tree too. > > Yes. However you should consider whether you want to use _() around > the strings (what is our policy) and use boost::format. Good idea. I've plumped for lyxerr << "XformsColor::read(" << filename << ")\n" << _("Failed to open file.") << std::endl; > Angus> * src/insets/insetgraphics.C escape the name of the external > Angus> file so that LaTeX can handle (f.ex) Cyrillic file names. > This Angus> patch should go in the 1.4.x tree too. > > Yes, provided you are sure it does what you think it does :) I'll mull this one over/do some testing. Angus
Re: [PATCH] Minipage removal
Jose' Matos wrote: > The code look correct and all the individual converter are self-contained. > The only thing that could go wrong is come missing import statement, but > those seem ok. > > Does it works? Yes. It works on Kornel's test file. > If yes then apply it. :-) Done. Thanks. IMHO Michael's patch could go in now. Can I apply it? Jürgen.
Re: [PATCH] Minipage removal
Juergen Spitzmueller wrote: > IMHO Michael's patch could go in now. Can I apply it? Go for it. -- Angus
InsetExternal usage poll
If you open the External dialog in order to insert a new inset, you're currently faced with the combox of available templates being set to 'RasterImage', thanks to this code in insetexternal.C namespace { string const defaultTemplateName = "RasterImage"; } // namespace anon InsetExternalParams::InsetExternalParams() : templatename_(defaultTemplateName) {} I have been mulling over the best way to implement André and Konni's desire that the combox be set to 'XFig' and I think that it would be easiest to use the point of application of the inset params: void InsetExternal::setParams(InsetExternalParams const & p, Buffer const & buffer) { params_ = p; + defaultTemplateName = params_.templatename(); ... } Thus, if you open an existing file containing only XFig external insets or if you 'Apply' an XFig inset from the dialog, then the combox wll be set to 'XFig' the next time that the dialog is opened. It seems to me that this is the generic solution to this type of problem too (since all dialogs use the data in the inset's params struct to set their widgets). Are you all happy with this scheme? -- Angus
Re: [PATCH] Minipage removal
Angus Leeming wrote: > Juergen Spitzmueller wrote: >> IMHO Michael's patch could go in now. Can I apply it? > > Go for it. I see you did indeed go for it. Could you increase the LyX format by one please (src/buffer.C) and add a note to this effect in development/FORMAT. To that end, it would probably be best to create new lyxconvert/lyxrevert files too... -- Angus
(José) why we copy files to the tmp dir
José, just before Christmas you asked why we always copied external files (graphics, xfig, gnuplot etc) to the tmp directory even when no modifications were needed. I've just remembered an additional reason: LaTeX can't cope with spaces in the path. When we copy the file to the temp directory we rename it in a LaTeX-friendly fashion. -- Angus
Re: [PATCH] Minipage removal
Angus Leeming wrote: > Could you increase the LyX format by one please (src/buffer.C) and add > a note to this effect in development/FORMAT. To that end, it would > probably be best to create new lyxconvert/lyxrevert files too... I don't quite understand why this is necessary here, but anyway. Can you have a look at the attached patch before I apply, please? Thanks, Jürgen. Index: development/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/development/ChangeLog,v retrieving revision 1.40 diff -u -r1.40 ChangeLog --- development/ChangeLog 15 Dec 2003 22:04:31 - 1.40 +++ development/ChangeLog 29 Dec 2003 14:50:25 - @@ -1,3 +1,7 @@ +2003-12-29 Jürgen Spitzmüller <[EMAIL PROTECTED]> + + * FORMAT: document change to format 229. + 2003-12-15 Angus Leeming <[EMAIL PROTECTED]> * FORMAT: document change to format 228. Index: development/FORMAT === RCS file: /usr/local/lyx/cvsroot/lyx-devel/development/FORMAT,v retrieving revision 1.20 diff -u -r1.20 FORMAT --- development/FORMAT 15 Dec 2003 22:04:31 - 1.20 +++ development/FORMAT 29 Dec 2003 14:50:25 - @@ -1,6 +1,11 @@ LyX file-format changes --- +2003-12-29 Jürgen Spitzmüller <[EMAIL PROTECTED]> + + * format incremented to 229. + * Minipages cannot be read anymore. + 2003-12-15 Angus Leeming <[EMAIL PROTECTED]> * format incremented to 228. Index: lib/lyx2lyx/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/ChangeLog,v retrieving revision 1.16 diff -u -r1.16 ChangeLog --- lib/lyx2lyx/ChangeLog 29 Dec 2003 12:56:09 - 1.16 +++ lib/lyx2lyx/ChangeLog 29 Dec 2003 14:50:28 - @@ -2,6 +2,9 @@ * lyxconvert_224.py (convert_minipage): remove function... * lyxconvert_227.py: ...and place it here. + * lyx2lyx: up the format to 229. + * lyxconvert_228.py: + * lyxrevert_229.py: new files (bare bones). 2003-12-19 Angus Leeming <[EMAIL PROTECTED]> Index: lib/lyx2lyx/lyx2lyx === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx2lyx,v retrieving revision 1.20 diff -u -r1.20 lyx2lyx --- lib/lyx2lyx/lyx2lyx 15 Dec 2003 22:04:31 - 1.20 +++ lib/lyx2lyx/lyx2lyx 29 Dec 2003 14:50:29 - @@ -40,7 +40,7 @@ format = re.compile(r"(\d)[\.,]?(\d\d)") fileformat = re.compile(r"\\lyxformat\s*(\S*)") -lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228] +lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228, 229] def usage(): print """Usage: lyx2lyx [options] [file] Index: lib/lyx2lyx/lyxconvert_228.py === RCS file: lib/lyx2lyx/lyxconvert_228.py diff -N lib/lyx2lyx/lyxconvert_228.py --- /dev/null 1 Jan 1970 00:00:00 - +++ lib/lyx2lyx/lyxconvert_228.py 29 Dec 2003 14:50:29 - @@ -0,0 +1,24 @@ +# This file is part of lyx2lyx +# Copyright (C) 2003 José Matos <[EMAIL PROTECTED]> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + +def convert(header, body): +pass + +if __name__ == "__main__": +pass Index: lib/lyx2lyx/lyxrevert_229.py === RCS file: lib/lyx2lyx/lyxrevert_229.py diff -N lib/lyx2lyx/lyxrevert_229.py --- /dev/null 1 Jan 1970 00:00:00 - +++ lib/lyx2lyx/lyxrevert_229.py 29 Dec 2003 14:50:29 - @@ -0,0 +1,24 @@ +# This file is part of lyx2lyx +# Copyright (C) 2003 José Matos <[EMAIL PROTECTED]> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place
Re: [PATCH] Minipage removal
Juergen Spitzmueller wrote: > Angus Leeming wrote: >> Could you increase the LyX format by one please (src/buffer.C) and >> add a note to this effect in development/FORMAT. To that end, it >> would probably be best to create new lyxconvert/lyxrevert files >> too... > > I don't quite understand why this is necessary here, but anyway. What I meant was that this 'removal of InsetMinipage/conversion of InsetMinipage to InsetBox' is a format change and so should 1 be documented 2 be placed in its own lyx2lyx files, lyxconvert_228.py and lyxrevert_229.py. > Can you have a look at the attached patch before I apply, please? The bare bones lyxconvert_228.py and lyxrevert_229.py are pointless (as you say). Personally I'd move the conversion code into them. The more of these tiny files we have, the more likely José is to come up with a versioning system that separates file from format number ;-) > Thanks, > Jürgen. -- Angus
Re: [PATCH] Minipage removal
Angus Leeming wrote: > What I meant was that this 'removal of InsetMinipage/conversion of > InsetMinipage to InsetBox' is a format change and so should > 1 be documented > 2 be placed in its own lyx2lyx files, lyxconvert_228.py and > lyxrevert_229.py. Yes, this is certainly much cleaner. > The bare bones lyxconvert_228.py and lyxrevert_229.py are pointless > (as you say). Personally I'd move the conversion code into them. The > more of these tiny files we have, the more likely José is to come up > with a versioning system that separates file from format number ;-) Is the attached better? Jürgen. Index: development/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/development/ChangeLog,v retrieving revision 1.40 diff -u -r1.40 ChangeLog --- development/ChangeLog 15 Dec 2003 22:04:31 - 1.40 +++ development/ChangeLog 29 Dec 2003 15:28:00 - @@ -1,3 +1,7 @@ +2003-12-29 Jürgen Spitzmüller <[EMAIL PROTECTED]> + + * FORMAT: document change to format 229. + 2003-12-15 Angus Leeming <[EMAIL PROTECTED]> * FORMAT: document change to format 228. Index: development/FORMAT === RCS file: /usr/local/lyx/cvsroot/lyx-devel/development/FORMAT,v retrieving revision 1.20 diff -u -r1.20 FORMAT --- development/FORMAT 15 Dec 2003 22:04:31 - 1.20 +++ development/FORMAT 29 Dec 2003 15:28:01 - @@ -1,6 +1,12 @@ LyX file-format changes --- +2003-12-29 Jürgen Spitzmüller <[EMAIL PROTECTED]> + + * format incremented to 229. + * Minipages cannot be read anymore. All minipage insets will + be converted to frameless box insets between 228->229. + 2003-12-15 Angus Leeming <[EMAIL PROTECTED]> * format incremented to 228. Index: lib/lyx2lyx/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/ChangeLog,v retrieving revision 1.16 diff -u -r1.16 ChangeLog --- lib/lyx2lyx/ChangeLog 29 Dec 2003 12:56:09 - 1.16 +++ lib/lyx2lyx/ChangeLog 29 Dec 2003 15:28:04 - @@ -1,7 +1,9 @@ 2003-12-29 Jürgen Spitzmüller <[EMAIL PROTECTED]> + * lyx2lyx: up the format to 229. * lyxconvert_224.py (convert_minipage): remove function... - * lyxconvert_227.py: ...and place it here. + * lyxconvert_228.py: ...and place it here. + * lyxrevert_229.py: new file (bare bones). 2003-12-19 Angus Leeming <[EMAIL PROTECTED]> Index: lib/lyx2lyx/lyx2lyx === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx2lyx,v retrieving revision 1.20 diff -u -r1.20 lyx2lyx --- lib/lyx2lyx/lyx2lyx 15 Dec 2003 22:04:31 - 1.20 +++ lib/lyx2lyx/lyx2lyx 29 Dec 2003 15:28:04 - @@ -40,7 +40,7 @@ format = re.compile(r"(\d)[\.,]?(\d\d)") fileformat = re.compile(r"\\lyxformat\s*(\S*)") -lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228] +lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228, 229] def usage(): print """Usage: lyx2lyx [options] [file] Index: lib/lyx2lyx/lyxconvert_227.py === RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyxconvert_227.py,v retrieving revision 1.5 diff -u -r1.5 lyxconvert_227.py --- lib/lyx2lyx/lyxconvert_227.py 29 Dec 2003 12:56:10 - 1.5 +++ lib/lyx2lyx/lyxconvert_227.py 29 Dec 2003 15:28:04 - @@ -16,7 +16,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys -from parser_tools import find_token, find_tokens +from parser_tools import find_tokens def convert_collapsable(lines): i = 0 @@ -52,72 +52,8 @@ i = i + 1 -def convert_minipage(lines): -""" Convert minipages to the box inset. -We try to use the same order of arguments as lyx does. -""" -pos = ["t","c","b"] -inner_pos = ["c","t","b","s"] - -i = 0 -while 1: -i = find_token(lines, "\\begin_inset Minipage", i) -if i == -1: -return - -lines[i] = "\\begin_inset Box Frameless" -i = i + 1 - -# convert old to new position using the pos list -if lines[i][:8] == "position": -lines[i] = 'position "%s"' % pos[int(lines[i][9])] -else: -lines.insert(i, 'position "%s"' % pos[0]) -i = i + 1 - -lines.insert(i, 'hor_pos "c"') -i = i + 1 -lines.insert(i, 'has_inner_box 1') -i = i + 1 - -# convert the inner_position -if lines[i][:14] == "inner_position": -lines[i] = 'inner_pos "%s"' % inner_pos[int(lines[i][15])] -else: -lines.insert('inner_pos "%s"' % inner_pos[0]) -i = i + 1 - -# We need this since the new file format has a height and width -# in a different order. -if lines[i][:6] == "height": -height = lines[i][6:]
Re: [PATCH] Minipage removal
Juergen Spitzmueller wrote: >> The bare bones lyxconvert_228.py and lyxrevert_229.py are pointless >> (as you say). Personally I'd move the conversion code into them. >> The more of these tiny files we have, the more likely José is to >> come up with a versioning system that separates file from format >> number ;-) > > Is the attached better? My opinion? Yes. -- Angus
Re: [PATCH] Minipage removal
Angus Leeming wrote: > > Is the attached better? > > My opinion? If you are in the mood... > Yes. OK, then I apply this and hope to close the chapter "minipage insets" finally. Jürgen.
Fonts patch for LyX/Mac (1.3.4cvs)
The attached patch to 1.3.4cvs -- suggested by Jean-Marc -- lets LyX/Mac find additional fonts in its own application bundle. The addFontPath code works, but does not get called by qfont_loader::available. Instead, Qt finds fonts in the teTeX hierarchy which do the math symbols wrong. The only way I could get the addFontPath code invoked was with the ugly hack to qfont_loader::font_info::font_info. I'd welcome suggestions. Thanks, -- Ronald fonts.patch Description: Binary data
Re: [Patch] Moving functionality into layouts
On Mon, Dec 29, 2003 at 12:29:57PM +0100, Jean-Marc Lasgouttes spake thusly: > > > "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > Martin> See the attached. The idea is to make it possible to use > Martin> LatexParam more flexibly to add attributes to opening tags. > Martin> Work in progress. > > Martin> OK to commit? > > What does the # in latexparam mean? Here the counter expression is substituted. See output_docbook.C (the lines with subst()). > Do you really need to use ? I'd think that a simple \" would > work. This is self-implemented, see lyxlayout.C:338. I did try if \" worked, and it didn't. Still, I'm open to better suggestions, is a bit verbose. > Martin> Also one thing I still want to do, is make the CharStyle > Martin> insets (I'm still thinking of them as Element insets :-) > Martin> enabled only if they are inside the right paragraph style, > Martin> like Jean-Marc did with ShortTitle. This will structure the > Martin> situation especially for editing the header. > > How do you plan to do this? A list of layouts that accept a given > CharStyle? Yes... as a parameter within that CharStyle definition. "AllowedIn" or something, with a comma separated arg list. > JMarc - Martin pgp0.pgp Description: PGP signature
Re: Unable to run 1.4cvs qt-lyx
-BEGIN PGP SIGNED MESSAGE- On Sonntag, 21. Dezember 2003 14:32, Atsushi Shimmra wrote: > Kornel Benko wrote: > > > Upgrading to SuSE 9.0 (with QT 3.2.1-56 and gcc 3.3.1), I have now problems to > > launch the qt-lyx. > > > > It crashes in call to QFontInfo() in src/frontends/qt2/lyx_gui.C:291 > > Me , too. > Ok, so I was not the only one ... As nobody else cares, I tried to look into this. The problem here is, that QFontInfo(font).family().latin1() returns NULL. The conversion to "string" afterwards leads to crash. Changing lines return QFontInfo(font).family().latin1(); to const char *x = QFontInfo(font).family().latin1(); return x?x:""; gives me at least a working qt-lyx version. May this be of some help to anyone? Kornel - -- Kornel Benko [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iQCVAwUBP/BpPrewfbDGmeqhAQHL6AP/TNVYXybOyGjEk7xWU8kerXfXAEQhqP0P WBLWqhDHzxjODKoHUyr9xv47+c0f+KNpNclCpsNYGHw8lZGg4HDGGskhCZS0T322 H4HS5gGzc3IuAI390tDi0mcMILXg5E4EIFaLsL/tUuycv8zPISWfwxdmMMrjzYTz 04GvkqyLdI4= =Ag/M -END PGP SIGNATURE-
Qt help needed
The patch below prevents a crash in the xforms frontend when launching the File Browser dialog from the External dialog. The problem was that this string, used to specify the file filter: "*.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm|xbm)" was being modified in ControlExternal to this: "*.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm" Converting this glob to a regex: ".*\.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm" lead to boost::regex bailing out (invalid regex --- no closing ')'). Clearly, the code I've removed was put there for a reason, but I think that it is now redundant. Any objections if I simply remove it? However, the main point of this mail is to ask what I need to do to get the Qt frontend to understand the filter "*.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm|xbm)" Any idea what the Qt-version would need to be? Angus diff -u -p -r1.30 FileDialog.C --- src/frontends/xforms/FileDialog.C 6 Oct 2003 15:42:53 - 1.30 +++ src/frontends/xforms/FileDialog.C 29 Dec 2003 18:20:11 - @@ -65,14 +65,8 @@ FileDialog::Result const FileDialog::ope FileDialog::Result const FileDialog::open(string const & path, string const & mask, string const & suggested) { string filter = mask; - - if (mask.empty()) - filter = _("*"); - else { - rsplit(mask, filter, '|'); - if (filter.empty()) - filter = mask; - } + if (filter.empty()) + filter = "*"; lyxerr[Debug::GUI] << "filedialog open with path \"" << path << "\", mask \"" << filter << "\", suggested \"" << suggested << '"' << endl;
Re: Qt help needed
Angus Leeming wrote: > However, the main point of this mail is to ask what I need to do to > get the Qt frontend to understand the filter > "*.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm|xbm)" > > Any idea what the Qt-version would need to be? H. I've just realised that "*.(gif|png|jpg|bmp|pbm|ppm|tga|tif|xpm|xbm)" isn't a valid glob. Moreover, Qt uses a (rather elegant) notation, of the form: "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" Rather than reinvent the wheel, I propose we use this notation ourselves and make the xforms frontend jump through a few hoops. Objections? Angus ps the xforms file dialog code is foul... A
Re: Most wanted feature: Spell as you type
Christian Ridderström wrote: >> > I've _suffered_ this "feature" in MS-Word... for me, the main problem >> > was the distraction from content. E.g., I frequently found myself >> > spending time on fixing spelling(*) instead of content -- I prefer >> > checking spelling at the end, when the content is there. >> >> Well, you can turn it off, right? (honest question). > [...] > * Not having used Word seriously before, I didn't feel like looking >through the menu system in order to disable it. That is quite unusual and not representative for any power user. -- Moritz Moeller-Herrmann [EMAIL PROTECTED] wiss. Mitarbeiter, IMGB La loi, dans un grand souci d'égalité, interdit aux riches comme aux pauvres de coucher sous les ponts, de mendier dans les rues et de voler du pain. (ANATOLE FRANCE)