diff options
| author | Roland McGrath | 1994-01-31 23:05:32 +0000 |
|---|---|---|
| committer | Roland McGrath | 1994-01-31 23:05:32 +0000 |
| commit | 20783a2b0d37fbba4a2f538ee0d43d88dc9645ab (patch) | |
| tree | a5db52112fcf5fa9fd64c710e6f02531d7908f42 /lisp | |
| parent | babf687a8b9e48028be2a475ec6ea52c64a89090 (diff) | |
| download | emacs-20783a2b0d37fbba4a2f538ee0d43d88dc9645ab.tar.gz emacs-20783a2b0d37fbba4a2f538ee0d43d88dc9645ab.zip | |
(visit-tags-table-buffer): Don't change VISIT-TAGS-TABLE-BUFFER-CONT when
it is 'same. Do list verification frobbing for it being either 'same or
nil; but only set tags-table-list-started-at and tags-table-list-pointer
when it's nil.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/etags.el | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index c39eed6d344..ebfdb910cb6 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; etags.el --- etags facility for Emacs | 1 | ;;; etags.el --- etags facility for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1986, 1988, 1989, 1992, 1993 | 3 | ;; Copyright (C) 1985, 1986, 1988, 1989, 1992, 1993, 1994 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Roland McGrath <roland@gnu.ai.mit.edu> | 6 | ;; Author: Roland McGrath <roland@gnu.ai.mit.edu> |
| @@ -359,20 +359,18 @@ Returns t if it visits a tags table, or nil if there are no more in the list." | |||
| 359 | (or tags-file-name | 359 | (or tags-file-name |
| 360 | (error (substitute-command-keys | 360 | (error (substitute-command-keys |
| 361 | (concat "No tags table in use! " | 361 | (concat "No tags table in use! " |
| 362 | "Use \\[visit-tags-table] to select one.")))) | 362 | "Use \\[visit-tags-table] to select one."))))) |
| 363 | ;; Set VISIT-TAGS-TABLE-BUFFER-CONT to nil | ||
| 364 | ;; so the code below will make sure tags-file-name | ||
| 365 | ;; is in tags-table-list. | ||
| 366 | (setq visit-tags-table-buffer-cont nil)) | ||
| 367 | 363 | ||
| 368 | (visit-tags-table-buffer-cont | 364 | (visit-tags-table-buffer-cont |
| 369 | ;; Find the next table. | 365 | ;; Find the next table. |
| 370 | (if (tags-next-table) | 366 | (if (tags-next-table) |
| 371 | ;; Skip over nonexistent files. | 367 | ;; Skip over nonexistent files. |
| 372 | (while (and (let ((file (tags-expand-table-name tags-file-name))) | 368 | (let (file) |
| 369 | (while (and (setq file | ||
| 370 | (tags-expand-table-name tags-file-name)) | ||
| 373 | (not (or (get-file-buffer file) | 371 | (not (or (get-file-buffer file) |
| 374 | (file-exists-p file)))) | 372 | (file-exists-p file)))) |
| 375 | (tags-next-table))))) | 373 | (tags-next-table))))) |
| 376 | 374 | ||
| 377 | (t | 375 | (t |
| 378 | ;; Pick a table out of our hat. | 376 | ;; Pick a table out of our hat. |
| @@ -423,7 +421,8 @@ Returns t if it visits a tags table, or nil if there are no more in the list." | |||
| 423 | ;; Expand the table name into a full file name. | 421 | ;; Expand the table name into a full file name. |
| 424 | (setq tags-file-name (tags-expand-table-name tags-file-name)) | 422 | (setq tags-file-name (tags-expand-table-name tags-file-name)) |
| 425 | 423 | ||
| 426 | (if (and (eq visit-tags-table-buffer-cont t) (null tags-table-list-pointer)) | 424 | (if (and (eq visit-tags-table-buffer-cont t) |
| 425 | (null tags-table-list-pointer)) | ||
| 427 | ;; All out of tables. | 426 | ;; All out of tables. |
| 428 | nil | 427 | nil |
| 429 | 428 | ||
| @@ -457,50 +456,51 @@ Returns t if it visits a tags table, or nil if there are no more in the list." | |||
| 457 | ;; doesn't get in the user's way. | 456 | ;; doesn't get in the user's way. |
| 458 | (bury-buffer (current-buffer)) | 457 | (bury-buffer (current-buffer)) |
| 459 | 458 | ||
| 460 | (if visit-tags-table-buffer-cont | 459 | (if (memq visit-tags-table-buffer-cont '(same nil)) |
| 461 | ;; No list frobbing required. | 460 | ;; Look in the list for the table we chose. |
| 462 | nil | 461 | (let ((elt (tags-table-list-member tags-file-name))) |
| 463 | 462 | (or elt | |
| 464 | ;; Look in the list for the table we chose. | 463 | ;; The table is not in the current set. |
| 465 | (let ((elt (tags-table-list-member tags-file-name))) | 464 | ;; Try to find it in another previously used set. |
| 466 | (or elt | 465 | (let ((sets tags-table-set-list)) |
| 467 | ;; The table is not in the current set. | 466 | (while (and sets |
| 468 | ;; Try to find it in another previously used set. | 467 | (not (setq elt |
| 469 | (let ((sets tags-table-set-list)) | 468 | (tags-table-list-member |
| 470 | (while (and sets | 469 | tags-file-name (car sets))))) |
| 471 | (not (setq elt (tags-table-list-member | 470 | (setq sets (cdr sets))) |
| 472 | tags-file-name (car sets))))) | 471 | (if sets |
| 473 | (setq sets (cdr sets))) | 472 | ;; Found in some other set. Switch to that set. |
| 474 | (if sets | 473 | (progn |
| 475 | ;; Found in some other set. Switch to that set. | 474 | (or (memq tags-table-list tags-table-set-list) |
| 476 | (progn | 475 | ;; Save the current list. |
| 476 | (setq tags-table-set-list | ||
| 477 | (cons tags-table-list | ||
| 478 | tags-table-set-list))) | ||
| 479 | (setq tags-table-list (car sets))) | ||
| 480 | |||
| 481 | ;; Not found in any existing set. | ||
| 482 | (if (and tags-table-list | ||
| 483 | (or tags-add-tables | ||
| 484 | (y-or-n-p | ||
| 485 | (concat "Keep current list of " | ||
| 486 | "tags tables also? ")))) | ||
| 487 | ;; Add it to the current list. | ||
| 488 | (setq tags-table-list (cons tags-file-name | ||
| 489 | tags-table-list)) | ||
| 490 | ;; Make a fresh list, and store the old one. | ||
| 491 | (message "Starting a new list of tags tables") | ||
| 477 | (or (memq tags-table-list tags-table-set-list) | 492 | (or (memq tags-table-list tags-table-set-list) |
| 478 | ;; Save the current list. | ||
| 479 | (setq tags-table-set-list | 493 | (setq tags-table-set-list |
| 480 | (cons tags-table-list | 494 | (cons tags-table-list |
| 481 | tags-table-set-list))) | 495 | tags-table-set-list))) |
| 482 | (setq tags-table-list (car sets))) | 496 | (setq tags-table-list (list tags-file-name))) |
| 483 | 497 | (setq elt tags-table-list)))) | |
| 484 | ;; Not found in any existing set. | 498 | |
| 485 | (if (and tags-table-list | 499 | (or visit-tags-table-buffer-cont |
| 486 | (or tags-add-tables | 500 | ;; Set the tags table list state variables to point |
| 487 | (y-or-n-p (concat "Keep current list of" | 501 | ;; at the table we want to use first. |
| 488 | " tags tables also? ")))) | 502 | (setq tags-table-list-started-at elt |
| 489 | ;; Add it to the current list. | 503 | tags-table-list-pointer elt)))) |
| 490 | (setq tags-table-list (cons tags-file-name | ||
| 491 | tags-table-list)) | ||
| 492 | ;; Make a fresh list, and store the old one. | ||
| 493 | (message "Starting a new list of tags tables") | ||
| 494 | (or (memq tags-table-list tags-table-set-list) | ||
| 495 | (setq tags-table-set-list | ||
| 496 | (cons tags-table-list tags-table-set-list))) | ||
| 497 | (setq tags-table-list (list tags-file-name))) | ||
| 498 | (setq elt tags-table-list)))) | ||
| 499 | |||
| 500 | ;; Set the tags table list state variables to point at the table | ||
| 501 | ;; we want to use first. | ||
| 502 | (setq tags-table-list-started-at elt | ||
| 503 | tags-table-list-pointer elt))) | ||
| 504 | 504 | ||
| 505 | ;; Return of t says the tags table is valid. | 505 | ;; Return of t says the tags table is valid. |
| 506 | t) | 506 | t) |