aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/autoload.el28
1 files changed, 16 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 5505b71b631..0e0832e61cf 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -379,19 +379,23 @@ Autoload section for %s is up to date."
379 (if (interactive-p) (save-buffer))))) 379 (if (interactive-p) (save-buffer)))))
380 380
381;;;###autoload 381;;;###autoload
382(defun update-autoloads-from-directory (dir) 382(defun update-autoloads-from-directories (&rest dirs)
383 "\ 383 "\
384Update loaddefs.el with all the current autoloads from DIR, and no old ones. 384Update loaddefs.el with all the current autoloads from DIRS, and no old ones.
385This uses `update-file-autoloads' (which see) do its work." 385This uses `update-file-autoloads' (which see) do its work."
386 (interactive "DUpdate autoloads from directory: ") 386 (interactive "DUpdate autoloads from directory: ")
387 (setq dir (expand-file-name dir)) 387 (let ((files (apply 'nconc
388 (let ((files (directory-files dir t "^[^=].*\\.el$"))) 388 (mapcar (function (lambda (dir)
389 (directory-files (expand-file-name dir)
390 t
391 "^[^=].*\\.el$")))
392 dirs)))
393 autoloads-file
394 top-dir)
395 (setq autoloads-file (locate-library generated-autoload-file))
396 (setq top-dir (file-name-directory autoloads-file))
389 (save-excursion 397 (save-excursion
390 (set-buffer (find-file-noselect 398 (set-buffer (find-file-noselect autoloads-file))
391 (if (file-exists-p generated-autoload-file)
392 (expand-file-name generated-autoload-file)
393 (expand-file-name generated-autoload-file
394 dir))))
395 (save-excursion 399 (save-excursion
396 (goto-char (point-min)) 400 (goto-char (point-min))
397 (while (search-forward generate-autoload-section-header nil t) 401 (while (search-forward generate-autoload-section-header nil t)
@@ -400,7 +404,7 @@ This uses `update-file-autoloads' (which see) do its work."
400 (end-of-file nil))) 404 (end-of-file nil)))
401 (file (nth 3 form))) 405 (file (nth 3 form)))
402 (cond ((not (stringp file))) 406 (cond ((not (stringp file)))
403 ((not (file-exists-p (expand-file-name file dir))) 407 ((not (file-exists-p (expand-file-name file top-dir)))
404 ;; Remove the obsolete section. 408 ;; Remove the obsolete section.
405 (let ((begin (match-beginning 0))) 409 (let ((begin (match-beginning 0)))
406 (search-forward generate-autoload-section-trailer) 410 (search-forward generate-autoload-section-trailer)
@@ -415,8 +419,8 @@ This uses `update-file-autoloads' (which see) do its work."
415;;;###autoload 419;;;###autoload
416(defun batch-update-autoloads () 420(defun batch-update-autoloads ()
417 "Update loaddefs.el autoloads in batch mode. 421 "Update loaddefs.el autoloads in batch mode.
418Calls `update-autoloads-from-directory' on each command line argument." 422Calls `update-autoloads-from-directories' on the command line arguments."
419 (mapcar 'update-autoloads-from-directory command-line-args-left) 423 (apply 'update-autoloads-from-directories command-line-args-left)
420 (setq command-line-args-left nil)) 424 (setq command-line-args-left nil))
421 425
422(provide 'autoload) 426(provide 'autoload)