aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-05-16 22:49:59 +0000
committerRichard M. Stallman1997-05-16 22:49:59 +0000
commit3fbca58aaed99714624a41bd76a8620435f92b7a (patch)
treee80664a5c31d9b68d3cba3bea3a253f2cac16c15
parentc47ec7c4a8616ed750660090b74c206b26ae9a7c (diff)
downloademacs-3fbca58aaed99714624a41bd76a8620435f92b7a.tar.gz
emacs-3fbca58aaed99714624a41bd76a8620435f92b7a.zip
(update-autoloads-from-directories): Renamed from
update-autoloads-from-directory. Take multiple directories as args. Use locate-library to find loaddefs.el and the top level Lisp dir. (batch-update-autoloads): Call update-autoloads-from-directories.
-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)