comparison lisp/cus-dep.el @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents fbbf69b4e8a7
children 064ab7fed2e0
comparison
equal deleted inserted replaced
370:bd866891f083 371:cc15677e0335
129 (goto-char (point-min)) 129 (goto-char (point-min))
130 (let ((name (file-name-sans-extension 130 (let ((name (file-name-sans-extension
131 (file-name-nondirectory file)))) 131 (file-name-nondirectory file))))
132 ;; Search for defcustom/defface/defgroup 132 ;; Search for defcustom/defface/defgroup
133 ;; expressions, and evaluate them. 133 ;; expressions, and evaluate them.
134 (while (re-search-forward 134 (ignore-errors
135 "^(defcustom\\|^(defface\\|^(defgroup" 135 (while (re-search-forward
136 nil t) 136 "^(defcustom\\|^(defface\\|^(defgroup"
137 (beginning-of-line) 137 nil t)
138 (let ((expr (read (current-buffer)))) 138 (beginning-of-line)
139 ;; We need to ignore errors here, so that 139 (let ((expr (read (current-buffer))))
140 ;; defcustoms with :set don't bug out. Of 140 (eval expr)
141 ;; course, their values will not be assigned in 141 ;; Hash the file of the affected symbol.
142 ;; case of errors, but their `custom-group' 142 (setf (gethash (nth 1 expr) hash) name)))))))
143 ;; properties will by that time be in place, and
144 ;; that's all we care about.
145 (ignore-errors
146 (eval expr))
147 ;; Hash the file of the affected symbol.
148 (setf (gethash (nth 1 expr) hash) name))))))
149 (cond 143 (cond
150 ((zerop (hash-table-count hash)) 144 ((zerop (hash-table-count hash))
151 (princ "(No customization dependencies") 145 (princ "(No customization dependencies")
152 (when (file-exists-p cusload-file) 146 (when (file-exists-p cusload-file)
153 (princ (format ", deleting %s" cusload-file)) 147 (princ (format ", deleting %s" cusload-file))
171 (unless (or (null where) 165 (unless (or (null where)
172 (member where found)) 166 (member where found))
173 (if found 167 (if found
174 (insert " ") 168 (insert " ")
175 (insert "(custom-add-loads '" 169 (insert "(custom-add-loads '"
176 (prin1-to-string sym) " '(")) 170 (symbol-name sym) " '("))
177 (prin1 where (current-buffer)) 171 (prin1 where (current-buffer))
178 (push where found))) 172 (push where found)))
179 (when found 173 (when found
180 (insert "))\n")))))) 174 (insert "))\n"))))))
181 (insert "\n;;; custom-load.el ends here\n")) 175 (insert "\n;;; custom-load.el ends here\n"))