changeset 71051:bf1f0ff1e25e

(ewoc--insert-new-node): Use ewoc--refresh-node.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 29 May 2006 03:47:56 +0000
parents 7db91d4d92b2
children 529644115612
files lisp/ChangeLog lisp/emacs-lisp/ewoc.el
diffstat 2 files changed, 12 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon May 29 03:28:52 2006 +0000
+++ b/lisp/ChangeLog	Mon May 29 03:47:56 2006 +0000
@@ -1,5 +1,7 @@
 2006-05-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* emacs-lisp/ewoc.el (ewoc--insert-new-node): Use ewoc--refresh-node.
+
 	* emacs-lisp/autoload.el (no-update-autoloads): Declare.
 	(generate-file-autoloads): Obey it.  Return whether autoloads were
 	added at point or not.
--- a/lisp/emacs-lisp/ewoc.el	Mon May 29 03:28:52 2006 +0000
+++ b/lisp/emacs-lisp/ewoc.el	Mon May 29 03:47:56 2006 +0000
@@ -99,7 +99,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))	;because of CL compiler macros
+(eval-when-compile (require 'cl))
 
 ;; The doubly linked list is implemented as a circular list
 ;; with a dummy node first and last. The dummy node is used as
@@ -197,18 +197,13 @@
 Call PRETTY-PRINTER with point at NODE's start, thus pushing back
 NODE and leaving the new node's start there.  Return the new node."
   (save-excursion
-    (let* ((inhibit-read-only t)
-           (m (copy-marker (ewoc--node-start-marker node)))
-           (pos (marker-position m))
-           (elemnode (ewoc--node-create m data)))
-      (goto-char pos)
-      (funcall pretty-printer data)
-      (setf (marker-position m) pos
-            (ewoc--node-left  elemnode) (ewoc--node-left node)
+    (let ((elemnode (ewoc--node-create
+                     (copy-marker (ewoc--node-start-marker node)) data)))
+      (setf (ewoc--node-left  elemnode) (ewoc--node-left node)
             (ewoc--node-right elemnode)                  node
             (ewoc--node-right (ewoc--node-left node)) elemnode
             (ewoc--node-left                   node)  elemnode)
-      (ewoc--adjust pos (point) node)
+      (ewoc--refresh-node pretty-printer elemnode)
       elemnode)))
 
 (defun ewoc--refresh-node (pp node)
@@ -584,10 +579,10 @@
 
 (provide 'ewoc)
 
-;;; Local Variables:
-;;; eval: (put 'ewoc--set-buffer-bind-dll 'lisp-indent-hook 1)
-;;; eval: (put 'ewoc--set-buffer-bind-dll-let* 'lisp-indent-hook 2)
-;;; End:
+;; Local Variables:
+;; eval: (put 'ewoc--set-buffer-bind-dll 'lisp-indent-hook 1)
+;; eval: (put 'ewoc--set-buffer-bind-dll-let* 'lisp-indent-hook 2)
+;; End:
 
-;;; arch-tag: d78915b9-9a07-44bf-aac6-04a1fc1bd6d4
+;; arch-tag: d78915b9-9a07-44bf-aac6-04a1fc1bd6d4
 ;;; ewoc.el ends here