Re: Mailing list for translations

2021-06-23 Thread Jonas Hahnfeld via Discussions on LilyPond development
Am Donnerstag, dem 24.06.2021 um 01:02 +0200 schrieb Federico Bruni:
> On Tue, Jun 22 2021 at 17:53:05 +0200, Jean Abou Samra 
>  wrote:
> > Yes. And on GitLab, if this turned out to be a significant
> > problem, we could also add a "Translation" label, and
> > let translators use the "Subscribe to label" feature.
> > 
> > https://about.gitlab.com/blog/2016/04/13/feature-highlight-subscribe-to-label/
> 
> This is a good idea.
> Labels can be applied to issues and MR too. I might subscribe to the 
> Translation label and track only that to help when I can.

I agree, using only lilypond-devel and GitLab sounds like a good way
forward. We already have a "Translation" label, just need to use it.
And we should probably document the new workflows in the CG...

While at it, we might also want to colorize our existing labels - there
should be more than just blue 🙂 I'd imagine red-ish colors for Crash,
Critical, Defect, and Regression; orange for Collision, Ugly, and
Warning; green for Enhancement, Maintainability, and Performance; and
maybe gray-ish for categories like Scripts, Translation, etc.?

Jonas


signature.asc
Description: This is a digitally signed message part


Re: Mailing list for translations

2021-06-23 Thread Federico Bruni
On Tue, Jun 22 2021 at 17:53:05 +0200, Jean Abou Samra 
 wrote:

Yes. And on GitLab, if this turned out to be a significant
problem, we could also add a "Translation" label, and
let translators use the "Subscribe to label" feature.

https://about.gitlab.com/blog/2016/04/13/feature-highlight-subscribe-to-label/


This is a good idea.
Labels can be applied to issues and MR too. I might subscribe to the 
Translation label and track only that to help when I can.







Re: Cairo

2021-06-23 Thread David Kastrup
Knut Petersen  writes:

>> Knut, if you read this message via the mailing list, please try to find
>> out why my messages don't reach you.
>
> T-online.de email addresses seem to become more and more
> obsolete. hotmail.com and outlook.com block t-online, you get blocked
> by t-online. lkml blocked t-online about 8 years ago.
>
> I changed my lilydevel subscription to knup...@gmail.com. AFAICS
> administrators seem to hesitate to block gmail.com as it is big enough
> to be important ;-)
>
> Yes, cairomm was a bad idea. Using cairo directly (and staying with
> c++11) isn't a problem.

The problem with C++ (and also Guile) wrapper libraries is that LilyPond
marries C++ and Guile data structures in a rather special way.  And
pulling more frameworks in can get messy because their design and
assumptions can make their modus operandi a bad fit.

That's particularly a danger when new language features are being used.

The mantra bringing C++ into existence was object orientation and
encapsulation while maintaining C's efficiency.  The proliferation of
the language has clawed onto efficiency, but particularly reuse of code
has not turned out to be much of a thing: perhaps the strongest example
for code in general use is the STL, and its code base is utter
specialist gibberish rather than written in what a standard programmer
would come up with: reusable code bases have turned out opaque in more
than just the CS sense.

In a way that is a reason why after 50+ years numerical libraries in
Fortran still have an impact, partly with C++ and other language
wrappers around them: Fortran has native multidimensional arrays, and so
independent libraries can easily be used, sharing the same data
structures, in user programs.  "If I've been able to reach far, it's
because I've been linking hands with my brethren."  And the rather
highly efficient numerical code of Fortran libraries is readable (if
ugly) and reflects the work of mathematicians rather than code
wranglers.

For better or worse, existing higher language wrappers (C++ or Guile)
tend to result in somewhat awkward fits with the LilyPond code base.

I'd say "something's rotten in the state of Denmark", but then
Stroustrup has not been a principal driving factor of C++ for quite a
while.

-- 
David Kastrup



Re: Cairo

2021-06-23 Thread Knut Petersen




Knut, if you read this message via the mailing list, please try to find
out why my messages don't reach you.


T-online.de email addresses seem to become more and more obsolete. hotmail.com 
and outlook.com block t-online, you get blocked by t-online. lkml blocked 
t-online about 8 years ago.

