🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87888

etags still has endless loop when there is an included file

#87888
From: garyo
Date: Wed, 24 Aug 1994 19:01
53 lines
2883 bytes
In GNU Emacs 19.25.94.1 (sparc-sun-solaris2.3, X toolkit) of Wed Aug 24 1994 on prometheus

In etags.el, the latest version from Roland, there's this code in
tags-table-extend-computed-list, at line 262:

	    (while tables
	      (setq computed (cons (car tables) computed)
		    table-buffer (get-file-buffer (car tables)))
	      (if table-buffer
		  (save-excursion
		    (set-buffer table-buffer)
		    (if (tags-included-tables)
			;; Insert the included tables into the list we
			;; are processing.
			(setcdr tables (append (tags-included-tables)
					       tables))))
		;; This table is not in core yet.  Insert a placeholder
		;; saying we must read it into core to check for included
		;; tables before searching the next table in the list.
		(setq computed (cons t computed))))


This loses when there is no file buffer for (car tables) because then
table-buffer is nil, so t gets consed onto computed, and the while
loop continues with tables never getting modified.

I think this piece of code wants to be like the code near line 226,
in tags-table-check-computed-list, which does a
  (setq tables (cdr tables))
before continuing the while loop.

Here's a patch:

*** etags.el.~1~	Wed Aug 10 19:33:39 1994
--- etags.el	Wed Aug 24 14:46:10 1994
***************
*** 273,279 ****
  		;; This table is not in core yet.  Insert a placeholder
  		;; saying we must read it into core to check for included
  		;; tables before searching the next table in the list.
! 		(setq computed (cons t computed))))
  	    (setq computed (nreverse computed))
  	    ;; COMPUTED now contains the list of included tables (and
  	    ;; tables included by them, etc.).  Now splice this into the
--- 273,280 ----
  		;; This table is not in core yet.  Insert a placeholder
  		;; saying we must read it into core to check for included
  		;; tables before searching the next table in the list.
! 		(setq computed (cons t computed)))
! 	      (setq tables (cdr tables)))
  	    (setq computed (nreverse computed))
  	    ;; COMPUTED now contains the list of included tables (and
  	    ;; tables included by them, etc.).  Now splice this into the
Technical Details
Message-ID: <9408241859.AA02032@prometheus>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!panix!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!avs.com!garyo

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,4a69a1a3d48a588b,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-08-24 12:09:57 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!panix!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!avs.com!garyo
From: garyo@avs.com
Newsgroups: gnu.emacs.bug
Subject: etags still has endless loop when there is an included file
Date: 24 Aug 1994 15:01:17 -0400
Organization: GNUs Not Usenet
Lines: 53
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9408241859.AA02032@prometheus>