def run(self, edit, expr, in_ns=True, **kwargs):
        input_keys = template_string_keys(expr)
        input_mapping = {}

        try:
            for key in ['selection', 'symbol_under_cursor', 'current_line']:
                if key in input_keys:
                    input_mapping[key] = globals()[key](self.view)
        except UserWarning as warning:
            sublime.status_message(str(warning))
            return

        expr = Template(expr).safe_substitute(input_mapping)

        """
    file_name = self.view.file_name()
        if in_ns and file_name:
            #TODO use ns form in file
            _, after_src = file_name.rsplit("/src/", 1)
            file_ns = re.sub(r"\.clj$", "", re.sub("/", ".", after_src))
            #TODO prompt to save the file first
            expr = ("(do (load-file \"%s\") (in-ns '%s) %s)"
                    % (file_name, file_ns, expr))
    """

        kwargs.update(expr = expr)
        self.view.window().run_command('clojure_eval', kwargs)
 def run(self, expr = None, input_panel = None, **kwargs):
     on_done = partial(self._handle_input, expr, **kwargs)
     if 'from_input_panel' in template_string_keys(expr):
         from_input_panel(self.window, input_panel, on_done)
     else:
         on_done(None)