X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fautoload.el;h=8ca8bbc5ffc11719707ecc466a21a4b20ef57cf8;hb=f4aa4b3950a7523ba54053b9e69a1d2e69a9583f;hp=b9b0a605aa42af471a1760481eb5e4bf8f608c8b;hpb=a1655b870904de973c366d85ebdc8adde4ef5e1e;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/autoload.el b/lisp/autoload.el index b9b0a60..8ca8bbc 100644 --- a/lisp/autoload.el +++ b/lisp/autoload.el @@ -2,7 +2,7 @@ ;; Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. -;; Copyright (C) 1996 Ben Wing. +;; Copyright (C) 1996, 2000 Ben Wing. ;; Author: Roland McGrath ;; Keywords: maint @@ -40,30 +40,33 @@ ;;; Code: (defun make-autoload (form file) - "Turn FORM, a defun or defmacro, into an autoload for source file FILE. -Returns nil if FORM is not a defun, define-skeleton or defmacro." + "Turn a definition generator FORM into an autoload for source file FILE. +Returns nil if FORM is not a defun, define-skeleton, define-derived-mode, +or defmacro." (let ((car (car-safe form))) - (if (memq car '(defun define-skeleton defmacro)) + (if (memq car '(defun define-skeleton defmacro define-derived-mode)) (let ((macrop (eq car 'defmacro)) name doc) (setq form (cdr form) name (car form) ;; Ignore the arguments. - form (cdr (if (eq car 'define-skeleton) - form - (cdr form))) + form (cdr (cond ((eq car 'define-skeleton) + form) + ((eq car 'define-derived-mode) + (cddr form)) + (t + (cdr form)))) doc (car form)) (if (stringp doc) (setq form (cdr form)) (setq doc nil)) (list 'autoload (list 'quote name) file doc (or (eq car 'define-skeleton) + (eq car 'define-derived-mode) (eq (car-safe (car form)) 'interactive)) (if macrop (list 'quote 'macro) nil))) nil))) -(put 'define-skeleton 'doc-string-elt 3) - (defvar generate-autoload-cookie ";;;###autoload" "Magic comment indicating the following form should be autoloaded. Used by `update-file-autoloads'. This string should be @@ -87,6 +90,8 @@ the section of autoloads for a file.") (defvar generate-autoload-section-trailer "\n;;;***\n" "String which indicates the end of the section of autoloads for a file.") +(defvar autoload-package-name nil) + ;;; Forms which have doc-strings which should be printed specially. ;;; A doc-string-elt property of ELT says that (nth ELT FORM) is ;;; the doc-string in FORM. @@ -110,6 +115,8 @@ the section of autoloads for a file.") (put 'defvar 'doc-string-elt 3) (put 'defconst 'doc-string-elt 3) (put 'defmacro 'doc-string-elt 3) +(put 'define-skeleton 'doc-string-elt 3) +(put 'define-derived-mode 'doc-string-elt 4) (defun autoload-trim-file-name (file) "Returns a relative pathname of FILE including the last directory." @@ -119,7 +126,7 @@ the section of autoloads for a file.") (directory-file-name (file-name-directory file)))) "\\\\" "/")) - + ;;;###autoload (defun generate-file-autoloads (file &optional funlist) "Insert at point a loaddefs autoload section for FILE. @@ -165,7 +172,7 @@ are used." (let ((find-file-hooks nil) (enable-local-variables nil)) (set-buffer (or visited (find-file-noselect file))) - (set-syntax-table lisp-mode-syntax-table)) + (set-syntax-table emacs-lisp-mode-syntax-table)) (save-excursion (save-restriction (widen) @@ -358,8 +365,8 @@ generally the file named `autoload-file-name' in the directory being updated.") (defconst cusload-file-name "custom-load.el" - "Generic filename ot put custom loads into. -Unless you are an XEmacs maintainr, it is probably unwise to change this.") + "Generic filename to put custom loads into. +Unless you are an XEmacs maintainer, it is probably unwise to change this.") ;;;###autoload (defun update-file-autoloads (file) @@ -507,7 +514,7 @@ The directory to which the auto-autoloads.el file must be the first parameter on the command line." (unless noninteractive (error "batch-update-autoloads is to be used only with -batch")) - (let ((defdir default-directory) + (let ((defdir (directory-file-name default-directory)) (enable-local-eval nil)) ; Don't query in batch mode. ;; (message "Updating autoloads in %s..." generated-autoload-file) (dolist (arg command-line-args-left) @@ -542,10 +549,11 @@ on the command line." (defvar autoload-package-name nil) -;; #### this function is almost identical, but subtly different, -;; from batch-update-autoloads. Steve, it's your responsibility to -;; clean this up. The two should be merged, but I'm not sure what -;; package-creation scripts out there might be using this. --ben +;; #### this function is almost identical to, but subtly different from, +;; batch-update-autoloads. Both of these functions, unfortunately, are +;; used in various build scripts in xemacs-packages. They should be +;; merged. (However, it looks like no scripts pass more than one arg, +;; making merging easy.) --ben ;;;###autoload (defun batch-update-directory () @@ -576,7 +584,7 @@ be used only with -batch." (setq command-line-args-left nil))) ;; #### i created the following. this one and the last should be merged into -;; batch-update-autoloads. --ben +;; batch-update-autoloads and batch-update-one-directory. --ben ;;;###autoload (defun batch-update-one-directory ()