comparison lisp/emacs-lisp/autoload.el @ 48136:c102d9848214

(generate-file-autoloads, update-file-autoloads): Strip .gz extensions. (update-autoloads-from-directories): Also consider compressed files.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 03 Nov 2002 12:37:48 +0000
parents f91cebb0f333
children 1fa683e2a917
comparison
equal deleted inserted replaced
48135:2c6154347319 48136:c102d9848214
255 are used." 255 are used."
256 (interactive "fGenerate autoloads for file: ") 256 (interactive "fGenerate autoloads for file: ")
257 (let ((outbuf (current-buffer)) 257 (let ((outbuf (current-buffer))
258 (autoloads-done '()) 258 (autoloads-done '())
259 (load-name (let ((name (file-name-nondirectory file))) 259 (load-name (let ((name (file-name-nondirectory file)))
260 (if (string-match "\\.elc?$" name) 260 (if (string-match "\\.elc?\\(\\.\\|$\\)" name)
261 (substring name 0 (match-beginning 0)) 261 (substring name 0 (match-beginning 0))
262 name))) 262 name)))
263 (print-length nil) 263 (print-length nil)
264 (print-readably t) ; This does something in Lucid Emacs. 264 (print-readably t) ; This does something in Lucid Emacs.
265 (float-output-format nil) 265 (float-output-format nil)
358 "Update the autoloads for FILE in `generated-autoload-file' 358 "Update the autoloads for FILE in `generated-autoload-file'
359 \(which FILE might bind in its local variables). 359 \(which FILE might bind in its local variables).
360 Return FILE if there was no autoload cookie in it." 360 Return FILE if there was no autoload cookie in it."
361 (interactive "fUpdate autoloads for file: ") 361 (interactive "fUpdate autoloads for file: ")
362 (let ((load-name (let ((name (file-name-nondirectory file))) 362 (let ((load-name (let ((name (file-name-nondirectory file)))
363 (if (string-match "\\.elc?$" name) 363 (if (string-match "\\.elc?\\(\\.\\|$\\)" name)
364 (substring name 0 (match-beginning 0)) 364 (substring name 0 (match-beginning 0))
365 name))) 365 name)))
366 (found nil) 366 (found nil)
367 (existing-buffer (get-file-buffer file)) 367 (existing-buffer (get-file-buffer file))
368 (no-autoloads nil)) 368 (no-autoloads nil))
478 (defun update-autoloads-from-directories (&rest dirs) 478 (defun update-autoloads-from-directories (&rest dirs)
479 "\ 479 "\
480 Update loaddefs.el with all the current autoloads from DIRS, and no old ones. 480 Update loaddefs.el with all the current autoloads from DIRS, and no old ones.
481 This uses `update-file-autoloads' (which see) do its work." 481 This uses `update-file-autoloads' (which see) do its work."
482 (interactive "DUpdate autoloads from directory: ") 482 (interactive "DUpdate autoloads from directory: ")
483 (let* ((files (apply 'nconc 483 (let* ((files-re (let ((tmp nil))
484 (dolist (suf load-suffixes
485 (concat "^[^=.].*" (regexp-opt tmp t) "\\'"))
486 (unless (string-match "\\.elc" suf) (push suf tmp)))))
487 (files (apply 'nconc
484 (mapcar (lambda (dir) 488 (mapcar (lambda (dir)
485 (directory-files (expand-file-name dir) 489 (directory-files (expand-file-name dir)
486 ;; FIXME: add .gz etc... 490 t files-re))
487 t "^[^=.].*\\.el\\'"))
488 dirs))) 491 dirs)))
489 (this-time (current-time)) 492 (this-time (current-time))
490 (no-autoloads nil) ;files with no autoload cookies. 493 (no-autoloads nil) ;files with no autoload cookies.
491 (autoloads-file 494 (autoloads-file
492 (expand-file-name generated-autoload-file 495 (expand-file-name generated-autoload-file