Re: Emacs Mode Problem with includes

2023-11-13 Thread Laurie Savage
Thanks David,

I think I'll stay with Frescobaldi! Emacs doesn't seem to edit .ly files
any more easily so there isn't much advantage in tweaking it to behave with
my customised Include files. As for your question about where I found the
documentation for the location of my Includes: Options > Customise Emacs ->
All Settings Matching > "lilypond".

It's a shame, I found Emacs to be the best LaTeX editor I tried.

Laurie Savage
https://www.queensofthewest.com/

On Tue, 14 Nov 2023 at 16:19, David Wright 
wrote:

> On Tue 14 Nov 2023 at 07:04:39 (+1100), Laurie Savage wrote:
> > Thanks, I should have spotted that.
>
> So presumably the "cannot find file" error went away when you
> corrected the full path "/home/Laurie/Lilypond/includes/jazzchords.ily"
> but how about when you type only:
>
>   \include "jazzchords.ily"
>
> Does that also work?
>
> > But I'm not sure why this setting
> > hasn't been picked up by Emacs lilypond mode:
> >
> >  Lilypond Include Path: String: /home/laurie/Lilypond/includes
> > State : SAVED and set.
> > LilyPond include path.
> > Groups: Lilypond
> >
> > I don't want to type the full file path everytime I use one of my
> includes.
>
> That looks like something to do with Frescobaldi; is that so?
> I'm not clear on how emacs would parse a .ily file that you
> included (as opposed to reading it into a buffer for you to edit).
>
> > > On Mon, Nov 13, 2023 at 02:45:26PM +1100, Laurie Savage wrote:
> > > >I set this in my ~/.emacs file
> > > >(custom-set-variables
> > > > '(LilyPond-include-path "/home/laurie/Lilypond/includes")
> > > > '(LilyPond-lilypond-command "/usr/bin/lilypond"))
>
> Where did you find that documented? It doesn't look like the way
> I include files in emacs. I use the standard ones included in the
> LilyPond archive, by means of the lines displayed here:
>
>   $ grep lily ~/.emacs
>   (add-to-list 'load-path "~/.emacs.d/lilypond-init")
>   (load-library "lilypond-init")
>   $
>
>   $ ls -Glg ~/.emacs.d/lilypond-init ~/.emacs.d/lilypond-init/
>   lrwxrwxrwx 1   62 Nov 13 18:28 /home/myself/.emacs.d/lilypond-init ->
> /home/myself/lilypond-2.24.0-linux-x86_64/share/emacs/site-lisp
>
>   /home/myself/.emacs.d/lilypond-init/:
>   total 140
>   -rw-r- 1 10492 Dec 13  2022 lilypond-font-lock.el
>   -rw-r- 1 22500 Dec 13  2022 lilypond-indent.el
>   -rw-r- 1  1015 Dec 13  2022 lilypond-init.el
>   -rw-r- 1 43307 Dec 13  2022 lilypond-mode.el
>   -rw-r- 1 20754 Dec 13  2022 lilypond-song.el
>   -rw-r- 1  8988 Dec 13  2022 lilypond-what-beat.el
>   -rw-r- 1 16402 Dec 13  2022 lilypond-words.el
>   $
>
> (Symlink refreshed at login to point to the most up-to-date version.)
>
> Failing to find a load-library in the load-path provokes this error
> from emacs:
>
>   File is missing: Cannot open load file, No such file or directory,
> lilyPond-init
>
> whereas your error message below was from LilyPond:
>
> > > > /home/laurie/Doc…Traditional.ly:3:10: error: cannot find file:
> > > > `/home/Laurie/Lilypond/includes/jazzchords.ily'
> > > > (search path: `/home/laurie/Documents/Charts/Trans… …
>
> Cheers,
> David.
>


Re: Emacs Mode Problem with includes

2023-11-13 Thread David Wright
On Tue 14 Nov 2023 at 07:04:39 (+1100), Laurie Savage wrote:
> Thanks, I should have spotted that.

So presumably the "cannot find file" error went away when you
corrected the full path "/home/Laurie/Lilypond/includes/jazzchords.ily"
but how about when you type only:

  \include "jazzchords.ily"

Does that also work?

> But I'm not sure why this setting
> hasn't been picked up by Emacs lilypond mode:
> 
>  Lilypond Include Path: String: /home/laurie/Lilypond/includes
> State : SAVED and set.
> LilyPond include path.
> Groups: Lilypond
> 
> I don't want to type the full file path everytime I use one of my includes.

That looks like something to do with Frescobaldi; is that so?
I'm not clear on how emacs would parse a .ily file that you
included (as opposed to reading it into a buffer for you to edit).

> > On Mon, Nov 13, 2023 at 02:45:26PM +1100, Laurie Savage wrote:
> > >I set this in my ~/.emacs file
> > >(custom-set-variables
> > > '(LilyPond-include-path "/home/laurie/Lilypond/includes")
> > > '(LilyPond-lilypond-command "/usr/bin/lilypond"))

Where did you find that documented? It doesn't look like the way
I include files in emacs. I use the standard ones included in the
LilyPond archive, by means of the lines displayed here:

  $ grep lily ~/.emacs
  (add-to-list 'load-path "~/.emacs.d/lilypond-init")
  (load-library "lilypond-init")
  $ 

  $ ls -Glg ~/.emacs.d/lilypond-init ~/.emacs.d/lilypond-init/
  lrwxrwxrwx 1   62 Nov 13 18:28 /home/myself/.emacs.d/lilypond-init -> 
/home/myself/lilypond-2.24.0-linux-x86_64/share/emacs/site-lisp

  /home/myself/.emacs.d/lilypond-init/:
  total 140
  -rw-r- 1 10492 Dec 13  2022 lilypond-font-lock.el
  -rw-r- 1 22500 Dec 13  2022 lilypond-indent.el
  -rw-r- 1  1015 Dec 13  2022 lilypond-init.el
  -rw-r- 1 43307 Dec 13  2022 lilypond-mode.el
  -rw-r- 1 20754 Dec 13  2022 lilypond-song.el
  -rw-r- 1  8988 Dec 13  2022 lilypond-what-beat.el
  -rw-r- 1 16402 Dec 13  2022 lilypond-words.el
  $ 

(Symlink refreshed at login to point to the most up-to-date version.)

Failing to find a load-library in the load-path provokes this error
from emacs:

  File is missing: Cannot open load file, No such file or directory, 
lilyPond-init

whereas your error message below was from LilyPond:

> > > /home/laurie/Doc…Traditional.ly:3:10: error: cannot find file:
> > > `/home/Laurie/Lilypond/includes/jazzchords.ily'
> > > (search path: `/home/laurie/Documents/Charts/Trans… …

Cheers,
David.



Re: Repeat volta Score.startRepeatBarType & Score.endRepeatBarType

2023-11-13 Thread Stu McKenzie


On 2023-11-11 05:57, Michael Werner wrote:

Hi Stu,

On Fri, Nov 10, 2023 at 11:18 AM Stu McKenzie  
wrote:


Thank you, Michael, for the working example.

You're quite welcome.

It seems that additional combinations of defineBarLine were added
in version 2.25.
I downloaded version 2.25.9 and found that adding break resulted
in inconsistent results using the defineBarLine with the
Score.startRepeatBarType and Score.endRepeatBarType.

For example simply adding a \break before changing the
Score.startRepeatBarType, i.e.:

      c d e f
  \break
      \set Score.startRepeatBarType = #"[[|:"

results in the bar line at the end of the first line to include
the new start repeat bar type.

I've tried defining various combinatons of bar lines, as defined
on the documentation for 2.25.9, e.g.:
  \defineBarLine "[[|:-StartDouble_fff" #'( #f #f #f )
  \defineBarLine "[[|:-EndDouble_fff" #'( #f #f #f )
  \defineBarLine "[[|:-StartDouble_ttf" #'( #t #t #f )
  \defineBarLine "[[|:-EndDouble_ttf" #'( #t #t #f )
  \defineBarLine "[[|:-StartDouble_ttt" #'( #t #t #t )
  \defineBarLine "[[|:-EndDouble_ttt" #'( #t #t #t )
but cannot get the results that I'd like, especially when
alternatives are added to the repeat volta.

Any further suggestions?


Yup. Try these:

  \defineBarLine "[[|:" #'( #f #t #f )
  \defineBarLine ":|]]" #'( #t #f #f )
  \defineBarLine ":|][[|:" #'( ":|]" "[[|:" #f)
  \defineBarLine ":|]][[|:" #'( ":|]]" "[[|:" #f)

As we want the end repeat to show up at the end of a line but not the 
beginning, and the start repeat to show at the beginning of a line but 
not the end, the eol and bol booleans need changed. Basically the two 
are the reverse of each other. So eol true for the end repeat, and bol 
true for the begin repeat. I've left the span-bar set false for both - 
the built-in single winged repeat appears to have it set to false, so 
I'm following along with that here. And yes, I goofed in my first 
message - I said it was beginning, mid and end of line. I skimmed the 
docs a bit too quickly there.  It is end of line, beginning, and 
span-bar (as in the bar spanning between staves when grouped, such as 
a StaffGroup).


 The next two are for use in \set Score.doubleRepeatBarType  They're 
the repeat sign that shows when two repeated sections are back to 
back. The first ( ":|][[|:" ) is going from a single winged repeat to 
a double winged, while the second is going from double to double. And 
with those, both the beginning of line and the end of line behavior 
are specified as separate entries. That way if there's a line break 
with either of them it should get the correct repeat sign either side 
of the line break.


So now we have:

\new Staff {
  \defineBarLine "[[|:" #'( #f #t #f )
  \defineBarLine ":|]]" #'( #t #f #f )
  \new Voice {
    \relative c' {
      \set Score.startRepeatBarType = #"[|:"
      \set Score.endRepeatBarType = #":|]"
      c' d e f
      \repeat volta 2 {
        c d e f
      }
      c d e f
      \break
      \set Score.startRepeatBarType = #"[[|:"
      \set Score.endRepeatBarType = #":|]]"
      \repeat volta 2 {
        c d e f
      }
      \fine
    }
  }
}

producing:

image.png

and:

\new Staff {
  \defineBarLine "[[|:" #'( #f #t #f )
  \defineBarLine ":|]]" #'( #t #f #f )
  \defineBarLine ":|][[|:" #'( ":|]" "[[|:" #f)
  \defineBarLine ":|]][[|:" #'( ":|]]" "[[|:" #f)
  \new Voice {
    \relative c' {
      \set Score.startRepeatBarType = #"[|:"
      \set Score.endRepeatBarType = #":|]"
      \set Score.doubleRepeatBarType = #":|][[|:"
      c' d e f
      \repeat volta 2 {
        c d e f
      }
      \break
      \set Score.startRepeatBarType = #"[[|:"
      \set Score.endRepeatBarType = #":|]]"
      \repeat volta 2 {
        c d e f
      }
      c d e f
      \set Score.startRepeatBarType = #"[|:"
      \set Score.endRepeatBarType = #":|]"
      \repeat volta 2 {
        c d e f
      }
      \set Score.doubleRepeatBarType = #":|][[|:"
      \set Score.endRepeatBarType = #":|]]"
      \repeat volta 2 {
        c d e f
      }
      c d e f
      \fine
    }
  }
}

producing:

image.png

Hopefully this'll help get you a bit closer to what you're after.
--
Michael



Thanks again Michael.  I know how much time and effort you've taken to 
help me.  Much appreciated!


I noticed in your last example that bar 5 starts a spurious single 
bracket repeat that doesn't end.


I've revamped your last score as follows:
(1)
added an example of the use of both square bracket and "normal" repeat 
at bar 2;

(2)
added the "once" option in the first repeat section (bar 2) so that a 
"normal" repeat may be used within that section;

(3)
deleted the single bracket repeat (previously at bar 5);
(4)
added some comments and markup to assist anyone else who may want to do 
similar things.


\version "2.25.9"
\language "english"

\new Staff {
 % 

Re: Emacs Mode Problem with includes

2023-11-13 Thread Laurie Savage
Thanks, I should have spotted that. But I'm not sure why this setting
hasn't been picked up by Emacs lilypond mode:

 Lilypond Include Path: String: /home/laurie/Lilypond/includes
State : SAVED and set.
LilyPond include path.
Groups: Lilypond

I don't want to type the full file path everytime I use one of my includes.

Laurie Savage
https://www.queensofthewest.com/

The Latest Queens of The West clips
https://www.youtube.com/playlist?list=PLgkDbfgWIb8_tQgEZRKeRWVSukoM2xoC_


On Mon, 13 Nov 2023 at 17:43, David Zelinsky  wrote:

> On Mon, Nov 13, 2023 at 02:45:26PM +1100, Laurie Savage wrote:
> >I store my Includes file in a directory ~/Lilypond/includes but
> >Lilypond mode cannot locate them even if I specify a full file name
> e.g
> >\include
> >"/home/Laurie/Lilypond/includes/jazzchords.ily"
> >I set this in my ~/.emacs file
> >(custom-set-variables
> > '(LilyPond-include-path "/home/laurie/Lilypond/includes")
> > '(LilyPond-lilypond-command "/usr/bin/lilypond"))
> >Still I get errors like this:
> >/home/laurie/Documents/Charts/Transpositions/Dear Old
> >Stockholm/Dear-Old-Stockhom_Traditional.ly:3:10: error: cannot find
> >file: `/home/Laurie/Lilypond/includes/jazzchords.ily'
> >(search path: `/home/laurie/Documents/Charts/Transpositions/Dear Old
> >
> Stockholm:/usr/share/lilypond/2.25.4/ly:/usr/share/lilypond/2.25.4/ps:/
> >
> usr/share/lilypond/2.25.4/scm:/usr/share/lilypond/2.25.4/fonts/otf/:/us
> >r/share/lilypond/2.25.4/fonts/svg/:')
>
> I've never used this feature of LilyPond mode, and don't know why it seems
> not to register in the search path.  But I noticed your absolute path in
> the \include starts with "/home/Laurie/" but the search path setting has
> "/home/laurie".  Directory names are case sensitive, and home directories
> are usually lower case, so I suspect "/home/Laurie/" is a typo.
>
> -David
>
>
>
>
>
>
>
>
>
>