def editor(self, filename, linenum=None, wait=True):
<EOL>editor = self.editor<EOL>if linenum is None or editor=='<STR_LIT>':<EOL><INDENT>linemark = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>linemark = '<STR_LIT>' % int(linenum)<EOL><DEDENT>if '<STR_LIT:U+0020>' in editor and os.path.isfile(editor) and editor[<NUM_LIT:0>] != '<STR_LIT:">':<EOL><INDENT>editor = '<STR_LIT>' % editor<EOL><DEDENT>proc = subprocess.Popen('<STR_LIT>' % (editor, linemark, filename),<EOL>shell=True)<EOL>if wait and proc.wait() != <NUM_LIT:0>:<EOL><INDENT>raise TryNext()<EOL><DEDENT>
Open the default editor at the given filename and linenumber.

    This is IPython's default editor hook, you can use it as an example to
    write your own modified one.  To set your own editor function as the
    new editor hook, call ip.set_hook('editor',yourfunc).