diff options
| author | Richard M. Stallman | 1997-08-15 19:28:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-15 19:28:16 +0000 |
| commit | 350ce4cf0aa3fa61e04572888ea5a5dfd36b5184 (patch) | |
| tree | 3bccb450cce5dbdc003b6cd59d58b1a18124261b | |
| parent | 540a8bd25e435f304589dbdcaaa4ea790d27511b (diff) | |
| download | emacs-350ce4cf0aa3fa61e04572888ea5a5dfd36b5184.tar.gz emacs-350ce4cf0aa3fa61e04572888ea5a5dfd36b5184.zip | |
(tags-verify-table): Obey revert-without-query.
(verify-tags-table-function): Doc fix.
| -rw-r--r-- | lisp/progmodes/etags.el | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 8b0cca71e35..e66d12d07f2 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -152,8 +152,7 @@ One argument, the tag info returned by `snarf-tag-function'.") | |||
| 152 | (defvar tags-included-tables-function nil | 152 | (defvar tags-included-tables-function nil |
| 153 | "Function to do the work of `tags-included-tables' (which see).") | 153 | "Function to do the work of `tags-included-tables' (which see).") |
| 154 | (defvar verify-tags-table-function nil | 154 | (defvar verify-tags-table-function nil |
| 155 | "Function to return t iff the current buffer contains a valid | 155 | "Function to return t iff current buffer contains valid tags file.") |
| 156 | \(already initialized\) tags file.") | ||
| 157 | 156 | ||
| 158 | ;; Initialize the tags table in the current buffer. | 157 | ;; Initialize the tags table in the current buffer. |
| 159 | ;; Returns non-nil iff it is a valid tags table. On | 158 | ;; Returns non-nil iff it is a valid tags table. On |
| @@ -314,10 +313,21 @@ Returns non-nil iff it is a valid table." | |||
| 314 | (set-buffer (get-file-buffer file)) | 313 | (set-buffer (get-file-buffer file)) |
| 315 | (setq win (or verify-tags-table-function (initialize-new-tags-table))) | 314 | (setq win (or verify-tags-table-function (initialize-new-tags-table))) |
| 316 | (if (or (verify-visited-file-modtime (current-buffer)) | 315 | (if (or (verify-visited-file-modtime (current-buffer)) |
| 317 | (not (yes-or-no-p | 316 | ;; Decide whether to revert the file. |
| 318 | (format "Tags file %s has changed, read new contents? " | 317 | ;; revert-without-query can say to revert |
| 319 | file)))) | 318 | ;; or the user can say to revert. |
| 320 | (and win (funcall verify-tags-table-function)) | 319 | (not (or (let ((tail revert-without-query) |
| 320 | (found nil)) | ||
| 321 | (while tail | ||
| 322 | (if (string-match (car tail) buffer-file-name) | ||
| 323 | (setq found t)) | ||
| 324 | (setq tail (cdr tail))) | ||
| 325 | found) | ||
| 326 | (yes-or-no-p | ||
| 327 | (format "Tags file %s has changed, read new contents? " | ||
| 328 | file))))) | ||
| 329 | (and verify-tags-table-function | ||
| 330 | (funcall verify-tags-table-function)) | ||
| 321 | (revert-buffer t t) | 331 | (revert-buffer t t) |
| 322 | (initialize-new-tags-table))) | 332 | (initialize-new-tags-table))) |
| 323 | (and (file-exists-p file) | 333 | (and (file-exists-p file) |