[proposal] solution for LyXWin's math font problems - next try without BaKoMa
Hello LyXers, because some of you complain about the BaKoMa-license, I tried another way: My MikTeX comes with the cm-fonts in Type1 format (pfb-files) created by bluesky. I compiled the fonts for win2000 and winXP as installable pfm-files. Compiling for both systems was necessary because the font handling is slightly different: WinXP doesn't accept the Win2000-compiled fonts (no installable font). And Win2000 complains about the WinXP-compiled fonts (the author of this font doesn't want to convert it to ttf) but installs them correctly and they work with LyX. You can download the font packages from http://fkurth.de/uwest/LyX/LyXWinMathT1Win2000.rar and http://fkurth.de/uwest/LyX/LyXWinMathT1WinXP.rar NOTE: You have to deinstall the corresponding ttf's before intalling the pfm's! Note2: When you test the fonts with LyX, you'll see that the big operators appear too high. I thaught it was fixed in LyX 1.3.5-nc - the XFT-ttf doesn't have this problem. To get well working fonts, replace the cmex10.pfm by the cmex10.ttf from my font-package. Could somebody please test the fonts? At last the license issues: I wasn't able to find the license of bluesky, does somebody know it? I assumed they are free, because they are shipped with the minimal installation of MikTeX. regards Uwe p.s. please CC answers directly to me
Re: ICM URL at http://www.lyx.org/download/
Rafal Maszkowski wrote: ftp://ftp.icm.edu.pl/vol/rzm0/lyx/ is not a canonical path and now is just wrong. The proper ones are e.g.: ftp://sunsite.icm.edu.pl/pub/unix/editors/lyx/ http://sunsite.icm.edu.pl/pub/unix/editors/lyx/ rsync://sunsite.icm.edu.pl/pub/unix/editors/lyx/ Thanks, Rafal. I've updated the web page. May take a few minutes to propogate. -- Angus
[PATCH] inserting in insets
This patch does the following: - make Buffer::insertStringAsLines work when inserting in nested insets - set autoBreakRows_ to true for the top-level inset. Alfredo, is that right? - fix a first crash in BufferView::Pimpl::MenuInsertLyXFile The situation of inserting files in nested insets is however very bad, since Buffer::readDocument can only use a pit_type as argument and this argument is actually never used :( Indeed, readDocument, which does the hard work, is never invoked. Would it be right to pass also a ParagraphList argument to Buffer::readFile and BufferReadDocument? Or is it better in this case (and in Buffer::insertStringAsLines) to pass a dociterator (or a cursor slice) to indicate where to insert. I ask, because buffer.C does not use cursors at all. Comments welcome. JMarc
Crash fixes, code comments, cvs is slooow?
I have a patch, I'd like to commit. It consists of some of the stuff which was approved, plus some comments for the code, and a little more const-correctness here and there. Also, I fixed the breakParagraph bug by remove some obsolete stuff. There was some logic which is not relevant anymore. Another problem with a crash after pressing space at the start of the document twice is also fixed. But the problem is that I can not make diffs for some reason. It just hangs and hangs. Does anybody else experience this problem? CVS is soo slow today. Anyway, I have found a reproducible problem: 1) Start a new document, 2) Type a, return, b, cursor up, return 3) cursor right 4) cursor right: Strange thing happens, the cursor moves on the empty line. 5) cursor down: Boom. Assert in getRowNearY. I believe the problem appears after 3: It probably removes the empty paragraph, but forgets to update the screen. Therefore in step 4, the cursor moves on the b line although it does not look that way. And things go completely wrong when we try to move down, because that row exists on the screen, but not behind the curtains. You can verify this: After step 3, resize the window to force a rebreak, and the empty line disappears, and everything works as intended. So, I guess the problem is that after empty line removal, we need to rebreak the screen. I haven't looked for how to do that yet. Another reproducable bug is the cursor x position after cut/paste when you move up or down: It does not move according to the new cursor position, but according to the old one before the cut. Any ideas where to look? Regards, Asger
Re: [PATCH] inserting in insets
On Thursday 27 January 2005 13:56, Jean-Marc Lasgouttes wrote: This patch does the following: ... Comments welcome. It is amazing what a zero size patch can do, isn't it? ;-) JMarc -- José Abílio
Re: [PATCH] inserting in insets
Jose' == Jose' Matos [EMAIL PROTECTED] writes: Jose' On Thursday 27 January 2005 13:56, Jean-Marc Lasgouttes wrote: This patch does the following: Jose' ... Comments welcome. Jose' It is amazing what a zero size patch can do, isn't it? ;-) Grr. Index: src/BufferView_pimpl.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.568 diff -u -p -r1.568 BufferView_pimpl.C --- src/BufferView_pimpl.C 24 Jan 2005 17:12:16 - 1.568 +++ src/BufferView_pimpl.C 27 Jan 2005 13:49:25 - @@ -807,7 +807,7 @@ void BufferView::Pimpl::MenuInsertLyXFil owner_-message(bformat(_(Inserting document %1$s...), disp_fn)); bv_-cursor().clearSelection(); - bv_-text()-breakParagraph(bv_-cursor()); + bv_-getLyXText()-breakParagraph(bv_-cursor()); BOOST_ASSERT(bv_-cursor().inTexted()); Index: src/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v retrieving revision 1.2100 diff -u -p -r1.2100 ChangeLog --- src/ChangeLog 24 Jan 2005 17:12:17 - 1.2100 +++ src/ChangeLog 27 Jan 2005 13:49:27 - @@ -1,7 +1,19 @@ +2005-01-27 Jean-Marc Lasgouttes [EMAIL PROTECTED] + + * BufferView_pimpl.C (MenuInsertLyXFile): do breakParagraph on the + LyXText containing the cursor, not the top-level one. + + * buffer.C (Impl): make sure the toplevel insettext has AutoBreak_ + true. + (insertStringAsLines): rename par to pit; use temporary variable + par to hold a Paragraph; do not store par.layout() in a variable, + since the pointer may die when breaking paragraphs; pass pars to + breakParagraph() instead of Buffer::paragraphs(). + 2005-01-24 Jürgen Spitzmüller [EMAIL PROTECTED] * LaTeXFeatures.[Ch]: Add a static list packages_ that - holds the contens of packages.lst. New functions getAvailable + holds the contents of packages.lst. New functions getAvailable and isAvailable to parse and check that list, resp. * LyXAction.C: Index: src/buffer.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v retrieving revision 1.607 diff -u -p -r1.607 buffer.C --- src/buffer.C 24 Jan 2005 17:12:15 - 1.607 +++ src/buffer.C 27 Jan 2005 13:49:27 - @@ -200,6 +200,7 @@ Buffer::Impl::Impl(Buffer parent, stri filename(file), filepath(OnlyPath(file)), file_fully_loaded(false), inset(params) { + inset.setAutoBreakRows(true); lyxvc.buffer(parent); temppath = createBufferTmpDir(); // FIXME: And now do something if temppath == string(), because we @@ -477,23 +478,22 @@ bool Buffer::readDocument(LyXLex lex) // needed to insert the selection void Buffer::insertStringAsLines(ParagraphList pars, - pit_type par, pos_type pos, + pit_type pit, pos_type pos, LyXFont const fn, string const str, bool autobreakrows) { - LyXLayout_ptr const layout = pars[par].layout(); - LyXFont font = fn; - pars[par].checkInsertChar(font); + pars[pit].checkInsertChar(font); // insert the string, don't insert doublespace bool space_inserted = true; for (string::const_iterator cit = str.begin(); - cit != str.end(); ++cit) { + cit != str.end(); ++cit) { + Paragraph par = pars[pit]; if (*cit == '\n') { - if (autobreakrows (!pars[par].empty() || pars[par].allowEmpty())) { -breakParagraph(params(), paragraphs(), par, pos, - layout-isEnvironment()); -++par; + if (autobreakrows (!par.empty() || par.allowEmpty())) { +breakParagraph(params(), pars, pit, pos, + par.layout()-isEnvironment()); +++pit; pos = 0; space_inserted = true; } else { @@ -501,18 +501,18 @@ void Buffer::insertStringAsLines(Paragra } // do not insert consecutive spaces if !free_spacing } else if ((*cit == ' ' || *cit == '\t') - space_inserted !pars[par].isFreeSpacing()) { + space_inserted !par.isFreeSpacing()) { continue; } else if (*cit == '\t') { - if (!pars[par].isFreeSpacing()) { + if (!par.isFreeSpacing()) { // tabs are like spaces here -pars[par].insertChar(pos, ' ', font); +par.insertChar(pos, ' ', font); ++pos; space_inserted = true; } else { const pos_type n = 8 - pos % 8; for (pos_type i = 0; i n; ++i) { - pars[par].insertChar(pos, ' ', font); + par.insertChar(pos, ' ', font); ++pos; } space_inserted = true; @@ -522,7 +522,7 @@ void Buffer::insertStringAsLines(Paragra continue; } else { // just insert the character - pars[par].insertChar(pos, *cit, font); + par.insertChar(pos, *cit, font); ++pos; space_inserted = (*cit == ' '); }
Re: [patch] change tracking output
Angus Leeming wrote: Oh, if the file is meant to change only at predetermined times, then a single line added to lyx_cb.C's Reconfigure would do the trick: LatexFeatures::getAvailable(); no? But you're probably right. Not worth it. At the moment. I did it nevertheless. Patch attached. If no one objects, I will commit this. Jürgen Index: LaTeXFeatures.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeXFeatures.C,v retrieving revision 1.116 diff -u -r1.116 LaTeXFeatures.C --- LaTeXFeatures.C 24 Jan 2005 17:12:18 - 1.116 +++ LaTeXFeatures.C 27 Jan 2005 16:02:20 - @@ -84,6 +84,11 @@ if (!lex.isOK()) return; + // This is necessary for lyx_cb.C's reconfigure + // (some packages might have been removed) + if (!packages_.empty()) + packages_.clear(); + bool finished = false; // Parse config-file while (lex.isOK() !finished) { Index: lyx_cb.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v retrieving revision 1.245 diff -u -r1.245 lyx_cb.C --- lyx_cb.C 10 Jan 2005 19:17:39 - 1.245 +++ lyx_cb.C 27 Jan 2005 16:02:21 - @@ -23,6 +23,7 @@ #include debug.h #include gettext.h #include lastfiles.h +#include LaTeXFeatures.h #include lyx_main.h #include lyxlayout.h #include lyxrc.h @@ -449,6 +450,8 @@ p.pop(); bv-owner()-message(_(Reloading configuration...)); lyxrc.read(LibFileSearch(string(), lyxrc.defaults)); + // Re-read packages.lst + LaTeXFeatures::getAvailable(); Alert::information(_(System reconfigured), _(The system has been reconfigured.\n
Re: Crash fixes, code comments, cvs is slooow?
Asger Ottar Alstrup wrote: But the problem is that I can not make diffs for some reason. It just hangs and hangs. Does anybody else experience this problem? CVS is soo slow today. What CVS client do you use? I've been using TortoiseCVS and it seems to work well. I have a question for you now, as my resident Windows knowledge base ;-) In this nastiness below, I tried to convert a LPTSTR object to an LPCSTR one so that I could add it to a larger string. However, I find that 1. I can't because the T2CA macro is an AFX thingie and I don't have that installed. 2. I don't need to anyway, because LPTSTR is already char-based. When is LPTSTR wchar_t-based and what would I need to do were that the case? // WaitForSingleObject failed DWORD const error_code = ::GetLastError(); LPVOID t_message; ::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 0, error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) t_message, 0, 0); // Convert the message to a char-based string. // LPCSTR c_message = T2CA(t_message); // LocalFree(t_message); // FIXME Use bformat here! string system_message((LPTSTR)t_message); -- Angus
tex2lyx does not support the new package scheme
Hi, when testing the latesttex2lyx I get this: $ ./tex2lyx ~/test.tex Unable to determine the system directory having searched /home/jamatos/lyx/lyx-devel/src/share/lyx-1.4.0cvs/ Try the '-sysdir' command line parameter or set the environment variable LYX_DIR_13x to the LyX system directory containing the file `chkconfig.ltx'. Any help? -- José Abílio
Re: tex2lyx does not support the new package scheme
Jose' Matos wrote: $ ./tex2lyx ~/test.tex Unable to determine the system directory having searched /home/jamatos/lyx/lyx-devel/src/share/lyx-1.4.0cvs/ Try the '-sysdir' command line parameter or set the environment variable LYX_DIR_13x to the LyX system directory containing the file `chkconfig.ltx'. Any help? A. The scheme expects that the binary to be in the top-build-dir/src directory, but tex2lyx is in the top-build-dir/src/tex2lyx directory. See get_build_dirs: string const binary_dir = OnlyPath(binary); string const build_support_dir = NormalizePath(AddPath(binary_dir, ../lib)); if (!FileSearch(build_support_dir, lyxrc.defaults).empty()) H. Any ideas on how best to tackle this? -- Angus
Re: tex2lyx does not support the new package scheme
On Thursday 27 January 2005 17:26, Angus Leeming wrote: A. The scheme expects that the binary to be in the top-build-dir/src directory, but tex2lyx is in the top-build-dir/src/tex2lyx directory. See get_build_dirs: string const binary_dir = OnlyPath(binary); string const build_support_dir = NormalizePath(AddPath(binary_dir, ../lib)); if (!FileSearch(build_support_dir, lyxrc.defaults).empty()) H. Any ideas on how best to tackle this? Add another argument for the relative depth, with 0 for lyx and 1 for tex2lyx? NormalizePath(AddPath(binary_dir, ../ * (depth + 1) + lib)); I am not sure how serious this is. ;-) -- José Abílio
Re: [patch] change tracking output
Juergen Spitzmueller [EMAIL PROTECTED] writes: | Angus Leeming wrote: Oh, if the file is meant to change only at predetermined times, then a single line added to lyx_cb.C's Reconfigure would do the trick: LatexFeatures::getAvailable(); no? But you're probably right. Not worth it. At the moment. | I did it nevertheless. Patch attached. If no one objects, I will commit this. | Jürgen | Index: LaTeXFeatures.C | === | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeXFeatures.C,v | retrieving revision 1.116 | diff -u -r1.116 LaTeXFeatures.C | --- LaTeXFeatures.C 24 Jan 2005 17:12:18 - 1.116 | +++ LaTeXFeatures.C 27 Jan 2005 16:02:20 - | @@ -84,6 +84,11 @@ | if (!lex.isOK()) | return; | | + // This is necessary for lyx_cb.C's reconfigure | + // (some packages might have been removed) | + if (!packages_.empty()) | + packages_.clear(); | + Any particualr reason not to just clear it? // Make sure that we are clean packages_.clear(); Without having seen the rest of the code, perhas it would be better to build the new packages in a new object and do a swap after it is setup fresh. Then exception safety will be (kindo) taken care of. -- Lgb
Re: Crash fixes, code comments, cvs is slooow?
Angus Leeming wrote: Asger Ottar Alstrup wrote: But the problem is that I can not make diffs for some reason. It just hangs and hangs. Does anybody else experience this problem? CVS is soo slow today. What CVS client do you use? I've been using TortoiseCVS and it seems to work well. Me too. It has been hanging for more than two hours. No progress, no errors, no diff. In this nastiness below, I tried to convert a LPTSTR object to an LPCSTR one so that I could add it to a larger string. However, I find that 1. I can't because the T2CA macro is an AFX thingie and I don't have that installed. 2. I don't need to anyway, because LPTSTR is already char-based. When is LPTSTR wchar_t-based and what would I need to do were that the case? LPTSTR is a long pointer to a _TCHAR based zero-terminated string. _TCHAR is 8-bit or 16-bit depending on which run-time library you link against. If you define _UNICODE, it will be 16-bit. If you define _MBCS, it will be 8-bit. The AFX thing is MFC-related. To do what you are trying to do, just use this, provided you are using the multi-byte runtime: std::string getFormatErrorMessage() { LONG error = ::GetLastError(); HLOCAL lpMsgBuf = 0; bool ok = ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) lpMsgBuf, 0, NULL ) != 0; if ( ok ) { std::string retValue( (LPTSTR) lpMsgBuf ); // Free the buffer. ::LocalFree( lpMsgBuf ); return retValue; } else { std::stringstream s; s Unknown error: error std::endl; return s.str(); } } Regards, Asger
Re: Crash fixes, code comments, cvs is slooow?
Asger Ottar Alstrup [EMAIL PROTECTED] writes: | Angus Leeming wrote: Asger Ottar Alstrup wrote: But the problem is that I can not make diffs for some reason. It just hangs and hangs. Does anybody else experience this problem? CVS is soo slow today. What CVS client do you use? I've been using TortoiseCVS and it seems to work well. | Me too. It has been hanging for more than two hours. No progress, no | errors, no diff. It is working fine for me... A bit slow perhaps... -- Lgb
Re: Crash fixes, code comments, cvs is slooow?
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: | Asger Ottar Alstrup [EMAIL PROTECTED] writes: | | Angus Leeming wrote: Asger Ottar Alstrup wrote: But the problem is that I can not make diffs for some reason. It just hangs and hangs. Does anybody else experience this problem? CVS is soo slow today. What CVS client do you use? I've been using TortoiseCVS and it seems to work well. | | Me too. It has been hanging for more than two hours. No progress, no | | errors, no diff. | It is working fine for me... | A bit slow perhaps... Actually quite fine. I see your process there... not doing squat... You should probably restart it. -- Lgb
[Patch] convert it
This is the convert patch I am going to commit unless I hear a lot of bad language. (There are some testing code that is not visible here that will also be committed) ? Config ? convert-1.diff ? convert-2.diff ? convert-3.diff ? cppflags-1.diff ? idxupdown2-1.diff ? includes-1.diff ? src/support/package.C ? src/support/tests Index: configure.ac === RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v retrieving revision 1.39 diff -u -p -B -b -w -r1.39 configure.ac --- configure.ac 21 Jan 2005 13:48:12 - 1.39 +++ configure.ac 27 Jan 2005 18:33:17 - @@ -413,6 +413,7 @@ AC_CONFIG_FILES([Makefile m4/Makefile \ src/graphics/Makefile \ src/insets/Makefile \ src/support/Makefile \ + src/support/tests/Makefile \ src/frontends/Makefile \ src/frontends/controllers/Makefile \ src/frontends/xforms/Makefile \ Index: po/POTFILES.in === RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/POTFILES.in,v retrieving revision 1.403 diff -u -p -B -b -w -r1.403 POTFILES.in --- po/POTFILES.in 12 Jan 2005 12:25:29 - 1.403 +++ po/POTFILES.in 27 Jan 2005 18:33:19 - @@ -206,6 +206,7 @@ src/paragraph.C src/rowpainter.C src/support/filefilterlist.C src/support/package.C.in +src/support/path_defines.C src/text.C src/text2.C src/text3.C Index: src/BufferView_pimpl.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.568 diff -u -p -B -b -w -r1.568 BufferView_pimpl.C --- src/BufferView_pimpl.C 24 Jan 2005 17:12:16 - 1.568 +++ src/BufferView_pimpl.C 27 Jan 2005 18:33:20 - @@ -88,7 +88,6 @@ using lyx::support::IsDirWriteable; using lyx::support::MakeDisplayPath; using lyx::support::MakeAbsPath; using lyx::support::package; -using lyx::support::strToUnsignedInt; using std::endl; using std::istringstream; @@ -966,7 +965,7 @@ FuncStatus BufferView::Pimpl::getStatus( break; case LFUN_BOOKMARK_GOTO: - flag.enabled(bv_-isSavedPosition(strToUnsignedInt(cmd.argument))); + flag.enabled(bv_-isSavedPosition(convertunsigned int(cmd.argument))); break; case LFUN_TRACK_CHANGES: flag.enabled(true); @@ -1052,11 +1051,11 @@ bool BufferView::Pimpl::dispatch(FuncReq break; case LFUN_BOOKMARK_SAVE: - savePosition(strToUnsignedInt(cmd.argument)); + savePosition(convertunsigned int(cmd.argument)); break; case LFUN_BOOKMARK_GOTO: - restorePosition(strToUnsignedInt(cmd.argument)); + restorePosition(convertunsigned int(cmd.argument)); break; case LFUN_REF_GOTO: { Index: src/Chktex.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Chktex.C,v retrieving revision 1.33 diff -u -p -B -b -w -r1.33 Chktex.C --- src/Chktex.C 6 Jan 2004 19:32:05 - 1.33 +++ src/Chktex.C 27 Jan 2005 18:33:20 - @@ -15,16 +15,15 @@ #include LaTeX.h // TeXErrors +#include support/convert.h #include support/filetools.h #include support/lstrings.h -#include support/lyxlib.h #include support/systemcall.h #include boost/format.hpp #include fstream -using lyx::support::atoi; using lyx::support::ChangeExtension; using lyx::support::OnlyFilename; using lyx::support::split; @@ -82,7 +81,7 @@ int Chktex::scanLogFile(TeXErrors terr token = split(token, warno, ':'); token = split(token, warning, ':'); - int const lineno = atoi(line); + int const lineno = convertint(line); #if USE_BOOST_FORMAT msg % warno; Index: src/Spacing.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Spacing.C,v retrieving revision 1.40 diff -u -p -B -b -w -r1.40 Spacing.C --- src/Spacing.C 6 Jan 2005 16:39:21 - 1.40 +++ src/Spacing.C 27 Jan 2005 18:33:20 - @@ -18,9 +18,7 @@ #include sstream #include string -using lyx::support::strToDbl; -//using std::ios; using std::ostream; using std::ostringstream; using std::string; @@ -45,11 +43,11 @@ string const Spacing::getValueAsString() double Spacing::getValue() const { - return strToDbl(getValueAsString()); + return convertdouble(getValueAsString()); } -void Spacing::set(Spacing::Space sp, float val) +void Spacing::set(Spacing::Space sp, double val) { set(sp, convertstring(val)); } @@ -59,7 +57,7 @@ void Spacing::set(Spacing::Space sp, str { space = sp; if (sp == Other) { - switch (int(strToDbl(val) * 1000 + 0.5)) { + switch (int(convertdouble(val) * 1000 + 0.5)) { case 1000: space = Single; break; Index: src/Spacing.h === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Spacing.h,v retrieving revision 1.28 diff -u -p -B -b -w -r1.28 Spacing.h --- src/Spacing.h 6 Jan 2005 13:48:07 - 1.28 +++ src/Spacing.h 27 Jan 2005 18:33:20 - @@
Re: Crash fixes, code comments, cvs is slooow?
Here is the rough patch. Ignore all you do not like, but many changes are good. I do not have time to make separate patch now. Sorry. Regards, Asger lyx-devel.patch.bz2 Description: Binary data
Re: scripting support via lyxserver
On Friday 21 January 2005 08:28, G. Milde wrote: Please find attached my work so far. If you copy lyx.py into the pythonpath, pydoc will give you a nice view of the doc strings and setup Hi Gnter, I would like to congratulate you for your work with the lyx server via the python module. This is something that I wanted to do for quite some time. :-) Generally, the lyxserver seems to be an a sad state mainly because noone seems to use it seriously. (Some of my ideas and complaints are to be found in examples/lyxtest.py.) If there is interest (and consent that this is the right place), I'd like to discuss this issue further. Please do. Gnter PS: In another movement (no pun John ;-) to help python scripting for lyx the lyx2lyx program has become only a interface to the new LyX.py module. The main concern of this module is mainly the file format (as it is to be expected from a lyx2lyx evolution), but my goal is make that a more general module. As such the lyx server component will be a nice addition. :-) -- Jos Ablio
Re: [proposal] solution for LyXWin's math font problems - next try without BaKoMa
I wrote: Compiling for both systems was necessary because the font handling is slightly different: WinXP doesn't accept the Win2000-compiled fonts (no installable font). Sorry, I didn't know that Win needs the pfm- AND the corresponding pfb-files. I uploaded a new package http://fkurth.de/uwest/LyX/LyXWinMathT1.rar that includes the pfb's. It should work on win2000 and winXP. Note2: When you test the fonts with LyX, you'll see that the big operators appear too high. I thaught it was fixed in LyX 1.3.5-nc - the XFT-ttf doesn't have this problem. While testing, I encountered that all Type1 fonts causes problems in LyX: When you insert a symbol to a formula, the math box becomes larger at the bottom (protrudes over the line base). Therefore the bluesky-fonts are only an option for the future, when LyXWin won't have this bug. regards Uwe
Re: Pending patches for the 1.3.x tree
On Mon, Jan 24, 2005 at 01:37:38PM +, Angus Leeming wrote: Jean-Marc Lasgouttes wrote: What I was not sure about is how you handle option=='foo bar'. We don't. All hell breaks loose at this point and always has. The existing code to split a string up into an argv array is: : [snip] : Ie, we assume that ' ' marks the gap between arguments in the string. To do this properly requires a fully-formed parser of the sh language. I just ran a quick test. Any Unix shell treats --option='foo bar' as a single element of *argv[]. The single-quotes protected the space from the shell. (I tested with bash, ash, csh, tcsh, ksh, and bsh.) For Windows, however I wouldn't be surprised if whitespace chars weren't escaped. Just another one of those platform differences that'll need special handling. -- John Weiss
Re: [Patch] Refactoring PreviewLoader
On Mon, Jan 24, 2005 at 08:15:10PM +, Andreas Vox wrote: Angus Leeming [EMAIL PROTECTED] writes: namespace support = lyx::support; using std::ostream; typedef liststring SnippetList; is just baaaddd. Ah, bad for *.h, ok for *.C? Got it. The reason being that *.h files are included into other files in ways you cannot control. Conversely, those including a *.h file into their own code have no control over its contents (at least in principle). So, if you pull something into the global namespace in a header file, like using std::list; would, you force EVERY file using your header file either to use std::list at all times or to go through name-conflict-resolution-gymnatics to use the correct token called list. But the whole point of namespaces is to minimize/eliminate these sorts of gymnastics in the first place. But why is it okay for *.C? First and most obviously, source files aren't included into other source or headers. But, more importantly, a source file is a translation unit. That is, the compiler treats it (and any #include'd headers) as a self-contained entity. Any references to outside critters must be flagged as such. So, doing using std::ostream; inside of a source file only affects the contents of *that* source file, and only during the tokenization stage of compilation. (The compiler's gonna internally change any unqualified ostream tokens back into std::ostream.) At this point, we enter a discussion of stylistics and code maintenance. The bulk of one's work on a piece of code will be maintenance, not writing it initially. It's one of the old bromides of software development, actually. Therefore, good coding style dictates that you code in the future tense, using language features only in the most narrow sense. For example, you don't make all members of a class public; you only make those you absolutely need to expose public. In the future, should you need to expose one of your private member functions, it's trivial to do so witha quick cut-n-paste in your class header file. The idea behind a using clause is similar. Localize them to where you need them most, and only to there. It's not much effort to add using std::string; at the top of each new function that requires STL strings. Then, if you later find that, yes, most of the functions in this *.C file need STL strings and will never use any other kind of string, you can easily add a top-level using std::string;, no changes to exsting code necessary. Consider the converse situation, where you use the hydroge-bomb approach and start out with using std::map; at the top of your source. You merrily write away. Then one day, you need to add a new header file and some special code for a specially-optimized RDBMS-backed dictionary structure. It's also called map. So you write your new functions, add a using somespecial::map to each, and WHAMO! You get a bazillion name-conflicts at compile time. Now you not only have to remove the top-level using std::map, but you need to sift through hundreds of lines of code to find which functions actually use std::map and add in a using statement to just those functions. What a headache! There are nevertheless reasons for putting a top-level using std::foo; decl. in a file. Doing so makes a statement: Don't even THINK of using another type of fooXYZ with this code! Putting in a toplevel using std::ostream; tells future authors that no one, no one at all, should even try to use anything but the STL ostream with this code... put it in another source file and link the two together instead! Does that help at all, Andreas? -- John Weiss
Let's All Attack John...
On Tue, Jan 25, 2005 at 09:16:38AM +0100, Asger Ottar Alstrup wrote: John Weiss wrote: [A great opportunity to have a little flame-fest.] You're the one attacking me out-of-hand. Not FUD. Reality. [Long story about something irrelevant.] Took them YEARS to get it to that state. Sad for them. I have a working LyX. It took a week of work while Elias was sleeping. All you are saying is FUD, and the proof is in the code. You can repeat the same stories ten times, but they will still be FUD. So, in other words, my professional experiences don't count for shit as far as you're concerned, you'd just rather insult highly-intelligent former-coworkers of mine for whom I have great respect and who did Windows/Unix-platform-independence some 10 years ago, before there was a Cygwin, before there was a QT, and before there was a Boost. Then, to top off your insult-fest, you have the gall to claim that I'm the one doing the flaming?!? You could've asked me *what* I was basing my claims on instead of name-calling. You could've found out that I've been comparing Boost's way of doing platform-indep. to what I saw at my former employer. You could've just said, Warnings acknowledged, but John, I don't think it'll be that bad as most of the heavy-lifting's been done in QT and/or Boost. You could've bothered to find out that I'm not at all against a Windows version of LyX, and that after certain legal issues have been cleared up with my present (new) employer, I would've been interested in working on a plaform-indep. abstraction. In short, you could've chosen any number of more civil forms of communication. You didn't. Well, I'm calling you on it, Asger: You instead chose to selectively edit so you could publicly insult and humiliate me. I thought I'd earned a bit of respect from you by now; you certainly had mine. Now... now I'm not even sure I want to be bothered with LyX. I've been through 3 years of job-hell. I don't need this added stress. -- John Weiss
Re: lyxbreaker???
On Tue, Jan 25, 2005 at 02:38:54PM +, Angus Leeming wrote: Which means that it's dead easy to set a break point in gdb. Any entry into lyxbreaker is automatically invalid, so stop there and have a look at the execution path to that point. Try it yourself: gdb ./lyx (gdb) break lyxbreaker Breakpoint 1 at 0x120132a34: file ostream, line 193. (gdb) run Ok, time for another language lesson: While, break means set a breakpoint to most of us comp.sci. types, in common English, it can mean smash with a hammer into little inoperable bits. When you add the -er suffix, however, only the latter meaning remains. That is, a Zbreaker would be someone who rips apart Z so that it's now broken. Incidentally, I'm gonna take a guess that the break in a debugger is related to circuit breaker, the thing in your electric panel that severs an electrical circuit pulling too many amps. In short: calling a function lyxbreaker is a Bad Idea, as it implies that this function somehow damages LyX. Better to call it lyxstopper or lyxbreakpt, the latter being far more descriptive if its purpose. -- John Weiss
Re: Nasty qt-3.3.3 bug
On Sun, Jan 23, 2005 at 09:57:26PM +0200, Martin Vermeer wrote: (This also reminded me how VERY VERY VERY unhappy I am about Math not having its own top-level menu entry anymore. It is such a separate and special part of both LyX and LaTeX, that this old practice was more than justified. IMHO of course.) Seconded. -- John Weiss
Questioning Why I Bother.
On Tue, Jan 25, 2005 at 09:30:45AM +, Angus Leeming wrote: John Weiss wrote: On Fri, Jan 21, 2005 at 09:57:48PM +, Angus Leeming wrote: Cygwin's POSIX emulation layer avoids the need for the various workarounds required when using other compilers under MS-Windows. See! See! I *am* speaking from real experience! I'm not just some idiot talking out his ass like Asger says I am! John, with all due respect, you're starting to rant. Umm... Gee, maybe that's because, oh, I dunno, I'M FEELING PERSONALLY ATTACKED HERE?! I thought that maybe, just maybe, after being a contributor in some form or other for 8+ years now I've deluded myself into thinking I had your collective respect? I foolishly thought that, at least here, my acumulated technical experience from the workplace would have *some* use, that it counted for something at least here. Clearly, I was wrong. I've been through 4 years of career-destroying Job Hell. My chances of flexing ... well, really, *anything* of my technical skills, let alone doing any C++ programming ... on the job in the next 2 years are slim to none. I've been forced into signing an NDA that would lay claim to anything creative I do. So, I've been holding off even looking at LyX code to protect it until I have my concerns with that NDA legally dealt with. (It's taken me nearly 3 months to get it resolved.) And what do I get for it? Personally attacked and insulted. Gee, thanks. -- John Weiss
Re: LyX on Windows
On Mon, Jan 24, 2005 at 10:01:09AM +0100, Lars Gullik Bjønnes wrote: Sure it is nice to compile on more than one compiler... but if the result is muddier code then I am not sure about the gain. (and not that I have not said that this is the case, just a thing to watch out for. And avoiding muddy code in a Unix-Windows-crossplatform program will require a bit of work (in which I include careful planning). Which was the whole point of those cautioning posts of mine. -- John Weiss
Re: [rework docs] default figure placement inside float
On Wed, Jan 26, 2005 at 02:24:05AM +0100, Uwe Stöhr wrote: Martin Vermeer wrote: What he means is that the figure is formally embedded in a paragraph inside the float, which is formatted justified (out of alternatives left, right, justified and centred). This means the picture will align with the left edge, being just one huge character in the paragraph. Yes, that was what I meant. Yeah, I kinda figured that, Uwe. What I'm wondering is: are figure floats automatically left-justified? (That's what I meant by LaTeX-ism.) I *vaguely* recall having to do some sorta preamble-hack to get my 100+ pages of figures for my thesis to appear centered on the page at the size I wanted. But it's been over 6 years since then, and my memory's failing. And, agreed, would be nice if the justification of an figure float were tunable. (How easy it would be... I'd have to dig out my dissertation and see if I'm even on the right track here, or if my memory's flakey.) -- John Weiss
Re: lyxbreaker???
John Weiss [EMAIL PROTECTED] writes: ... In short: calling a function lyxbreaker is a Bad Idea, as it implies that this function somehow damages LyX. Better to call it lyxstopper or lyxbreakpt, the latter being far more descriptive if its purpose. But lyxbreaker has BOOST_ASSERT(false) in its body, so it *does* break lyx. I think the name is ok, I just don't understand why one would put such a function into the code; and why one needs another function lyxaborter which does exactly the same, just with other output. /Andreas
Re: Let's All Attack John...
John Weiss [EMAIL PROTECTED] writes: | Now... now I'm not even sure I want to be bothered with LyX. I've | been through 3 years of job-hell. I don't need this added stress. Please take a step back. If you knew the flak I have taken... You really, really should come to a LyX meeting. Then we could have some beer and it each other over the head with the bottles. -- Lgb
Re: Questioning Why I Bother.
John Weiss [EMAIL PROTECTED] writes: | On Tue, Jan 25, 2005 at 09:30:45AM +, Angus Leeming wrote: John Weiss wrote: On Fri, Jan 21, 2005 at 09:57:48PM +, Angus Leeming wrote: Cygwin's POSIX emulation layer avoids the need for the various workarounds required when using other compilers under MS-Windows. See! See! I *am* speaking from real experience! I'm not just some idiot talking out his ass like Asger says I am! John, with all due respect, you're starting to rant. | Umm... Gee, maybe that's because, oh, I dunno, I'M FEELING PERSONALLY | ATTACKED HERE?! Please. You are not helping now. Besides I am the only one allowed to be personally attacked in this forum. -- Lgb
Re: Let's All Attack John...
Lars Gullik Bjnnes [EMAIL PROTECTED] writes: John Weiss [EMAIL PROTECTED] writes: | Now... now I'm not even sure I want to be bothered with LyX. I've | been through 3 years of job-hell. I don't need this added stress. Please take a step back. If you knew the flak I have taken... You really, really should come to a LyX meeting. Then we could have some beer and it each other over the head with the bottles. For heavens sake add a smiley there! ;-) We don't want John to think Europeans do bar fights for sport ... John, after what you told us about your situation I can understand you don't want any aggro from this list. But I don't see that *all* attack you, just some robust discussion with Asger, which you'd probably forgive once you had drunk some beer with him ... (see, Europeans *do* believe they can be friends with anyone once they drink beer together! :-) ) I wish you best luck for your work (I just had half a year of job hell and I don't envy you) and hope you find some rest from your troubles. Ciao /Andreas
Re: Questioning Why I Bother.
On Fri, Jan 28, 2005 at 02:21:01AM +0100, Lars Gullik Bj?nnes wrote: Besides I am the only one allowed to be personally attacked in this forum. Oh come on, you must consider Andre here. (For which I'm a bit sorry...) john
Re: Let's All Attack John...
On Fri, Jan 28, 2005 at 01:52:45AM +, Andreas Vox wrote: John, after what you told us about your situation I can understand you don't want any aggro from this list. But I don't see that *all* attack you, Anyway, Mr. Weiss needs to know I've long since taken his title of Least Popular John. john
Re: scripting support via lyxserver
On Thu, Jan 27, 2005 at 07:03:11PM +, Jose' Matos wrote: PS: In another movement (no pun John ;-) to help python scripting for lyx Is this a test on whether I'm still listening? :) Super-glad to see Asger back into the fold. He can be a less hated me!! john
Drag-n-drop image files (QT)
Howdy, A colleague asked me if there was anything that MS word could do well, that LyX couldn't, and all I could think of was drag-n-dropping image files into the document. That got me to thinking what it would take to implement it in LyX. Here's one solution, albeit somewhat naive perhaps, as I've not been hacking LyX for quite some time, so there may be unaccounted side-effects. The strategy was to build on the current drag-n-drop support, which allows you to open a lyx file by dropping it in the main window. Now QWorkArea::dropEvent() checks each entry in the QStringList::Iterator, and if it represents an image file, dispatch sends an LFUN_INSET_INSERT graphics request. If it isn't a graphics file, then dispatch requests an LFUN_FILE_OPEN. Then in factory.C, createInset() handles the LFUN_INSET_INSERT graphics by adding the filename obtained from the dropEvent to the InsetGraphicsParams structure before InsetGraphics::setParams() is called. I've patched 1.3.5-qt (3.3.3) for drag-n-drop of graphics files, and it works great. Also have a patch for 1.4.0 cvs, but it's buggy, and I'm not sure whether it's my doing or just a result of the current state of cvs. In 1.3.5, the image is placed at the cursor, already showing, and clipped. But in 1.4.0, the image is always inserted at the top of the document, and there are bizarre redraws with multiple images (e.g. some are missing until you resize the window a certain way). Is anyone working on dnd image support? The 1.4.0 current cvs patch follows. Let me know if you want the patch for 1.3.5. JB -- Johnathan K. Burchill, Ph.D. [EMAIL PROTECTED] Patch for 1.4.0 current cvs: Index: src/frontends/qt2/QWorkArea.h === RCS file: /cvs/lyx/lyx-devel/src/frontends/qt2/QWorkArea.h,v retrieving revision 1.15 diff -u -3 -p -u -r1.15 QWorkArea.h --- src/frontends/qt2/QWorkArea.h 2004/04/28 17:22:04 1.15 +++ src/frontends/qt2/QWorkArea.h 2005/01/28 04:29:20 @@ -64,6 +64,8 @@ public: /// get the content pane widget QWidget * getContent() const { return content_; } private: + /// Test whether str is a loadable image + bool decodeGraphics( QString const str ); /// scroll bar QScrollBar * scrollbar_; /// content Index: src/frontends/qt2/QWorkArea.C === RCS file: /cvs/lyx/lyx-devel/src/frontends/qt2/QWorkArea.C,v retrieving revision 1.28 diff -u -3 -p -u -r1.28 QWorkArea.C --- src/frontends/qt2/QWorkArea.C 2004/05/20 09:36:28 1.28 +++ src/frontends/qt2/QWorkArea.C 2005/01/28 04:29:20 @@ -225,7 +225,24 @@ void QWorkArea::dropEvent(QDropEvent* ev lyxerr[Debug::GUI] QWorkArea::dropEvent: got URIs! endl; for (QStringList::Iterator i = files.begin(); -i!=files.end(); ++i) - dispatch(FuncRequest(LFUN_FILE_OPEN, fromqstr(*i))); +i!=files.end(); ++i) { + //First see if a graphic was dropped + if ( decodeGraphics(*i) ) { + dispatch(FuncRequest(LFUN_INSET_INSERT, + graphics \ + fromqstr(*i) + \)); + } else { + dispatch(FuncRequest(LFUN_FILE_OPEN, fromqstr(*i))); + } + } } } + +bool QWorkArea::decodeGraphics( QString const str ) +{ + //Allow ps, eps, and allowable QT formats + QString name(str); + return (name.endsWith(.ps, false) || + name.endsWith(.eps, false) || +(QImageIO::imageFormat(name) != 0)); +} + Index: src/factory.C === RCS file: /cvs/lyx/lyx-devel/src/factory.C,v retrieving revision 1.95 diff -u -3 -p -u -r1.95 factory.C --- src/factory.C 2004/08/14 15:55:17 1.95 +++ src/factory.C 2005/01/28 04:29:20 @@ -252,6 +252,12 @@ InsetBase * createInset(BufferView * bv, InsetGraphicsMailer::string2params(cmd.argument, buffer, igp); auto_ptrInsetGraphics inset(new InsetGraphics); + string const filename = cmd.getArg( 1 ); + if (!filename.empty()) { + igp.filename = filename; + //automatically clip the image + igp.clip = true; + } inset-setParams(igp); return inset.release(); pgp8tErWqNiaY.pgp Description: PGP signature
Toplevel math menu (was: Nasty qt-3.3.3 bug)
On 27.01.05, John Weiss wrote: On Sun, Jan 23, 2005 at 09:57:26PM +0200, Martin Vermeer wrote: (This also reminded me how VERY VERY VERY unhappy I am about Math not having its own top-level menu entry anymore. It is such a separate and special part of both LyX and LaTeX, that this old practice was more than justified. IMHO of course.) Seconded. This is easily achieved in my 1.3.4 by the following patch --- /usr/share/lyx/ui/default.ui2004-07-25 07:39:20.0 +0200 +++ /home/milde/.lyx/ui/topmath.ui 2005-01-28 08:25:31.0 +0100 @@ -7,6 +7,7 @@ Submenu File|F file Submenu Edit|E edit Submenu Insert|I insert + Submenu Math|M edit_math Submenu Layout|L layout Submenu View|V view Submenu Navigate|N navigate @@ -72,7 +73,6 @@ Separator Item Find Replace...|F find-replace Submenu Tabular|T edit_tabular - Submenu Math|M edit_math Separator #Item Read Only buffer-toggle-read-only Item Spellchecker...|S spellchecker Now set the GUI file in EditPreferences to topmath (without the .ui extension), save and restart with a Math top level menu. Günter -- G.Milde web.de
Re: lyxbreaker???
On 28.01.05, Andreas Vox wrote: John Weiss [EMAIL PROTECTED] writes: ... In short: calling a function lyxbreaker is a Bad Idea, as it implies that this function somehow damages LyX. Better to call it lyxstopper or lyxbreakpt, the latter being far more descriptive if its purpose. But lyxbreaker has BOOST_ASSERT(false) in its body, so it *does* break lyx. No, IMHO, the aim of the function is to make you aware of a broken LyX, not to break it (into pieces). Günter -- G.Milde web.de
[proposal] solution for LyXWin's math font problems - next try without BaKoMa
Hello LyXers, because some of you complain about the BaKoMa-license, I tried another way: My MikTeX comes with the cm-fonts in Type1 format (pfb-files) created by bluesky. I compiled the fonts for win2000 and winXP as installable pfm-files. Compiling for both systems was necessary because the font handling is slightly different: WinXP doesn't accept the Win2000-compiled fonts ("no installable font"). And Win2000 complains about the WinXP-compiled fonts ("the author of this font doesn't want to convert it to ttf") but installs them correctly and they work with LyX. You can download the font packages from http://fkurth.de/uwest/LyX/LyXWinMathT1Win2000.rar and http://fkurth.de/uwest/LyX/LyXWinMathT1WinXP.rar NOTE: You have to deinstall the corresponding ttf's before intalling the pfm's! Note2: When you test the fonts with LyX, you'll see that the big operators appear too high. I thaught it was fixed in LyX 1.3.5-nc - the XFT-ttf doesn't have this problem. To get well working fonts, replace the cmex10.pfm by the cmex10.ttf from my font-package. Could somebody please test the fonts? At last the license issues: I wasn't able to find the license of bluesky, does somebody know it? I assumed they are free, because they are shipped with the minimal installation of MikTeX. regards Uwe p.s. please CC answers directly to me
Re: ICM URL at http://www.lyx.org/download/
Rafal Maszkowski wrote: > ftp://ftp.icm.edu.pl/vol/rzm0/lyx/ is not a canonical path and now is > just wrong. The proper ones are e.g.: > > ftp://sunsite.icm.edu.pl/pub/unix/editors/lyx/ > http://sunsite.icm.edu.pl/pub/unix/editors/lyx/ > rsync://sunsite.icm.edu.pl/pub/unix/editors/lyx/ Thanks, Rafal. I've updated the web page. May take a few minutes to propogate. -- Angus
[PATCH] inserting in insets
This patch does the following: - make Buffer::insertStringAsLines work when inserting in nested insets - set autoBreakRows_ to true for the top-level inset. Alfredo, is that right? - fix a first crash in BufferView::Pimpl::MenuInsertLyXFile The situation of inserting files in nested insets is however very bad, since Buffer::readDocument can only use a pit_type as argument and this argument is actually never used :( Indeed, readDocument, which does the hard work, is never invoked. Would it be right to pass also a ParagraphList argument to Buffer::readFile and BufferReadDocument? Or is it better in this case (and in Buffer::insertStringAsLines) to pass a dociterator (or a cursor slice) to indicate where to insert. I ask, because buffer.C does not use cursors at all. Comments welcome. JMarc
Crash fixes, code comments, cvs is slooow?
I have a patch, I'd like to commit. It consists of some of the stuff which was approved, plus some comments for the code, and a little more const-correctness here and there. Also, I fixed the breakParagraph bug by remove some obsolete stuff. There was some logic which is not relevant anymore. Another problem with a crash after pressing space at the start of the document twice is also fixed. But the problem is that I can not make diffs for some reason. It just hangs and hangs. Does anybody else experience this problem? CVS is soo slow today. Anyway, I have found a reproducible problem: 1) Start a new document, 2) Type "a", return, "b", cursor up, return 3) cursor right 4) cursor right: Strange thing happens, the cursor moves on the empty line. 5) cursor down: Boom. Assert in getRowNearY. I believe the problem appears after 3: It probably removes the empty paragraph, but forgets to update the screen. Therefore in step 4, the cursor moves on the "b" line although it does not look that way. And things go completely wrong when we try to move down, because that row exists on the screen, but not behind the curtains. You can verify this: After step 3, resize the window to force a rebreak, and the empty line disappears, and everything works as intended. So, I guess the problem is that after empty line removal, we need to rebreak the screen. I haven't looked for how to do that yet. Another reproducable bug is the cursor x position after cut/paste when you move up or down: It does not move according to the new cursor position, but according to the old one before the cut. Any ideas where to look? Regards, Asger
Re: [PATCH] inserting in insets
On Thursday 27 January 2005 13:56, Jean-Marc Lasgouttes wrote: > This patch does the following: ... > Comments welcome. It is amazing what a zero size patch can do, isn't it? ;-) > JMarc -- José Abílio
Re: [PATCH] inserting in insets
> "Jose'" == Jose' Matos <[EMAIL PROTECTED]> writes: Jose'> On Thursday 27 January 2005 13:56, Jean-Marc Lasgouttes wrote: >> This patch does the following: Jose'> ... >> Comments welcome. Jose'> It is amazing what a zero size patch can do, isn't it? ;-) Grr. Index: src/BufferView_pimpl.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.568 diff -u -p -r1.568 BufferView_pimpl.C --- src/BufferView_pimpl.C 24 Jan 2005 17:12:16 - 1.568 +++ src/BufferView_pimpl.C 27 Jan 2005 13:49:25 - @@ -807,7 +807,7 @@ void BufferView::Pimpl::MenuInsertLyXFil owner_->message(bformat(_("Inserting document %1$s..."), disp_fn)); bv_->cursor().clearSelection(); - bv_->text()->breakParagraph(bv_->cursor()); + bv_->getLyXText()->breakParagraph(bv_->cursor()); BOOST_ASSERT(bv_->cursor().inTexted()); Index: src/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v retrieving revision 1.2100 diff -u -p -r1.2100 ChangeLog --- src/ChangeLog 24 Jan 2005 17:12:17 - 1.2100 +++ src/ChangeLog 27 Jan 2005 13:49:27 - @@ -1,7 +1,19 @@ +2005-01-27 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * BufferView_pimpl.C (MenuInsertLyXFile): do breakParagraph on the + LyXText containing the cursor, not the top-level one. + + * buffer.C (Impl): make sure the toplevel insettext has AutoBreak_ + true. + (insertStringAsLines): rename par to pit; use temporary variable + par to hold a Paragraph; do not store par.layout() in a variable, + since the pointer may die when breaking paragraphs; pass pars to + breakParagraph() instead of Buffer::paragraphs(). + 2005-01-24 Jürgen Spitzmüller <[EMAIL PROTECTED]> * LaTeXFeatures.[Ch]: Add a static list packages_ that - holds the contens of packages.lst. New functions getAvailable + holds the contents of packages.lst. New functions getAvailable and isAvailable to parse and check that list, resp. * LyXAction.C: Index: src/buffer.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v retrieving revision 1.607 diff -u -p -r1.607 buffer.C --- src/buffer.C 24 Jan 2005 17:12:15 - 1.607 +++ src/buffer.C 27 Jan 2005 13:49:27 - @@ -200,6 +200,7 @@ Buffer::Impl::Impl(Buffer & parent, stri filename(file), filepath(OnlyPath(file)), file_fully_loaded(false), inset(params) { + inset.setAutoBreakRows(true); lyxvc.buffer(); temppath = createBufferTmpDir(); // FIXME: And now do something if temppath == string(), because we @@ -477,23 +478,22 @@ bool Buffer::readDocument(LyXLex & lex) // needed to insert the selection void Buffer::insertStringAsLines(ParagraphList & pars, - pit_type & par, pos_type & pos, + pit_type & pit, pos_type & pos, LyXFont const & fn, string const & str, bool autobreakrows) { - LyXLayout_ptr const & layout = pars[par].layout(); - LyXFont font = fn; - pars[par].checkInsertChar(font); + pars[pit].checkInsertChar(font); // insert the string, don't insert doublespace bool space_inserted = true; for (string::const_iterator cit = str.begin(); - cit != str.end(); ++cit) { + cit != str.end(); ++cit) { + Paragraph & par = pars[pit]; if (*cit == '\n') { - if (autobreakrows && (!pars[par].empty() || pars[par].allowEmpty())) { -breakParagraph(params(), paragraphs(), par, pos, - layout->isEnvironment()); -++par; + if (autobreakrows && (!par.empty() || par.allowEmpty())) { +breakParagraph(params(), pars, pit, pos, + par.layout()->isEnvironment()); +++pit; pos = 0; space_inserted = true; } else { @@ -501,18 +501,18 @@ void Buffer::insertStringAsLines(Paragra } // do not insert consecutive spaces if !free_spacing } else if ((*cit == ' ' || *cit == '\t') && - space_inserted && !pars[par].isFreeSpacing()) { + space_inserted && !par.isFreeSpacing()) { continue; } else if (*cit == '\t') { - if (!pars[par].isFreeSpacing()) { + if (!par.isFreeSpacing()) { // tabs are like spaces here -pars[par].insertChar(pos, ' ', font); +par.insertChar(pos, ' ', font); ++pos; space_inserted = true; } else { const pos_type n = 8 - pos % 8; for (pos_type i = 0; i < n; ++i) { - pars[par].insertChar(pos, ' ', font); + par.insertChar(pos, ' ', font); ++pos; } space_inserted = true; @@ -522,7 +522,7 @@ void Buffer::insertStringAsLines(Paragra continue; } else { // just insert the character - pars[par].insertChar(pos, *cit, font); + par.insertChar(pos, *cit, font); ++pos; space_inserted = (*cit == ' '); }
Re: [patch] change tracking output
Angus Leeming wrote: > Oh, if the file is meant to change only at predetermined times, then a > single line added to lyx_cb.C's Reconfigure would do the trick: > > LatexFeatures::getAvailable(); > > no? > > But you're probably right. Not worth it. At the moment. I did it nevertheless. Patch attached. If no one objects, I will commit this. Jürgen Index: LaTeXFeatures.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeXFeatures.C,v retrieving revision 1.116 diff -u -r1.116 LaTeXFeatures.C --- LaTeXFeatures.C 24 Jan 2005 17:12:18 - 1.116 +++ LaTeXFeatures.C 27 Jan 2005 16:02:20 - @@ -84,6 +84,11 @@ if (!lex.isOK()) return; + // This is necessary for lyx_cb.C's reconfigure + // (some packages might have been removed) + if (!packages_.empty()) + packages_.clear(); + bool finished = false; // Parse config-file while (lex.isOK() && !finished) { Index: lyx_cb.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v retrieving revision 1.245 diff -u -r1.245 lyx_cb.C --- lyx_cb.C 10 Jan 2005 19:17:39 - 1.245 +++ lyx_cb.C 27 Jan 2005 16:02:21 - @@ -23,6 +23,7 @@ #include "debug.h" #include "gettext.h" #include "lastfiles.h" +#include "LaTeXFeatures.h" #include "lyx_main.h" #include "lyxlayout.h" #include "lyxrc.h" @@ -449,6 +450,8 @@ p.pop(); bv->owner()->message(_("Reloading configuration...")); lyxrc.read(LibFileSearch(string(), "lyxrc.defaults")); + // Re-read packages.lst + LaTeXFeatures::getAvailable(); Alert::information(_("System reconfigured"), _("The system has been reconfigured.\n"
Re: Crash fixes, code comments, cvs is slooow?
Asger Ottar Alstrup wrote: > But the problem is that I can not make diffs for some reason. It just > hangs and hangs. Does anybody else experience this problem? CVS is soo > slow today. What CVS client do you use? I've been using TortoiseCVS and it seems to work well. I have a question for you now, as my resident Windows knowledge base ;-) In this nastiness below, I tried to convert a LPTSTR object to an LPCSTR one so that I could add it to a larger string. However, I find that 1. I can't because the T2CA macro is an AFX thingie and I don't have that installed. 2. I don't need to anyway, because LPTSTR is already char-based. When is LPTSTR wchar_t-based and what would I need to do were that the case? // WaitForSingleObject failed DWORD const error_code = ::GetLastError(); LPVOID t_message; ::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 0, error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) _message, 0, 0); // Convert the message to a char-based string. // LPCSTR c_message = T2CA(t_message); // LocalFree(t_message); // FIXME Use bformat here! string system_message((LPTSTR)t_message); -- Angus
tex2lyx does not support the new package scheme
Hi, when testing the latesttex2lyx I get this: $ ./tex2lyx ~/test.tex Unable to determine the system directory having searched /home/jamatos/lyx/lyx-devel/src/share/lyx-1.4.0cvs/ Try the '-sysdir' command line parameter or set the environment variable LYX_DIR_13x to the LyX system directory containing the file `chkconfig.ltx'. Any help? -- José Abílio
Re: tex2lyx does not support the new package scheme
Jose' Matos wrote: > $ ./tex2lyx ~/test.tex > Unable to determine the system directory having searched > /home/jamatos/lyx/lyx-devel/src/share/lyx-1.4.0cvs/ > Try the '-sysdir' command line parameter or set the environment variable > LYX_DIR_13x to the LyX system directory containing the file > `chkconfig.ltx'. > > Any help? A. The scheme expects that the binary to be in the /src directory, but tex2lyx is in the /src/tex2lyx directory. See get_build_dirs: string const binary_dir = OnlyPath(binary); string const build_support_dir = NormalizePath(AddPath(binary_dir, "../lib")); if (!FileSearch(build_support_dir, "lyxrc.defaults").empty()) H. Any ideas on how best to tackle this? -- Angus
Re: tex2lyx does not support the new package scheme
On Thursday 27 January 2005 17:26, Angus Leeming wrote: > > A. > > The scheme expects that the binary to be in the /src > directory, but tex2lyx is in the /src/tex2lyx directory. > See get_build_dirs: > > string const binary_dir = OnlyPath(binary); > string const build_support_dir = > NormalizePath(AddPath(binary_dir, "../lib")); > > if (!FileSearch(build_support_dir, "lyxrc.defaults").empty()) > > H. Any ideas on how best to tackle this? Add another argument for the relative depth, with 0 for lyx and 1 for tex2lyx? NormalizePath(AddPath(binary_dir, "../" * (depth + 1) + "lib")); I am not sure how serious this is. ;-) -- José Abílio
Re: [patch] change tracking output
Juergen Spitzmueller <[EMAIL PROTECTED]> writes: | Angus Leeming wrote: >> Oh, if the file is meant to change only at predetermined times, then a >> single line added to lyx_cb.C's Reconfigure would do the trick: >> >> LatexFeatures::getAvailable(); >> >> no? >> >> But you're probably right. Not worth it. At the moment. > | I did it nevertheless. Patch attached. If no one objects, I will commit this. > | Jürgen > | Index: LaTeXFeatures.C | === | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeXFeatures.C,v | retrieving revision 1.116 | diff -u -r1.116 LaTeXFeatures.C | --- LaTeXFeatures.C 24 Jan 2005 17:12:18 - 1.116 | +++ LaTeXFeatures.C 27 Jan 2005 16:02:20 - | @@ -84,6 +84,11 @@ | if (!lex.isOK()) | return; | | + // This is necessary for lyx_cb.C's reconfigure | + // (some packages might have been removed) | + if (!packages_.empty()) | + packages_.clear(); | + Any particualr reason not to just clear it? // Make sure that we are clean packages_.clear(); Without having seen the rest of the code, perhas it would be better to build the new packages in a new object and do a swap after it is setup fresh. Then exception safety will be (kindo) taken care of. -- Lgb
Re: Crash fixes, code comments, cvs is slooow?
Angus Leeming wrote: Asger Ottar Alstrup wrote: But the problem is that I can not make diffs for some reason. It just hangs and hangs. Does anybody else experience this problem? CVS is soo slow today. What CVS client do you use? I've been using TortoiseCVS and it seems to work well. Me too. It has been hanging for more than two hours. No progress, no errors, no diff. In this nastiness below, I tried to convert a LPTSTR object to an LPCSTR one so that I could add it to a larger string. However, I find that 1. I can't because the T2CA macro is an AFX thingie and I don't have that installed. 2. I don't need to anyway, because LPTSTR is already char-based. When is LPTSTR wchar_t-based and what would I need to do were that the case? LPTSTR is a long pointer to a _TCHAR based zero-terminated string. _TCHAR is 8-bit or 16-bit depending on which run-time library you link against. If you define _UNICODE, it will be 16-bit. If you define _MBCS, it will be 8-bit. The AFX thing is MFC-related. To do what you are trying to do, just use this, provided you are using the multi-byte runtime: std::string getFormatErrorMessage() { LONG error = ::GetLastError(); HLOCAL lpMsgBuf = 0; bool ok = ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) , 0, NULL ) != 0; if ( ok ) { std::string retValue( (LPTSTR) lpMsgBuf ); // Free the buffer. ::LocalFree( lpMsgBuf ); return retValue; } else { std::stringstream s; s << "Unknown error: " << error << std::endl; return s.str(); } } Regards, Asger
Re: Crash fixes, code comments, cvs is slooow?
Asger Ottar Alstrup <[EMAIL PROTECTED]> writes: | Angus Leeming wrote: >> Asger Ottar Alstrup wrote: >> >>>But the problem is that I can not make diffs for some reason. It just >>>hangs and hangs. Does anybody else experience this problem? CVS is soo >>>slow today. >> What CVS client do you use? I've been using TortoiseCVS and it seems >> to >> work well. > | Me too. It has been hanging for more than two hours. No progress, no | errors, no diff. It is working fine for me... A bit slow perhaps... -- Lgb
Re: Crash fixes, code comments, cvs is slooow?
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: | Asger Ottar Alstrup <[EMAIL PROTECTED]> writes: > | | Angus Leeming wrote: >>> Asger Ottar Alstrup wrote: >>> But the problem is that I can not make diffs for some reason. It just hangs and hangs. Does anybody else experience this problem? CVS is soo slow today. >>> What CVS client do you use? I've been using TortoiseCVS and it seems >>> to >>> work well. >> | | Me too. It has been hanging for more than two hours. No progress, no | | errors, no diff. > | It is working fine for me... > | A bit slow perhaps... Actually quite fine. I see your process there... not doing squat... You should probably restart it. -- Lgb
[Patch] convert it
This is the convert patch I am going to commit unless I hear a lot of bad language. (There are some testing code that is not visible here that will also be committed) ? Config ? convert-1.diff ? convert-2.diff ? convert-3.diff ? cppflags-1.diff ? idxupdown2-1.diff ? includes-1.diff ? src/support/package.C ? src/support/tests Index: configure.ac === RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v retrieving revision 1.39 diff -u -p -B -b -w -r1.39 configure.ac --- configure.ac 21 Jan 2005 13:48:12 - 1.39 +++ configure.ac 27 Jan 2005 18:33:17 - @@ -413,6 +413,7 @@ AC_CONFIG_FILES([Makefile m4/Makefile \ src/graphics/Makefile \ src/insets/Makefile \ src/support/Makefile \ + src/support/tests/Makefile \ src/frontends/Makefile \ src/frontends/controllers/Makefile \ src/frontends/xforms/Makefile \ Index: po/POTFILES.in === RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/POTFILES.in,v retrieving revision 1.403 diff -u -p -B -b -w -r1.403 POTFILES.in --- po/POTFILES.in 12 Jan 2005 12:25:29 - 1.403 +++ po/POTFILES.in 27 Jan 2005 18:33:19 - @@ -206,6 +206,7 @@ src/paragraph.C src/rowpainter.C src/support/filefilterlist.C src/support/package.C.in +src/support/path_defines.C src/text.C src/text2.C src/text3.C Index: src/BufferView_pimpl.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.568 diff -u -p -B -b -w -r1.568 BufferView_pimpl.C --- src/BufferView_pimpl.C 24 Jan 2005 17:12:16 - 1.568 +++ src/BufferView_pimpl.C 27 Jan 2005 18:33:20 - @@ -88,7 +88,6 @@ using lyx::support::IsDirWriteable; using lyx::support::MakeDisplayPath; using lyx::support::MakeAbsPath; using lyx::support::package; -using lyx::support::strToUnsignedInt; using std::endl; using std::istringstream; @@ -966,7 +965,7 @@ FuncStatus BufferView::Pimpl::getStatus( break; case LFUN_BOOKMARK_GOTO: - flag.enabled(bv_->isSavedPosition(strToUnsignedInt(cmd.argument))); + flag.enabled(bv_->isSavedPosition(convert(cmd.argument))); break; case LFUN_TRACK_CHANGES: flag.enabled(true); @@ -1052,11 +1051,11 @@ bool BufferView::Pimpl::dispatch(FuncReq break; case LFUN_BOOKMARK_SAVE: - savePosition(strToUnsignedInt(cmd.argument)); + savePosition(convert(cmd.argument)); break; case LFUN_BOOKMARK_GOTO: - restorePosition(strToUnsignedInt(cmd.argument)); + restorePosition(convert(cmd.argument)); break; case LFUN_REF_GOTO: { Index: src/Chktex.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Chktex.C,v retrieving revision 1.33 diff -u -p -B -b -w -r1.33 Chktex.C --- src/Chktex.C 6 Jan 2004 19:32:05 - 1.33 +++ src/Chktex.C 27 Jan 2005 18:33:20 - @@ -15,16 +15,15 @@ #include "LaTeX.h" // TeXErrors +#include "support/convert.h" #include "support/filetools.h" #include "support/lstrings.h" -#include "support/lyxlib.h" #include "support/systemcall.h" #include #include -using lyx::support::atoi; using lyx::support::ChangeExtension; using lyx::support::OnlyFilename; using lyx::support::split; @@ -82,7 +81,7 @@ int Chktex::scanLogFile(TeXErrors & terr token = split(token, warno, ':'); token = split(token, warning, ':'); - int const lineno = atoi(line); + int const lineno = convert(line); #if USE_BOOST_FORMAT msg % warno; Index: src/Spacing.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Spacing.C,v retrieving revision 1.40 diff -u -p -B -b -w -r1.40 Spacing.C --- src/Spacing.C 6 Jan 2005 16:39:21 - 1.40 +++ src/Spacing.C 27 Jan 2005 18:33:20 - @@ -18,9 +18,7 @@ #include #include -using lyx::support::strToDbl; -//using std::ios; using std::ostream; using std::ostringstream; using std::string; @@ -45,11 +43,11 @@ string const Spacing::getValueAsString() double Spacing::getValue() const { - return strToDbl(getValueAsString()); + return convert(getValueAsString()); } -void Spacing::set(Spacing::Space sp, float val) +void Spacing::set(Spacing::Space sp, double val) { set(sp, convert(val)); } @@ -59,7 +57,7 @@ void Spacing::set(Spacing::Space sp, str { space = sp; if (sp == Other) { - switch (int(strToDbl(val) * 1000 + 0.5)) { + switch (int(convert(val) * 1000 + 0.5)) { case 1000: space = Single; break; Index: src/Spacing.h === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Spacing.h,v retrieving revision 1.28 diff -u -p -B -b -w -r1.28 Spacing.h --- src/Spacing.h 6 Jan 2005 13:48:07 - 1.28 +++ src/Spacing.h 27 Jan 2005 18:33:20 - @@ -35,7 +35,7 @@ public: /// Spacing() : space(Default), value("1.0") {} ///
Re: Crash fixes, code comments, cvs is slooow?
Here is the rough patch. Ignore all you do not like, but many changes are good. I do not have time to make separate patch now. Sorry. Regards, Asger lyx-devel.patch.bz2 Description: Binary data
Re: scripting support via lyxserver
On Friday 21 January 2005 08:28, G. Milde wrote: > > Please find attached my work so far. If you copy lyx.py into the > "pythonpath", pydoc will give you a nice view of the doc strings and > setup Hi GÃnter, I would like to congratulate you for your work with the lyx server via the python module. This is something that I wanted to do for quite some time. :-) > Generally, the lyxserver seems to be an a sad state mainly because noone > seems to use it seriously. (Some of my ideas and complaints are to be > found in examples/lyxtest.py.) If there is interest (and consent that > this is the right place), I'd like to discuss this issue further. Please do. > GÃnter PS: In another movement (no pun John ;-) to help python scripting for lyx the lyx2lyx program has become only a interface to the new LyX.py module. The main concern of this module is mainly the file format (as it is to be expected from a lyx2lyx evolution), but my goal is make that a more general module. As such the lyx server component will be a nice addition. :-) -- Josà AbÃlio
Re: [proposal] solution for LyXWin's math font problems - next try without BaKoMa
I wrote: Compiling for both systems was necessary because the font handling is slightly different: > WinXP doesn't accept the Win2000-compiled fonts ("no installable > font"). Sorry, I didn't know that Win needs the pfm- AND the corresponding pfb-files. I uploaded a new package http://fkurth.de/uwest/LyX/LyXWinMathT1.rar that includes the pfb's. It should work on win2000 and winXP. Note2: When you test the fonts with LyX, you'll see that the big operators appear too high. I thaught it was fixed in LyX 1.3.5-nc - the XFT-ttf doesn't have this problem. While testing, I encountered that all Type1 fonts causes problems in LyX: When you insert a symbol to a formula, the math box becomes larger at the bottom (protrudes over the line base). Therefore the bluesky-fonts are only an option for the future, when LyXWin won't have this bug. regards Uwe
Re: Pending patches for the 1.3.x tree
On Mon, Jan 24, 2005 at 01:37:38PM +, Angus Leeming wrote: > Jean-Marc Lasgouttes wrote: > > What I was not sure about is how you handle option=='foo bar'. > > We don't. All hell breaks loose at this point and always has. The existing > code to split a string up into an argv array is: : [snip] : > Ie, we assume that ' ' marks the gap between arguments in the string. To do > this properly requires a fully-formed parser of the sh language. I just ran a quick test. Any Unix shell treats "--option='foo bar'" as a single element of "*argv[]". The single-quotes protected the space from the shell. (I tested with bash, ash, csh, tcsh, ksh, and bsh.) For Windows, however I wouldn't be surprised if whitespace chars weren't escaped. Just another one of those platform differences that'll need special handling. -- John Weiss
Re: [Patch] Refactoring PreviewLoader
On Mon, Jan 24, 2005 at 08:15:10PM +, Andreas Vox wrote: > > Angus Leeming <[EMAIL PROTECTED]> writes: > > namespace support = lyx::support; > > using std::ostream; > > typedef list SnippetList; > > > > is just baaaddd. > > Ah, bad for *.h, ok for *.C? > Got it. The reason being that *.h files are included into other files in ways you cannot control. Conversely, those including a *.h file into their own code have no control over its contents (at least in principle). So, if you pull something into the global namespace in a header file, like "using std::list;" would, you force EVERY file using your header file either to use "std::list" at all times or to go through name-conflict-resolution-gymnatics to use the correct token called "list". But the whole point of namespaces is to minimize/eliminate these sorts of gymnastics in the first place. But why is it okay for *.C? First and most obviously, source files aren't included into other source or headers. But, more importantly, a source file is a "translation unit". That is, the compiler treats it (and any #include'd headers) as a self-contained entity. Any references to outside critters must be flagged as such. So, doing "using std::ostream;" inside of a source file only affects the contents of *that* source file, and only during the tokenization stage of compilation. (The compiler's gonna internally change any unqualified "ostream" tokens back into "std::ostream".) At this point, we enter a discussion of stylistics and code maintenance. The bulk of one's work on a piece of code will be maintenance, not writing it initially. It's one of the old bromides of software development, actually. Therefore, "good coding style" dictates that you "code in the future tense," using language features only in the most narrow sense. For example, you don't make all members of a class "public"; you only make those you absolutely need to expose public. In the future, should you need to expose one of your private member functions, it's trivial to do so witha quick cut-n-paste in your class header file. The idea behind a "using" clause is similar. Localize them to where you need them most, and only to there. It's not much effort to add "using std::string;" at the top of each new function that requires STL strings. Then, if you later find that, yes, most of the functions in this *.C file need STL strings and will never use any other kind of string, you can easily add a top-level "using std::string;", no changes to exsting code necessary. Consider the converse situation, where you use the hydroge-bomb approach and start out with "using std::map"; at the top of your source. You merrily write away. Then one day, you need to add a new header file and some special code for a specially-optimized RDBMS-backed dictionary structure. It's also called "map". So you write your new functions, add a "using somespecial::map" to each, and WHAMO! You get a bazillion name-conflicts at compile time. Now you not only have to remove the top-level "using std::map", but you need to sift through hundreds of lines of code to find which functions actually use std::map and add in a "using" statement to just those functions. What a headache! There are nevertheless reasons for putting a top-level "using std::foo;" decl. in a file. Doing so makes a statement: Don't even THINK of using another type of "fooXYZ" with this code! Putting in a toplevel "using std::ostream;" tells future authors that no one, no one at all, should even try to use anything but the STL ostream with this code... put it in another source file and link the two together instead! Does that help at all, Andreas? -- John Weiss
Let's All Attack John...
On Tue, Jan 25, 2005 at 09:16:38AM +0100, Asger Ottar Alstrup wrote: > John Weiss wrote: > [A great opportunity to have a little flame-fest.] You're the one attacking me out-of-hand. > >Not FUD. Reality. [Long story about something irrelevant.] > > Took them YEARS to get it to that state. > > Sad for them. I have a working LyX. It took a week of work while Elias > was sleeping. All you are saying is FUD, and the proof is in the code. > > You can repeat the same stories ten times, but they will still be FUD. So, in other words, my professional experiences don't count for shit as far as you're concerned, you'd just rather insult highly-intelligent former-coworkers of mine for whom I have great respect and who did Windows/Unix-platform-independence some 10 years ago, before there was a Cygwin, before there was a QT, and before there was a Boost. Then, to top off your insult-fest, you have the gall to claim that I'm the one doing the flaming?!? You could've asked me *what* I was basing my claims on instead of name-calling. You could've found out that I've been comparing Boost's way of doing platform-indep. to what I saw at my former employer. You could've just said, "Warnings acknowledged, but John, I don't think it'll be that bad as most of the heavy-lifting's been done in QT and/or Boost." You could've bothered to find out that I'm not at all against a Windows version of LyX, and that after certain legal issues have been cleared up with my present (new) employer, I would've been interested in working on a plaform-indep. abstraction. In short, you could've chosen any number of more civil forms of communication. You didn't. Well, I'm calling you on it, Asger: You instead chose to selectively edit so you could publicly insult and humiliate me. I thought I'd earned a bit of respect from you by now; you certainly had mine. Now... now I'm not even sure I want to be bothered with LyX. I've been through 3 years of job-hell. I don't need this added stress. -- John Weiss
Re: lyxbreaker???
On Tue, Jan 25, 2005 at 02:38:54PM +, Angus Leeming wrote: > > Which means that it's dead easy to set a break point in gdb. Any entry > into lyxbreaker is automatically invalid, so stop there and have a look at > the execution path to that point. > > Try it yourself: > gdb ./lyx > (gdb) break lyxbreaker > Breakpoint 1 at 0x120132a34: file ostream, line 193. > (gdb) run Ok, time for another language lesson: While, "break" means set a breakpoint to most of us comp.sci. types, in common English, it can mean "smash with a hammer into little inoperable bits". When you add the "-er" suffix, however, only the latter meaning remains. That is, a "Zbreaker" would be someone who rips apart "Z" so that it's now broken. Incidentally, I'm gonna take a guess that the "break" in a debugger is related to "circuit breaker", the thing in your electric panel that severs an electrical circuit pulling too many amps. In short: calling a function "lyxbreaker" is a Bad Idea, as it implies that this function somehow damages LyX. Better to call it "lyxstopper" or "lyxbreakpt", the latter being far more descriptive if its purpose. -- John Weiss
Re: Nasty qt-3.3.3 bug
On Sun, Jan 23, 2005 at 09:57:26PM +0200, Martin Vermeer wrote: > > (This also reminded me how VERY VERY VERY unhappy I am about Math not > having its own top-level menu entry anymore. It is such a separate and > special part of both LyX and LaTeX, that this old practice was more than > justified. IMHO of course.) Seconded. -- John Weiss
Questioning Why I Bother.
On Tue, Jan 25, 2005 at 09:30:45AM +, Angus Leeming wrote: > John Weiss wrote: > > > On Fri, Jan 21, 2005 at 09:57:48PM +, Angus Leeming wrote: > >> Cygwin's POSIX emulation layer avoids > >> the need for the various workarounds required when using other > >> compilers under MS-Windows. > > > > See! See! I *am* speaking from real experience! I'm not just some > > idiot talking out his ass like Asger says I am! > > John, with all due respect, you're starting to rant. Umm... Gee, maybe that's because, oh, I dunno, I'M FEELING PERSONALLY ATTACKED HERE?! I thought that maybe, just maybe, after being a contributor in some form or other for 8+ years now I've deluded myself into thinking I had your collective respect? I foolishly thought that, at least here, my acumulated technical experience from the workplace would have *some* use, that it counted for something at least here. Clearly, I was wrong. I've been through 4 years of career-destroying Job Hell. My chances of flexing ... well, really, *anything* of my technical skills, let alone doing any C++ programming ... on the job in the next 2 years are slim to none. I've been forced into signing an NDA that would lay claim to anything creative I do. So, I've been holding off even looking at LyX code to protect it until I have my concerns with that NDA legally dealt with. (It's taken me nearly 3 months to get it resolved.) And what do I get for it? Personally attacked and insulted. Gee, thanks. -- John Weiss
Re: LyX on Windows
On Mon, Jan 24, 2005 at 10:01:09AM +0100, Lars Gullik Bjønnes wrote: > > Sure it is nice to compile on more than one compiler... but if the > result is muddier code then I am not sure about the gain. (and not > that I have not said that this is the case, just a thing to watch out > for. And avoiding muddy code in a Unix-Windows-crossplatform program will require a bit of work (in which I include careful planning). Which was the whole point of those cautioning posts of mine. -- John Weiss
Re: [rework docs] default figure placement inside float
On Wed, Jan 26, 2005 at 02:24:05AM +0100, Uwe Stöhr wrote: > Martin Vermeer wrote: > > >What he means is that the figure is formally embedded in a paragraph > >inside the float, which is formatted "justified" (out of alternatives > >left, right, justified and centred). This means the picture will align > >with the left edge, being just one huge "character" in the paragraph. > > Yes, that was what I meant. Yeah, I kinda figured that, Uwe. What I'm wondering is: are figure floats automatically left-justified? (That's what I meant by "LaTeX-ism".) I *vaguely* recall having to do some sorta preamble-hack to get my 100+ pages of figures for my thesis to appear centered on the page at the size I wanted. But it's been over 6 years since then, and my memory's failing. And, agreed, would be nice if the justification of an figure float were tunable. (How easy it would be... I'd have to dig out my dissertation and see if I'm even on the right track here, or if my memory's flakey.) -- John Weiss
Re: lyxbreaker???
John Weiss <[EMAIL PROTECTED]> writes: > ... > In short: calling a function "lyxbreaker" is a Bad Idea, as it > implies that this function somehow damages LyX. Better to call it > "lyxstopper" or "lyxbreakpt", the latter being far more descriptive if > its purpose. But lyxbreaker has " BOOST_ASSERT(false) " in its body, so it *does* break lyx. I think the name is ok, I just don't understand why one would put such a function into the code; and why one needs another function lyxaborter which does exactly the same, just with other output. /Andreas
Re: Let's All Attack John...
John Weiss <[EMAIL PROTECTED]> writes: | Now... now I'm not even sure I want to be bothered with LyX. I've | been through 3 years of job-hell. I don't need this added stress. Please take a step back. If you knew the flak I have taken... You really, really should come to a LyX meeting. Then we could have some beer and it each other over the head with the bottles. -- Lgb
Re: Questioning Why I Bother.
John Weiss <[EMAIL PROTECTED]> writes: | On Tue, Jan 25, 2005 at 09:30:45AM +, Angus Leeming wrote: >> John Weiss wrote: >> >> > On Fri, Jan 21, 2005 at 09:57:48PM +, Angus Leeming wrote: >> >> Cygwin's POSIX emulation layer avoids >> >> the need for the various workarounds required when using other >> >> compilers under MS-Windows. >> > >> > See! See! I *am* speaking from real experience! I'm not just some >> > idiot talking out his ass like Asger says I am! >> >> John, with all due respect, you're starting to rant. > | Umm... Gee, maybe that's because, oh, I dunno, I'M FEELING PERSONALLY | ATTACKED HERE?! Please. You are not helping now. Besides I am the only one allowed to be personally attacked in this forum. -- Lgb
Re: Let's All Attack John...
Lars Gullik BjÃnnes <[EMAIL PROTECTED]> writes: > > John Weiss <[EMAIL PROTECTED]> writes: > > | Now... now I'm not even sure I want to be bothered with LyX. I've > | been through 3 years of job-hell. I don't need this added stress. > > Please take a step back. > > If you knew the flak I have taken... > > You really, really should come to a LyX meeting. Then we could have > some beer and it each other over the head with the bottles. For heavens sake add a smiley there! ;-) We don't want John to think Europeans do bar fights for sport ... John, after what you told us about your situation I can understand you don't want any aggro from this list. But I don't see that *all* attack you, just some "robust" discussion with Asger, which you'd probably forgive once you had drunk some beer with him ... (see, Europeans *do* believe they can be friends with anyone once they drink beer together! :-) ) I wish you best luck for your work (I just had half a year of job hell and I don't envy you) and hope you find some rest from your troubles. Ciao /Andreas
Re: Questioning Why I Bother.
On Fri, Jan 28, 2005 at 02:21:01AM +0100, Lars Gullik Bj?nnes wrote: > Besides I am the only one allowed to be personally attacked in this > forum. Oh come on, you must consider Andre here. (For which I'm a bit sorry...) john
Re: Let's All Attack John...
On Fri, Jan 28, 2005 at 01:52:45AM +, Andreas Vox wrote: > John, after what you told us about your situation I can understand you > don't want any aggro from this list. But I don't see that *all* attack you, Anyway, Mr. Weiss needs to know I've long since taken his title of "Least Popular John". john
Re: scripting support via lyxserver
On Thu, Jan 27, 2005 at 07:03:11PM +, Jose' Matos wrote: > PS: In another movement (no pun John ;-) to help python scripting for lyx Is this a test on whether I'm still listening? :) Super-glad to see Asger back into the fold. He can be a less hated me!! john
Drag-n-drop image files (QT)
Howdy, A colleague asked me if there was anything that MS word could do well, that LyX couldn't, and all I could think of was drag-n-dropping image files into the document. That got me to thinking what it would take to implement it in LyX. Here's one solution, albeit somewhat naive perhaps, as I've not been hacking LyX for quite some time, so there may be unaccounted side-effects. The strategy was to build on the current drag-n-drop support, which allows you to open a lyx file by dropping it in the main window. Now QWorkArea::dropEvent() checks each entry in the QStringList::Iterator, and if it represents an image file, dispatch sends an LFUN_INSET_INSERT graphics request. If it isn't a graphics file, then dispatch requests an LFUN_FILE_OPEN. Then in factory.C, createInset() handles the LFUN_INSET_INSERT "graphics" by adding the filename obtained from the dropEvent to the InsetGraphicsParams structure before InsetGraphics::setParams() is called. I've patched 1.3.5-qt (3.3.3) for drag-n-drop of graphics files, and it works great. Also have a patch for 1.4.0 cvs, but it's buggy, and I'm not sure whether it's my doing or just a result of the current state of cvs. In 1.3.5, the image is placed at the cursor, already showing, and clipped. But in 1.4.0, the image is always inserted at the top of the document, and there are bizarre redraws with multiple images (e.g. some are missing until you resize the window a certain way). Is anyone working on dnd image support? The 1.4.0 current cvs patch follows. Let me know if you want the patch for 1.3.5. JB -- Johnathan K. Burchill, Ph.D. [EMAIL PROTECTED] Patch for 1.4.0 current cvs: Index: src/frontends/qt2/QWorkArea.h === RCS file: /cvs/lyx/lyx-devel/src/frontends/qt2/QWorkArea.h,v retrieving revision 1.15 diff -u -3 -p -u -r1.15 QWorkArea.h --- src/frontends/qt2/QWorkArea.h 2004/04/28 17:22:04 1.15 +++ src/frontends/qt2/QWorkArea.h 2005/01/28 04:29:20 @@ -64,6 +64,8 @@ public: /// get the content pane widget QWidget * getContent() const { return content_; } private: + /// Test whether str is a loadable image + bool decodeGraphics( QString const & str ); /// scroll bar QScrollBar * scrollbar_; /// content Index: src/frontends/qt2/QWorkArea.C === RCS file: /cvs/lyx/lyx-devel/src/frontends/qt2/QWorkArea.C,v retrieving revision 1.28 diff -u -3 -p -u -r1.28 QWorkArea.C --- src/frontends/qt2/QWorkArea.C 2004/05/20 09:36:28 1.28 +++ src/frontends/qt2/QWorkArea.C 2005/01/28 04:29:20 @@ -225,7 +225,24 @@ void QWorkArea::dropEvent(QDropEvent* ev lyxerr[Debug::GUI] << "QWorkArea::dropEvent: got URIs!" << endl; for (QStringList::Iterator i = files.begin(); -i!=files.end(); ++i) - dispatch(FuncRequest(LFUN_FILE_OPEN, fromqstr(*i))); +i!=files.end(); ++i) { + //First see if a graphic was dropped + if ( decodeGraphics(*i) ) { + dispatch(FuncRequest(LFUN_INSET_INSERT, + "graphics \"" + fromqstr(*i) + "\"")); + } else { + dispatch(FuncRequest(LFUN_FILE_OPEN, fromqstr(*i))); + } + } } } + +bool QWorkArea::decodeGraphics( QString const & str ) +{ + //Allow ps, eps, and allowable QT formats + QString name(str); + return (name.endsWith(".ps", false) || + name.endsWith(".eps", false) || +(QImageIO::imageFormat(name) != 0)); +} + Index: src/factory.C === RCS file: /cvs/lyx/lyx-devel/src/factory.C,v retrieving revision 1.95 diff -u -3 -p -u -r1.95 factory.C --- src/factory.C 2004/08/14 15:55:17 1.95 +++ src/factory.C 2005/01/28 04:29:20 @@ -252,6 +252,12 @@ InsetBase * createInset(BufferView * bv, InsetGraphicsMailer::string2params(cmd.argument, buffer, igp); auto_ptr inset(new InsetGraphics); + string const & filename = cmd.getArg( 1 ); + if (!filename.empty()) { + igp.filename = filename; + //automatically clip the image + igp.clip = true; + } inset->setParams(igp); return inset.release(); pgp8tErWqNiaY.pgp Description: PGP signature
Toplevel math menu (was: Nasty qt-3.3.3 bug)
On 27.01.05, John Weiss wrote: > On Sun, Jan 23, 2005 at 09:57:26PM +0200, Martin Vermeer wrote: > > > > (This also reminded me how VERY VERY VERY unhappy I am about Math not > > having its own top-level menu entry anymore. It is such a separate and > > special part of both LyX and LaTeX, that this old practice was more than > > justified. IMHO of course.) > > Seconded. This is easily achieved in my 1.3.4 by the following patch --- /usr/share/lyx/ui/default.ui2004-07-25 07:39:20.0 +0200 +++ /home/milde/.lyx/ui/topmath.ui 2005-01-28 08:25:31.0 +0100 @@ -7,6 +7,7 @@ Submenu "File|F" "file" Submenu "Edit|E" "edit" Submenu "Insert|I" "insert" + Submenu "Math|M" "edit_math" Submenu "Layout|L" "layout" Submenu "View|V" "view" Submenu "Navigate|N" "navigate" @@ -72,7 +73,6 @@ Separator Item "Find & Replace...|F" "find-replace" Submenu "Tabular|T" "edit_tabular" - Submenu "Math|M" "edit_math" Separator #Item "Read Only" "buffer-toggle-read-only" Item "Spellchecker...|S" "spellchecker" Now set the GUI file in Edit>Preferences to topmath (without the .ui extension), save and restart with a Math top level menu. Günter -- G.Milde web.de
Re: lyxbreaker???
On 28.01.05, Andreas Vox wrote: > John Weiss <[EMAIL PROTECTED]> writes: > > > > ... > > In short: calling a function "lyxbreaker" is a Bad Idea, as it > > implies that this function somehow damages LyX. Better to call it > > "lyxstopper" or "lyxbreakpt", the latter being far more descriptive if > > its purpose. > > But lyxbreaker has " BOOST_ASSERT(false) " in its body, so it > *does* break lyx. No, IMHO, the aim of the function is to make you aware of a broken LyX, not to break it (into pieces). Günter -- G.Milde web.de