mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -05:00
Bump version.
May also have fixed some indentation issues as ein-python was meant for an old version of python.el.
This commit is contained in:
parent
ab8ad81c51
commit
04d36b3fa1
4 changed files with 34 additions and 30 deletions
|
@ -563,6 +563,11 @@ everything the log buffer. You can reset the patch and log level with
|
|||
Change Log
|
||||
==========
|
||||
|
||||
v0.5
|
||||
----
|
||||
|
||||
* Add support for stdin channel. This mean getpass.getpass() and the ipdb work in no
|
||||
|
||||
v0.4
|
||||
----
|
||||
|
||||
|
|
|
@ -663,7 +663,6 @@ Example::
|
|||
(let* ((passwd (read-passwd (plist-get content :prompt)))
|
||||
(content (list :value passwd))
|
||||
(msg (ein:kernel--get-msg kernel "input_reply" content)))
|
||||
(plist-put (plist-get msg :header) :msg_id msg-id)
|
||||
(ein:websocket-send-stdin-channel kernel msg)
|
||||
(setf (ein:$kernel-stdin-activep kernel) nil))
|
||||
(cond ((string-match "ipdb>" (plist-get content :prompt))
|
||||
|
|
|
@ -37,40 +37,40 @@
|
|||
"except" "finally" "for" "while" "with")
|
||||
symbol-end))
|
||||
|
||||
(defun ein:python-indent-calculate-levels ()
|
||||
"Forcefully set indent level to 0 when there is no python block
|
||||
yet in this cell."
|
||||
(ein:and-let* ((cell (ein:worksheet-get-current-cell :noerror t))
|
||||
(beg (ein:cell-input-pos-min cell))
|
||||
((< beg (point))))
|
||||
(save-excursion
|
||||
(unless (search-backward-regexp ein:python-block-start beg t)
|
||||
(setq python-indent-levels (list 0))
|
||||
(setq python-indent-current-level 0)
|
||||
t))))
|
||||
;; (defun ein:python-indent-calculate-levels ()
|
||||
;; "Forcefully set indent level to 0 when there is no python block
|
||||
;; yet in this cell."
|
||||
;; (ein:and-let* ((cell (ein:worksheet-get-current-cell :noerror t))
|
||||
;; (beg (ein:cell-input-pos-min cell))
|
||||
;; ((< beg (point))))
|
||||
;; (save-excursion
|
||||
;; (unless (search-backward-regexp ein:python-block-start beg t)
|
||||
;; (setq python-indent-levels (list 0))
|
||||
;; (setq python-indent-current-level 0)
|
||||
;; t))))
|
||||
|
||||
(defadvice python-indent-calculate-levels
|
||||
(around ein:python-indent-calculate-levels activate)
|
||||
"Hack `python-indent-calculate-levels' to reset indent per cell.
|
||||
;; (defadvice python-indent-calculate-levels
|
||||
;; (around ein:python-indent-calculate-levels activate)
|
||||
;; "Hack `python-indent-calculate-levels' to reset indent per cell.
|
||||
|
||||
Let's say you have a notebook something like this::
|
||||
;; Let's say you have a notebook something like this::
|
||||
|
||||
In [1]:
|
||||
def func():
|
||||
pass
|
||||
;; In [1]:
|
||||
;; def func():
|
||||
;; pass
|
||||
|
||||
In [2]:
|
||||
something[]
|
||||
;; In [2]:
|
||||
;; something[]
|
||||
|
||||
Here, ``[]`` is the cursor position. When you hit the tab here,
|
||||
you don't expect it to indent. However, python.el tries to follow
|
||||
the indent of ``func()`` then you get indentation. This advice
|
||||
workaround this problem.
|
||||
;; Here, ``[]`` is the cursor position. When you hit the tab here,
|
||||
;; you don't expect it to indent. However, python.el tries to follow
|
||||
;; the indent of ``func()`` then you get indentation. This advice
|
||||
;; workaround this problem.
|
||||
|
||||
Note that this workaround does not work with the MuMaMo based
|
||||
notebook mode."
|
||||
(unless (ein:python-indent-calculate-levels)
|
||||
ad-do-it))
|
||||
;; Note that this workaround does not work with the MuMaMo based
|
||||
;; notebook mode."
|
||||
;; (unless (ein:python-indent-calculate-levels)
|
||||
;; ad-do-it))
|
||||
|
||||
(provide 'ein-python)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
;; John Miller <millejoh at millejoh.com>
|
||||
;; URL: http://tkf.github.com/emacs-ipython-notebook/
|
||||
;; Keywords: applications, tools
|
||||
;; Version: 0.4.0
|
||||
;; Version: 0.5.0
|
||||
|
||||
;; This file is NOT part of GNU Emacs.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue