diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/ewoc.el | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 888d793e621..b8720226e8d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,8 @@ * emacs-lisp/ewoc.el (ewoc--create): No longer take HEADER and FOOTER args. Update unique caller. + (ewoc-delete): Compute last node once before looping. + 2006-05-27 Mathias Dahl <mathias.dahl@gmail.com> * dired.el (dired-mode-map): Change `tumme-tag-remove' to diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el index d1ededc583d..a02425b0cec 100644 --- a/lisp/emacs-lisp/ewoc.el +++ b/lisp/emacs-lisp/ewoc.el @@ -385,12 +385,12 @@ arguments will be passed to MAP-FUNCTION." (defun ewoc-delete (ewoc &rest nodes) "Delete NODES from EWOC." (ewoc--set-buffer-bind-dll-let* ewoc - ((L nil) (R nil)) + ((L nil) (R nil) (last (ewoc--last-node ewoc))) (dolist (node nodes) ;; If we are about to delete the node pointed at by last-node, ;; set last-node to nil. - (if (eq (ewoc--last-node ewoc) node) - (setf (ewoc--last-node ewoc) nil)) + (when (eq last node) + (setf last nil (ewoc--last-node ewoc) nil)) (delete-region (ewoc--node-start-marker node) (ewoc--node-start-marker (ewoc--node-next node))) (set-marker (ewoc--node-start-marker node) nil) |