Historical note: cus-dep used to just load the file, but it was very
slow. Stallman rewrote it to just scan the file and evaluate the
defcustoms, and I ported that code to XEmacs (and practically rewrote
it in the process.) I think the approach we use now is basically a
sane one.
Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
cus-dep should either just 'load' the file or redefine
custom-add-variable and friends to not try to call the functions.
A third option is to simply ignore the signaled error. All we are
interested in is the `custom-group' property of the symbol, which is
set before the initializer method gets called. The code in cus-dep.el
already has an `ignore-errors', but at the wrong place.
Does this patch fix the problem?
1998-11-30 Hrvoje Niksic <hniksic(a)srce.hr>
* cus-dep.el (Custom-make-dependencies): Be smarter about trapping
errors.
--- lisp/cus-dep.el.orig Mon Nov 30 21:03:24 1998
+++ lisp/cus-dep.el Mon Nov 30 21:03:43 1998
@@ -131,15 +131,21 @@
(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")