79 |
(message "Generating %s..." generated-custom-dependencies-file) |
(message "Generating %s..." generated-custom-dependencies-file) |
80 |
(set-buffer (find-file-noselect generated-custom-dependencies-file)) |
(set-buffer (find-file-noselect generated-custom-dependencies-file)) |
81 |
(erase-buffer) |
(erase-buffer) |
82 |
(insert "\ |
(insert ";;; " (file-name-nondirectory generated-custom-dependencies-file) |
|
;;; " (file-name-nondirectory generated-custom-dependencies-file) |
|
83 |
" --- automatically extracted custom dependencies |
" --- automatically extracted custom dependencies |
84 |
;; |
;;\n;;; Code: |
|
;;; Code: |
|
85 |
|
|
86 |
") |
") |
87 |
(mapatoms (lambda (symbol) |
(mapatoms (lambda (symbol) |
88 |
(let ((members (get symbol 'custom-group)) |
(let ((members (get symbol 'custom-group)) |
89 |
item where found) |
where found) |
90 |
(when members |
(when members |
91 |
;; So x and no-x builds won't differ. |
(dolist (member |
92 |
(setq members |
;; So x and no-x builds won't differ. |
93 |
(sort (copy-sequence members) |
(sort (mapcar 'car members) 'string<)) |
94 |
(lambda (x y) (string< (car x) (car y))))) |
(setq where (get member 'custom-where)) |
|
(while members |
|
|
(setq item (car (car members)) |
|
|
members (cdr members) |
|
|
where (get item 'custom-where)) |
|
95 |
(unless (or (null where) |
(unless (or (null where) |
96 |
(member where found)) |
(member where found)) |
|
(if found |
|
|
(insert " ") |
|
|
(insert "(put '" (symbol-name symbol) |
|
|
" 'custom-loads '(")) |
|
|
(prin1 where (current-buffer)) |
|
97 |
(push where found))) |
(push where found))) |
98 |
(when found |
(when found |
99 |
(insert "))\n")))))) |
(insert "(put '" (symbol-name symbol) |
100 |
|
" 'custom-loads '") |
101 |
|
(prin1 found (current-buffer)) |
102 |
|
(insert "))\n")))))) |
103 |
(insert "\ |
(insert "\ |
104 |
;;; These are for handling :version. We need to have a minimum of |
;; These are for handling :version. We need to have a minimum of |
105 |
;;; information so `customize-changed-options' could do its job. |
;; information so `customize-changed-options' could do its job. |
106 |
|
|
107 |
;;; For groups we set `custom-version', `group-documentation' and |
;; For groups we set `custom-version', `group-documentation' and |
108 |
;;; `custom-tag' (which are shown in the customize buffer), so we |
;; `custom-tag' (which are shown in the customize buffer), so we |
109 |
;;; don't have to load the file containing the group. |
;; don't have to load the file containing the group. |
110 |
|
|
111 |
;;; `custom-versions-load-alist' is an alist that has as car a version |
;; `custom-versions-load-alist' is an alist that has as car a version |
112 |
;;; number and as elts the files that have variables or faces that |
;; number and as elts the files that have variables or faces that |
113 |
;;; contain that version. These files should be loaded before showing |
;; contain that version. These files should be loaded before showing |
114 |
;;; the customization buffer that `customize-changed-options' |
;; the customization buffer that `customize-changed-options' |
115 |
;;; generates. |
;; generates. |
116 |
|
|
117 |
;;; This macro is used so we don't modify the information about |
;; This macro is used so we don't modify the information about |
118 |
;;; variables and groups if it's already set. (We don't know when |
;; variables and groups if it's already set. (We don't know when |
119 |
;;; " (file-name-nondirectory generated-custom-dependencies-file) |
;; " (file-name-nondirectory generated-custom-dependencies-file) |
120 |
" is going to be loaded and at that time some of the |
" is going to be loaded and at that time some of the |
121 |
;;; files might be loaded and some others might not). |
;; files might be loaded and some others might not). |
122 |
\(defmacro custom-put-if-not (symbol propname value) |
\(defmacro custom-put-if-not (symbol propname value) |
123 |
`(unless (get ,symbol ,propname) |
`(unless (get ,symbol ,propname) |
124 |
(put ,symbol ,propname ,value))) |
(put ,symbol ,propname ,value))) |
167 |
\(provide '" (file-name-sans-extension |
\(provide '" (file-name-sans-extension |
168 |
(file-name-nondirectory generated-custom-dependencies-file)) ") |
(file-name-nondirectory generated-custom-dependencies-file)) ") |
169 |
|
|
170 |
;;; Local Variables: |
;; Local Variables: |
171 |
;;; version-control: never |
;; version-control: never |
172 |
;;; no-byte-compile: t |
;; no-byte-compile: t |
173 |
;;; no-update-autoloads: t |
;; no-update-autoloads: t |
174 |
;;; End: |
;; End:\n;;; " |
175 |
;;; " (file-name-nondirectory generated-custom-dependencies-file) " ends here\n") |
(file-name-nondirectory generated-custom-dependencies-file) |
176 |
|
" ends here\n") |
177 |
(let ((kept-new-versions 10000000)) |
(let ((kept-new-versions 10000000)) |
178 |
(save-buffer)) |
(save-buffer)) |
179 |
(message "Generating %s...done" generated-custom-dependencies-file) |
(message "Generating %s...done" generated-custom-dependencies-file) |
181 |
|
|
182 |
|
|
183 |
|
|
184 |
;;; arch-tag: b7b6421a-bf7a-44fd-a382-6f44976bdf68 |
;; arch-tag: b7b6421a-bf7a-44fd-a382-6f44976bdf68 |
185 |
;;; cus-dep.el ends here |
;;; cus-dep.el ends here |