diff options
| -rw-r--r-- | lisp/progmodes/etags.el | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 23d42404f80..08eb0b5dd45 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -332,10 +332,10 @@ Returns non-nil iff it is a valid table." | |||
| 332 | ;; Subroutine of visit-tags-table-buffer. Search the current tags tables | 332 | ;; Subroutine of visit-tags-table-buffer. Search the current tags tables |
| 333 | ;; for one that has tags for THIS-FILE (or that includes a table that | 333 | ;; for one that has tags for THIS-FILE (or that includes a table that |
| 334 | ;; does). Returns the tail of `tags-table-computed-list' whose car is a | 334 | ;; does). Returns the tail of `tags-table-computed-list' whose car is a |
| 335 | ;; table listing THIS-FILE. If CORE-ONLY is non-nil, check only tags | 335 | ;; table listing THIS-FILE; if the table is one included by another table, |
| 336 | ;; tables that are already in buffers--don't visit any new files. | 336 | ;; it is the master table that we return. If CORE-ONLY is non-nil, check |
| 337 | ;; only tags tables that are already in buffers--don't visit any new files. | ||
| 337 | (defun tags-table-including (this-file core-only) | 338 | (defun tags-table-including (this-file core-only) |
| 338 | (tags-table-check-computed-list) | ||
| 339 | (let ((tables tags-table-computed-list) | 339 | (let ((tables tags-table-computed-list) |
| 340 | (found nil)) | 340 | (found nil)) |
| 341 | ;; Loop over the list, looking for a table containing tags for THIS-FILE. | 341 | ;; 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." | |||
| 350 | ;; Skip this table not in core. | 350 | ;; Skip this table not in core. |
| 351 | (setq tables (cdr (cdr tables)))) | 351 | (setq tables (cdr (cdr tables)))) |
| 352 | 352 | ||
| 353 | ;; Select the tags table buffer and get the file list up to date. | 353 | (if tables |
| 354 | (let ((tags-file-name (car tables))) | 354 | ;; Select the tags table buffer and get the file list up to date. |
| 355 | (visit-tags-table-buffer 'same) | 355 | (let ((tags-file-name (car tables))) |
| 356 | (if (member this-file (tags-table-files)) | 356 | (visit-tags-table-buffer 'same) |
| 357 | ;; Found it. | 357 | (if (member this-file (tags-table-files)) |
| 358 | (setq found tables))) | 358 | ;; Found it. |
| 359 | (setq found tables)))) | ||
| 359 | (setq tables (cdr tables))) | 360 | (setq tables (cdr tables))) |
| 361 | (if found | ||
| 362 | ;; Now determine if the table we found was one included by another | ||
| 363 | ;; table, not explicitly listed. | ||
| 364 | (let ((could-be nil) | ||
| 365 | (elt tags-table-computed-list)) | ||
| 366 | (while (not (eq elt (cdr found))) | ||
| 367 | (if (tags-table-list-member (car elt) tags-table-list) | ||
| 368 | ;; This table appears in the user's list, so it could be | ||
| 369 | ;; the one which includes the table we found. | ||
| 370 | (setq could-be (cons (car elt) could-be))) | ||
| 371 | (setq elt (cdr elt))) | ||
| 372 | ;; The last element we found in the computed list before | ||
| 373 | ;; FOUND that appears in the | ||
| 360 | found)) | 374 | found)) |
| 361 | 375 | ||
| 362 | ;; Subroutine of visit-tags-table-buffer. Move tags-table-list-pointer | 376 | ;; Subroutine of visit-tags-table-buffer. Move tags-table-list-pointer |