I changed my lilydevel subscription to knup...@gmail.com. AFAICS administrators 
seem to hesitate to block gmail.com as it is big enough to be important ;-)

Yes, cairomm was a bad idea. Using cairo directly (and staying with c++11) 
isn't a problem.

Knut





Re: Please review Pygments lexer and style

2021-06-23 Thread Dan Eble
On Jun 23, 2021, at 10:33, Jean Abou Samra  wrote:
> 
> Le 23/06/2021 à 09:58, Jean Abou Samra a écrit :
>> To whet your appetite, a highlighted version of the test
>> file included in the PR is attached.
> 
> Not sure why the HTML hasn't gotten through email — on
> the archives and in Dan's mailbox it appears as plain
> LilyPond code. Here are additional RTF and SVG versions.
> 
> Jean
> 

Not a bad idea, but -1 for the use of light colors on white: silver, yellow, 
sky blue, etc.

What is the minimum set of distinctions that is likely to do more good than 
harm?  The example is a little overwhelming.

(All MHO.)
— 
Dan




Re: Please review Pygments lexer and style

2021-06-23 Thread Jean Abou Samra

Le 23/06/2021 à 18:53, Dan Eble a écrit :

On Jun 23, 2021, at 10:33, Jean Abou Samra  wrote:

Le 23/06/2021 à 09:58, Jean Abou Samra a écrit :

To whet your appetite, a highlighted version of the test
file included in the PR is attached.

Not sure why the HTML hasn't gotten through email — on
the archives and in Dan's mailbox it appears as plain
LilyPond code. Here are additional RTF and SVG versions.

Jean


Not a bad idea, but -1 for the use of light colors on white: silver, yellow, 
sky blue, etc.

What is the minimum set of distinctions that is likely to do more good than 
harm?  The example is a little overwhelming.

(All MHO.)


I should probably find something else for pitches and
durations. The example does look overwhelming, but it
was intentionally constructed as a showcase for many
pieces of syntax and builtins. A typical score mostly
consists of long runs of pitches and durations interspersed
with articulations and commands, so I think making many
distinctions should be fine as long as the most common
parts of the syntax have colors that are easy enough
to read.



Re: Please review Pygments lexer and style

2021-06-23 Thread Jean Abou Samra

Le 23/06/2021 à 09:58, Jean Abou Samra a écrit :

To whet your appetite, a highlighted version of the test
file included in the PR is attached.


Not sure why the HTML hasn't gotten through email — on
the archives and in Dan's mailbox it appears as plain
LilyPond code. Here are additional RTF and SVG versions.

Jean
\version "2.23.3"

% This is a test file for Pygments' LilyPond support. To compile
% it with Guile 1 (as in official releases as of this writing),
% remove the "commented form" below.

%{
  All supported constructs are covered in
  this file.  For example, multi-line comments.

  These are non-nested. The following will
  end the whole comment:
  %{ %}

\header {
  title = "This is an assignment to a string."
  composer = \markup \smallCaps "And this is a markup"
}
% The following is just a comment.
%}

\paper {
  indent = 30\staff-space
  page-count = 1
}

myFunc =
# #;(This is a commented form. After it, we are still in Scheme mode.)
(define-music-function (music n) (ly:music? index?)
   (let* ((repeated (make-list n music))
  (copied (map ly:music-deep-copy repeated)))
 ; This is a Scheme comment.
 (make-sequential-music copied)))

mySecondFunc =
#(define-music-function (music) (ly:music?)
   #{
 % LilyPond syntax here.
 \compressMMRests
   \shiftDurations -2 1
# ; Scheme syntax again.
 (ly:music-deep-copy music)
   #})

myPitch = ##{ c #}

% Here we should be back to LilyPond mode. This
% is a LilyPond comment.

<<
  \new Staff \with {
\consists Duration_line_engraver
  }
  \relative c' {
