diff options
| author | Roland McGrath | 1992-10-12 17:18:22 +0000 |
|---|---|---|
| committer | Roland McGrath | 1992-10-12 17:18:22 +0000 |
| commit | a128c7a0043744281f8ae9cae4baa42ab9c6a11b (patch) | |
| tree | c9a245de78868651ea15ed4d5a7d321636bc0cde /lisp | |
| parent | e0dad66eef65e274a80d69a88f804e69f6e674a7 (diff) | |
| download | emacs-a128c7a0043744281f8ae9cae4baa42ab9c6a11b.tar.gz emacs-a128c7a0043744281f8ae9cae4baa42ab9c6a11b.zip | |
(visit-tags-table-buffer): When trying to pick table, call
tags-expand-table-name on alternatives that might be nil.
(tags-table-files): Don't call visit-tags-table-buffer; assume we are there.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/etags.el | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 222114587f3..76a1da858c6 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -324,11 +324,14 @@ Returns t if it visits a tags table, or nil if there are no more in the list." | |||
| 324 | ;; tags for the current buffer's file. | 324 | ;; tags for the current buffer's file. |
| 325 | ;; If one is found, the lists will be frobnicated, | 325 | ;; If one is found, the lists will be frobnicated, |
| 326 | ;; and CONT will be set non-nil so we don't do it below. | 326 | ;; and CONT will be set non-nil so we don't do it below. |
| 327 | (save-excursion | 327 | (let ((found (save-excursion |
| 328 | (car (tags-table-including buffer-file-name | 328 | (tags-table-including buffer-file-name |
| 329 | tags-table-list))) | 329 | tags-table-list)))) |
| 330 | (car tags-table-list) | 330 | (and found |
| 331 | tags-file-name | 331 | ;; Expand it so it won't be nil. |
| 332 | (tags-expand-table-name (car found)))) | ||
| 333 | (tags-expand-table-name (car tags-table-list)) | ||
| 334 | (tags-expand-table-name tags-file-name) | ||
| 332 | (expand-file-name | 335 | (expand-file-name |
| 333 | (read-file-name "Visit tags table: (default TAGS) " | 336 | (read-file-name "Visit tags table: (default TAGS) " |
| 334 | default-directory | 337 | default-directory |
| @@ -417,7 +420,7 @@ Returns t if it visits a tags table, or nil if there are no more in the list." | |||
| 417 | (kill-local-variable 'tags-file-name) | 420 | (kill-local-variable 'tags-file-name) |
| 418 | (setq tags-file-name nil) | 421 | (setq tags-file-name nil) |
| 419 | (error "File %s is not a valid tags table" buffer-file-name)))) | 422 | (error "File %s is not a valid tags table" buffer-file-name)))) |
| 420 | 423 | ||
| 421 | (defun file-of-tag () | 424 | (defun file-of-tag () |
| 422 | "Return the file name of the file whose tags point is within. | 425 | "Return the file name of the file whose tags point is within. |
| 423 | Assumes the tags table is the current buffer. | 426 | Assumes the tags table is the current buffer. |
| @@ -428,11 +431,9 @@ File name returned is relative to tags table file's directory." | |||
| 428 | (defun tags-table-files () | 431 | (defun tags-table-files () |
| 429 | "Return a list of files in the current tags table. | 432 | "Return a list of files in the current tags table. |
| 430 | File names returned are absolute." | 433 | File names returned are absolute." |
| 431 | (save-excursion | 434 | (or tags-table-files |
| 432 | (visit-tags-table-buffer) | 435 | (setq tags-table-files |
| 433 | (or tags-table-files | 436 | (funcall tags-table-files-function)))) |
| 434 | (setq tags-table-files | ||
| 435 | (funcall tags-table-files-function))))) | ||
| 436 | 437 | ||
| 437 | (defun tags-included-tables () | 438 | (defun tags-included-tables () |
| 438 | "Return a list of tags tables included by the current table." | 439 | "Return a list of tags tables included by the current table." |
| @@ -473,7 +474,7 @@ File names returned are absolute." | |||
| 473 | (if (eq what t) | 474 | (if (eq what t) |
| 474 | (all-completions string (tags-completion-table) predicate) | 475 | (all-completions string (tags-completion-table) predicate) |
| 475 | (try-completion string (tags-completion-table) predicate)))) | 476 | (try-completion string (tags-completion-table) predicate)))) |
| 476 | 477 | ||
| 477 | ;; Return a default tag to search for, based on the text at point. | 478 | ;; Return a default tag to search for, based on the text at point. |
| 478 | (defun find-tag-default () | 479 | (defun find-tag-default () |
| 479 | (save-excursion | 480 | (save-excursion |
| @@ -940,6 +941,7 @@ if the file was newly read in, the value is the filename." | |||
| 940 | (setq next-file-list (tags-table-files)))) | 941 | (setq next-file-list (tags-table-files)))) |
| 941 | (or next-file-list | 942 | (or next-file-list |
| 942 | (save-excursion | 943 | (save-excursion |
| 944 | ;; Get the files from the next tags table. | ||
| 943 | ;; When doing (visit-tags-table-buffer t), | 945 | ;; When doing (visit-tags-table-buffer t), |
| 944 | ;; the tags table buffer must be current. | 946 | ;; the tags table buffer must be current. |
| 945 | (if (and (visit-tags-table-buffer 'same) | 947 | (if (and (visit-tags-table-buffer 'same) |