Re: Solving the Meta/Control key swap problem on Mac OS X
Jens Nöckel wrote: Another version of the patch is attached, this time hopefully readable by everyone... no its octet-stream now. next guess is .txt :) cant be this code: +// GUI_DONTSWAPCB_VISIBLE reveals checkbox for switching Ctrl and Meta on Mac: +#ifdef Q_WS_MACX +#if QT_VERSION 0x040600 + connect(dontswapCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); +#define GUI_DONTSWAPCB_VISIBLE true +#endif +#endif +#ifndef GUI_DONTSWAPCB_VISIBLE + dontswapCB-setVisible(false); +#endif written as: + connect(dontswapCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); +#ifdef Q_WS_MACX +#if QT_VERSION 0x040600 + dontswapCB-setVisible(false); +#endif ? pavel
Re: pref2pref
Richard Heck wrote: I'm assuming that, as with layouts, LyX should only convert the file internally, leaving the original file as is. Unless, of course, you then make some modification (to shortcuts, say, or to preferences). Then LyX will have to write the file in the format of whatever version you are using. But this is already true. ahaaa, then its completely fine. As with layout2layout, again, I don't see a need to provide for reversion. OK? yes. pavel
Re: Patch: Diagram inset
Ronen Abravanel wrote: Pavel -- Thanks. I removed big portion of the code that was not needed. good news I can refactor both XYMatrix and Diagram class to have one common base class, but it will take me a while. How urgent things should be ready for 2.0? personally i would prefer not to touch XYMatrix ;) (basically because i dont know all its features and can't test whether we killed something...) so my proposal was rather that Diagram would be child of XYMatrix, althought i understand the philosophical point behind common virtual class. so in case other devs are not against, i would choose the simpler route... but as i have written before the class is so small that i would accept even the current version if the inheritance bussiness makes things complicated ;) +def revert_diagram(document): + i = 0 + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) + while True: +i = find_token(document.body, '\\begin_inset Formula', i) +if i == -1: + print returning debug output is not needed + return +j = find_end_of_inset(document.body, i) +if j == -1: +print Melformed document! typo +return +m = re_diagram.search(\n.join(document.body[i:j])) i'm surprised about this newline, but you are right its there. strange. i still think the postscript output will be the same but who knows... + * \file InsetMathDiagram.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author André Pönitz +* \author Ronen Abravanel whitespace pavel
Re: When preview is on
Ronen Abravanel wrote: Currently, in Lyx 2.0, there are 3 modes for preview: * On -- Preview is working for math and preview-inset * No math -- * Off My 1st question is what the different between no math and Off? what else is previewed other than math and preview inset? for example external insets use this mechanism to render pictures My second concern is the reason this mail is on the developers list: Is there any reason no to separate the rendering of the preview-inset from regular math? for 98 percent of my math -- I prefer it will not be rendered. But for the other two percent -- the diagrams (either using \xymatrix, the new \Diagram inset, or just plain-old ERT), I would really like to be previewed. If it's some arbitrary decision, and you didn't thought it's important, I'll be happy to try and do the change.. original author is currently away... personally i have no problem with separating it. i guess that you would be happy to connect no math with your usecase? (although i'll be happy for some pointers, as I don't yet very familiar with lyx' code). for the insetpreview part, quick peek gives two possibly interesting commits 38890, 33890: git log --author=vfr |grep -A2 InsetPreview New file format for InsetPreview introduced in r38890. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/tr...@33891 a592a061-630c-0410-9148-cb99ea01b6c8 -- Introduce InsetPreview. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/tr...@33890 a592a061-630c-0410-9148-cb99ea01b6c8 pavel
Re: Thesaurus feature (trunk)
Kornel Benko wrote: Yes, but this is not the point I meant. What is the point, then? Jürgen
Re: Please, verify the INSTALL on MacOSX document...
Am 19.09.2010 um 03:33 schrieb BH: On Mon, Sep 6, 2010 at 7:56 AM, Stephan Witt st.w...@gmx.net wrote: Am 06.09.2010 um 13:46 schrieb BH: I tried this out with a new Mac, and it works well. I did not compile aspell or test Tiger or 64-bit support. Thanks for your comments. A couple of minor comments, with my numbering following that of INSTALL.MacOSX: PREREQUISITES 1. Can Qt be installed from Nokia's .dmg, or must it be self-compiled? I followed the instructions to compile it myself, and it worked with no problems, but if that's not necessary, it might be worth making it clearer. Yes, you're right. I'll check and add that - if LyX can be compiled with Nokia's .dmg. I think it's the case - but I want to be sure. So, I'll test it. 2. The version of automake macports installed is 2.67, which autogen.sh rejected. (It wants only automake 2.65.) So I had to edit autogen.sh to allow 2.67, which worked fine. Do you mean *autoconf* 2.67? That one I didn't notice since I have an older version. Didn't update macports a while. We should test that on Linux and change autogen.sh if it works. Pavel, what do you think? BUILD INSTRUCTIONS 1. Environment (a) ... We have to change that with if on that build system. Should this be: We have to change that if not on that build system? I'm not sure about the grammar... I meant We have to change the default if using that build system. That's it. Nice job with the clear documentation ... and nice work on LyX/Mac quite generally. It's coming along great! Thanks. Am 19.09.2010 um 06:26 schrieb Jens Nöckel: On Sep 18, 2010, at 6:33 PM, BH wrote: That's it. Nice job with the clear documentation ... and nice work on LyX/Mac quite generally. It's coming along great! Hi Bennett, I agree the INSTALL.MacOSX is now much more comprehensive and useful! I had to make some adjustments though, because I compiled on a machine where I use fink instead of MacPorts (our newest Mac uses MacPorts, but I'm not compiling LyX on that one... just to make life more interesting). This configuration I don't have. Nice to get some feedback from you. So in my case, here is a summary of the steps, assuming you have autoconf, gettext and pkgconfig from fink: 1) Compile qt-everywhere-opensource-src-4.6.3 (universal without Tiger) as in step 1 of INSTALL.MacOSX. The download location for the source is ftp://ftp.qt.nokia.com/qt/source/ (which may be a little hard to find if you're following the link given in INSTALL.MacOSX) I'll add that link. 2) Then to build LyX from SVN, download the source using svn co svn://svn.lyx.org/lyx/lyx-devel/trunk lyx-devel I'm not sure if I'd like to mention that. If one is able to read INSTALL.MacOSX it is somehow done - and may very well be a tarball download instead. Set I the following flags (assuming bash syntax): export CFLAGS=-arch i386 export CXXFLAGS=-arch i386 export OBJCFLAGS=-arch i386 export LDFLAGS=-framework Carbon -framework AppKit -arch i386 This differs from INSTALL.MacOSX because my version of pkgconfig wasn't clever enough to detect the framework dependencies automatically. My current version of INSTALL.MacOSX mentions here: export LDFLAGS=$LDFLAGS -framework ApplicationServices -framework Cocoa -framework AppKit I've learned it from pkgconfig guesses for Qt4. So, you're saying -framework ApplicationServices is not needed? I'll remove it from INSTALL.MacOSX then... Next, in the lyx-devel directory, I did: ./autogen.sh ./configure --with-version-suffix=-2.0 --disable-stdlib-debug --prefix=PATH/TO/LyX.app --with-qt4-dir=/path/to/QT4 --with-libiconv-prefix=/usr make make install-strip The libiconv prefix needed to be specified on the configure line to avoid loading an older version of that library installed by fink. This is a good idea. The --with-libiconv-prefix=/usr option should be used in any case. I had problems with the macports version, too. I'll add that. That's how things worked for me. Thank you for the feedback. Stephan
Re: r35445 - lyx-devel/trunk
sa...@lyx.org wrote: Author: sanda Date: Sun Sep 19 13:58:35 2010 New Revision: 35445 URL: http://www.lyx.org/trac/changeset/35445 Log: Allow autoconf 2.67, tested on linux. Juergen?
Re: Small glitch in spellchecker (trunk)
Am 18.09.2010 um 09:36 schrieb Stephan Witt: Am 18.09.2010 um 09:12 schrieb Kornel Benko: Am Freitag 17 September 2010 schrieb Kornel Benko: Am Freitag 17 September 2010 schrieb Kornel Benko: I attach a test-case. The spell-checker even marks the word as english after accepting ... Which word? But this happens only, if continuous spellchecking is set. Ok, I understood your scenario finally. Right click presents speller suggestions only when continuous spellchecking is active. Kornel Now it's working again. ... From now on I was unable to put it to my previous erroneous state. Is there something cached? Through sessions? There is a non-persistent cache per paragraph for the positions of spell errors. This cache is bypassed with check_learned = true for word-wise checks. The cache is not written to disk - at least I have not coded that. I'll see if the cache is not invalidated when you accept a suggestion of the speller. The replaced word is checked again, the rest of the cache is untouched (and valid). But I had to correct the 2nd try. Now it should really work. The original problem I cannot reproduce. Obviously the quality of the dictionaries matters to. The abbreviation ggf. is not misspelled for the 1st try because the word ggf is already accepted. Here you can see the problems with word-wise checking. Apples native spell checker rejects ggf but accepts ggf. It has it's own problems though. When editing the check of the currently changed word is not good enough then. But the whole thing should be better then before now. Stephan
Re: Thesaurus feature (trunk)
Am Sonntag 19 September 2010 schrieb Jürgen Spitzmüller: Kornel Benko wrote: Yes, but this is not the point I meant. What is the point, then? Jürgen In a multilingual document it came handy to have the default language for thesaurus being that of the word instead of the document Kornel signature.asc Description: This is a digitally signed message part.
Re: Small glitch in spellchecker (trunk)
Am Sonntag 19 September 2010 schrieb Stephan Witt: Am Freitag 17 September 2010 schrieb Kornel Benko: Am Freitag 17 September 2010 schrieb Kornel Benko: I attach a test-case. The spell-checker even marks the word as english after accepting ... Which word? There is this sentence in a a document with a default of german language value ( ggf. (value is marked as british english) The spellchecker did not accept ggf., instead ggf was selected and a set of suggestions displayed. Also ggf.. Accepting this, resulted in the sentence value ( ggf.. while ggf. was marked as english now. Kornel signature.asc Description: This is a digitally signed message part.
Re: Small glitch in spellchecker (trunk)
Am 19.09.2010 um 14:36 schrieb Kornel Benko: Am Sonntag 19 September 2010 schrieb Stephan Witt: Am Freitag 17 September 2010 schrieb Kornel Benko: Am Freitag 17 September 2010 schrieb Kornel Benko: I attach a test-case. The spell-checker even marks the word as english after accepting ... Which word? There is this sentence in a document with a default of german language value ( ggf. (value is marked as british english) The spellchecker did not accept ggf., instead ggf was selected and a set of suggestions displayed. Also ggf.. Accepting this, resulted in the sentence value ( ggf.. while ggf. was marked as english now. Sorry, I cannot confirm that. Neither on Mac nor on Linux. Stephan
Re: r35369 - lyx-devel/trunk/src
On 16/09/2010 17:31, Stephan Witt wrote: Am 14.09.2010 um 15:46 schrieb Abdelrazak Younes: On 09/14/2010 02:48 PM, sw...@lyx.org wrote: Author: switt Date: Tue Sep 14 14:48:03 2010 New Revision: 35369 URL: http://www.lyx.org/trac/changeset/35369 Log: reduce nesting levels in markMisspelledWords; simplify range check of fontspan I have a compile error: /home/younes/devel/lyx/trunk/src/Paragraph.cpp: In member function ‘void lyx::Paragraph::Private::markMisspelledWords(const lyx::pos_type, const lyx::pos_type, lyx::SpellChecker::Result, const lyx::docstring, const std::vectorlong int, std::allocatorlong int )’: /home/younes/devel/lyx/trunk/src/Paragraph.cpp:3538: error: no matching function for call to ‘lyx::Paragraph::Private::countSoftbreaks(__gnu_cxx::__normal_iteratorconst long int*, std::vectorlong int, std::allocatorlong int, __gnu_cxx::__normal_iteratorconst long int*, std::vectorlong int, std::allocatorlong int, int)’ /home/younes/devel/lyx/trunk/src/Paragraph.cpp:366: note: candidates are: int lyx::Paragraph::Private::countSoftbreaks(__gnu_cxx::__normal_iteratorconst long int*, std::vectorlong int, std::allocatorlong int, __gnu_cxx::__normal_iteratorconst long int*, std::vectorlong int, std::allocatorlong int, lyx::pos_type) const make[2]: *** [src/CMakeFiles/lyx2.0.dir/home/younes/devel/lyx/trunk/src/Paragraph.cpp.o] Error 1 Abdel. Of course the function Paragraph::Private::countSoftbreaks() should have int argument, but why did it compile here with gcc 4.2.1 on Mac and gcc 4.4 on Linux? What's your environment? Kubuntu 10.04, gcc-4.3 I believe. Another question: I want to replace the map of the speller state by a vector to make it more similar to the FontList. The patch is attached. Is it ok? Sorry, no time but it seems to remove code so, if that doesn't introduce regression in performance this has to be good. Abdel.
Re: Small glitch in spellchecker (trunk)
Am Sonntag 19 September 2010 schrieb Stephan Witt: while ggf. was marked as english now. Sorry, I cannot confirm that. Neither on Mac nor on Linux. I was describing the behaviour which I _had_. Now I don't see it also. Kornel signature.asc Description: This is a digitally signed message part.
Re: Please, verify the INSTALL on MacOSX document...
On Sun, Sep 19, 2010 at 6:43 AM, Stephan Witt st.w...@gmx.net wrote: Am 19.09.2010 um 03:33 schrieb BH: ... 2. The version of automake macports installed is 2.67, which autogen.sh rejected. (It wants only automake 2.65.) So I had to edit autogen.sh to allow 2.67, which worked fine. Do you mean *autoconf* 2.67? Yes. That one I didn't notice since I have an older version. Didn't update macports a while. We should test that on Linux and change autogen.sh if it works. Pavel, what do you think? BUILD INSTRUCTIONS 1. Environment (a) ... We have to change that with if on that build system. Should this be: We have to change that if not on that build system? I'm not sure about the grammar... I meant We have to change the default if using that build system. Yes -- that's right. (I was getting myself confused) BH
Re: #6906: GNU/Hurd build failure because of PATH_MAX usage
LyX Ticket Tracker, le Sun 19 Sep 2010 13:12:51 -, a écrit : i'm no expert on glibc, but man pages explicitly states that realpath shouldn't be used at all. Please update your manpages. “The resolved_path == NULL feature, not standardized in POSIX.1-2001, but standardized in POSIX.1-2008, allows this design problem to be avoided.” what is the correct fix for hurd then? This is precisely the correct fix: just using POSIX 2008's behavior, already available in glibc since ages. i'm also not happy about the ifdefs. does canonicalize_file_name works on hurd? Sure, since hurd's libc is glibc. i would rather try to put it there unconditionally if possible. Put what? canonicalize_file_name is only a glibc extension so you'd need at least detection of this feature. Samuel
Re: Solving the Meta/Control key swap problem on Mac OS X
On Sep 19, 2010, at 12:02 AM, Pavel Sanda wrote: Jens Nöckel wrote: Another version of the patch is attached, this time hopefully readable by everyone... no its octet-stream now. next guess is .txt :) Or using a different mailer, sigh. cant be this code: +// GUI_DONTSWAPCB_VISIBLE reveals checkbox for switching Ctrl and Meta on Mac: +#ifdef Q_WS_MACX +#if QT_VERSION 0x040600 + connect(dontswapCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); +#define GUI_DONTSWAPCB_VISIBLE true +#endif +#endif +#ifndef GUI_DONTSWAPCB_VISIBLE + dontswapCB-setVisible(false); +#endif written as: + connect(dontswapCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); +#ifdef Q_WS_MACX +#if QT_VERSION 0x040600 + dontswapCB-setVisible(false); +#endif No, this would be the wrong way around. If you really want even fewer #ifdef, one could say this: + connect(dontswapCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); + dontswapCB-setVisible(false); +#ifdef Q_WS_MACX +#if QT_VERSION 0x040600 + dontswapCB-setVisible(true); +#endif But then the actual code on Mac would execute two calls to setVisible instead of one, which just seems slightly more inelegant. Jens
Re: #6906: GNU/Hurd build failure because of PATH_MAX usage
Samuel Thibault wrote: LyX Ticket Tracker, le Sun 19 Sep 2010 13:12:51 -, a écrit : i'm no expert on glibc, but man pages explicitly states that realpath shouldn't be used at all. Please update your manpages. why not if you give me root access on that box ;) what is the correct fix for hurd then? This is precisely the correct fix: just using POSIX 2008's behavior, already available in glibc since ages. i hope those ages also cover the distros still shipping apparently old man pages because otherwise this fix will introduce new bugs on other platforms than hurd. Sure, since hurd's libc is glibc. i would rather try to put it there unconditionally if possible. Put what? canonicalize_file_name is only a glibc extension so you'd need at least detection of this feature. to reformulate my question: is there posix solution without ifdefs? thanks, pavel
Re: Patch: Diagram inset
On Sun, Sep 19, 2010 at 3:35 AM, Pavel Sanda sa...@lyx.org wrote: Ronen Abravanel wrote: Pavel -- Thanks. I removed big portion of the code that was not needed. good news I can refactor both XYMatrix and Diagram class to have one common base class, but it will take me a while. How urgent things should be ready for 2.0? personally i would prefer not to touch XYMatrix ;) (basically because i dont know all its features and can't test whether we killed something...) so my proposal was rather that Diagram would be child of XYMatrix, althought i understand the philosophical point behind common virtual class. so in case other devs are not against, i would choose the simpler route... but as i have written before the class is so small that i would accept even the current version if the inheritance bussiness makes things complicated ;) +def revert_diagram(document): + i = 0 + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) + while True: +i = find_token(document.body, '\\begin_inset Formula', i) +if i == -1: + print returning debug output is not needed + return +j = find_end_of_inset(document.body, i) +if j == -1: +print Melformed document! typo +return +m = re_diagram.search(\n.join(document.body[i:j])) i'm surprised about this newline, but you are right its there. strange. i still think the postscript output will be the same but who knows... + * \file InsetMathDiagram.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author André Pönitz +* \author Ronen Abravanel whitespace pavel diff -rupN lyx-2.0.0alpha6/lib/lyx2lyx/lyx_2_0.py lyx-2.0.0alpha6_feynFinal/lib/lyx2lyx/lyx_2_0.py --- lyx-2.0.0alpha6/lib/lyx2lyx/lyx_2_0.py 2010-09-15 16:33:40.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/lib/lyx2lyx/lyx_2_0.py 2010-09-19 10:49:58.0 -0400 @@ -1568,7 +1568,6 @@ def revert_fontcolor(document): + ', ' + str(blueout) + '}\n' + '\\color{document_fontcolor}\n') - def revert_shadedboxcolor(document): Reverts shaded box color to preamble code i = 0 @@ -2161,6 +2160,26 @@ def revert_rule(document): else: return +def revert_diagram(document): + i = 0 + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) + while True: +i = find_token(document.body, '\\begin_inset Formula', i) +if i == -1: + return +j = find_end_of_inset(document.body, i) +if j == -1: +document.warning(Malformed LyX document: Can't find end of line inset.) +return +m = re_diagram.search(\n.join(document.body[i:j])) +if not m: + i += 1 + continue +add_to_preamble(document, \\use_package{feyn}) +# only need to do it once! +return + + ## # Conversion hub @@ -2221,10 +2240,12 @@ convert = [[346, []], [397, [remove_Nameref]], [398, []], [399, [convert_mathdots]], - [400, [convert_rule]] + [400, [convert_rule]], + [401, []] ] -revert = [[399, [revert_rule]], +revert = [[400, [revert_diagram]], + [399, [revert_rule]], [398, [revert_mathdots]], [397, [revert_mathrsfs]], [396, []], diff -rupN lyx-2.0.0alpha6/src/Buffer.cpp lyx-2.0.0alpha6_feynFinal/src/Buffer.cpp --- lyx-2.0.0alpha6/src/Buffer.cpp 2010-09-15 16:33:41.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/Buffer.cpp 2010-09-18 22:33:25.0 -0400 @@ -127,7 +127,7 @@ namespace { // Do not remove the comment below, so we get merge conflict in // independent branches. Instead add your own. -int const LYX_FORMAT = 400; // uwestoehr: support for \rule +int const LYX_FORMAT = 401; // uwestoehr: support for \rule \\Ronen: support for \Diagrasr typedef mapstring, bool DepClean; typedef mapdocstring, pairInsetLabel const *, Buffer::References RefCache; diff -rupN lyx-2.0.0alpha6/src/insets/InsetCode.h lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h --- lyx-2.0.0alpha6/src/insets/InsetCode.h 2010-09-15 16:33:43.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h 2010-09-18 21:22:40.0 -0400 @@ -223,6 +223,8 @@ enum InsetCode { /// PREVIEW_CODE, /// + MATH_DIAGRAM_CODE, + /// INSET_CODE_SIZE, }; diff -rupN lyx-2.0.0alpha6/src/insets/Inset.cpp lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp --- lyx-2.0.0alpha6/src/insets/Inset.cpp 2010-09-15 16:33:42.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp 2010-09-18 21:23:37.0 -0400 @@ -168,6 +168,7 @@ static void build_translator() insetnames[MATH_XARROW_CODE] = InsetName(mathxarrow); insetnames[MATH_XYARROW_CODE] = InsetName(mathxyarrow); insetnames[MATH_XYMATRIX_CODE] = InsetName(mathxymatrix); + insetnames[MATH_DIAGRAM_CODE] = InsetName(mathdiagram);
Re: Solving the Meta/Control key swap problem on Mac OS X
Jens Nöckel wrote: + connect(dontswapCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); + dontswapCB-setVisible(false); +#ifdef Q_WS_MACX +#if QT_VERSION 0x040600 + dontswapCB-setVisible(true); +#endif But then the actual code on Mac would execute two calls to setVisible instead of one, which just seems slightly more inelegant. i see. what you feel better with bool swapcb=false; #ifdef Q_WS_MACX #if QT_VERSION 0x040600 swapcb=true; #endif dontswapCB-setVisible(swapcb); pavel
Re: Solving the Meta/Control key swap problem on Mac OS X
On Sep 19, 2010, at 8:25 AM, Pavel Sanda wrote: Jens Nöckel wrote: + connect(dontswapCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); + dontswapCB-setVisible(false); +#ifdef Q_WS_MACX +#if QT_VERSION 0x040600 + dontswapCB-setVisible(true); +#endif But then the actual code on Mac would execute two calls to setVisible instead of one, which just seems slightly more inelegant. i see. what you feel better with bool swapcb=false; #ifdef Q_WS_MACX #if QT_VERSION 0x040600 swapcb=true; #endif dontswapCB-setVisible(swapcb); pavel That's perfect - please feel free to modify my patch this way. Jens
Re: #6906: GNU/Hurd build failure because of PATH_MAX usage
Pavel Sanda, le Sun 19 Sep 2010 16:59:52 +0200, a écrit : Samuel Thibault wrote: LyX Ticket Tracker, le Sun 19 Sep 2010 13:12:51 -, a écrit : i'm no expert on glibc, but man pages explicitly states that realpath shouldn't be used at all. Please update your manpages. why not if you give me root access on that box ;) Well, any linux box with manpages = 3.20 will have that latest text. Take debian's http://ftp.de.debian.org/debian/pool/main/m/manpages/manpages_3.25.orig.tar.gz for instance. what is the correct fix for hurd then? This is precisely the correct fix: just using POSIX 2008's behavior, already available in glibc since ages. i hope those ages also cover the distros still shipping apparently old man pages because otherwise this fix will introduce new bugs on other platforms than hurd. The old manpages still do say that glibc allocates memory in that case, so it'll work there. They are saying it's not a good idea to rely on it because it's a glibc extension, but in my patch I'm precisely using it only with glibc, so it's completely fine. And when I say ages, I mean it: it was added in 1996... Sure, since hurd's libc is glibc. i would rather try to put it there unconditionally if possible. Put what? canonicalize_file_name is only a glibc extension so you'd need at least detection of this feature. to reformulate my question: is there posix solution without ifdefs? No. That's one of the biggest mistakes of Posix. Samuel
Re: #6906: GNU/Hurd build failure because of PATH_MAX usage
Samuel Thibault wrote: And when I say ages, I mean it: it was added in 1996... ok, thanks for responses. i will commit this for 2.0. pavel
Re: Patch: Diagram inset
On 9/19/10 11:19 AM, Ronen Abravanel wrote: +def revert_diagram(document): + i = 0 + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) + while True: +i = find_token(document.body, '\\begin_inset Formula', i) +if i == -1: + return +j = find_end_of_inset(document.body, i) +if j == -1: +document.warning(Malformed LyX document: Can't find end of line inset.) +return +m = re_diagram.search(\n.join(document.body[i:j])) +if not m: + i += 1 + continue +add_to_preamble(document, \\use_package{feyn}) +# only need to do it once! +return + + Like Pavel, I'm a bit puzzled by this. I see the newline in InsetXYMatrix::write() and now in your code, but I hadn't realized we put newlines into the math stuff. Anyway, better not to assume they're not there. +int const LYX_FORMAT = 401; // uwestoehr: support for \rule \\Ronen: support for \Diagrasr You can take Uwe's comment out, which applied to format 400, and just have yours. The main thing is just to have a comment there. Otherwise looks fine to me, though I'm not expert on the math stuff. rh
Re: When preview is on
It seems that that simple patch do the trick (Preview is rendered on Instant Preview - On OR No math..) On Sun, Sep 19, 2010 at 3:48 AM, Pavel Sanda sa...@lyx.org wrote: Ronen Abravanel wrote: Currently, in Lyx 2.0, there are 3 modes for preview: * On -- Preview is working for math and preview-inset * No math -- * Off My 1st question is what the different between no math and Off? what else is previewed other than math and preview inset? for example external insets use this mechanism to render pictures My second concern is the reason this mail is on the developers list: Is there any reason no to separate the rendering of the preview-inset from regular math? for 98 percent of my math -- I prefer it will not be rendered. But for the other two percent -- the diagrams (either using \xymatrix, the new \Diagram inset, or just plain-old ERT), I would really like to be previewed. If it's some arbitrary decision, and you didn't thought it's important, I'll be happy to try and do the change.. original author is currently away... personally i have no problem with separating it. i guess that you would be happy to connect no math with your usecase? (although i'll be happy for some pointers, as I don't yet very familiar with lyx' code). for the insetpreview part, quick peek gives two possibly interesting commits 38890, 33890: git log --author=vfr |grep -A2 InsetPreview New file format for InsetPreview introduced in r38890. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/tr...@33891a592a061-630c-0410-9148-cb99ea01b6c8 -- Introduce InsetPreview. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/tr...@33890a592a061-630c-0410-9148-cb99ea01b6c8 pavel --- lyx-2.0.0alpha6_feyn/src/insets/InsetPreview.cpp 2010-09-15 16:33:43.0 -0400 +++ lyx-2.0.0alpha6/src/insets/InsetPreview.cpp 2010-09-19 11:56:12.0 -0400 @@ -78,7 +78,7 @@ void InsetPreview::preparePreview(DocIte bool InsetPreview::previewState(BufferView * bv) const { - if (!editing(bv) RenderPreview::status() == LyXRC::PREVIEW_ON) { + if (!editing(bv) (RenderPreview::status() == LyXRC::PREVIEW_ON || RenderPreview::status() == LyXRC::PREVIEW_NO_MATH)) { graphics::PreviewImage const * pimage = preview_-getPreviewImage(bv-buffer()); return pimage pimage-image();
Re: Patch: Diagram inset
On Sun, Sep 19, 2010 at 11:46 AM, Richard Heck rgh...@comcast.net wrote: On 9/19/10 11:19 AM, Ronen Abravanel wrote: +def revert_diagram(document): + i = 0 + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) + while True: +i = find_token(document.body, '\\begin_inset Formula', i) +if i == -1: + return +j = find_end_of_inset(document.body, i) +if j == -1: +document.warning(Malformed LyX document: Can't find end of line inset.) +return +m = re_diagram.search(\n.join(document.body[i:j])) +if not m: + i += 1 + continue +add_to_preamble(document, \\use_package{feyn}) +# only need to do it once! +return + + Like Pavel, I'm a bit puzzled by this. I see the newline in InsetXYMatrix::write() and now in your code, but I hadn't realized we put newlines into the math stuff. Anyway, better not to assume they're not there. I don't understand how all this mechanism works. I just assume the XTMatrix works, and then change the things I do understand. +int const LYX_FORMAT = 401; // uwestoehr: support for \rule \\Ronen: support for \Diagrasr You can take Uwe's comment out, which applied to format 400, and just have yours. The main thing is just to have a comment there. Otherwise looks fine to me, though I'm not expert on the math stuff. rh (The only part changes now: The comment in Buffer.cpp) diff -rupN lyx-2.0.0alpha6/lib/lyx2lyx/lyx_2_0.py lyx-2.0.0alpha6_feynFinal/lib/lyx2lyx/lyx_2_0.py --- lyx-2.0.0alpha6/lib/lyx2lyx/lyx_2_0.py 2010-09-15 16:33:40.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/lib/lyx2lyx/lyx_2_0.py 2010-09-19 10:49:58.0 -0400 @@ -1568,7 +1568,6 @@ def revert_fontcolor(document): + ', ' + str(blueout) + '}\n' + '\\color{document_fontcolor}\n') - def revert_shadedboxcolor(document): Reverts shaded box color to preamble code i = 0 @@ -2161,6 +2160,26 @@ def revert_rule(document): else: return +def revert_diagram(document): + i = 0 + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) + while True: +i = find_token(document.body, '\\begin_inset Formula', i) +if i == -1: + return +j = find_end_of_inset(document.body, i) +if j == -1: +document.warning(Malformed LyX document: Can't find end of line inset.) +return +m = re_diagram.search(\n.join(document.body[i:j])) +if not m: + i += 1 + continue +add_to_preamble(document, \\use_package{feyn}) +# only need to do it once! +return + + ## # Conversion hub @@ -2221,10 +2240,12 @@ convert = [[346, []], [397, [remove_Nameref]], [398, []], [399, [convert_mathdots]], - [400, [convert_rule]] + [400, [convert_rule]], + [401, []] ] -revert = [[399, [revert_rule]], +revert = [[400, [revert_diagram]], + [399, [revert_rule]], [398, [revert_mathdots]], [397, [revert_mathrsfs]], [396, []], diff -rupN lyx-2.0.0alpha6/src/Buffer.cpp lyx-2.0.0alpha6_feynFinal/src/Buffer.cpp --- lyx-2.0.0alpha6/src/Buffer.cpp 2010-09-15 16:33:41.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/Buffer.cpp 2010-09-18 22:33:25.0 -0400 @@ -127,7 +127,7 @@ namespace { // Do not remove the comment below, so we get merge conflict in // independent branches. Instead add your own. -int const LYX_FORMAT = 400; // uwestoehr: support for \rule +int const LYX_FORMAT = 401; // Ronen: support for \Diagram typedef mapstring, bool DepClean; typedef mapdocstring, pairInsetLabel const *, Buffer::References RefCache; diff -rupN lyx-2.0.0alpha6/src/insets/InsetCode.h lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h --- lyx-2.0.0alpha6/src/insets/InsetCode.h 2010-09-15 16:33:43.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h 2010-09-18 21:22:40.0 -0400 @@ -223,6 +223,8 @@ enum InsetCode { /// PREVIEW_CODE, /// + MATH_DIAGRAM_CODE, + /// INSET_CODE_SIZE, }; diff -rupN lyx-2.0.0alpha6/src/insets/Inset.cpp lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp --- lyx-2.0.0alpha6/src/insets/Inset.cpp 2010-09-15 16:33:42.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp 2010-09-18 21:23:37.0 -0400 @@ -168,6 +168,7 @@ static void build_translator() insetnames[MATH_XARROW_CODE] = InsetName(mathxarrow); insetnames[MATH_XYARROW_CODE] = InsetName(mathxyarrow); insetnames[MATH_XYMATRIX_CODE] = InsetName(mathxymatrix); + insetnames[MATH_DIAGRAM_CODE] = InsetName(mathdiagram); insetnames[MATH_MACRO_CODE] = InsetName(mathmacro); passed = true; diff -rupN lyx-2.0.0alpha6/src/LaTeXFeatures.cpp lyx-2.0.0alpha6_feynFinal/src/LaTeXFeatures.cpp --- lyx-2.0.0alpha6/src/LaTeXFeatures.cpp 2010-09-15 16:33:41.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/LaTeXFeatures.cpp 2010-09-18
Re: Patch: Diagram inset
Ronen Abravanel wrote: (The only part changes now: The comment in Buffer.cpp) i'll wait day more if somebody else has comments and then commit. also post the example file... good work, pavel
Re: Thesaurus feature (trunk)
Kornel Benko wrote: In a multilingual document it came handy to have the default language for thesaurus being that of the word instead of the document Probably my previous answer was unclear. I meant that this is how it works here. If the cursor is in a French word in a German document, the Thesaurus comes up with French preselected. The Thesaurus is supposed to know the language at cursor. Jürgen
Re: r35445 - lyx-devel/trunk
Pavel Sanda wrote: Log: Allow autoconf 2.67, tested on linux. Juergen? OK. Jürgen
Re: ANNOUNCE: LyX version 2.0.0 (alpha 6)
Il 16/09/2010 15:23, Pavel Sanda ha scritto: Pavel Sanda wrote: Public release of LyX version 2.0.0 (alpha 6) = We are pleased to announce the sixth alpha release of LyX 2.0.0. some additional notes: - since we are close to to beta - which should be basically just bugfixing - its the best time to contribute user's stuff (like modules) you consider worthy for lyx 2.0. what is the expected timeline for the beta and final release ? Thx, T.
Re: Thesaurus feature (trunk)
Am Sonntag 19 September 2010 schrieb Jürgen Spitzmüller: Kornel Benko wrote: In a multilingual document it came handy to have the default language for thesaurus being that of the word instead of the document Probably my previous answer was unclear. I meant that this is how it works here. If the cursor is in a French word in a German document, the Thesaurus comes up with French preselected. The Thesaurus is supposed to know the language at cursor. Jürgen You are right. It's so now. But believe it or not, I saw this was not working that way. But wait. If I change a previous checked German word to English, and then try thesaurus on it, I get German as default (should be English) Kornel signature.asc Description: This is a digitally signed message part.
Re: Reference to LyX's examples and templates [Was: Beta plans (again, again)]
Le 17/09/2010 17:21, Stephan Witt a écrit : I'll investigate later. I had a short look already... ...one has to avoid use of QFileDialog::getOpenFileName - which is currently used. So it is a little bit more work. Hmm, you mean we cannot have side urls in this case? Probably reading Qt source may help us to see what is doable. JMarc
Re: Beta plans (again, again)
Le 17/09/2010 22:42, Gregor GORJANC a écrit : I do not know what is the current status with direct Sweave support in LyX. It is some time since I used LyX with Sweave - there was no need in the last year (had to finnish PhD). I can provide testing, but can someone point me in the right direction, i.e., how can I start, etc. Normally, it should work without any change to the prefs. And I have another pending patch that avoids the need for inserting newlines for line breaking (have the Chaunk layout behave like ERT). This is waiting for code from Richard to translate old files (I don't do python yet). I remember there was an issue with LyX compiling LaTeX in temporary directory, but we could postpone this up to the point where all other stuff works, though I have posted obvious (for me) solution to mailing list several times. Yes, I am guilty for this. JMarc
Re: When preview is on
Ronen Abravanel wrote: It seems that that simple patch do the trick (Preview is rendered on Instant Preview - On OR No math..) yes i was expecting it... pavel
Re: When preview is on
Is there a good reason no to do that change? On Sun, Sep 19, 2010 at 4:09 PM, Pavel Sanda sa...@lyx.org wrote: Ronen Abravanel wrote: It seems that that simple patch do the trick (Preview is rendered on Instant Preview - On OR No math..) yes i was expecting it... pavel
Re: Bugs
Le 18/09/2010 13:57, Pavel Sanda a écrit : Pavel Sanda wrote: i'm just going to be little bit aggressive about the bugs in trac because its impossible to fullfill the whole list for 2.0. JMarc, could you add new keyword inside trac? something like test for the automatical tests from John. I added keytest. Is it OK now? JMarc
Re: pref2pref
Le 19/09/2010 00:12, Richard Heck a écrit : I'm assuming that, as with layouts, LyX should only convert the file internally, leaving the original file as is. Unless, of course, you then make some modification (to shortcuts, say, or to preferences). Then LyX will have to write the file in the format of whatever version you are using. But this is already true. Yes, this is what we want to do. And later we should have a function for updating layouts, rc and ui files on disk. JMarc
Re: When preview is on
Ronen Abravanel wrote: Is there a good reason no to do that change? i planned to commit it... pavel
Re: ANNOUNCE: LyX version 2.0.0 (alpha 6)
Tommaso Cucinotta wrote: its the best time to contribute user's stuff (like modules) you consider worthy for lyx 2.0. what is the expected timeline for the beta and final release ? basically when #6417 is fixed and i hope it happens within few weeks. final approx december. i'm trying to keep this info at http://wiki.lyx.org/Devel/ReleaseSchedule anyway the real date depends how much will people try to fix the remaining bugs ;) pavel
Re: Bugs
Jean-Marc Lasgouttes wrote: JMarc, could you add new keyword inside trac? something like test for the automatical tests from John. I added keytest. Is it OK now? great, thanks. pavel
Re: pref2pref
Jean-Marc Lasgouttes wrote: And later we should have a function for updating layouts, rc and ui files on disk. unless i misunderstood what you mean by updating on disk i tried to say its not good idea to do it at least for rc. pavel
Re: Solving the Meta/Control key swap problem on Mac OS X
Jens Nöckel wrote: That's perfect - please feel free to modify my patch this way. its in. perhaps you want to add oneliner into misc section of newinlyx20 wiki... pavel
Re: Patch: Diagram inset
Pavel Sanda wrote: Ronen Abravanel wrote: (The only part changes now: The comment in Buffer.cpp) everything is in now. most probably you want to put some bullet into latex section of newinlyx20 wiki. also post the example file... pave
Re: Patch: Diagram inset
I'll need a password for the wiki.. Thanks, Ronen. On Sun, Sep 19, 2010 at 6:46 PM, Pavel Sanda sa...@lyx.org wrote: Pavel Sanda wrote: Ronen Abravanel wrote: (The only part changes now: The comment in Buffer.cpp) everything is in now. most probably you want to put some bullet into latex section of newinlyx20 wiki. also post the example file... pave
Re: Solving the Meta/Control key swap problem on Mac OS X
On Sep 19, 2010, at 3:03 PM, Pavel Sanda wrote: Jens Nöckel wrote: That's perfect - please feel free to modify my patch this way. its in. perhaps you want to add oneliner into misc section of newinlyx20 wiki... pavel Great! Could someone send me the WIki password? Then I'll add a line under Miscellaneous. Thanks, Jens
Re: Patch: Diagram inset
Hello Ronen, thanks for your cool new feature! As you know an undocumented feature won't be used - that's why we have e.g. the Math manual. There already exists in sec. 21 Diagrams a description of amscd and a link to the xymatrix description. Can you do me a favor and write either - something similar as I did for amscd in the Math manual or - a separate file like our XYmatrix manual (if a description would be too big for the Math manual) I propose to do it the first way and refer to the feyn manual since this manual is already excellent. I'll sent you the Wiki password in a private mail so that you can your feature to http://wiki.lyx.org/LyX/NewInLyX20 . Besides the documentation, there are some open issues: 1. Because of the fileformat change, we need an entry in the FORMAT file 2. As a new LaTeX package is used by LyX we need to check for it in chkconfig.ltx 3. For the same reason as 2. we need an entry in the file LaTeXConfig.lyx I have done all 3 tasks in this commit: http://www.lyx.org/trac/changeset/35460 can you please check if this is OK? - While playing with your feature i noticed that the export to the LyX 1.6 fileformat via lyx2lyx is not working. I now fixed the bug that the LyX 1.6.x files were not compilable. But there are still some issues: Take your example file and export it to LyX 1.6.x format. Then open this with LyX 1.6.7 and you can see that the PDF output is completely different from that in LyX 2.0. can you please have a look? thanks regards Uwe
Re: Patch: Diagram inset
While playing with your feature i noticed that the export to the LyX 1.6 fileformat via lyx2lyx is not working. I now fixed the bug that the LyX 1.6.x files were not compilable. But there are still some issues: Take your example file and export it to LyX 1.6.x format. Then open this with LyX 1.6.7 and you can see that the PDF output is completely different from that in LyX 2.0. can you please have a look? What is the difference between the LaTeX that is output? The only thing the lyx2lyx does is add \usepackage{feyn} to the preamble. The commands OUGHT to be the same. Richard
Re: Patch: Diagram inset
Am 20.09.2010 03:54, schrieb Richard Heck: Take your example file and export it to LyX 1.6.x format. Then open this with LyX 1.6.7 and you can see that the PDF output is completely different from that in LyX 2.0. can you please have a look? What is the difference between the LaTeX that is output? The only thing the lyx2lyx does is add \usepackage{feyn} to the preamble. The commands OUGHT to be the same. You will see that LyX 1.6.x cannot handle the columns, because it is unknown for it that \Diagram can have columns and rows. I tried to find a solution, but I currently don't see another way than to revert such equations to TeX code. regards Uwe
Re: Patch: Diagram inset
Am 20.09.2010 04:52, schrieb Ronen Abravanel: Added few paragraphs to the Math manual (the full manual attached. note that the file version changed to 401). It won't compile for me even before the change, so I'll appreciate if someone will make sure it's compiles properly. What errors do you get when compiling the Math manual? It works for me with LyX 2.0alpha6. I added subsection 21.3, and edited the line in section 21. Attached. Thanks you, I'll have a look at this tomorrow. regarding export to lyx 1.6 -- One ugly hack I can thing about is making sure that there is no \xymatrix in the document, and then converting \Diagram into \xymatrix and adding proper \renew command in the preamble. I had the same idea, but what do you do if the document also contains \xymatrix? And what if users on LyX 1.6.x later on add an \xymatrix? I therefore think that only a complete reversion of the whole formula to TeX code is really safe. And there is the option of converting to ERT, that seems more reasonable... but I'll be happy for a clue regarding were to start. That should be easy: copy the content between begin/end of the formula inset into ERT. Outputting the TeX code is done via the put_cmd_in_ert routine. (see the revert_rule routine as example). I'll appreciate if someone will send me a password for the wiki. I forgot this - now sent it to you. regards Uwe
Re: Patch: Diagram inset
Am 20.09.2010 04:52, schrieb Ronen Abravanel: Added few paragraphs to the Math manual (the full manual attached. note that the file version changed to 401). Your attached file doesn't contain any feyn-related stuff and is in format 345. regards Uwe
Re: Solving the Meta/Control key swap problem on Mac OS X
Jens Nöckel wrote: > Another version of the patch is attached, this time hopefully readable by > everyone... no its octet-stream now. next guess is .txt :) cant be this code: +// GUI_DONTSWAPCB_VISIBLE reveals checkbox for switching Ctrl and Meta on Mac: +#ifdef Q_WS_MACX +#if QT_VERSION > 0x040600 + connect(dontswapCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); +#define GUI_DONTSWAPCB_VISIBLE true +#endif +#endif +#ifndef GUI_DONTSWAPCB_VISIBLE + dontswapCB->setVisible(false); +#endif written as: + connect(dontswapCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); +#ifdef Q_WS_MACX +#if QT_VERSION > 0x040600 + dontswapCB->setVisible(false); +#endif ? pavel
Re: pref2pref
Richard Heck wrote: > I'm assuming that, as with layouts, LyX should only convert the file > "internally", leaving the original file as is. Unless, of course, you then > make some modification (to shortcuts, say, or to preferences). Then LyX > will have to write the file in the format of whatever version you are > using. But this is already true. ahaaa, then its completely fine. > As with layout2layout, again, I don't see a need to provide for reversion. > OK? yes. pavel
Re: Patch: Diagram inset
Ronen Abravanel wrote: > Pavel -- Thanks. I removed big portion of the code that was not needed. good news > I can refactor both XYMatrix and Diagram class to have one common base > class, but it will take me a while. How urgent things should be ready for > 2.0? personally i would prefer not to touch XYMatrix ;) (basically because i dont know all its features and can't test whether we killed something...) so my proposal was rather that Diagram would be child of XYMatrix, althought i understand the philosophical point behind common virtual class. so in case other devs are not against, i would choose the simpler route... but as i have written before the class is so small that i would accept even the current version if the inheritance bussiness makes things complicated ;) > +def revert_diagram(document): > + i = 0 > + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) > + while True: > +i = find_token(document.body, '\\begin_inset Formula', i) > +if i == -1: > + print "returning" debug output is not needed > + return > +j = find_end_of_inset(document.body, i) > +if j == -1: > +print "Melformed document!" typo > +return > +m = re_diagram.search("\n".join(document.body[i:j])) i'm surprised about this newline, but you are right its there. strange. i still think the postscript output will be the same but who knows... > + * \file InsetMathDiagram.h > + * This file is part of LyX, the document processor. > + * Licence details can be found in the file COPYING. > + * > + * \author André Pönitz > +* \author Ronen Abravanel whitespace pavel
Re: When preview is on
Ronen Abravanel wrote: > Currently, in Lyx 2.0, there are 3 modes for preview: > * On -- Preview is working for math and preview-inset > * No math -- > * Off > > My 1st question is what the different between "no math" and Off? what else > is previewed other than math and preview inset? for example external insets use this mechanism to render pictures > My second concern is the reason this mail is on the developers list: Is > there any reason no to separate the rendering of the preview-inset from > regular math? for 98 percent of my math -- I prefer it will not be rendered. > But for the other two percent -- the diagrams (either using \xymatrix, the > new \Diagram inset, or just plain-old ERT), I would really like to be > previewed. > > If it's some arbitrary decision, and you didn't thought it's important, I'll > be happy to try and do the change.. original author is currently away... personally i have no problem with separating it. i guess that you would be happy to connect "no math" with your usecase? >(although i'll be happy for some > pointers, as I don't yet very familiar with lyx' code). for the insetpreview part, quick peek gives two possibly interesting commits 38890, 33890: git log --author=vfr |grep -A2 InsetPreview New file format for InsetPreview introduced in r38890. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/tr...@33891 a592a061-630c-0410-9148-cb99ea01b6c8 -- Introduce InsetPreview. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/tr...@33890 a592a061-630c-0410-9148-cb99ea01b6c8 pavel
Re: Thesaurus feature (trunk)
Kornel Benko wrote: > Yes, but this is not the point I meant. What is the point, then? Jürgen
Re: Please, verify the INSTALL on MacOSX document...
Am 19.09.2010 um 03:33 schrieb BH: > On Mon, Sep 6, 2010 at 7:56 AM, Stephan Wittwrote: >> Am 06.09.2010 um 13:46 schrieb BH: >> > > I tried this out with a new Mac, and it works well. I did not compile > aspell or test Tiger or 64-bit support. > Thanks for your comments. > A couple of minor comments, with my numbering following that of > INSTALL.MacOSX: > > PREREQUISITES > > 1. Can Qt be installed from Nokia's .dmg, or must it be self-compiled? > I followed the instructions to compile it myself, and it worked with > no problems, but if that's not necessary, it might be worth making it > clearer. Yes, you're right. I'll check and add that - if LyX can be compiled with Nokia's .dmg. I think it's the case - but I want to be sure. So, I'll test it. > 2. The version of automake macports installed is 2.67, which > autogen.sh rejected. (It wants only automake < 2.65.) So I had to edit > autogen.sh to allow 2.67, which worked fine. Do you mean *autoconf* 2.67? That one I didn't notice since I have an older version. Didn't update macports a while. We should test that on Linux and change autogen.sh if it works. Pavel, what do you think? > > BUILD INSTRUCTIONS > > 1. Environment > > (a) ... "We have to change that with if on that build system". Should > this be: "We have to change that if not on that build system"? I'm not sure about the grammar... I meant "We have to change the default if using that build system." > That's it. Nice job with the clear documentation ... and nice work on > LyX/Mac quite generally. It's coming along great! Thanks. Am 19.09.2010 um 06:26 schrieb Jens Nöckel: > > On Sep 18, 2010, at 6:33 PM, BH wrote: >> >> That's it. Nice job with the clear documentation ... and nice work on >> LyX/Mac quite generally. It's coming along great! > > Hi Bennett, > I agree the INSTALL.MacOSX is now much more comprehensive and useful! > I had to make some adjustments though, because I compiled on a machine where > I use fink instead of MacPorts (our newest Mac uses MacPorts, but I'm not > compiling LyX on that one... just to make life more interesting). This configuration I don't have. Nice to get some feedback from you. > So in my case, here is a summary of the steps, assuming you have autoconf, > gettext and pkgconfig from fink: > > 1) > Compile qt-everywhere-opensource-src-4.6.3 (universal without Tiger) as in > step 1 of INSTALL.MacOSX. The download location for the source is > ftp://ftp.qt.nokia.com/qt/source/ (which may be a little hard to find if > you're following the link given in INSTALL.MacOSX) I'll add that link. > 2) > Then to build LyX from SVN, download the source using > svn co svn://svn.lyx.org/lyx/lyx-devel/trunk lyx-devel I'm not sure if I'd like to mention that. If one is able to read INSTALL.MacOSX it is somehow done - and may very well be a tarball download instead. > Set I the following flags (assuming bash syntax): > export CFLAGS="-arch i386" > export CXXFLAGS="-arch i386" > export OBJCFLAGS="-arch i386" > export LDFLAGS="-framework Carbon -framework AppKit -arch i386" > This differs from INSTALL.MacOSX because my version of pkgconfig wasn't > clever enough to detect the framework dependencies automatically. My current version of INSTALL.MacOSX mentions here: export LDFLAGS="$LDFLAGS -framework ApplicationServices -framework Cocoa -framework AppKit" I've learned it from pkgconfig guesses for Qt4. So, you're saying "-framework ApplicationServices" is not needed? I'll remove it from INSTALL.MacOSX then... > Next, in the lyx-devel directory, I did: > ./autogen.sh > ./configure --with-version-suffix=-2.0 --disable-stdlib-debug > --prefix=PATH/TO/LyX.app --with-qt4-dir=/path/to/QT4 > --with-libiconv-prefix=/usr > make > make install-strip > > The libiconv prefix needed to be specified on the configure line to avoid > loading an older version of that library installed by fink. This is a good idea. The --with-libiconv-prefix=/usr option should be used in any case. I had problems with the macports version, too. I'll add that. > That's how things worked for me. Thank you for the feedback. Stephan
Re: r35445 - lyx-devel/trunk
sa...@lyx.org wrote: > Author: sanda > Date: Sun Sep 19 13:58:35 2010 > New Revision: 35445 > URL: http://www.lyx.org/trac/changeset/35445 > > Log: > Allow autoconf 2.67, tested on linux. Juergen?
Re: Small glitch in spellchecker (trunk)
Am 18.09.2010 um 09:36 schrieb Stephan Witt: > Am 18.09.2010 um 09:12 schrieb Kornel Benko: > >> Am Freitag 17 September 2010 schrieb Kornel Benko: >>> Am Freitag 17 September 2010 schrieb Kornel Benko: I attach a test-case. The spell-checker even marks the word as english after accepting ... Which word? >>> But this happens only, if continuous spellchecking is set. Ok, I understood your scenario finally. Right click presents speller suggestions only when continuous spellchecking is active. >>> >>> Kornel >> >> Now it's working again. ... >> >> From now on I was unable to put it to my previous erroneous state. >> >> Is there something cached? Through sessions? > > There is a non-persistent cache per paragraph for the positions of spell > errors. > This cache is bypassed with check_learned = true for word-wise checks. > The cache is not written to disk - at least I have not coded that. > I'll see if the cache is not invalidated when you accept a suggestion of the > speller. The replaced word is checked again, the rest of the cache is untouched (and valid). But I had to correct the 2nd try. Now it should really work. The original problem I cannot reproduce. Obviously the quality of the dictionaries matters to. The abbreviation ggf. is not misspelled for the 1st try because the word ggf is already accepted. Here you can see the problems with word-wise checking. Apples native spell checker rejects "ggf" but accepts "ggf." It has it's own problems though. When editing the check of the currently changed word is not good enough then. But the whole thing should be better then before now. Stephan
Re: Thesaurus feature (trunk)
Am Sonntag 19 September 2010 schrieb Jürgen Spitzmüller: > Kornel Benko wrote: > > Yes, but this is not the point I meant. > > What is the point, then? > > Jürgen In a multilingual document it came handy to have the default language for thesaurus being that of the word instead of the document Kornel signature.asc Description: This is a digitally signed message part.
Re: Small glitch in spellchecker (trunk)
Am Sonntag 19 September 2010 schrieb Stephan Witt: > >> Am Freitag 17 September 2010 schrieb Kornel Benko: > >>> Am Freitag 17 September 2010 schrieb Kornel Benko: > I attach a test-case. The spell-checker even marks the word as english > after accepting ... > > Which word? There is this sentence in a a document with a default of german language value ( ggf. (value is marked as british english) The spellchecker did not accept "ggf.", instead "ggf" was selected and a set of suggestions displayed. Also "ggf.". Accepting this, resulted in the sentence value ( ggf.. while "ggf." was marked as english now. Kornel signature.asc Description: This is a digitally signed message part.
Re: Small glitch in spellchecker (trunk)
Am 19.09.2010 um 14:36 schrieb Kornel Benko: > Am Sonntag 19 September 2010 schrieb Stephan Witt: Am Freitag 17 September 2010 schrieb Kornel Benko: > Am Freitag 17 September 2010 schrieb Kornel Benko: >> I attach a test-case. The spell-checker even marks the word as english >> after accepting ... >> >> Which word? > > There is this sentence in a document with a default of german language > > value ( ggf. > > (value is marked as british english) > > The spellchecker did not accept "ggf.", instead "ggf" was selected and a set > of suggestions displayed. Also > "ggf.". Accepting this, resulted in the sentence > > value ( ggf.. > > while "ggf." was marked as english now. Sorry, I cannot confirm that. Neither on Mac nor on Linux. Stephan
Re: r35369 - lyx-devel/trunk/src
On 16/09/2010 17:31, Stephan Witt wrote: Am 14.09.2010 um 15:46 schrieb Abdelrazak Younes: On 09/14/2010 02:48 PM, sw...@lyx.org wrote: Author: switt Date: Tue Sep 14 14:48:03 2010 New Revision: 35369 URL: http://www.lyx.org/trac/changeset/35369 Log: reduce nesting levels in markMisspelledWords; simplify range check of fontspan I have a compile error: /home/younes/devel/lyx/trunk/src/Paragraph.cpp: In member function ‘void lyx::Paragraph::Private::markMisspelledWords(const lyx::pos_type&, const lyx::pos_type&, lyx::SpellChecker::Result, const lyx::docstring&, const std::vector >&)’: /home/younes/devel/lyx/trunk/src/Paragraph.cpp:3538: error: no matching function for call to ‘lyx::Paragraph::Private::countSoftbreaks(__gnu_cxx::__normal_iterator > >&, __gnu_cxx::__normal_iterator > >&, int&)’ /home/younes/devel/lyx/trunk/src/Paragraph.cpp:366: note: candidates are: int lyx::Paragraph::Private::countSoftbreaks(__gnu_cxx::__normal_iterator > >&, __gnu_cxx::__normal_iterator > >, lyx::pos_type&) const make[2]: *** [src/CMakeFiles/lyx2.0.dir/home/younes/devel/lyx/trunk/src/Paragraph.cpp.o] Error 1 Abdel. Of course the function Paragraph::Private::countSoftbreaks() should have int argument, but why did it compile here with gcc 4.2.1 on Mac and gcc 4.4 on Linux? What's your environment? Kubuntu 10.04, gcc-4.3 I believe. Another question: I want to replace the map of the speller state by a vector to make it more similar to the FontList. The patch is attached. Is it ok? Sorry, no time but it seems to remove code so, if that doesn't introduce regression in performance this has to be good. Abdel.
Re: Small glitch in spellchecker (trunk)
Am Sonntag 19 September 2010 schrieb Stephan Witt: > > while "ggf." was marked as english now. > > Sorry, I cannot confirm that. Neither on Mac nor on Linux. I was describing the behaviour which I _had_. Now I don't see it also. Kornel signature.asc Description: This is a digitally signed message part.
Re: Please, verify the INSTALL on MacOSX document...
On Sun, Sep 19, 2010 at 6:43 AM, Stephan Wittwrote: > Am 19.09.2010 um 03:33 schrieb BH: ... >> 2. The version of automake macports installed is 2.67, which >> autogen.sh rejected. (It wants only automake < 2.65.) So I had to edit >> autogen.sh to allow 2.67, which worked fine. > > Do you mean *autoconf* 2.67? Yes. > That one I didn't notice since I have an older version. > Didn't update macports a while. > > We should test that on Linux and change autogen.sh if it works. > Pavel, what do you think? > >> >> BUILD INSTRUCTIONS >> >> 1. Environment >> >> (a) ... "We have to change that with if on that build system". Should >> this be: "We have to change that if not on that build system"? > > I'm not sure about the grammar... I meant > > "We have to change the default if using that build system." Yes -- that's right. (I was getting myself confused) BH
Re: #6906: GNU/Hurd build failure because of PATH_MAX usage
LyX Ticket Tracker, le Sun 19 Sep 2010 13:12:51 -, a écrit : > i'm no expert on glibc, but man pages explicitly states that realpath > shouldn't be used at all. Please update your manpages. “The resolved_path == NULL feature, not standardized in POSIX.1-2001, but standardized in POSIX.1-2008, allows this design problem to be avoided.” > what is the correct fix for hurd then? This is precisely the correct fix: just using POSIX 2008's behavior, already available in glibc since ages. > i'm also not happy about the ifdefs. does canonicalize_file_name works on > hurd? Sure, since hurd's libc is glibc. > i would rather try to put it there "unconditionally" if possible. Put what? canonicalize_file_name is only a glibc extension so you'd need at least detection of this feature. Samuel
Re: Solving the Meta/Control key swap problem on Mac OS X
On Sep 19, 2010, at 12:02 AM, Pavel Sanda wrote: > Jens Nöckel wrote: >> Another version of the patch is attached, this time hopefully readable by >> everyone... > > no its octet-stream now. next guess is .txt :) > Or using a different mailer, sigh. > cant be this code: > > +// GUI_DONTSWAPCB_VISIBLE reveals checkbox for switching Ctrl and Meta on > Mac: > > +#ifdef Q_WS_MACX > +#if QT_VERSION > 0x040600 > + connect(dontswapCB, SIGNAL(toggled(bool)), > + this, SIGNAL(changed())); > +#define GUI_DONTSWAPCB_VISIBLE true > +#endif > +#endif > +#ifndef GUI_DONTSWAPCB_VISIBLE > + dontswapCB->setVisible(false); > +#endif > > > written as: > > + connect(dontswapCB, SIGNAL(toggled(bool)), > + this, SIGNAL(changed())); > +#ifdef Q_WS_MACX > +#if QT_VERSION > 0x040600 > + dontswapCB->setVisible(false); > +#endif > No, this would be the wrong way around. If you really want even fewer #ifdef, one could say this: + connect(dontswapCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); + dontswapCB->setVisible(false); +#ifdef Q_WS_MACX +#if QT_VERSION > 0x040600 + dontswapCB->setVisible(true); +#endif But then the actual code on Mac would execute two calls to setVisible instead of one, which just seems slightly more inelegant. Jens
Re: #6906: GNU/Hurd build failure because of PATH_MAX usage
Samuel Thibault wrote: > LyX Ticket Tracker, le Sun 19 Sep 2010 13:12:51 -, a écrit : > > i'm no expert on glibc, but man pages explicitly states that realpath > > shouldn't be used at all. > > Please update your manpages. why not if you give me root access on that box ;) > > what is the correct fix for hurd then? > > This is precisely the correct fix: just using POSIX 2008's behavior, > already available in glibc since ages. i hope those ages also cover the distros still shipping apparently old man pages because otherwise this fix will introduce new bugs on other platforms than hurd. > Sure, since hurd's libc is glibc. > > > i would rather try to put it there "unconditionally" if possible. > > Put what? canonicalize_file_name is only a glibc extension so you'd need > at least detection of this feature. to reformulate my question: is there posix solution without ifdefs? thanks, pavel
Re: Patch: Diagram inset
On Sun, Sep 19, 2010 at 3:35 AM, Pavel Sandawrote: > Ronen Abravanel wrote: > > Pavel -- Thanks. I removed big portion of the code that was not needed. > > good news > > > I can refactor both XYMatrix and Diagram class to have one common base > > class, but it will take me a while. How urgent things should be ready for > > 2.0? > > personally i would prefer not to touch XYMatrix ;) > (basically because i dont know all its features and can't test whether we > killed something...) > > so my proposal was rather that Diagram would be child of XYMatrix, > althought i > understand the philosophical point behind common virtual class. > so in case other devs are not against, i would choose the simpler route... > > but as i have written before the class is so small that i would accept > even the current version if the inheritance bussiness makes things > complicated ;) > > > +def revert_diagram(document): > > + i = 0 > > + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', > re.DOTALL) > > + while True: > > +i = find_token(document.body, '\\begin_inset Formula', i) > > +if i == -1: > > + print "returning" > > debug output is not needed > > > + return > > +j = find_end_of_inset(document.body, i) > > +if j == -1: > > +print "Melformed document!" > > typo > > > +return > > +m = re_diagram.search("\n".join(document.body[i:j])) > > i'm surprised about this newline, but you are right its there. > strange. i still think the postscript output will be the same > but who knows... > > > + * \file InsetMathDiagram.h > > + * This file is part of LyX, the document processor. > > + * Licence details can be found in the file COPYING. > > + * > > + * \author André Pönitz > > +* \author Ronen Abravanel > > whitespace > > pavel > diff -rupN lyx-2.0.0alpha6/lib/lyx2lyx/lyx_2_0.py lyx-2.0.0alpha6_feynFinal/lib/lyx2lyx/lyx_2_0.py --- lyx-2.0.0alpha6/lib/lyx2lyx/lyx_2_0.py 2010-09-15 16:33:40.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/lib/lyx2lyx/lyx_2_0.py 2010-09-19 10:49:58.0 -0400 @@ -1568,7 +1568,6 @@ def revert_fontcolor(document): + ', ' + str(blueout) + '}\n' + '\\color{document_fontcolor}\n') - def revert_shadedboxcolor(document): " Reverts shaded box color to preamble code " i = 0 @@ -2161,6 +2160,26 @@ def revert_rule(document): else: return +def revert_diagram(document): + i = 0 + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) + while True: +i = find_token(document.body, '\\begin_inset Formula', i) +if i == -1: + return +j = find_end_of_inset(document.body, i) +if j == -1: +document.warning("Malformed LyX document: Can't find end of line inset.") +return +m = re_diagram.search("\n".join(document.body[i:j])) +if not m: + i += 1 + continue +add_to_preamble(document, "\\use_package{feyn}") +# only need to do it once! +return + + ## # Conversion hub @@ -2221,10 +2240,12 @@ convert = [[346, []], [397, [remove_Nameref]], [398, []], [399, [convert_mathdots]], - [400, [convert_rule]] + [400, [convert_rule]], + [401, []] ] -revert = [[399, [revert_rule]], +revert = [[400, [revert_diagram]], + [399, [revert_rule]], [398, [revert_mathdots]], [397, [revert_mathrsfs]], [396, []], diff -rupN lyx-2.0.0alpha6/src/Buffer.cpp lyx-2.0.0alpha6_feynFinal/src/Buffer.cpp --- lyx-2.0.0alpha6/src/Buffer.cpp 2010-09-15 16:33:41.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/Buffer.cpp 2010-09-18 22:33:25.0 -0400 @@ -127,7 +127,7 @@ namespace { // Do not remove the comment below, so we get merge conflict in // independent branches. Instead add your own. -int const LYX_FORMAT = 400; // uwestoehr: support for \rule +int const LYX_FORMAT = 401; // uwestoehr: support for \rule \\Ronen: support for \Diagrasr typedef map DepClean; typedef map RefCache; diff -rupN lyx-2.0.0alpha6/src/insets/InsetCode.h lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h --- lyx-2.0.0alpha6/src/insets/InsetCode.h 2010-09-15 16:33:43.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h 2010-09-18 21:22:40.0 -0400 @@ -223,6 +223,8 @@ enum InsetCode { /// PREVIEW_CODE, /// + MATH_DIAGRAM_CODE, + /// INSET_CODE_SIZE, }; diff -rupN lyx-2.0.0alpha6/src/insets/Inset.cpp lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp --- lyx-2.0.0alpha6/src/insets/Inset.cpp 2010-09-15 16:33:42.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp 2010-09-18 21:23:37.0 -0400 @@ -168,6 +168,7 @@ static void build_translator() insetnames[MATH_XARROW_CODE] = InsetName("mathxarrow"); insetnames[MATH_XYARROW_CODE] = InsetName("mathxyarrow"); insetnames[MATH_XYMATRIX_CODE] = InsetName("mathxymatrix");
Re: Solving the Meta/Control key swap problem on Mac OS X
Jens Nöckel wrote: > + connect(dontswapCB, SIGNAL(toggled(bool)), > + this, SIGNAL(changed())); > + dontswapCB->setVisible(false); > +#ifdef Q_WS_MACX > +#if QT_VERSION > 0x040600 > + dontswapCB->setVisible(true); > +#endif > > But then the actual code on Mac would execute two calls to setVisible instead > of one, which just seems slightly more inelegant. i see. what you feel better with bool swapcb=false; #ifdef Q_WS_MACX #if QT_VERSION > 0x040600 swapcb=true; #endif dontswapCB->setVisible(swapcb); pavel
Re: Solving the Meta/Control key swap problem on Mac OS X
On Sep 19, 2010, at 8:25 AM, Pavel Sanda wrote: > Jens Nöckel wrote: >> + connect(dontswapCB, SIGNAL(toggled(bool)), >> + this, SIGNAL(changed())); >> + dontswapCB->setVisible(false); >> +#ifdef Q_WS_MACX >> +#if QT_VERSION > 0x040600 >> + dontswapCB->setVisible(true); >> +#endif >> >> But then the actual code on Mac would execute two calls to setVisible >> instead of one, which just seems slightly more inelegant. > > i see. what you feel better with > > bool swapcb=false; > > #ifdef Q_WS_MACX > #if QT_VERSION > 0x040600 > swapcb=true; > #endif > > dontswapCB->setVisible(swapcb); > > pavel That's perfect - please feel free to modify my patch this way. Jens
Re: #6906: GNU/Hurd build failure because of PATH_MAX usage
Pavel Sanda, le Sun 19 Sep 2010 16:59:52 +0200, a écrit : > Samuel Thibault wrote: > > LyX Ticket Tracker, le Sun 19 Sep 2010 13:12:51 -, a écrit : > > > i'm no expert on glibc, but man pages explicitly states that realpath > > > shouldn't be used at all. > > > > Please update your manpages. > > why not if you give me root access on that box ;) Well, any linux box with manpages >= 3.20 will have that latest text. Take debian's http://ftp.de.debian.org/debian/pool/main/m/manpages/manpages_3.25.orig.tar.gz for instance. > > > what is the correct fix for hurd then? > > > > This is precisely the correct fix: just using POSIX 2008's behavior, > > already available in glibc since ages. > > i hope those ages also cover the distros still shipping apparently old man > pages because otherwise this fix will introduce new bugs on other platforms > than hurd. The old manpages still do say that glibc allocates memory in that case, so it'll work there. They are saying it's not a good idea to rely on it because it's a glibc extension, but in my patch I'm precisely using it only with glibc, so it's completely fine. And when I say "ages", I mean it: it was added in 1996... > > Sure, since hurd's libc is glibc. > > > > > i would rather try to put it there "unconditionally" if possible. > > > > Put what? canonicalize_file_name is only a glibc extension so you'd need > > at least detection of this feature. > > to reformulate my question: is there posix solution without ifdefs? No. That's one of the biggest mistakes of Posix. Samuel
Re: #6906: GNU/Hurd build failure because of PATH_MAX usage
Samuel Thibault wrote: > And when I say "ages", I mean it: it was added in 1996... ok, thanks for responses. i will commit this for 2.0. pavel
Re: Patch: Diagram inset
On 9/19/10 11:19 AM, Ronen Abravanel wrote: +def revert_diagram(document): + i = 0 + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) + while True: +i = find_token(document.body, '\\begin_inset Formula', i) +if i == -1: + return +j = find_end_of_inset(document.body, i) +if j == -1: +document.warning("Malformed LyX document: Can't find end of line inset.") +return +m = re_diagram.search("\n".join(document.body[i:j])) +if not m: + i += 1 + continue +add_to_preamble(document, "\\use_package{feyn}") +# only need to do it once! +return + + Like Pavel, I'm a bit puzzled by this. I see the newline in InsetXYMatrix::write() and now in your code, but I hadn't realized we put newlines into the math stuff. Anyway, better not to assume they're not there. +int const LYX_FORMAT = 401; // uwestoehr: support for \rule \\Ronen: support for \Diagrasr You can take Uwe's comment out, which applied to format 400, and just have yours. The main thing is just to have a comment there. Otherwise looks fine to me, though I'm not expert on the math stuff. rh
Re: When preview is on
It seems that that simple patch do the trick (Preview is rendered on Instant Preview -> On OR No math..) On Sun, Sep 19, 2010 at 3:48 AM, Pavel Sandawrote: > Ronen Abravanel wrote: > > Currently, in Lyx 2.0, there are 3 modes for preview: > > * On -- Preview is working for math and preview-inset > > * No math -- > > * Off > > > > My 1st question is what the different between "no math" and Off? what > else > > is previewed other than math and preview inset? > > for example external insets use this mechanism to render pictures > > > My second concern is the reason this mail is on the developers list: Is > > there any reason no to separate the rendering of the preview-inset from > > regular math? for 98 percent of my math -- I prefer it will not be > rendered. > > But for the other two percent -- the diagrams (either using \xymatrix, > the > > new \Diagram inset, or just plain-old ERT), I would really like to be > > previewed. > > > > If it's some arbitrary decision, and you didn't thought it's important, > I'll > > be happy to try and do the change.. > > original author is currently away... personally i have no problem with > separating it. > i guess that you would be happy to connect "no math" with your usecase? > > >(although i'll be happy for some > > pointers, as I don't yet very familiar with lyx' code). > > for the insetpreview part, quick peek gives two possibly interesting > commits 38890, 33890: > > git log --author=vfr |grep -A2 InsetPreview >New file format for InsetPreview introduced in r38890. > >git-svn-id: > svn://svn.lyx.org/lyx/lyx-devel/tr...@33891a592a061-630c-0410-9148-cb99ea01b6c8 > -- >Introduce InsetPreview. > >git-svn-id: > svn://svn.lyx.org/lyx/lyx-devel/tr...@33890a592a061-630c-0410-9148-cb99ea01b6c8 > > pavel > --- lyx-2.0.0alpha6_feyn/src/insets/InsetPreview.cpp 2010-09-15 16:33:43.0 -0400 +++ lyx-2.0.0alpha6/src/insets/InsetPreview.cpp 2010-09-19 11:56:12.0 -0400 @@ -78,7 +78,7 @@ void InsetPreview::preparePreview(DocIte bool InsetPreview::previewState(BufferView * bv) const { - if (!editing(bv) && RenderPreview::status() == LyXRC::PREVIEW_ON) { + if (!editing(bv) && (RenderPreview::status() == LyXRC::PREVIEW_ON || RenderPreview::status() == LyXRC::PREVIEW_NO_MATH)) { graphics::PreviewImage const * pimage = preview_->getPreviewImage(bv->buffer()); return pimage && pimage->image();
Re: Patch: Diagram inset
On Sun, Sep 19, 2010 at 11:46 AM, Richard Heckwrote: > On 9/19/10 11:19 AM, Ronen Abravanel wrote: > >> >> +def revert_diagram(document): >> + i = 0 >> + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', >> re.DOTALL) >> + while True: >> +i = find_token(document.body, '\\begin_inset Formula', i) >> +if i == -1: >> + return >> +j = find_end_of_inset(document.body, i) >> +if j == -1: >> +document.warning("Malformed LyX document: Can't find end of line >> inset.") >> >> +return >> +m = re_diagram.search("\n".join(document.body[i:j])) >> +if not m: >> + i += 1 >> + continue >> +add_to_preamble(document, "\\use_package{feyn}") >> +# only need to do it once! >> +return >> + >> + >> >> >> > Like Pavel, I'm a bit puzzled by this. I see the newline in > InsetXYMatrix::write() and now in your code, but I hadn't realized we put > newlines into the math stuff. Anyway, better not to assume they're not > there. > I don't understand how all this mechanism works. I just assume the XTMatrix works, and then change the things I do understand. > > +int const LYX_FORMAT = 401; // uwestoehr: support for \rule \\Ronen: >> support for \Diagrasr >> >> >> > You can take Uwe's comment out, which applied to format 400, and just have > yours. The main thing is just to have a comment there. > > Otherwise looks fine to me, though I'm not expert on the math stuff. > > rh > (The only part changes now: The comment in Buffer.cpp) diff -rupN lyx-2.0.0alpha6/lib/lyx2lyx/lyx_2_0.py lyx-2.0.0alpha6_feynFinal/lib/lyx2lyx/lyx_2_0.py --- lyx-2.0.0alpha6/lib/lyx2lyx/lyx_2_0.py 2010-09-15 16:33:40.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/lib/lyx2lyx/lyx_2_0.py 2010-09-19 10:49:58.0 -0400 @@ -1568,7 +1568,6 @@ def revert_fontcolor(document): + ', ' + str(blueout) + '}\n' + '\\color{document_fontcolor}\n') - def revert_shadedboxcolor(document): " Reverts shaded box color to preamble code " i = 0 @@ -2161,6 +2160,26 @@ def revert_rule(document): else: return +def revert_diagram(document): + i = 0 + re_diagram = re.compile(r'\\begin_inset Formula .*\\Diagram', re.DOTALL) + while True: +i = find_token(document.body, '\\begin_inset Formula', i) +if i == -1: + return +j = find_end_of_inset(document.body, i) +if j == -1: +document.warning("Malformed LyX document: Can't find end of line inset.") +return +m = re_diagram.search("\n".join(document.body[i:j])) +if not m: + i += 1 + continue +add_to_preamble(document, "\\use_package{feyn}") +# only need to do it once! +return + + ## # Conversion hub @@ -2221,10 +2240,12 @@ convert = [[346, []], [397, [remove_Nameref]], [398, []], [399, [convert_mathdots]], - [400, [convert_rule]] + [400, [convert_rule]], + [401, []] ] -revert = [[399, [revert_rule]], +revert = [[400, [revert_diagram]], + [399, [revert_rule]], [398, [revert_mathdots]], [397, [revert_mathrsfs]], [396, []], diff -rupN lyx-2.0.0alpha6/src/Buffer.cpp lyx-2.0.0alpha6_feynFinal/src/Buffer.cpp --- lyx-2.0.0alpha6/src/Buffer.cpp 2010-09-15 16:33:41.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/Buffer.cpp 2010-09-18 22:33:25.0 -0400 @@ -127,7 +127,7 @@ namespace { // Do not remove the comment below, so we get merge conflict in // independent branches. Instead add your own. -int const LYX_FORMAT = 400; // uwestoehr: support for \rule +int const LYX_FORMAT = 401; // Ronen: support for \Diagram typedef map DepClean; typedef map RefCache; diff -rupN lyx-2.0.0alpha6/src/insets/InsetCode.h lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h --- lyx-2.0.0alpha6/src/insets/InsetCode.h 2010-09-15 16:33:43.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/insets/InsetCode.h 2010-09-18 21:22:40.0 -0400 @@ -223,6 +223,8 @@ enum InsetCode { /// PREVIEW_CODE, /// + MATH_DIAGRAM_CODE, + /// INSET_CODE_SIZE, }; diff -rupN lyx-2.0.0alpha6/src/insets/Inset.cpp lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp --- lyx-2.0.0alpha6/src/insets/Inset.cpp 2010-09-15 16:33:42.0 -0400 +++ lyx-2.0.0alpha6_feynFinal/src/insets/Inset.cpp 2010-09-18 21:23:37.0 -0400 @@ -168,6 +168,7 @@ static void build_translator() insetnames[MATH_XARROW_CODE] = InsetName("mathxarrow"); insetnames[MATH_XYARROW_CODE] = InsetName("mathxyarrow"); insetnames[MATH_XYMATRIX_CODE] = InsetName("mathxymatrix"); + insetnames[MATH_DIAGRAM_CODE] = InsetName("mathdiagram"); insetnames[MATH_MACRO_CODE] = InsetName("mathmacro"); passed = true; diff -rupN lyx-2.0.0alpha6/src/LaTeXFeatures.cpp lyx-2.0.0alpha6_feynFinal/src/LaTeXFeatures.cpp --- lyx-2.0.0alpha6/src/LaTeXFeatures.cpp 2010-09-15 16:33:41.0 -0400 +++
Re: Patch: Diagram inset
Ronen Abravanel wrote: > (The only part changes now: The comment in Buffer.cpp) i'll wait day more if somebody else has comments and then commit. also post the example file... good work, pavel
Re: Thesaurus feature (trunk)
Kornel Benko wrote: > In a multilingual document it came handy to have the default language for > thesaurus being that of the word instead of the document Probably my previous answer was unclear. I meant that this is how it works here. If the cursor is in a French word in a German document, the Thesaurus comes up with French preselected. The Thesaurus is supposed to know the language at cursor. Jürgen
Re: r35445 - lyx-devel/trunk
Pavel Sanda wrote: > > Log: > > Allow autoconf 2.67, tested on linux. > > Juergen? OK. Jürgen
Re: ANNOUNCE: LyX version 2.0.0 (alpha 6)
Il 16/09/2010 15:23, Pavel Sanda ha scritto: Pavel Sanda wrote: Public release of LyX version 2.0.0 (alpha 6) = We are pleased to announce the sixth alpha release of LyX 2.0.0. some additional notes: - since we are close to to beta - which should be basically just bugfixing - its the best time to contribute user's stuff (like modules) you consider worthy for lyx 2.0. what is the expected timeline for the beta and final release ? Thx, T.
Re: Thesaurus feature (trunk)
Am Sonntag 19 September 2010 schrieb Jürgen Spitzmüller: > Kornel Benko wrote: > > In a multilingual document it came handy to have the default language for > > thesaurus being that of the word instead of the document > > Probably my previous answer was unclear. I meant that this is how it works > here. If the cursor is in a French word in a German document, the Thesaurus > comes up with French preselected. The Thesaurus is supposed to know the > language at cursor. > > Jürgen You are right. It's so now. But believe it or not, I saw this was not working that way. But wait. If I change a previous checked German word to English, and then try thesaurus on it, I get German as default (should be English) Kornel signature.asc Description: This is a digitally signed message part.
Re: Reference to LyX's examples and templates [Was: Beta plans (again, again)]
Le 17/09/2010 17:21, Stephan Witt a écrit : I'll investigate later. I had a short look already... ...one has to avoid use of QFileDialog::getOpenFileName - which is currently used. So it is a little bit more work. Hmm, you mean we cannot have side urls in this case? Probably reading Qt source may help us to see what is doable. JMarc
Re: Beta plans (again, again)
Le 17/09/2010 22:42, Gregor GORJANC a écrit : I do not know what is the current status with direct Sweave support in LyX. It is some time since I used LyX with Sweave - there was no need in the last year (had to finnish PhD). I can provide testing, but can someone point me in the right direction, i.e., how can I start, etc. Normally, it should work without any change to the prefs. And I have another pending patch that avoids the need for inserting newlines for line breaking (have the Chaunk layout behave like ERT). This is waiting for code from Richard to translate old files (I don't do python yet). I remember there was an issue with LyX compiling LaTeX in temporary directory, but we could postpone this up to the point where all other stuff works, though I have posted obvious (for me) solution to mailing list several times. Yes, I am guilty for this. JMarc
Re: When preview is on
Ronen Abravanel wrote: > It seems that that simple patch do the trick (Preview is rendered on Instant > Preview -> On OR No math..) yes i was expecting it... pavel
Re: When preview is on
Is there a good reason no to do that change? On Sun, Sep 19, 2010 at 4:09 PM, Pavel Sandawrote: > Ronen Abravanel wrote: > > It seems that that simple patch do the trick (Preview is rendered on > Instant > > Preview -> On OR No math..) > > yes i was expecting it... > pavel >
Re: Bugs
Le 18/09/2010 13:57, Pavel Sanda a écrit : Pavel Sanda wrote: i'm just going to be little bit aggressive about the bugs in trac because its impossible to fullfill the whole list for 2.0. JMarc, could you add new keyword inside trac? something like "test" for the automatical tests from John. I added "keytest". Is it OK now? JMarc
Re: pref2pref
Le 19/09/2010 00:12, Richard Heck a écrit : I'm assuming that, as with layouts, LyX should only convert the file "internally", leaving the original file as is. Unless, of course, you then make some modification (to shortcuts, say, or to preferences). Then LyX will have to write the file in the format of whatever version you are using. But this is already true. Yes, this is what we want to do. And later we should have a function for updating layouts, rc and ui files on disk. JMarc
Re: When preview is on
Ronen Abravanel wrote: > Is there a good reason no to do that change? i planned to commit it... pavel
Re: ANNOUNCE: LyX version 2.0.0 (alpha 6)
Tommaso Cucinotta wrote: >>its the best time to contribute user's stuff (like modules) you >> consider >>worthy for lyx 2.0. >> > what is the expected timeline for the beta and final release ? basically when #6417 is fixed and i hope it happens within few weeks. final approx december. i'm trying to keep this info at http://wiki.lyx.org/Devel/ReleaseSchedule anyway the real date depends how much will people try to fix the remaining bugs ;) pavel
Re: Bugs
Jean-Marc Lasgouttes wrote: >> JMarc, could you add new keyword inside trac? something like "test" >> for the automatical tests from John. > > I added "keytest". Is it OK now? great, thanks. pavel
Re: pref2pref
Jean-Marc Lasgouttes wrote: > And later we should have a function for > updating layouts, rc and ui files on disk. unless i misunderstood what you mean by updating on disk i tried to say its not good idea to do it at least for rc. pavel
Re: Solving the Meta/Control key swap problem on Mac OS X
Jens Nöckel wrote: > That's perfect - please feel free to modify my patch this way. its in. perhaps you want to add oneliner into misc section of newinlyx20 wiki... pavel
Re: Patch: Diagram inset
Pavel Sanda wrote: > Ronen Abravanel wrote: > > > (The only part changes now: The comment in Buffer.cpp) everything is in now. most probably you want to put some bullet into latex section of newinlyx20 wiki. > also post the example file... >pave
Re: Patch: Diagram inset
I'll need a password for the wiki.. Thanks, Ronen. On Sun, Sep 19, 2010 at 6:46 PM, Pavel Sandawrote: > Pavel Sanda wrote: > > Ronen Abravanel wrote: > > > > > (The only part changes now: The comment in Buffer.cpp) > > everything is in now. > most probably you want to put some bullet into latex section of newinlyx20 > wiki. > > > also post the example file... > >pave >
Re: Solving the Meta/Control key swap problem on Mac OS X
On Sep 19, 2010, at 3:03 PM, Pavel Sanda wrote: > Jens Nöckel wrote: >> That's perfect - please feel free to modify my patch this way. > > its in. perhaps you want to add oneliner into misc section of newinlyx20 > wiki... > pavel Great! Could someone send me the WIki password? Then I'll add a line under "Miscellaneous". Thanks, Jens
Re: Patch: Diagram inset
Hello Ronen, thanks for your cool new feature! As you know an undocumented feature won't be used - that's why we have e.g. the Math manual. There already exists in sec. 21 "Diagrams" a description of amscd and a link to the xymatrix description. Can you do me a favor and write either - something similar as I did for amscd in the Math manual or - a separate file like our XYmatrix manual (if a description would be too big for the Math manual) I propose to do it the first way and refer to the feyn manual since this manual is already excellent. I'll sent you the Wiki password in a private mail so that you can your feature to http://wiki.lyx.org/LyX/NewInLyX20 . Besides the documentation, there are some open issues: 1. Because of the fileformat change, we need an entry in the FORMAT file 2. As a new LaTeX package is used by LyX we need to check for it in chkconfig.ltx 3. For the same reason as 2. we need an entry in the file LaTeXConfig.lyx I have done all 3 tasks in this commit: http://www.lyx.org/trac/changeset/35460 can you please check if this is OK? - While playing with your feature i noticed that the export to the LyX 1.6 fileformat via lyx2lyx is not working. I now fixed the bug that the LyX 1.6.x files were not compilable. But there are still some issues: Take your example file and export it to LyX 1.6.x format. Then open this with LyX 1.6.7 and you can see that the PDF output is completely different from that in LyX 2.0. can you please have a look? thanks regards Uwe
Re: Patch: Diagram inset
While playing with your feature i noticed that the export to the LyX 1.6 fileformat via lyx2lyx is not working. I now fixed the bug that the LyX 1.6.x files were not compilable. But there are still some issues: Take your example file and export it to LyX 1.6.x format. Then open this with LyX 1.6.7 and you can see that the PDF output is completely different from that in LyX 2.0. can you please have a look? What is the difference between the LaTeX that is output? The only thing the lyx2lyx does is add \usepackage{feyn} to the preamble. The commands OUGHT to be the same. Richard
Re: Patch: Diagram inset
Am 20.09.2010 03:54, schrieb Richard Heck: Take your example file and export it to LyX 1.6.x format. Then open this with LyX 1.6.7 and you can see that the PDF output is completely different from that in LyX 2.0. can you please have a look? What is the difference between the LaTeX that is output? The only thing the lyx2lyx does is add \usepackage{feyn} to the preamble. The commands OUGHT to be the same. You will see that LyX 1.6.x cannot handle the columns, because it is unknown for it that \Diagram can have columns and rows. I tried to find a solution, but I currently don't see another way than to revert such equations to TeX code. regards Uwe
Re: Patch: Diagram inset
Am 20.09.2010 04:52, schrieb Ronen Abravanel: Added few paragraphs to the Math manual (the full manual attached. note that the file version changed to 401). It won't compile for me even before the change, so I'll appreciate if someone will make sure it's compiles properly. What errors do you get when compiling the Math manual? It works for me with LyX 2.0alpha6. I added subsection 21.3, and edited the line in section 21. Attached. Thanks you, I'll have a look at this tomorrow. regarding export to lyx 1.6 -- One ugly hack I can thing about is making sure that there is no \xymatrix in the document, and then converting \Diagram into \xymatrix and adding proper "\renew command" in the preamble. I had the same idea, but what do you do if the document also contains \xymatrix? And what if users on LyX 1.6.x later on add an \xymatrix? I therefore think that only a complete reversion of the whole formula to TeX code is really safe. And there is the option of converting to ERT, that seems more reasonable... but I'll be happy for a clue regarding were to start. That should be easy: copy the content between begin/end of the formula inset into ERT. Outputting the TeX code is done via the put_cmd_in_ert routine. (see the revert_rule routine as example). I'll appreciate if someone will send me a password for the wiki. I forgot this - now sent it to you. regards Uwe
Re: Patch: Diagram inset
Am 20.09.2010 04:52, schrieb Ronen Abravanel: Added few paragraphs to the Math manual (the full manual attached. note that the file version changed to 401). Your attached file doesn't contain any feyn-related stuff and is in format 345. regards Uwe