Mercurial > emacs
comparison lisp/emacs-lisp/autoload.el @ 57880:52307ec50b54
(update-file-autoloads): Don't use interactive-p; take new arg SAVE-AFTER.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 02 Nov 2004 09:20:13 +0000 |
parents | fd1be95301bf |
children | 847ceead54c3 e24e2e78deda |
comparison
equal
deleted
inserted
replaced
57879:7b2c608f3b0b | 57880:52307ec50b54 |
---|---|
358 (goto-char output-end) | 358 (goto-char output-end) |
359 (insert generate-autoload-section-trailer))) | 359 (insert generate-autoload-section-trailer))) |
360 (message "Generating autoloads for %s...done" file))) | 360 (message "Generating autoloads for %s...done" file))) |
361 | 361 |
362 ;;;###autoload | 362 ;;;###autoload |
363 (defun update-file-autoloads (file) | 363 (defun update-file-autoloads (file &optional save-after) |
364 "Update the autoloads for FILE in `generated-autoload-file' | 364 "Update the autoloads for FILE in `generated-autoload-file' |
365 \(which FILE might bind in its local variables). | 365 \(which FILE might bind in its local variables). |
366 Return FILE if there was no autoload cookie in it." | 366 If SAVE-AFTER is non-nil (which is always, when called interactively), |
367 (interactive "fUpdate autoloads for file: ") | 367 save the buffer too. |
368 | |
369 Return FILE if there was no autoload cookie in it, else nil." | |
370 (interactive "fUpdate autoloads for file: \np") | |
368 (let ((load-name (let ((name (file-name-nondirectory file))) | 371 (let ((load-name (let ((name (file-name-nondirectory file))) |
369 (if (string-match "\\.elc?\\(\\.\\|$\\)" name) | 372 (if (string-match "\\.elc?\\(\\.\\|$\\)" name) |
370 (substring name 0 (match-beginning 0)) | 373 (substring name 0 (match-beginning 0)) |
371 name))) | 374 name))) |
372 (found nil) | 375 (found nil) |
462 (setq no-autoloads t) | 465 (setq no-autoloads t) |
463 t) | 466 t) |
464 (or existing-buffer | 467 (or existing-buffer |
465 (kill-buffer (current-buffer)))))))) | 468 (kill-buffer (current-buffer)))))))) |
466 (generate-file-autoloads file)))) | 469 (generate-file-autoloads file)))) |
467 (and (interactive-p) | 470 (and save-after |
468 (buffer-modified-p) | 471 (buffer-modified-p) |
469 (save-buffer)) | 472 (save-buffer)) |
470 | 473 |
471 (if no-autoloads file)))) | 474 (if no-autoloads file)))) |
472 | 475 |