Better make all the calls to length on buffer-undo-list safe.

This commit is contained in:
John Miller 2019-12-06 21:26:57 -06:00
parent 152cbc8da1
commit 0f2ba0370f

View file

@ -149,6 +149,7 @@ Normalize `buffer-undo-list' by removing extraneous details, and update the ein:
(numberp (car (last u))) (numberp (cdr (last u))))
(append (cl-subseq u 0 3)
(cons (+ ,distance (car (last u)))
(+ ,distance (cdr (last u))))))
((and (consp u) (eq (car u) 'apply)
(numberp (nth 2 u)) (numberp (nth 3 u)))
@ -236,9 +237,9 @@ Normalize `buffer-undo-list' by removing extraneous details, and update the ein:
(ein:log 'debug "unsh adj %s %s" u cell-id)
(setq lst (nconc lst (list (funcall func-after-cell u)))))
(setq lst (nconc lst (list u)))))))
(cl-assert (= (length buffer-undo-list) (length lst)) t
(cl-assert (= (safe-length buffer-undo-list) (length lst)) t
"ein:worksheet--unshift-undo-list %d != %d"
(length buffer-undo-list) (length lst))
(safe-length buffer-undo-list) (length lst))
(setq buffer-undo-list lst)
(ein:worksheet--update-cell-lengths cell exogenous-input)))))