Fix the problem with autoexec and insert

The problem was that ein:cell-input-pos-min/max fail when called
during the insertion, because the input area does not exist yet
when inserting, for example prompt EWOC node.  This is fixed in
the previous commit 0205188933.
They return nil when there is no input area yet.  So,
ein:autoexec-after-change checks if they return nil or not now.
This commit is contained in:
Takafumi Arakaki 2012-07-22 17:07:17 +02:00
parent 0205188933
commit 91af6700ce

View file

@ -49,8 +49,8 @@ If the previous execution timer is not fired yet, cancel the timer."
(let ((cell (ein:notebook-get-current-cell beg)))
(when (and (ein:codecell-p cell)
this-command
(<= (ein:cell-input-pos-min cell) beg)
(>= (ein:cell-input-pos-max cell) end))
(ein:aif (ein:cell-input-pos-min cell) (<= it beg))
(ein:aif (ein:cell-input-pos-max cell) (>= it end)))
(ein:autoexec-execute-cell cell))))
(define-minor-mode ein:autoexec-mode