\clef alto
\time 6/8
\key d \major
\cadenzaOn
deses'!4.~(\tweak thickness 4\( deses^\p-\signumcongruentiae_1\4
deses\longa) \myFunc { r } 4 des8 8[ 8]\)
\bar "||"
\cadenzaOff
\once \hide NoteHead
\once \override NoteHead.no-ledgers = ##t
\once \omit Dots
\once \override Staff.DurationLine.thickness = #5
c''?2.:16\-^"Some music" |
\mySecondFunc
  R1*1/2^\markup \center-column {
   Some
   Text
   In
   A
   \bold \italic Column!
   super % not highlighted as a markup command
 }
\repeat unfold 4 { c8\< c^\> c\p\! }
  }
  \addlyrics {
\set Score.melismaBusyProperties = #'()
My Lily -- Song
  }
  \chordmode {
c cis:3+ des:maj7/+e
  }
  \new TabVoice {
f'4\^ g'4\^ f'2
  }
  \drums {
hihat4 hh bassdrum bd
  }
>>
\version "2.23.3"

% This is a test file for Pygments' LilyPond support. To compile
% it with Guile 1 (as in official releases as of this writing),
% remove the "commented form" below.

%{
  All supported constructs are covered in
  this file.  For example, multi-line comments.

  These are non-nested. The following will
  end the whole comment:
  %{ %}

\header {
  title = "This is an assignment to a string."
  composer = \markup \smallCaps "And this is a markup"
}
% The following is just a comment.
%}

\paper {
  indent = 30\staff-space
  page-count = 1
}

myFunc =
# #;(This is a commented form. After it, we are still in Scheme mode.)
(define-music-function (music n) (ly:music? index?)
   (let* ((repeated (make-list n music))
  (copied (map ly:music-deep-copy repeated)))
 ; This is a Scheme comment.
 (make-sequential-music copied)))

mySecondFunc =
#(define-music-function (music) (ly:music?)
   #{
 % LilyPond syntax here.
 \compressMMRests
   \shiftDurations -2 1
# ; Scheme syntax again.
 (ly:music-deep-copy music)
   #})

myPitch = ##{ c #}

% Here we should be back to LilyPond mode. This
% is a LilyPond comment.

<<
  \new Staff \with {
\consists Duration_line_engraver
  }
  \relative c' {
\clef alto
\time 6/8
\key d \major
\cadenzaOn
deses'!4.~(\tweak thickness 4\( deses^\p-\signumcongruentiae_1\4
deses\longa) \myFunc { r } 4 des8 8[ 8]\)
\bar "||"
\cadenzaOff
\once \hide NoteHead
\once \override NoteHead.no-ledgers = ##t
\once \omit Dots
\once \override Staff.DurationLine.thickness = #5
c''?2.:16\-^"Some music" |
\mySecondFunc
  R1*1/2^\markup \center-column {
   Some
   Text
   In
   A
   \bold \italic Column!
   super % not highlighted as a markup command
 }
\repeat unfold 4 { c8\< c^\> c\p\! }
  }
  \addlyrics {
\set Score.melismaBusyProperties = #'()
My Lily -- Song
  }
  \chordmode {
c cis:3+ des:maj7/+e
  }
  \new TabVoice {
f'4\^ g'4\^ f'2
  }
  \drums {
hihat4 hh bassdrum bd
  }
>>


example.rtf
Description: RTF file


Please review Pygments lexer and style

2021-06-23 Thread Jean Abou Samra

Hello,

Pygments is a Python syntax highlighter supporting many
languages, used by Sphinx-documented projects, users of
the 'minted' LaTeX package, Wikipedia, and various websites.
I'd like to see Pygments supporting LilyPond. Here is my
pull request (the equivalent of a merge request, on GitHub):

https://github.com/pygments/pygments/pull/1845

(Note that there is a previous attempt,
https://github.com/pygments/pygments/pull/1371. However,
it is far less precise, does not understand Scheme, and,
above all, reuses code covered by the GPL from Frescobaldi,
making it unsuitable for inclusion in the BSD-licensed
Pygments.)

Reviews and testing would be appreciated. In particular,
if you would not like to have a later unpleasant surprise
with my aesthetic choices, please give the style a look;
the eventual goal would be to make this used in our
documentation. The setup to start testing is
(assuming Python 3 installed):

git clone https://github.com/Jean-Abou-Samra/pygments.git
cd pygments
git checkout lilypond
python3 -m venv pygments-env
source pygments-env/bin/activate
pip install -r requirements.txt

Then you can highlight file.ly, outputting to file.html,
using

python -m pygments -f html -O full,style=lilypond file.ly > file.html

(If you begin a new session of testing, don't forget
to start with 'source pygments-env/bin/activate'.)

To whet your appetite, a highlighted version of the test
file included in the PR is attached.

Cheers,
Jean
\version "2.23.3"

% This is a test file for Pygments' LilyPond support. To compile
% it with Guile 1 (as in official releases as of this writing),
% remove the "commented form" below.

%{
  All supported constructs are covered in
  this file.  For example, multi-line comments.

  These are non-nested. The following will
  end the whole comment:
  %{ %}

\header {
  title = "This is an assignment to a string."
  composer = \markup \smallCaps "And this is a markup"
}
% The following is just a comment.
%}

\paper {
  indent = 30\staff-space
  page-count = 1
}

myFunc =
# #;(This is a commented form. After it, we are still in Scheme mode.)
(define-music-function (music n) (ly:music? index?)
   (let* ((repeated (make-list n music))
  (copied (map ly:music-deep-copy repeated)))
 ; This is a Scheme comment.
 (make-sequential-music copied)))

mySecondFunc =
#(define-music-function (music) (ly:music?)
   #{
 % LilyPond syntax here.
 \compressMMRests
   \shiftDurations -2 1
# ; Scheme syntax again.
 (ly:music-deep-copy music)
   #})

myPitch = ##{ c #}

% Here we should be back to LilyPond mode. This
% is a LilyPond comment.

<<
  \new Staff \with {
\consists Duration_line_engraver
  }
  \relative c' {
\clef alto
\time 6/8
\key d \major
\cadenzaOn
deses'!4.~(\tweak thickness 4\( deses^\p-\signumcongruentiae_1\4
deses\longa) \myFunc { r } 4 des8 8[ 8]\)
\bar "||"
\cadenzaOff
\once \hide NoteHead
\once \override NoteHead.no-ledgers = ##t
\once \omit Dots
\once \override Staff.DurationLine.thickness = #5
c''?2.:16\-^"Some music" |
\mySecondFunc
  R1*1/2^\markup \center-column {
   Some
   Text
   In
   A
   \bold \italic Column!
   super % not highlighted as a markup command
 }
\repeat unfold 4 { c8\< c^\> c\p\! }
  }
  \addlyrics {
\set Score.melismaBusyProperties = #'()
My Lily -- Song
  }
  \chordmode {
c cis:3+ des:maj7/+e
  }
  \new TabVoice {
f'4\^ g'4\^ f'2
  }
  \drums {
hihat4 hh bassdrum bd
  }
>>
\version "2.23.3"

% This is a test file for Pygments' LilyPond support. To compile
% it with Guile 1 (as in official releases as of this writing),
% remove the "commented form" below.

%{
  All supported constructs are covered in
  this file.  For example, multi-line comments.

  These are non-nested. The following will
  end the whole comment:
  %{ %}

\header {
  title = "This is an assignment to a string."
  composer = \markup \smallCaps "And this is a markup"
}
% The following is just a comment.
%}

\paper {
  indent = 30\staff-space
  page-count = 1
}

myFunc =
# #;(This is a commented form. After it, we are still in Scheme mode.)
(define-music-function (music n) (ly:music? index?)
   (let* ((repeated (make-list n music))
  (copied (map ly:music-deep-copy repeated)))
 ; This is a Scheme comment.
 (make-sequential-music copied)))

mySecondFunc =
#(define-music-function (music) (ly:music?)
   #{
 % LilyPond syntax here.
 \compressMMRests
   \shiftDurations -2 1
# ; Scheme syntax again.
 (ly:music-deep-copy music)
   #})

myPitch = ##{ c #}

% Here we should be back to LilyPond mode. This
% is a LilyPond comment.

<<
  \new Staff \with {
\consists Duration_line_engraver
  }
  \relative c' {
\clef alto
\time 6/8
\key d \major
\cadenzaOn
deses'!4.~(\tweak thickness 4\( deses^\p-\signumcongruentiae_