Re: A couple of lilypond docbook tests failing
On Tue, Nov 02, 2021 at 12:55:54AM +0100, Thibaut Cuvelier wrote: > Hi Scott, > > What version of LilyPond are you using? Probably an old one: $ lilypond -v GNU LilyPond 2.22.0 > I am indeed getting errors at least > with the first document, but not at all the same ones. The error you get > should have been solved by e22f52e7, at least on Windows (os.chdir solved > it for me in some cases). Strange, I did the tests on current master. > You could chime in > https://gitlab.com/lilypond/lilypond/-/issues/6187 to indicate you have the > same issue on Linux. Thanks for making the upstream bug reports. I subscribed to the issue. Scott > Here is the error I get (only the LilyPond part of the output): > > >> Given arguments: > >> LilyPond: present. > >> LilyPond callable as: C:\Program Files > (x86)\LilyPond\usr\bin/lilypond-book. > >> LilyPond path: C:\Program Files (x86)\LilyPond\usr\bin. > >> Input file: > C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/LilyPond_Book.xml. > >> Output file: D:/LyX/lyx-unstable/lib/examples/Modules/LilyPond_Book.xml. > >> Input folder: > C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0. > >> Output folder: D:/LyX/lyx-unstable/lib/examples/Modules. > >> The input file needs a LilyPond pass and LilyPond is available. > >> Rewriting > C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/LilyPond_Book.xml > >> as > C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/LilyPond_Book.lyxml. > >> Running LilyPond. > lilypond-book (GNU LilyPond) 2.23.3 > Reading > `C:\Users\Thibaut\AppData\Local\Temp\lyx_tmpdir.qugZiVZlvBWx\lyx_tmpbuf0\LilyPond_Book.lyxml' > Dissecting... > Writing snippets... > Processing... > Running lilypond... > Processing > `C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/21/ > lily-0a4ea353.ly' > Parsing... > C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/21/lily-0a4ea353.ly:127:17: > error: undefined cha > racter or shorthand: & > \new PianoStaff > % RH Staff \new Staff {\clef treble\key > aes \major\time 2/4%\set Staff.finger > ingOrientations = #'(up)%\set Score.currentBarNumber = #9\partial 8 >aes''-4 c''8\staccato|%\s > et doubleSlurs = ##tbes''-5 des''-24(aes''-4 > c''8\staccato)\noBeamc''8-5\staccato\pp > |\unset doubleSlursbes'8..(aes'32g'8)\staccato > f'8\staccato|e'4-2r8%\once \override S > cript #'script-priority = #-100\afterGracef'8(\trill^\markup { > \finger "3-2" }{ e'16[ f'16] }|g'8..- > 3f'32e'8-1)\staccatod'8-2\staccato|c'4r4 } % LH > Staff \new Staff {\key aes \major\cle > f treble%\override Fingering #'direction = #down%\set > Staff.fingeringOrientations = #'(down)\partial 8 > t;aes' aes8\staccato%\set doubleSlurs = ##tg'-2 > ees'-34(aes' aes8)\staccato\noBeam > \c > C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/21/lily-0a4ea353.ly:127:17: > error: syntax error, > unexpected STRING > > I have reported this issue to LilyPond, because there is nothing LyX could > do to prevent it: https://gitlab.com/lilypond/lilypond/-/issues/6204. > > On Sun, 31 Oct 2021 at 18:02, Scott Kostyshak wrote: > > > The following tests are failing for me: > > > > The following tests FAILED: > > 4010 - export/examples/Modules/LilyPond_Book_docbook5 (Failed) > > 5165 - > > INVERTED.DOCBOOK_export/examples/fr/Modules/Linguistics_docbook5 (Failed) > > 5557 - export/examples/ja/Modules/LilyPond_Book_docbook5 (Failed) > > > > When I open lib/examples/Modules/LilyPond_Book.lyx and export to docbook5, > > I get the following output in the terminal: > > > > Command '/usr/bin/lilypond --formats=ps,png -dbackend=eps -I "./" -I > > "/tmp/lyx_tmpdir.xdBexxcIwFHp/lyx_tmpbuf0" -deps-box-padding=3.00 > > -dread-file-list -dno-strip-output-dir > > "/tmp/lyx_tmpdir.xdBexxcIwFHp/lyx_tmpbuf0/ > > snippet-names-8f8c627f87a88430f6904f4119093d6b.ly"' returned non-zero > > exit status 1. > > python: can't open file > > '/tmp/lyx_tmpdir.xdBexxcIwFHp/lyx_tmpbuf0/lilypond-book': [Errno 2] No such > > file or directory > > >> Error from LilyPond. The successive calls were: > > Traceback (most recent call last): > > File "/home/scott/lyxbuilds/master/repo/lib/scripts/docbook_copy.py", > > line 174, in > > DocBookCopier(sys.argv).copy() > > File "/home/scott/lyxbuilds/master/repo/lib/scripts/docbook_copy.py", > > line 161, in copy > > self.call_lilypond() > > File "/home/scott/lyxbuilds/master/repo/lib/scripts/docbook_copy.py", > > line 128, in call_lilypond > > print('>> (' + i + ') Error from trying ' + str(cmd) + ':') > > TypeError: can only concatenate str (not "int") to str > > support/Systemcall.cpp (291): Systemcall: 'python > >
Re: A couple of lilypond docbook tests failing
Hi Scott, What version of LilyPond are you using? I am indeed getting errors at least with the first document, but not at all the same ones. The error you get should have been solved by e22f52e7, at least on Windows (os.chdir solved it for me in some cases). You could chime in https://gitlab.com/lilypond/lilypond/-/issues/6187 to indicate you have the same issue on Linux. Here is the error I get (only the LilyPond part of the output): >> Given arguments: >> LilyPond: present. >> LilyPond callable as: C:\Program Files (x86)\LilyPond\usr\bin/lilypond-book. >> LilyPond path: C:\Program Files (x86)\LilyPond\usr\bin. >> Input file: C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/LilyPond_Book.xml. >> Output file: D:/LyX/lyx-unstable/lib/examples/Modules/LilyPond_Book.xml. >> Input folder: C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0. >> Output folder: D:/LyX/lyx-unstable/lib/examples/Modules. >> The input file needs a LilyPond pass and LilyPond is available. >> Rewriting C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/LilyPond_Book.xml >> as C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/LilyPond_Book.lyxml. >> Running LilyPond. lilypond-book (GNU LilyPond) 2.23.3 Reading `C:\Users\Thibaut\AppData\Local\Temp\lyx_tmpdir.qugZiVZlvBWx\lyx_tmpbuf0\LilyPond_Book.lyxml' Dissecting... Writing snippets... Processing... Running lilypond... Processing `C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/21/ lily-0a4ea353.ly' Parsing... C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/21/lily-0a4ea353.ly:127:17: error: undefined cha racter or shorthand: & \new PianoStaff % RH Staff \new Staff {\clef treble\key aes \major\time 2/4%\set Staff.finger ingOrientations = #'(up)%\set Score.currentBarNumber = #9\partial 8 aes''-4 c''8\staccato|%\s et doubleSlurs = ##tbes''-5 des''-24(aes''-4 c''8\staccato)\noBeamc''8-5\staccato\pp |\unset doubleSlursbes'8..(aes'32g'8)\staccato f'8\staccato|e'4-2r8%\once \override S cript #'script-priority = #-100\afterGracef'8(\trill^\markup { \finger "3-2" }{ e'16[ f'16] }|g'8..- 3f'32e'8-1)\staccatod'8-2\staccato|c'4r4 } % LH Staff \new Staff {\key aes \major\cle f treble%\override Fingering #'direction = #down%\set Staff.fingeringOrientations = #'(down)\partial 8 t;aes' aes8\staccato%\set doubleSlurs = ##tg'-2 ees'-34(aes' aes8)\staccato\noBeam \c C:/Users/Thibaut/AppData/Local/Temp/lyx_tmpdir.qugZiVZlvBWx/lyx_tmpbuf0/21/lily-0a4ea353.ly:127:17: error: syntax error, unexpected STRING I have reported this issue to LilyPond, because there is nothing LyX could do to prevent it: https://gitlab.com/lilypond/lilypond/-/issues/6204. On Sun, 31 Oct 2021 at 18:02, Scott Kostyshak wrote: > The following tests are failing for me: > > The following tests FAILED: > 4010 - export/examples/Modules/LilyPond_Book_docbook5 (Failed) > 5165 - > INVERTED.DOCBOOK_export/examples/fr/Modules/Linguistics_docbook5 (Failed) > 5557 - export/examples/ja/Modules/LilyPond_Book_docbook5 (Failed) > > When I open lib/examples/Modules/LilyPond_Book.lyx and export to docbook5, > I get the following output in the terminal: > > Command '/usr/bin/lilypond --formats=ps,png -dbackend=eps -I "./" -I > "/tmp/lyx_tmpdir.xdBexxcIwFHp/lyx_tmpbuf0" -deps-box-padding=3.00 > -dread-file-list -dno-strip-output-dir > "/tmp/lyx_tmpdir.xdBexxcIwFHp/lyx_tmpbuf0/ > snippet-names-8f8c627f87a88430f6904f4119093d6b.ly"' returned non-zero > exit status 1. > python: can't open file > '/tmp/lyx_tmpdir.xdBexxcIwFHp/lyx_tmpbuf0/lilypond-book': [Errno 2] No such > file or directory > >> Error from LilyPond. The successive calls were: > Traceback (most recent call last): > File "/home/scott/lyxbuilds/master/repo/lib/scripts/docbook_copy.py", > line 174, in > DocBookCopier(sys.argv).copy() > File "/home/scott/lyxbuilds/master/repo/lib/scripts/docbook_copy.py", > line 161, in copy > self.call_lilypond() > File "/home/scott/lyxbuilds/master/repo/lib/scripts/docbook_copy.py", > line 128, in call_lilypond > print('>> (' + i + ') Error from trying ' + str(cmd) + ':') > TypeError: can only concatenate str (not "int") to str > support/Systemcall.cpp (291): Systemcall: 'python > "/home/scott/lyxbuilds/master/repo/lib/scripts/docbook_copy.py" > lilypond-book "/tmp/lyx_tmpdir.xdBexxcIwFHp/lyx_tmpbuf0/LilyPond_Book.xml" > "/home/scott/lyxbuilds/master/repo/lib/examples/Modules/LilyPond_Book.xml"' > finished with exit code 1 > Error: Couldn't copy file > > Scott > -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: master crash (tocwidget code)
On Mon, Nov 01, 2021 at 05:01:34PM +0100, Jürgen Spitzmüller wrote: > Am Montag, dem 01.11.2021 um 14:15 +0100 schrieb Pavel Sanda: > > Looking at the backtrace and commit it seems that > > + TocItem const & item = > > + gui_view_.tocModels().currentItem(current_type_, > > index); > > triggers the crash. > > > > Juergen, can you reproduce? > > Yes. I am not sure what goes on here exactly, but the toc seems empty > after the window switch. I don't think the code above is to blame, it > just reveals the problem. > > The attached patch prevents the crash, but I am not sure whether it > doesn't hide the actual problem. Do we need to update the respective > toc somewhere? But where? I don't know the code in question either, but I can try to look later this week. Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Footnote size is larger on master (\normalsize is prepended)
On Mon, Nov 01, 2021 at 11:21:49AM +0100, Jürgen Spitzmüller wrote: > Am Montag, dem 01.11.2021 um 10:29 +0100 schrieb Jürgen Spitzmüller: > > On another look I tend to think that, rather than overwriting metrics > > and draw in individual insets, we would need a method similar to > > inheritFont() which only applies to screen font (I thought that > > resetsFonEdit() is that, but it isn't). > > Something like the attached. I figure, in the long run we also need a > layout tag. Fixes the original issue from what I can see, although I know nothing about the code. I'm not sure if the following is a related issue. See attached. It's hard to see, but the in-line footnote number itself is now bold on master. Note the "\bfseries" in the difference in TeX code produced below. master with your patch: To set the bracket size for the second line correctly, the first line is ended with \textbf{\textbackslash right.}\index{Commands!R!right@\textbackslash right} and the second line with \textbf{\textbackslash left.}{\bfseries\footnote{for more about \textbf{\textbackslash left} and \textbf{\textbackslash right} 2.3.x: To set the bracket size for the second line correctly, the first line is ended with \textbf{\textbackslash right.}\index{Commands!R!right@\textbackslash right} and the second line with \textbf{\textbackslash left.}\footnote{for more about \textbf{\textbackslash left} and \textbf{\textbackslash right} Scott signature.asc Description: PGP signature -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: master crash (tocwidget code)
Am Montag, dem 01.11.2021 um 14:15 +0100 schrieb Pavel Sanda: > Looking at the backtrace and commit it seems that > + TocItem const & item = > + gui_view_.tocModels().currentItem(current_type_, > index); > triggers the crash. > > Juergen, can you reproduce? Yes. I am not sure what goes on here exactly, but the toc seems empty after the window switch. I don't think the code above is to blame, it just reveals the problem. The attached patch prevents the crash, but I am not sure whether it doesn't hide the actual problem. Do we need to update the respective toc somewhere? But where? Jürgen diff --git a/src/frontends/qt/TocModel.cpp b/src/frontends/qt/TocModel.cpp index 16990b8359..c0c3dce548 100644 --- a/src/frontends/qt/TocModel.cpp +++ b/src/frontends/qt/TocModel.cpp @@ -327,6 +327,11 @@ TocItem const TocModels::currentItem(QString const & type, } LASSERT(index.model() == it.value()->model(), return TocItem()); + if (it.value()->empty()) { + LYXERR(Debug::GUI, "TocModels::currentItem(): requested toc is empty!"); + return TocItem(); + } + return it.value()->tocItem(index); } diff --git a/src/frontends/qt/TocModel.h b/src/frontends/qt/TocModel.h index 55507a0a92..ee447616d0 100644 --- a/src/frontends/qt/TocModel.h +++ b/src/frontends/qt/TocModel.h @@ -47,6 +47,8 @@ public: /// void clear(); /// + bool empty() { return toc_->empty(); } + /// QAbstractItemModel * model(); /// QAbstractItemModel const * model() const; signature.asc Description: This is a digitally signed message part -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
master crash (tocwidget code)
Hi, I get the crash in majority of cases when using the following recipy: 1. launch lyx & open introduction manual 2. open new window via file -> new window 3. view->hidden->introduction 4. kaboom /usr/include/c++/10/debug/vector:434: In function: std::__debug::vector<_Tp, _Allocator>::const_reference std::__debug::vector<_Tp, _Allocator>::operator[](std::__debug::vector<_Tp, _Allocator>::size_type) const [with _Tp = lyx::TocItem; _Allocator = std::allocator; std::__debug::vector<_Tp, _Allocator>::const_reference = const lyx::TocItem&; std::__debug::vector<_Tp, _Allocator>::size_type = long unsigned int] Error: attempt to subscript container with out-of-bounds index 0, but container only holds 0 elements. Objects involved in the operation: sequence "this" @ 0x0x57f3b0d0 { type = std::__debug::vector >; } Thread 1 "lyx" received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x76aa4537 in __GI_abort () at abort.c:79 #2 0x7694eeb1 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #3 0x56100051 in lyx::frontend::TocModel::tocItem(QModelIndex const&) const () #4 0x56102cbc in lyx::frontend::TocModels::currentItem(QString const&, QModelIndex const&) const () #5 0x563080c4 in lyx::frontend::TocWidget::filterContents() () #6 0x5630856f in lyx::frontend::TocWidget::finishUpdateView() () #7 0x5630947b in lyx::frontend::TocWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () bisect leads to: commit 4d7f4762a1af2bbe4d2051bd86e45c35361f0cfc Author: Juergen Spitzmueller Date: Sun Mar 15 10:46:35 2020 +0100 Outliner: Add filter combo for non-output items Addresses #11442, #10786 Looking at the backtrace and commit it seems that + TocItem const & item = + gui_view_.tocModels().currentItem(current_type_, index); triggers the crash. Juergen, can you reproduce? Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Marking inverted branch insets
Sounds reasonable to me. Riki Riki, is it OK to have this also in stable? Yuriy -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Footnote size is larger on master (\normalsize is prepended)
Am Montag, dem 01.11.2021 um 10:29 +0100 schrieb Jürgen Spitzmüller: > On another look I tend to think that, rather than overwriting metrics > and draw in individual insets, we would need a method similar to > inheritFont() which only applies to screen font (I thought that > resetsFonEdit() is that, but it isn't). Something like the attached. I figure, in the long run we also need a layout tag. Jürgen diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp index 400b7b66e8..c35526bd77 100644 --- a/src/RowPainter.cpp +++ b/src/RowPainter.cpp @@ -100,7 +100,7 @@ void RowPainter::paintInset(Row::Element const & e) const bool const pi_do_spellcheck = pi_.do_spellcheck; Change const pi_change = pi_.change; - pi_.base.font = e.inset->inheritFont() ? e.font.fontInfo() : + pi_.base.font = e.inset->inheritScreenFont() ? e.font.fontInfo() : pi_.base.bv->buffer().params().getFont().fontInfo(); pi_.ltr_pos = !e.font.isVisibleRightToLeft(); pi_.change = pi_.change.changed() ? pi_.change : e.change; diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index a2a3e4b427..e8a13dc3f8 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -505,7 +505,7 @@ bool TextMetrics::redoParagraph(pit_type const pit, bool const align_rows) Dimension dim; int const w = max_width_ - leftMargin(pit, e.pos) - right_margin - eop; - Font const & font = e.inset->inheritFont() ? + Font const & font = e.inset->inheritScreenFont() ? displayFont(pit, e.pos) : bufferfont; MacroContext mc(, parPos); MetricsInfo mi(bv_, font.fontInfo(), w, mc, e.pos == 0, tight_); diff --git a/src/insets/Inset.h b/src/insets/Inset.h index af24423e4e..d62cc5d556 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -591,6 +591,11 @@ public: * Otherwise the document default font is used. */ virtual bool inheritFont() const { return true; } + /** + * This method only applies to the screen font. It can be overriden + * if output and screen font inheritance differ. + */ + virtual bool inheritScreenFont() const { return inheritFont(); } /** * If this method returns true all explicitly set font attributes * are reset during editing operations. diff --git a/src/insets/InsetFootlike.h b/src/insets/InsetFootlike.h index e0a3fd31d0..fb53b33ee2 100644 --- a/src/insets/InsetFootlike.h +++ b/src/insets/InsetFootlike.h @@ -31,10 +31,10 @@ private: void write(std::ostream & os) const override; /// bool insetAllowed(InsetCode) const override; - /** returns false if, when outputting LaTeX, font changes should - be closed before generating this inset. This is needed for - insets that may contain several paragraphs */ - bool inheritFont() const override { return false; } + /// Footnotes have InheritFont true (do not need to + /// explicitly reset fonts in output, but the screen font + /// differs from context + bool inheritScreenFont() const override { return false; } }; signature.asc Description: This is a digitally signed message part -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Footnote size is larger on master (\normalsize is prepended)
Am Montag, dem 01.11.2021 um 09:56 +0100 schrieb Jürgen Spitzmüller: > (2.) revert b37929fd to correct the workarea font in footnotes (which > otherwise inherits the font of the context, e.g. section) > > JMarc, what do you think about (2.)? It was part of your series to > address #12204. On another look I tend to think that, rather than overwriting metrics and draw in individual insets, we would need a method similar to inheritFont() which only applies to screen font (I thought that resetsFonEdit() is that, but it isn't). Jürgen signature.asc Description: This is a digitally signed message part -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Footnote size is larger on master (\normalsize is prepended)
Am Sonntag, dem 31.10.2021 um 13:11 -0400 schrieb Scott Kostyshak: > See the attached file. On master, \normalsize is included inside the > footnote, which is different from 2.3.x. To fix this, one needs (1.) to set inheritFont() in InsetFootlike to true (i.e., back to default) in order to prevent unnecessary font switches and (2.) revert b37929fd to correct the workarea font in footnotes (which otherwise inherits the font of the context, e.g. section) JMarc, what do you think about (2.)? It was part of your series to address #12204. Jürgen signature.asc Description: This is a digitally signed message part -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel