diff options
| author | Richard M. Stallman | 1993-06-19 20:18:05 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-19 20:18:05 +0000 |
| commit | c142ab2d38d91af83c8351fc702f8d3fea1ba59d (patch) | |
| tree | c765d1342e74b0c10483e36c6bebfe9b14df510a | |
| parent | 3be6243a7dd313b0f3eb1fdd11f7ef6d8152853a (diff) | |
| download | emacs-c142ab2d38d91af83c8351fc702f8d3fea1ba59d.tar.gz emacs-c142ab2d38d91af83c8351fc702f8d3fea1ba59d.zip | |
(Info-insert-dir): Record file attributes of files used.
Recompute the dir if they change.
| -rw-r--r-- | lisp/info.el | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lisp/info.el b/lisp/info.el index 1aec6acc629..5d2682e6430 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -279,13 +279,25 @@ to read a file name from the minibuffer." | |||
| 279 | ;; of the merged dir text. | 279 | ;; of the merged dir text. |
| 280 | (defvar Info-dir-contents-directory nil) | 280 | (defvar Info-dir-contents-directory nil) |
| 281 | 281 | ||
| 282 | ;; Record the file attributes of all the files from which we | ||
| 283 | ;; constructed Info-dir-contents. | ||
| 284 | (defvar Info-dir-file-attributes nil) | ||
| 285 | |||
| 282 | ;; Construct the Info directory node by merging the files named `dir' | 286 | ;; Construct the Info directory node by merging the files named `dir' |
| 283 | ;; from various directories. Set the *info* buffer's | 287 | ;; from various directories. Set the *info* buffer's |
| 284 | ;; default-directory to the first directory we actually get any text | 288 | ;; default-directory to the first directory we actually get any text |
| 285 | ;; from. | 289 | ;; from. |
| 286 | (defun Info-insert-dir () | 290 | (defun Info-insert-dir () |
| 287 | (if Info-dir-contents | 291 | (if (and Info-dir-contents Info-dir-file-attributes |
| 292 | ;; Verify that none of the files we used has changed | ||
| 293 | ;; since we used it. | ||
| 294 | (eval (cons 'and | ||
| 295 | (mapcar '(lambda (elt) | ||
| 296 | (equal (cdr elt) | ||
| 297 | (file-attributes (car elt)))) | ||
| 298 | Info-dir-file-attributes)))) | ||
| 288 | (insert Info-dir-contents) | 299 | (insert Info-dir-contents) |
| 300 | (recursive-edit) | ||
| 289 | (let ((dirs Info-directory-list) | 301 | (let ((dirs Info-directory-list) |
| 290 | buffers buffer others nodes dirs-done) | 302 | buffers buffer others nodes dirs-done) |
| 291 | 303 | ||
| @@ -316,7 +328,11 @@ to read a file name from the minibuffer." | |||
| 316 | (cons (directory-file-name | 328 | (cons (directory-file-name |
| 317 | (file-truename (expand-file-name (car dirs)))) | 329 | (file-truename (expand-file-name (car dirs)))) |
| 318 | dirs-done))) | 330 | dirs-done))) |
| 319 | (if buffer (setq buffers (cons buffer buffers))))) | 331 | (if buffer (setq buffers (cons buffer buffers) |
| 332 | Info-dir-file-attributes | ||
| 333 | (cons (cons (buffer-file-name buffer) | ||
| 334 | (file-attributes (buffer-file-name buffer))) | ||
| 335 | Info-dir-file-attributes))))) | ||
| 320 | (setq dirs (cdr dirs))) | 336 | (setq dirs (cdr dirs))) |
| 321 | 337 | ||
| 322 | ;; Distinguish the dir file that comes with Emacs from all the | 338 | ;; Distinguish the dir file that comes with Emacs from all the |