]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/apply-context-iterator.cc
Run `make grand-replace'.
[lilypond.git] / lily / apply-context-iterator.cc
index 38036708c0dd867c0f966b0c4929032cd1f3093e..3ed593be587a187b779a55199955a8a459d51cd0 100644 (file)
@@ -1,10 +1,17 @@
-#include "simple-music-iterator.hh"
+/*
+  apply-context-iterator.cc -- implement Apply_context_iterator
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2004--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
+
 #include "context.hh"
+#include "input.hh"
+#include "international.hh"
 #include "music.hh"
+#include "simple-music-iterator.hh"
 
-/**
-  Iterate a property.  
- */
 class Apply_context_iterator : public Simple_music_iterator
 {
 public:
@@ -13,16 +20,18 @@ protected:
   virtual void process (Moment);
 };
 
-
 void
 Apply_context_iterator::process (Moment m)
 {
   SCM proc = get_music ()->get_property ("procedure");
 
-  scm_call_1 (proc, get_outlet ()->self_scm ());
-  
+  if (ly_is_procedure (proc))
+    scm_call_1 (proc, get_outlet ()->self_scm ());
+  else
+    get_music ()->origin ()->warning (_ ("\\applycontext argument is not a procedure"));
+
   Simple_music_iterator::process (m);
 }
 
 IMPLEMENT_CTOR_CALLBACK (Apply_context_iterator);
-  
+