]> code.delx.au - gnu-emacs/blobdiff - lisp/cus-dep.el
(custom-variable-prompt): Doc change. Use custom-variable-p.
[gnu-emacs] / lisp / cus-dep.el
index 6794b196930b7c143cca02b61bce3be16ebb1b6f..aeec07ae4f088e094d49d432eb616c207a7d918d 100644 (file)
@@ -30,6 +30,9 @@
 (require 'widget)
 (require 'cus-face)
 
+(defvar generated-custom-dependencies-file "cus-load.el"
+  "File \\[cusom-make-dependencies] puts custom dependencies into.")
+
 (defun custom-make-dependencies ()
   "Batch function to extract custom dependencies from .el files.
 Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
@@ -54,7 +57,8 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
            (insert-file-contents file)
            (goto-char (point-min))
            (string-match "\\`\\(.*\\)\\.el\\'" file)
-           (let ((name (file-name-nondirectory (match-string 1 file))))
+           (let ((name (file-name-nondirectory (match-string 1 file)))
+                 (load-file-name file))
              (if (save-excursion
                    (re-search-forward
                     (concat "(provide[ \t\n]+\\('\\|(quote[ \t\n]\\)[ \t\n]*"
@@ -72,11 +76,12 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
                            (put (nth 1 expr) 'custom-where name))
                        (error nil))))
                (error nil))))))))
-  (message "Generating cus-load.el...")
-  (set-buffer (find-file-noselect "cus-load.el"))
+  (message "Generating %s..." generated-custom-dependencies-file)
+  (set-buffer (find-file-noselect generated-custom-dependencies-file))
   (erase-buffer)
   (insert "\
-;;; cus-load.el --- automatically extracted custom dependencies
+;;; " (file-name-nondirectory generated-custom-dependencies-file)
+      " --- automatically extracted custom dependencies
 ;;
 ;;; Code:
 
@@ -119,7 +124,8 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
 
 ;;; This macro is used so we don't modify the information about
 ;;; variables and groups if it's already set. (We don't know when
-;;; cus-load.el is going to be loaded and at that time some of the
+;;; " (file-name-nondirectory generated-custom-dependencies-file)
+      " is going to be loaded and at that time some of the
 ;;; files might be loaded and some others might not).
 \(defmacro custom-put-if-not (symbol propname value)
   `(unless (get ,symbol ,propname)
@@ -160,17 +166,18 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
     
   (insert "\
 
-\(provide 'cus-load)
+\(provide '" (file-name-sans-extension
+             (file-name-nondirectory generated-custom-dependencies-file)) ")
 
 ;;; Local Variables:
 ;;; version-control: never
 ;;; no-byte-compile: t
 ;;; no-update-autoloads: t
 ;;; End:
-;;; cus-load.el ends here\n")
+;;; " (file-name-nondirectory generated-custom-dependencies-file) " ends here\n")
   (let ((kept-new-versions 10000000))
     (save-buffer))
-  (message "Generating cus-load.el...done")
+  (message "Generating %s...done" generated-custom-dependencies-file)
   (kill-emacs))
 
 \f