diff lisp/autoload.el @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents de805c49cfc1
children
line wrap: on
line diff
--- a/lisp/autoload.el	Mon Aug 13 11:19:22 2007 +0200
+++ b/lisp/autoload.el	Mon Aug 13 11:20:41 2007 +0200
@@ -87,8 +87,6 @@
 (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.
@@ -116,12 +114,10 @@
 (defun autoload-trim-file-name (file)
   "Returns a relative pathname of FILE including the last directory."
   (setq file (expand-file-name file))
-  (replace-in-string
-   (file-relative-name file (file-name-directory
-			     (directory-file-name
-			      (file-name-directory file))))
-   "\\\\" "/"))
-  
+  (file-relative-name file (file-name-directory
+			    (directory-file-name
+			     (file-name-directory file)))))
+
 ;;;###autoload
 (defun generate-file-autoloads (file &optional funlist)
   "Insert at point a loaddefs autoload section for FILE.
@@ -343,7 +339,7 @@
   "Generic filename to put autoloads into.
 Unless you are an XEmacs maintainer, it is probably unwise to change this.")
 
-(defvar autoload-target-directory "../lisp/"
+(defvar autoload-target-directory "../lisp/prim/"
   "Directory to put autoload declaration file into.
 Unless you know what you're doing, don't mess with this.")
 
@@ -353,11 +349,7 @@
 		    data-directory)
   "*File `update-file-autoloads' puts autoloads into.
 A .el file can set this in its local variables section to make its
-autoloads go somewhere else.
-
-Note that `batch-update-directory' binds this variable to its own value,
-generally the file named `autoload-file-name' in the directory being
-updated.")
+autoloads go somewhere else.")
 
 (defconst cusload-file-name "custom-load.el"
   "Generic filename ot put custom loads into.
@@ -367,7 +359,7 @@
 (defun update-file-autoloads (file)
   "Update the autoloads for FILE in `generated-autoload-file'
 \(which FILE might bind in its local variables).
-This function refuses to update autoloads files."
+This functions refuses to update autoloads files."
   (interactive "fUpdate autoloads for file: ")
   (setq file (expand-file-name file))
   (when (and (file-newer-than-file-p file generated-autoload-file)
@@ -466,9 +458,7 @@
 (defun update-autoloads-from-directory (dir)
   "Update `generated-autoload-file' with all the current autoloads from DIR.
 This runs `update-file-autoloads' on each .el file in DIR.
-Obsolete autoload entries for files that no longer exist are deleted.
-Note that, if this function is called from `batch-update-directory',
-`generated-autoload-file' was rebound in that function."
+Obsolete autoload entries for files that no longer exist are deleted."
   (interactive "DUpdate autoloads for directory: ")
   (setq dir (expand-file-name dir))
   (let ((simple-dir (file-name-as-directory
@@ -542,24 +532,20 @@
 	  (goto-char (point-max))
 	  (insert "\n(provide '" sym ")\n")))))
 
-;; #### 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
+(defvar autoload-package-name nil)
 
 ;;;###autoload
 (defun batch-update-directory ()
-  "Update the autoloads for the directories on the command line.
-Runs `update-file-autoloads' on each file in the given directory, and must
-be used only with -batch."
+  "Update the autoloads for the directory on the command line.
+Runs `update-file-autoloads' on each file in the given directory, must
+be used only with -batch and kills XEmacs on completion."
   (unless noninteractive
     (error "batch-update-directory is to be used only with -batch"))
   (let ((defdir default-directory)
 	(enable-local-eval nil))	; Don't query in batch mode.
     (dolist (arg command-line-args-left)
       (setq arg (expand-file-name arg defdir))
-      (let ((generated-autoload-file (expand-file-name autoload-file-name
-							arg)))
+      (let ((generated-autoload-file (concat arg "/" autoload-file-name)))
 	(cond
 	 ((file-directory-p arg)
 	  (message "Updating autoloads in directory %s..." arg)
@@ -575,36 +561,6 @@
       )
     (setq command-line-args-left nil)))
 
-;; #### i created the following.  this one and the last should be merged into
-;; batch-update-autoloads. --ben
-
-;;;###autoload
-(defun batch-update-one-directory ()
-  "Update the autoloads for a single directory on the command line.
-Runs `update-file-autoloads' on each file in the given directory, and must
-be used only with -batch."
-  (unless noninteractive
-    (error "batch-update-directory is to be used only with -batch"))
-  (let ((defdir default-directory)
-	(enable-local-eval nil))	; Don't query in batch mode.
-    (let ((arg (car command-line-args-left)))
-      (setq command-line-args-left (cdr command-line-args-left))
-      (setq arg (expand-file-name arg defdir))
-      (let ((generated-autoload-file (expand-file-name autoload-file-name
-							arg)))
-	(cond
-	 ((file-directory-p arg)
-	  (message "Updating autoloads in directory %s..." arg)
-	  (update-autoloads-from-directory arg))
-	 (t (error "No such file or directory: %s" arg)))
-	(fixup-autoload-buffer (concat (if autoload-package-name
-					   autoload-package-name
-					 (file-name-nondirectory arg))
-				"-autoloads"))
-	(save-some-buffers t))
-      ;; (message "Done")
-      )))
-
 (provide 'autoload)
 
 ;;; autoload.el ends here