;;; cus-dep.el --- find customization dependencies
;;
-;; Copyright (C) 1997, 2001-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2013 Free Software Foundation, Inc.
;;
;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
;; Keywords: internal
;;; Code:
-(eval-when-compile (require 'cl))
(require 'widget)
(require 'cus-face)
(autoload 'autoload-rubric "autoload")
+(defun set-generated-custom-dependencies-file (file)
+ "Set value of `generated-custom-dependencies-file' from FILE.
+
+On systems other than MS-Windows, just sets the value
+of `generated-custom-dependencies-file'. On MS-Windows, converts
+/d/foo/bar form passed by MSYS Make into d:/foo/bar that Emacs can
+grok. This function is called from lisp/Makefile."
+ (when (and (eq system-type 'windows-nt)
+ (string-match "\\`/[a-zA-Z]/" file))
+ (setq file (concat (substring file 1 2) ":" (substring file 2))))
+ (setq generated-custom-dependencies-file file))
+
(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"
- (let ((enable-local-eval nil))
+ (let ((enable-local-eval nil)
+ subdir)
(with-temp-buffer
- (dolist (subdir command-line-args-left)
+ ;; Use up command-line-args-left else Emacs can try to open
+ ;; the args as directories after we are done.
+ (while (setq subdir (pop command-line-args-left))
(message "Directory %s" subdir)
(let ((files (directory-files subdir nil "\\`[^=].*\\.el\\'"))
(default-directory (expand-file-name subdir))
(preloaded (concat "\\`"
(regexp-opt (mapcar
- (lambda (f)
- (file-name-sans-extension
- (file-name-nondirectory f)))
+ 'file-name-base
preloaded-file-list) t)
"\\.el\\'")))
(dolist (file files)