Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make \pinclude etc more useful #61

Open
noteflakes opened this issue Feb 19, 2018 · 0 comments
Open

Make \pinclude etc more useful #61

noteflakes opened this issue Feb 19, 2018 · 0 comments

Comments

@noteflakes
Copy link
Collaborator

Issue #40 talked about making the lyp-provided include commands more "beautiful" but this is not really the problem with lyp-provided include commands. The problems with the current implementation are:

  • \pinclude is not differentiated enough from \include.
  • What does the "p" stand for? package?
  • In properly structured modular notation projects, files will normally be included only once. So including once should be the rule and not the exception.
  • the lyp-provided Lilypond commands (i.e. \pinclude etc) should be namespaced. It should be obvious that they come from lyp.
  • the conditional includes are actually not that useful, and they don't really get used that often. They might be useful when doing "polyfills" in order to support older versions of Lilypond
  • There's no conventional way to include a whole directory, or multiple files using a filename pattern.

So, we change the user-facing lyp interface as follows:

  • Rename the commands:
    • \pinclude becomes lyp-load
    • \pincludeOnce becomes lyp-include
    • \require becomes lyp-require
    • all old commands are deprecated, that is, display a warning
    • conditional include commands are not given new names, they're just deprecated
  • Make lyp-load and lyp-include more useful:
    • accept multiple arguments (for loading multiple files): \lyp-include tree templates music
    • accept directory references (for loading all files in a directory): \lyp-include utils
    • accept filename patterns (for loading files matching the pattern): \lyp-include utils/*
    • accept file references without extension, look for .ly or .ily files. If both exist, throw an error, otherwise load the existing one, if none exist, throw an error
noteflakes added a commit that referenced this issue Feb 20, 2018
- Deprecate `\require`, `\pinclude` et al commands. They still work, but
  will produce a warning when verbose option is used.
- Introduce new commands to replace the old commands:
  - `lyp-require`: load a package
  - `lyp-load`: load a file
  - `lyp-include`: load a file only once
- Richer, easier to use `lyp-include` commands accept:
  - directory for loading all files in directory: `\lyp-include utils`
  - filename pattern with wildcard: `\lyp-include "lib/*.ly"`
  - multiple file references: `\lyp-include #'(stave1 stave2)`
- Cleanup and refactor scheme definitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant