aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2005-11-10 01:58:55 +0000
committerStefan Monnier2005-11-10 01:58:55 +0000
commite2dc1f61ad9c878eafabbb1930f41e25af3478bc (patch)
treed2255f00c64e400fc7ea4668d411deb0a3425755
parent38fe06125061a94919e8b8b2afb89cc3a9ebfd88 (diff)
downloademacs-e2dc1f61ad9c878eafabbb1930f41e25af3478bc.tar.gz
emacs-e2dc1f61ad9c878eafabbb1930f41e25af3478bc.zip
(custom-make-dependencies): Simplify.
Better follow the commenting conventions.
-rw-r--r--lisp/cus-dep.el79
1 files changed, 36 insertions, 43 deletions
diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el
index 61c597a200e..af21c2ce759 100644
--- a/lisp/cus-dep.el
+++ b/lisp/cus-dep.el
@@ -79,54 +79,46 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
79 (message "Generating %s..." generated-custom-dependencies-file) 79 (message "Generating %s..." generated-custom-dependencies-file)
80 (set-buffer (find-file-noselect generated-custom-dependencies-file)) 80 (set-buffer (find-file-noselect generated-custom-dependencies-file))
81 (erase-buffer) 81 (erase-buffer)
82 (insert "\ 82 (insert ";;; " (file-name-nondirectory generated-custom-dependencies-file)
83;;; " (file-name-nondirectory generated-custom-dependencies-file)
84 " --- automatically extracted custom dependencies 83 " --- automatically extracted custom dependencies
85;; 84;;\n;;; Code:
86;;; Code:
87 85
88") 86")
89 (mapatoms (lambda (symbol) 87 (mapatoms (lambda (symbol)
90 (let ((members (get symbol 'custom-group)) 88 (let ((members (get symbol 'custom-group))
91 item where found) 89 where found)
92 (when members 90 (when members
93 ;; So x and no-x builds won't differ. 91 (dolist (member
94 (setq members 92 ;; So x and no-x builds won't differ.
95 (sort (copy-sequence members) 93 (sort (mapcar 'car members) 'string<))
96 (lambda (x y) (string< (car x) (car y))))) 94 (setq where (get member 'custom-where))
97 (while members
98 (setq item (car (car members))
99 members (cdr members)
100 where (get item 'custom-where))
101 (unless (or (null where) 95 (unless (or (null where)
102 (member where found)) 96 (member where found))
103 (if found
104 (insert " ")
105 (insert "(put '" (symbol-name symbol)
106 " 'custom-loads '("))
107 (prin1 where (current-buffer))
108 (push where found))) 97 (push where found)))
109 (when found 98 (when found
110 (insert "))\n")))))) 99 (insert "(put '" (symbol-name symbol)
100 " 'custom-loads '")
101 (prin1 found (current-buffer))
102 (insert "))\n"))))))
111 (insert "\ 103 (insert "\
112;;; These are for handling :version. We need to have a minimum of 104;; These are for handling :version. We need to have a minimum of
113;;; information so `customize-changed-options' could do its job. 105;; information so `customize-changed-options' could do its job.
114 106
115;;; For groups we set `custom-version', `group-documentation' and 107;; For groups we set `custom-version', `group-documentation' and
116;;; `custom-tag' (which are shown in the customize buffer), so we 108;; `custom-tag' (which are shown in the customize buffer), so we
117;;; don't have to load the file containing the group. 109;; don't have to load the file containing the group.
118 110
119;;; `custom-versions-load-alist' is an alist that has as car a version 111;; `custom-versions-load-alist' is an alist that has as car a version
120;;; number and as elts the files that have variables or faces that 112;; number and as elts the files that have variables or faces that
121;;; contain that version. These files should be loaded before showing 113;; contain that version. These files should be loaded before showing
122;;; the customization buffer that `customize-changed-options' 114;; the customization buffer that `customize-changed-options'
123;;; generates. 115;; generates.
124 116
125;;; This macro is used so we don't modify the information about 117;; This macro is used so we don't modify the information about
126;;; variables and groups if it's already set. (We don't know when 118;; variables and groups if it's already set. (We don't know when
127;;; " (file-name-nondirectory generated-custom-dependencies-file) 119;; " (file-name-nondirectory generated-custom-dependencies-file)
128 " is going to be loaded and at that time some of the 120 " is going to be loaded and at that time some of the
129;;; files might be loaded and some others might not). 121;; files might be loaded and some others might not).
130\(defmacro custom-put-if-not (symbol propname value) 122\(defmacro custom-put-if-not (symbol propname value)
131 `(unless (get ,symbol ,propname) 123 `(unless (get ,symbol ,propname)
132 (put ,symbol ,propname ,value))) 124 (put ,symbol ,propname ,value)))
@@ -175,12 +167,13 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
175\(provide '" (file-name-sans-extension 167\(provide '" (file-name-sans-extension
176 (file-name-nondirectory generated-custom-dependencies-file)) ") 168 (file-name-nondirectory generated-custom-dependencies-file)) ")
177 169
178;;; Local Variables: 170;; Local Variables:
179;;; version-control: never 171;; version-control: never
180;;; no-byte-compile: t 172;; no-byte-compile: t
181;;; no-update-autoloads: t 173;; no-update-autoloads: t
182;;; End: 174;; End:\n;;; "
183;;; " (file-name-nondirectory generated-custom-dependencies-file) " ends here\n") 175 (file-name-nondirectory generated-custom-dependencies-file)
176 " ends here\n")
184 (let ((kept-new-versions 10000000)) 177 (let ((kept-new-versions 10000000))
185 (save-buffer)) 178 (save-buffer))
186 (message "Generating %s...done" generated-custom-dependencies-file) 179 (message "Generating %s...done" generated-custom-dependencies-file)
@@ -188,5 +181,5 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
188 181
189 182
190 183
191;;; arch-tag: b7b6421a-bf7a-44fd-a382-6f44976bdf68 184;; arch-tag: b7b6421a-bf7a-44fd-a382-6f44976bdf68
192;;; cus-dep.el ends here 185;;; cus-dep.el ends here