From: David Kastrup <dak@gnu.org>
Date: Sat, 14 Sep 2013 19:12:38 +0000 (+0200)
Subject: Issue 4911/1: \with #*unspecified* should be equivalent to \with { }
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=be3f2841c224e88d36ecf0f809be60893c83471d;p=lilypond.git

Issue 4911/1: \with #*unspecified* should be equivalent to \with { }
---

diff --git a/lily/parser.yy b/lily/parser.yy
index 52fe450b7d..3601ea8f6a 100644
--- a/lily/parser.yy
+++ b/lily/parser.yy
@@ -1511,7 +1511,10 @@ context_modification:
 		if (unsmob<Context_mod> ($2))
 			$$ = $2;
 		else {
-			parser->parser_error (@2, _ ("not a context mod"));
+			// let's permit \with #*unspecified* to go for
+			// an empty context mod
+			if (!scm_is_eq ($2, SCM_UNSPECIFIED))
+				parser->parser_error (@2, _ ("not a context mod"));
 			$$ = Context_mod ().smobbed_copy ();
 		}
 	}
@@ -1570,18 +1573,15 @@ context_mod_list:
                      unsmob<Context_mod> ($1)->add_context_mods (md->get_mods ());
         }
 	| context_mod_list context_mod_arg {
-		if (scm_is_eq ($2, SCM_UNSPECIFIED))
-			;
-		else if (unsmob<Music> ($2)) {
+		if (unsmob<Music> ($2)) {
 			SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
 			$2 = scm_call_1 (proc, $2);
 		}
 		if (unsmob<Context_mod> ($2))
 			unsmob<Context_mod> ($$)->add_context_mods
 				(unsmob<Context_mod> ($2)->get_mods ());
-		else {
+		else if (!scm_is_eq ($2, SCM_UNSPECIFIED))
 			parser->parser_error (@2, _ ("not a context mod"));
-		}
         }
         ;