Fix ein:notebook-merge-cell-command

Let binding of buffer-undo-list of shadowed the global variable.
This commit is contained in:
Takafumi Arakaki 2012-06-17 09:50:45 +02:00
parent 9fe12edfea
commit 7d81026f2c
2 changed files with 25 additions and 10 deletions

View file

@ -635,8 +635,7 @@ If prefix is given, merge current cell into previous cell."
(unless cell (error "No previous cell"))
(ein:cell-goto cell))
(let* ((next-cell (ein:cell-next cell))
(tail (ein:cell-get-text next-cell))
(buffer-undo-list t)) ; disable undo recording
(tail (ein:cell-get-text next-cell)))
(ein:notebook-delete-cell ein:notebook next-cell)
(save-excursion
(goto-char (1- (ein:cell-location cell :input t)))

View file

@ -454,9 +454,10 @@ In [ ]:
(line-2 "second line"))
(ein:notebook-insert-cell-below-command)
(ein:notebook-insert-cell-below-command)
;; Extra cell to avoid "Changes to be undone are outside visible
;; Extra cells to avoid "Changes to be undone are outside visible
;; portion of buffer" user-error:
(ein:notebook-insert-cell-below-command)
(ein:notebook-insert-cell-below-command)
(goto-char (point-min))
(ein:notebook-goto-next-input-command)
@ -469,16 +470,14 @@ In [ ]:
(ein:notebook-goto-prev-input-command)
(ein:notebook-merge-cell-command)
(undo-boundary)
(should (equal (ein:cell-get-text (ein:notebook-get-current-cell))
(concat line-1 "\n" line-2)))
(if (eq ein:notebook-enable-undo 'full)
(undo)
(should-error (undo)))
(when (eq ein:notebook-enable-undo 'full)
;; FIXME: Known bug. (it must succeed.) ... or maybe it should
;; inhibit undo for `full' case here.
(should-error (should (equal (buffer-string) "
(if (eq ein:notebook-enable-undo 'no)
(should-error (undo))
(undo)
(should (equal (buffer-string) "
In [ ]:
first line
@ -488,6 +487,23 @@ In [ ]:
In [ ]:
")))
(when (eq ein:notebook-enable-undo 'yes)
;; FIXME: `undo' should work...
(should-error (undo-more 1)))
(when (eq ein:notebook-enable-undo 'full)
(undo)
;; FIXME: Known bug... What should the result be?
(should-error (should (equal (buffer-string) "
In [ ]:
In [ ]:
In [ ]:
")))))))
(defun eintest:notebook-undo-after-execution-1-cell ()