XEmacs 21.2.22 "Mercedes".
[chise/xemacs-chise.git.1] / lisp / cus-dep.el
index 81cb424..cf9fa27 100644 (file)
@@ -4,8 +4,8 @@
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>, then
 ;;         Richard Stallman <rms@gnu.ai.mit.edu>, then
-;;         Hrvoje Niksic <hniksic@srce.hr>       (rewritten for XEmacs)
-;; Maintainer: Hrvoje Niksic <hniksic@srce.hr>
+;;         Hrvoje Niksic <hniksic@xemacs.org>       (rewritten for XEmacs)
+;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org>
 ;; Keywords: internal
 
 ;; This file is part of XEmacs.
@@ -131,15 +131,21 @@ Batch usage: xemacs -batch -l cus-dep.el -f Custom-make-dependencies DIRS"
                             (file-name-nondirectory file))))
                  ;; Search for defcustom/defface/defgroup
                  ;; expressions, and evaluate them.
-                 (ignore-errors
-                   (while (re-search-forward
-                           "^(defcustom\\|^(defface\\|^(defgroup"
-                           nil t)
-                     (beginning-of-line)
-                     (let ((expr (read (current-buffer))))
-                       (eval expr)
-                       ;; Hash the file of the affected symbol.
-                       (setf (gethash (nth 1 expr) hash) name)))))))
+                 (while (re-search-forward
+                         "^(defcustom\\|^(defface\\|^(defgroup"
+                         nil t)
+                   (beginning-of-line)
+                   (let ((expr (read (current-buffer))))
+                     ;; We need to ignore errors here, so that
+                     ;; defcustoms with :set don't bug out.  Of
+                     ;; course, their values will not be assigned in
+                     ;; case of errors, but their `custom-group'
+                     ;; properties will by that time be in place, and
+                     ;; that's all we care about.
+                     (ignore-errors
+                       (eval expr))
+                     ;; Hash the file of the affected symbol.
+                     (setf (gethash (nth 1 expr) hash) name))))))
            (cond
             ((zerop (hash-table-count hash))
              (princ "(No customization dependencies")
@@ -167,7 +173,7 @@ Batch usage: xemacs -batch -l cus-dep.el -f Custom-make-dependencies DIRS"
                           (if found
                               (insert " ")
                             (insert "(custom-add-loads '"
-                                    (symbol-name sym) " '("))
+                                    (prin1-to-string sym) " '("))
                           (prin1 where (current-buffer))
                           (push where found)))
                       (when found