From 6d8cac3623bd1fa9ea113f5c19929266a8b8435b Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 2 May 1994 21:41:43 +0000 Subject: [PATCH] (tags-find-table-in-list): Only recurse if (tags-included-tables) returns non-nil (avoid infinite recursion). --- lisp/progmodes/etags.el | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index fe871c968ad..72d30c935b6 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -294,22 +294,24 @@ file the tag was in." (let ((tags-file-name this-file) found) (visit-tags-table-buffer 'same) - (if (tags-find-table-in-list file recursing-move-to - (tags-included-tables)) - (progn - ;; We found FILE in the included table. - (if move-to - (progn - ;; The recursive call has already frobbed the list - ;; pointers. It set tags-table-parent-pointer-list - ;; to a list including RECURSING-MOVE-TO. Now we - ;; must mutate that cons so its list pointers show - ;; the position where we found this included table. - (setcar (cdr (car recursing-move-to)) list) - (setcar (cdr (cdr (car recursing-move-to))) list) - ;; Don't do further list frobnication below. - (setq move-to nil))) - (setq list t)))))) + (and (tags-included-tables) + ;; We have some included tables; check them. + (tags-find-table-in-list file recursing-move-to + tags-included-tables) + (progn + ;; We found FILE in the included table. + (if move-to + (progn + ;; The recursive call has already frobbed the list + ;; pointers. It set tags-table-parent-pointer-list + ;; to a list including RECURSING-MOVE-TO. Now we + ;; must mutate that cons so its list pointers show + ;; the position where we found this included table. + (setcar (cdr (car recursing-move-to)) list) + (setcar (cdr (cdr (car recursing-move-to))) list) + ;; Don't do further list frobnication below. + (setq move-to nil))) + (setq list t)))))) (if (consp list) (setq list (cdr list)))) (and list move-to -- 2.39.5