[IPython-dev] Ace versus CodeMirror

Brian Granger ellisonbg at gmail.com
Mon Jan 23 13:48:30 EST 2012

On Sun, Jan 22, 2012 at 7:11 PM, John Fawcett <fawce at quantopian.com> wrote:
> Hi,
> I think the long-form edit case is very promising. It borders on full blown
> development, and seems to imply the eventual unification of the cellular
> edit style with the file-oriented style of a typical editor. Is that the
> idea? (Aside: i signed up for c9.io based on the Ace editor project, and it
> is the best online IDE I've tried - they have tabbed editors btw).
> - I tried selecting a block in a cell, and it seemed like tab did indent,
> and shift-tab de-indented. Is that what you meant by indentation support?

Yes, I think we can get this to work in CodeMirror though.

> - the total lack of docstring support in CM is annoying, maybe it is
> feasible to patch CM to support it properly?

Yes, very much so.

> - CM has a decent demo of search/replace, that I think is as good as Ace:
> http://codemirror.net/demo/search.html

We should be able to adapt this to the notebook.

> My free advice (which is worth what you pay for it :) ) is to aim to have
> one editor for cell and long-form editing. It seems like getting the
> docstring and indentation support in CM would have to be compared to getting
> Ace to support multiple editors on one page.

Yes, we would like the notebook to be a complete environment for doing
development work.  There is no reason we shouldn't allow regular .py
files to be open and edited in a CM editor.

I think that getting Ace to support multiple editors would be quite
difficult - more difficult than fixing CM in the above areas.

> thanks,
> fawce
> On Sun, Jan 22, 2012 at 5:39 PM, Fernando Perez <fperez.net at gmail.com>
> wrote:
>> On Sun, Jan 22, 2012 at 1:56 PM, Brian Granger <ellisonbg at gmail.com>
>> wrote:
>> > Some questions:
>> >
>> > * Is Ace really that much better that it is worth us shipping/using it?
>> > * Do people like the ability to edit a single cell in a
>> > more-full-window capacity?
>> >
>> > Please check out the Ace capabilty in master and let us know what you
>> > think...
>> There are some limitations of CM that make it really painful for
>> editing longer cells:
>> - inability to rigidly indent/dedent whole blocks.  This is a killer
>> for refactoring just about anything.
>> - no indentation support (not even soft-tabs) inside docstrings.
>> Typing eight spaces at the beginning of each line in a method
>> docstring is ridiculously annoying.  I just type them in emacs and
>> paste them back in.
>> - no search and replace: also killer for refactoring.
>> These are the big ones for me, so I'm +1 on including Ace.
>> There's also the fact that in teaching/workshops, we often struggle
>> with the question of 'what editor should I use along with ipython'.
>> Once Ace is available, we can simply tell people to use it for editing
>> also their python scripts, all within the ipython workflow.  This may
>> not be the long-term solution they want if they become full-time
>> users, but when you only have a day or two to teach a group some
>> basics, having ipython provide them a complete solution out of the box
>> would be great, I think.
>> Cheers,
>> f
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com

More information about the IPython-dev mailing list