tkf / emacs-ipython-notebook

IPython notebook client in Emacs
tkf.github.com/emacs-ipython-notebook/
GNU General Public License v3.0
548 stars 51 forks source link

Highlight indentation mode in code cell? #112

Closed djthorne closed 8 years ago

djthorne commented 11 years ago

A very low priority, but it would be great.

tkf commented 11 years ago

What do you mean by "indentation mode"? If you want to activate some minor mode in notebook, use ein:notebook-mode-hook.

djthorne commented 11 years ago

Right. I should have been more specific. I have tried do activate highlight-indentation-mode with the hook prior to posting my question ( https://github.com/antonj/Highlight-Indentation-for-Emacs/). I've tried it with and without mumamo. Thanks for the quick reply!

On Sun, May 26, 2013 at 3:35 AM, Takafumi Arakaki notifications@github.comwrote:

What do you mean by "indentation mode"? If you want to activate some minor mode in notebook, use ein:notebook-mode-hook.

— Reply to this email directly or view it on GitHubhttps://github.com/tkf/emacs-ipython-notebook/issues/112#issuecomment-18461144 .

tkf commented 11 years ago

I guess it would be hard to make it work with mumamo. Mumamo is actually not needed for multi-language syntax highlighting now. By default (i.e., ein:notebook-multilang-mode [1]), the highlighting should work without mumamo. Does (add-hook 'ein:notebook-mode-hook 'highlight-indentation-mode) work?

[1] http://tkf.github.io/emacs-ipython-notebook/#ein:notebook-modes

djthorne commented 11 years ago

Unfortunately not. The background color used to demarcate code blocks is interfering. The hook is activating the minor mode, as the minor mode highlighting can be seen in the output sections.

tkf commented 11 years ago

I see. EIN is doing some hack [1] to make highlighting work against multiple languages. If you use ein:notebook-python-mode or ein:notebook-plain-mode then it probably works, but you lost sane highlighting. Definite fix should wait until Emacs core support highlighting with multiple languages. Let me close this issue until Emacs core is changed.

[1] It copies cell body to another buffer and "copy colors" from that buffer to the actually cell. So, if you run highlight-indentation-mode (or some function from there) in that buffer it may work.

tkf commented 11 years ago

Wait sec, you think it is because of the background? If so, do M-x customize-face ein:cell-input-area RET and uncheck "background".