- has_line_width = self.option_dict.has_key (LINE_WIDTH)
- if has_line_width and self.option_dict[LINE_WIDTH] == None:
- has_line_width = False
- del self.option_dict[LINE_WIDTH]
-
- # TODO: Can't we do that more efficiently (built-in python func?)
- for k in self.formatter.default_snippet_options:
- if k not in self.option_dict:
- self.option_dict[k] = self.formatter.default_snippet_options[k]
-
- # RELATIVE does not work without FRAGMENT;
- # make RELATIVE imply FRAGMENT
- has_relative = self.option_dict.has_key (RELATIVE)
- if has_relative and not self.option_dict.has_key (FRAGMENT):
- self.option_dict[FRAGMENT] = None
-
- if not has_line_width:
- if type == 'lilypond' or FRAGMENT in self.option_dict:
- self.option_dict[RAGGED_RIGHT] = None
-
- if type == 'lilypond':
- if LINE_WIDTH in self.option_dict:
- del self.option_dict[LINE_WIDTH]
+ has_line_width = self.snippet_option_dict.has_key (LINE_WIDTH)
+ if has_line_width and self.snippet_option_dict[LINE_WIDTH] == None:
+ del self.snippet_option_dict[LINE_WIDTH]
+
+ # RELATIVE does not work without FRAGMENT, so imply that
+ if self.snippet_option_dict.has_key (RELATIVE):
+ self.snippet_option_dict[FRAGMENT] = None
+
+ # Now get the default options from the formatter object (HTML, latex,
+ # texinfo, etc.) and insert the explicit snippet options to get the
+ # list of all options for this snippet
+ # first, make sure we have an INDENT value as a fallback
+ self.option_dict = {INDENT: '0\\mm'};
+ self.option_dict.update (self.formatter.default_snippet_options);
+ self.option_dict.update (self.snippet_option_dict);
+
+ # also construct a list of all options (as strings) that influence the
+ # visual appearance of the snippet
+ lst = filter (lambda (x,y): x not in PROCESSING_INDEPENDENT_OPTIONS,
+ self.option_dict.iteritems ());
+ option_list = []
+ for (key, value) in lst:
+ if value == None:
+ option_list.append (key)