Menu

#4326 Enhancement: simplify accepting a new custom context like an existing context

Invalid
nobody
None
Enhancement
2020-03-22
2015-03-16
Anonymous
No

Originally created by: *anonymous

Originally created by: ColinPKC...@gmail.com

From Paul Morris:

Use \alias for determining what contexts accept other contexts (and not just
for allowing commands accepted in one context to be used in another context).

Jim Long:

“...it would be nice, if it is practical, for "Higher" contexts to decide to
accept "Lower" contexts based on context name (\ChordNames) as well as on alias
(\alias ChordNames).

A would accept C because A accepts B, and C is explicitly
declared as an alias of B.  Therefore, A would accept B and all
aliases of B.”

Paul Morris:

"Most of the time if we want commands that work in X to work in Y (by using
\alias X), we also want Y to be accepted wherever X is accepted.

So when Z is determining whether to accept a new context Y... have it first
check Y's name, and if the name is unknown (not in its "accepts" list) then
have it check Y's alias (\alias X).  If the alias X is in the "accepts" list,
then Z would accept Y.

In rare cases where we didn't want these things coupled (where we wanted
commands from X to work in Y, but we didn't want Y to be accepted wherever X is
accepted), then we could use \denies and \accepts to define exactly where we
want Y to be accepted or denied.

This would really simplify the process of creating custom contexts, especially
in the common case of wanting a modified version of an existing context that
works everywhere it does.”

See full discussion thread here:
http://lists.gnu.org/archive/html/lilypond-user/2015-02/msg00684.html

Discussion

  • Paul Morris

    Paul Morris - 2017-09-20

    We can close this issue now that issue 4561 has taken care of this quite elegantly. Not sure what the correct status(es) would be or I'd go ahead and close it myself.

     
  • David Kastrup

    David Kastrup - 2017-09-20
    • Description has changed:

    Diff:

    
    
    • Needs: -->
    • Patch: -->
     
  • David Kastrup

    David Kastrup - 2017-09-20

    Uh, the proper label likely would be "wontfix" because something different is supposed to obviate the need for it. But I don't actually see any such status. "Fixed" seems wrong, and so do "Duplicate" and "Invalid". Of the present choices, I'd likely lean towards "Invalid".

     
  • Valentin Villenave

    • status: Accepted --> Invalid
     
  • Valentin Villenave

    Closing. See issue 4561.

     
MongoDB Logo MongoDB