]> git.eshelyaron.com Git - emacs.git/commitdiff
(tags-table-including): Don't call tags-table-check-computed-list.
authorRoland McGrath <roland@gnu.org>
Thu, 23 Jun 1994 01:11:38 +0000 (01:11 +0000)
committerRoland McGrath <roland@gnu.org>
Thu, 23 Jun 1994 01:11:38 +0000 (01:11 +0000)
After skipping a table not in core, make sure TABLES is non-nil before
using it.  At end, find the table in the user's list which includes FOUND.

lisp/progmodes/etags.el

index 23d42404f805012ed0ea6dc3041863982d8755d1..08eb0b5dd4535d67f31ecbd9c343a9a41a1420df 100644 (file)
@@ -332,10 +332,10 @@ Returns non-nil iff it is a valid table."
 ;; Subroutine of visit-tags-table-buffer.  Search the current tags tables
 ;; for one that has tags for THIS-FILE (or that includes a table that
 ;; does).  Returns the tail of `tags-table-computed-list' whose car is a
-;; table listing THIS-FILE.  If CORE-ONLY is non-nil, check only tags
-;; tables that are already in buffers--don't visit any new files.
+;; table listing THIS-FILE; if the table is one included by another table,
+;; it is the master table that we return.  If CORE-ONLY is non-nil, check
+;; only tags tables that are already in buffers--don't visit any new files.
 (defun tags-table-including (this-file core-only)
-  (tags-table-check-computed-list)
   (let ((tables tags-table-computed-list)
        (found nil))
     ;; Loop over the list, looking for a table containing tags for THIS-FILE.
@@ -350,13 +350,27 @@ Returns non-nil iff it is a valid table."
          ;; Skip this table not in core.
          (setq tables (cdr (cdr tables))))
 
-      ;; Select the tags table buffer and get the file list up to date.
-      (let ((tags-file-name (car tables)))
-       (visit-tags-table-buffer 'same)
-       (if (member this-file (tags-table-files))
-           ;; Found it.
-           (setq found tables)))
+      (if tables
+         ;; Select the tags table buffer and get the file list up to date.
+         (let ((tags-file-name (car tables)))
+           (visit-tags-table-buffer 'same)
+           (if (member this-file (tags-table-files))
+               ;; Found it.
+               (setq found tables))))
       (setq tables (cdr tables)))
+    (if found
+       ;; Now determine if the table we found was one included by another
+       ;; table, not explicitly listed.
+       (let ((could-be nil)
+             (elt tags-table-computed-list))
+         (while (not (eq elt (cdr found)))
+           (if (tags-table-list-member (car elt) tags-table-list)
+               ;; This table appears in the user's list, so it could be
+               ;; the one which includes the table we found.
+               (setq could-be (cons (car elt) could-be)))
+           (setq elt (cdr elt)))
+         ;; The last element we found in the computed list before
+         ;; FOUND that appears in the 
     found))
 
 ;; Subroutine of visit-tags-table-buffer.  Move tags-table-list-pointer