changeset 23377:acb6d2c4220b

(tags-reset-tags-tables): Properly find the markers in the old rings that are being discarded.
author Karl Heuer <kwzh@gnu.org>
date Tue, 06 Oct 1998 22:35:51 +0000
parents c27c5254e5d4
children 85656c9cca2a
files lisp/progmodes/etags.el
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/etags.el	Tue Oct 06 22:30:28 1998 +0000
+++ b/lisp/progmodes/etags.el	Tue Oct 06 22:35:51 1998 +0000
@@ -613,17 +613,17 @@
 (defun tags-reset-tags-tables ()
   "Reset tags state to cancel effect of any previous \\[visit-tags-table] or \\[find-tag]."
   (interactive)
+  ;; Clear out the markers we are throwing away.
+  (let ((i 0))
+    (while (< i find-tag-marker-ring-length)
+      (if (aref (cddr tags-location-ring) i)
+	  (set-marker (aref (cddr tags-location-ring) i) nil))
+      (if (aref (cddr find-tag-marker-ring) i)
+	  (set-marker (aref (cddr find-tag-marker-ring) i) nil))
+      (setq i (1+ i))))
   (setq tags-file-name nil
-	tags-location-ring (progn
-			     (mapcar (lambda (m)
-				       (set-marker m nil))
-				     tags-location-ring)
-			     (make-ring find-tag-marker-ring-length))
-	find-tag-marker-ring (progn
-			       (mapcar (lambda (m)
-					 (set-marker m nil))
-				       find-tag-marker-ring)
-			       (make-ring find-tag-marker-ring-length))
+	tags-location-ring (make-ring find-tag-marker-ring-length)
+	find-tag-marker-ring (make-ring find-tag-marker-ring-length)
 	tags-table-list nil
 	tags-table-computed-list nil
 	tags-table-computed-list-for nil