comparison lisp/autoload.el @ 1733:5903b079bee1

[xemacs-hg @ 2003-10-07 21:52:12 by james] Use module-extensions instead of an explicit list of module extensions.
author james
date Tue, 07 Oct 2003 21:52:26 +0000
parents c3cf7db99b98
children 588465af3ca1
comparison
equal deleted inserted replaced
1732:2efe1d771c94 1733:5903b079bee1
459 "Insert at point an autoload section for the C file FILE. 459 "Insert at point an autoload section for the C file FILE.
460 autoloads are generated for defuns and defmacros in FILE 460 autoloads are generated for defuns and defmacros in FILE
461 marked by `generate-c-autoload-cookie' (which see). 461 marked by `generate-c-autoload-cookie' (which see).
462 If FILE is being visited in a buffer, the contents of the buffer 462 If FILE is being visited in a buffer, the contents of the buffer
463 are used." 463 are used."
464 (let ((exists-p-format 464 (let ((exists-p-format
465 "(file-exists-p (expand-file-name \"%s.%s\" module-directory))") 465 "(when (locate-file \"%s\" module-load-path module-extensions)\n")
466 (autoloads-done '()) 466 autoloads-done)
467 )
468
469 (save-excursion 467 (save-excursion
470 (save-restriction 468 (save-restriction
471 (widen) 469 (widen)
472 (goto-char (point-min)) 470 (goto-char (point-min))
473 ;; Is there a module name comment? 471 ;; Is there a module name comment?
477 (skip-chars-forward "^ \t\n\f") 475 (skip-chars-forward "^ \t\n\f")
478 (setq load-name (buffer-substring begin (point))))) 476 (setq load-name (buffer-substring begin (point)))))
479 (if funlist 477 (if funlist
480 (progn 478 (progn
481 (message "Generating autoloads for %s..." trim-name) 479 (message "Generating autoloads for %s..." trim-name)
482 (princ "(when (or\n " outbuf) 480 (princ (format exists-p-format load-name) outbuf)
483 (princ (format exists-p-format load-name "ell") outbuf)
484 (princ "\n " outbuf)
485 (princ (format exists-p-format load-name "dll") outbuf)
486 (princ "\n " outbuf)
487 (princ (format exists-p-format load-name "so") outbuf)
488 ;; close the princ'd `or' form
489 (princ ")\n " outbuf)
490 (dolist (arg funlist) 481 (dolist (arg funlist)
491 (goto-char (point-min)) 482 (goto-char (point-min))
492 (re-search-forward 483 (re-search-forward
493 (concat "DEFUN (\"" 484 (concat "DEFUN (\""
494 (regexp-quote (symbol-name arg)) 485 (regexp-quote (symbol-name arg))
506 (unless match 497 (unless match
507 (message "No autoloads found in %s" trim-name) 498 (message "No autoloads found in %s" trim-name)
508 (return-from generate-c-file-autoloads-1 nil)) 499 (return-from generate-c-file-autoloads-1 nil))
509 500
510 (message "Generating autoloads for %s..." trim-name) 501 (message "Generating autoloads for %s..." trim-name)
511 (princ "(when (or\n " outbuf) 502 (princ (format exists-p-format load-name) outbuf)
512 (princ (format exists-p-format load-name "ell") outbuf)
513 (princ "\n " outbuf)
514 (princ (format exists-p-format load-name "dll") outbuf)
515 (princ "\n " outbuf)
516 (princ (format exists-p-format load-name "so") outbuf)
517 ;; close the princ'd `or' form
518 (princ ")\n " outbuf)
519 (while match 503 (while match
520 (forward-line 1) 504 (forward-line 1)
521 (let ((autoload (make-c-autoload load-name))) 505 (let ((autoload (make-c-autoload load-name)))
522 (when autoload 506 (when autoload
523 (push (nth 1 (nth 1 autoload)) autoloads-done) 507 (push (nth 1 (nth 1 autoload)) autoloads-done)