aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThien-Thi Nguyen2006-05-11 08:02:11 +0000
committerThien-Thi Nguyen2006-05-11 08:02:11 +0000
commitbfbdb5cacfc4d492709b4631995eb6e784a94c5e (patch)
tree4896c2510c7e05ddc7616ba733507372fe36fecf
parent21f8fcfd24dc96790589ad578c7ee54593fcfd10 (diff)
downloademacs-bfbdb5cacfc4d492709b4631995eb6e784a94c5e.tar.gz
emacs-bfbdb5cacfc4d492709b4631995eb6e784a94c5e.zip
(ewoc--refresh-node): No longer save-excursion.
Update all callers to do it there, instead.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/emacs-lisp/ewoc.el34
2 files changed, 24 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 83586c49717..c031c2beae5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12006-05-11 Thien-Thi Nguyen <ttn@gnu.org>
2
3 * emacs-lisp/ewoc.el (ewoc--refresh-node): No longer save-excursion.
4 Update all callers to do it there, instead.
5
12006-05-10 Glenn Morris <rgm@gnu.org> 62006-05-10 Glenn Morris <rgm@gnu.org>
2 7
3 * calendar/calendar.el (calendar-basic-setup): Set day to 1 in 8 * calendar/calendar.el (calendar-basic-setup): Set day to 1 in
@@ -20,7 +25,7 @@
20 * progmodes/idlwave.el (idlwave-push-mark): Removed obsolete 25 * progmodes/idlwave.el (idlwave-push-mark): Removed obsolete
21 compatibility function (Emacs 18/19). 26 compatibility function (Emacs 18/19).
22 (idlwave-is-continuation-line): Always return point at start of 27 (idlwave-is-continuation-line): Always return point at start of
23 previous non-blank continuation line. 28 previous non-blank continuation line.
24 `keyword-parameters': Fix continued comment font-lock matcher. 29 `keyword-parameters': Fix continued comment font-lock matcher.
25 (idlwave-font-lock-fontify-region): Written, use as 30 (idlwave-font-lock-fontify-region): Written, use as
26 font-lock-fontify-region-function, to fix continued keyword 31 font-lock-fontify-region-function, to fix continued keyword
diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el
index 6ef14558a6a..e5f1299333c 100644
--- a/lisp/emacs-lisp/ewoc.el
+++ b/lisp/emacs-lisp/ewoc.el
@@ -235,14 +235,13 @@ start position and the element DATA."
235(defun ewoc--refresh-node (pp node) 235(defun ewoc--refresh-node (pp node)
236 "Redisplay the element represented by NODE using the pretty-printer PP." 236 "Redisplay the element represented by NODE using the pretty-printer PP."
237 (let ((inhibit-read-only t)) 237 (let ((inhibit-read-only t))
238 (save-excursion 238 ;; First, remove the string from the buffer:
239 ;; First, remove the string from the buffer: 239 (delete-region (ewoc--node-start-marker node)
240 (delete-region (ewoc--node-start-marker node) 240 (1- (marker-position
241 (1- (marker-position 241 (ewoc--node-start-marker (ewoc--node-right node)))))
242 (ewoc--node-start-marker (ewoc--node-right node))))) 242 ;; Calculate and insert the string.
243 ;; Calculate and insert the string. 243 (goto-char (ewoc--node-start-marker node))
244 (goto-char (ewoc--node-start-marker node)) 244 (funcall pp (ewoc--node-data node))))
245 (funcall pp (ewoc--node-data node)))))
246 245
247;;; =========================================================================== 246;;; ===========================================================================
248;;; Public members of the Ewoc package 247;;; Public members of the Ewoc package
@@ -361,10 +360,11 @@ arguments will be passed to MAP-FUNCTION."
361 (ewoc--set-buffer-bind-dll-let* ewoc 360 (ewoc--set-buffer-bind-dll-let* ewoc
362 ((footer (ewoc--footer ewoc)) 361 ((footer (ewoc--footer ewoc))
363 (node (ewoc--node-nth dll 1))) 362 (node (ewoc--node-nth dll 1)))
364 (while (not (eq node footer)) 363 (save-excursion
365 (if (apply map-function (ewoc--node-data node) args) 364 (while (not (eq node footer))
366 (ewoc--refresh-node (ewoc--pretty-printer ewoc) node)) 365 (if (apply map-function (ewoc--node-data node) args)
367 (setq node (ewoc--node-next dll node))))) 366 (ewoc--refresh-node (ewoc--pretty-printer ewoc) node))
367 (setq node (ewoc--node-next dll node))))))
368 368
369(defun ewoc-filter (ewoc predicate &rest args) 369(defun ewoc-filter (ewoc predicate &rest args)
370 "Remove all elements in EWOC for which PREDICATE returns nil. 370 "Remove all elements in EWOC for which PREDICATE returns nil.
@@ -473,8 +473,9 @@ If the EWOC is empty, nil is returned."
473 "Call EWOC's pretty-printer for each element in NODES. 473 "Call EWOC's pretty-printer for each element in NODES.
474Delete current text first, thus effecting a \"refresh\"." 474Delete current text first, thus effecting a \"refresh\"."
475 (ewoc--set-buffer-bind-dll ewoc 475 (ewoc--set-buffer-bind-dll ewoc
476 (dolist (node nodes) 476 (save-excursion
477 (ewoc--refresh-node (ewoc--pretty-printer ewoc) node)))) 477 (dolist (node nodes)
478 (ewoc--refresh-node (ewoc--pretty-printer ewoc) node)))))
478 479
479(defun ewoc-goto-prev (ewoc arg) 480(defun ewoc-goto-prev (ewoc arg)
480 "Move point to the ARGth previous element in EWOC. 481 "Move point to the ARGth previous element in EWOC.
@@ -572,8 +573,9 @@ Return nil if the buffer has been deleted."
572 "Set the HEADER and FOOTER of EWOC." 573 "Set the HEADER and FOOTER of EWOC."
573 (setf (ewoc--node-data (ewoc--header ewoc)) header) 574 (setf (ewoc--node-data (ewoc--header ewoc)) header)
574 (setf (ewoc--node-data (ewoc--footer ewoc)) footer) 575 (setf (ewoc--node-data (ewoc--footer ewoc)) footer)
575 (ewoc--refresh-node 'insert (ewoc--header ewoc)) 576 (save-excursion
576 (ewoc--refresh-node 'insert (ewoc--footer ewoc))) 577 (ewoc--refresh-node 'insert (ewoc--header ewoc))
578 (ewoc--refresh-node 'insert (ewoc--footer ewoc))))
577 579
578 580
579(provide 'ewoc) 581(provide 'ewoc)