diff --git a/IPython/UserConfig/ipythonrc b/IPython/UserConfig/ipythonrc index a500846..749b1aa 100644 --- a/IPython/UserConfig/ipythonrc +++ b/IPython/UserConfig/ipythonrc @@ -1,5 +1,5 @@ # -*- Mode: Shell-Script -*- Not really, but shows comments correctly -# $Id: ipythonrc 923 2005-11-15 08:51:15Z fperez $ +# $Id: ipythonrc 963 2005-12-28 19:21:29Z fperez $ #*************************************************************************** # @@ -60,6 +60,13 @@ include autocall 1 +# Auto-edit syntax errors. When you use the %edit magic in ipython to edit +# source code (see the 'editor' variable below), it is possible that you save +# a file with syntax errors in it. If this variable is true, IPython will ask +# you whether to re-open the editor immediately to correct such an error. + +autoedit_syntax 1 + # Auto-indent. IPython can recognize lines ending in ':' and indent the next # line, while also un-indenting automatically after 'raise' or 'return'. diff --git a/IPython/iplib.py b/IPython/iplib.py index aab0d20..4784297 100644 --- a/IPython/iplib.py +++ b/IPython/iplib.py @@ -6,7 +6,7 @@ Requires Python 2.1 or newer. This file contains all the classes and helper functions specific to IPython. -$Id: iplib.py 962 2005-12-28 18:04:59Z fperez $ +$Id: iplib.py 963 2005-12-28 19:21:29Z fperez $ """ #***************************************************************************** @@ -1716,8 +1716,9 @@ want to merge them back into the new files.""" % locals() print 'SyntaxError: !! is not allowed in multiline statements' return pre else: - cmd = ("%s %s" % (iFun[1:],theRest)).replace('"','\\"') - line_out = '%s%s.system("%s")' % (pre,self.name,cmd) + cmd = ("%s %s" % (iFun[1:],theRest)) #.replace('"','\\"') + #line_out = '%s%s.system("%s")' % (pre,self.name,cmd) + line_out = '%s%s.system(r"""%s"""[:-1])' % (pre,self.name,cmd + "_") #line_out = ('%s%s.system(' % (pre,self.name)) + repr(cmd) + ')' else: # single-line input if line.startswith('!!'): @@ -1729,8 +1730,10 @@ want to merge them back into the new files.""" % locals() return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,line[2:]), continue_prompt,pre,iFun,theRest) else: - cmd = esc_quotes(line[1:]) - line_out = '%s.system("%s")' % (self.name,cmd) + #cmd = esc_quotes(line[1:]) + cmd=line[1:] + #line_out = '%s.system("%s")' % (self.name,cmd) + line_out = '%s.system(r"""%s"""[:-1])' % (self.name,cmd +"_") #line_out = ('%s.system(' % self.name) + repr(cmd)+ ')' # update cache/log and return self.log(line_out,continue_prompt) diff --git a/IPython/ipmaker.py b/IPython/ipmaker.py index 4bb12e6..4d6559f 100644 --- a/IPython/ipmaker.py +++ b/IPython/ipmaker.py @@ -6,7 +6,7 @@ Requires Python 2.1 or better. This file contains the main make_IPython() starter function. -$Id: ipmaker.py 960 2005-12-28 06:51:01Z fperez $""" +$Id: ipmaker.py 963 2005-12-28 19:21:29Z fperez $""" #***************************************************************************** # Copyright (C) 2001-2004 Fernando Perez. @@ -177,6 +177,7 @@ object? -> Details about 'object'. ?object also works, ?? prints more. # Set sensible command line defaults. # This should have everything from cmdline_opts and cmdline_only opts_def = Struct(autocall = 1, + autoedit_syntax = 1, autoindent=0, automagic = 1, banner = 1, @@ -225,7 +226,6 @@ object? -> Details about 'object'. ?object also works, ?? prints more. xmode = 'Verbose', wildcards_case_sensitive = 1, magic_docstrings = 0, # undocumented, for doc generation - autoedit_syntax = 0, ) # Things that will *only* appear in rcfiles (not at the command line). diff --git a/doc/ChangeLog b/doc/ChangeLog index 2c4dbe9..d84fb07 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,16 @@ 2005-12-28 Fernando Perez + * IPython/iplib.py (handle_shell_escape): add Ville's patch to + better hadnle backslashes in paths. See the thread 'More Windows + questions part 2 - \/ characters revisited' on the iypthon user + list: + http://scipy.net/pipermail/ipython-user/2005-June/000907.html + + * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag + true by default, and add it to the shipped ipythonrc file. Since + this asks the user before proceeding, I think it's OK to make it + true by default. + * IPython/Magic.py (magic_exit): make new exit/quit magics instead of the previous special-casing of input in the eval loop. I think this is cleaner, as they really are commands and shouldn't have