annotate lisp/cus-dep.el @ 111834:6951f234b0c3

* lisp/ansi-color.el (ansi-color-unfontify-region): Replace by trivial def. (ansi-color-filter-apply): Simplify. (ansi-color-apply): Use `font-lock-face' rather than `face'.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 06 Dec 2010 11:51:37 -0500
parents 280c8ae2476d
children 417b1e4d63cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 30884
diff changeset
1 ;;; cus-dep.el --- find customization dependencies
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
2 ;;
95556
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
3 ;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 105859
diff changeset
4 ;; 2008, 2009, 2010 Free Software Foundation, Inc.
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
5 ;;
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
7 ;; Keywords: internal
110015
280c8ae2476d Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
8 ;; Package: emacs
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
9
17520
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
10 ;; This file is part of GNU Emacs.
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
11
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
17520
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
15 ;; (at your option) any later version.
17520
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
16
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
20 ;; GNU General Public License for more details.
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
21
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
22 ;; You should have received a copy of the GNU General Public License
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
17520
f33d7729b6a1 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17479
diff changeset
24
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 30884
diff changeset
25 ;;; Commentary:
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 30884
diff changeset
26
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
27 ;;; Code:
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
28
28301
88b4e08f3ac1 Require CL at compile-time only.
Gerd Moellmann <gerd@gnu.org>
parents: 23099
diff changeset
29 (eval-when-compile (require 'cl))
17685
3a1471ba9387 (custom-make-dependencies):
Richard M. Stallman <rms@gnu.org>
parents: 17520
diff changeset
30 (require 'widget)
3a1471ba9387 (custom-make-dependencies):
Richard M. Stallman <rms@gnu.org>
parents: 17520
diff changeset
31 (require 'cus-face)
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
32
48992
1e54c94f1eca * cus-dep.el (generated-custom-dependencies-file): New variable.
Andreas Schwab <schwab@suse.de>
parents: 48335
diff changeset
33 (defvar generated-custom-dependencies-file "cus-load.el"
95556
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
34 "Output file for `custom-make-dependencies'.")
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
35
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
36 ;; See finder-no-scan-regexp in finder.el.
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
37 (defvar custom-dependencies-no-scan-regexp "\\(^\\.#\\|\\(loaddefs\\|\
96164
ecb510f4fdc4 (custom-dependencies-no-scan-regexp): Add ldefs-boot.el.
Glenn Morris <rgm@gnu.org>
parents: 95556
diff changeset
38 ldefs-boot\\|cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)"
95556
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
39 "Regexp matching file names not to scan for `custom-make-dependencies'.")
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
40
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
41 (autoload 'autoload-rubric "autoload")
48992
1e54c94f1eca * cus-dep.el (generated-custom-dependencies-file): New variable.
Andreas Schwab <schwab@suse.de>
parents: 48335
diff changeset
42
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
43 (defun custom-make-dependencies ()
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
44 "Batch function to extract custom dependencies from .el files.
17744
2522a70cd009 (custom-make-dependencies): Don't find the subdirs here;
Richard M. Stallman <rms@gnu.org>
parents: 17685
diff changeset
45 Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
47824
f9a9cf859646 (custom-make-dependencies): Don't use find-file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47571
diff changeset
46 (let ((enable-local-eval nil))
95556
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
47 (with-temp-buffer
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
48 (dolist (subdir command-line-args-left)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
49 (message "Directory %s" subdir)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
50 (let ((files (directory-files subdir nil "\\`[^=].*\\.el\\'"))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
51 (default-directory (expand-file-name subdir))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
52 (preloaded (concat "\\`"
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
53 (regexp-opt (mapcar
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
54 (lambda (f)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
55 (file-name-sans-extension
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
56 (file-name-nondirectory f)))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
57 preloaded-file-list) t)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
58 "\\.el\\'")))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
59 (dolist (file files)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
60 (unless (or (string-match custom-dependencies-no-scan-regexp file)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
61 (string-match preloaded file)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
62 (not (file-exists-p file)))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
63 (erase-buffer)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
64 (insert-file-contents file)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
65 (goto-char (point-min))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
66 (string-match "\\`\\(.*\\)\\.el\\'" file)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
67 (let ((name (file-name-nondirectory (match-string 1 file)))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
68 (load-file-name file))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
69 (if (save-excursion
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
70 (re-search-forward
47824
f9a9cf859646 (custom-make-dependencies): Don't use find-file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47571
diff changeset
71 (concat "(provide[ \t\n]+\\('\\|(quote[ \t\n]\\)[ \t\n]*"
f9a9cf859646 (custom-make-dependencies): Don't use find-file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47571
diff changeset
72 (regexp-quote name) "[ \t\n)]")
f9a9cf859646 (custom-make-dependencies): Don't use find-file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 47571
diff changeset
73 nil t))
95556
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
74 (setq name (intern name)))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
75 (condition-case nil
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
76 (while (re-search-forward
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
77 "^(def\\(custom\\|face\\|group\\)" nil t)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
78 (beginning-of-line)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
79 (let ((expr (read (current-buffer))))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
80 (condition-case nil
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
81 (let ((custom-dont-initialize t))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
82 (eval expr)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
83 (put (nth 1 expr) 'custom-where name))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
84 (error nil))))
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
85 (error nil)))))))))
48992
1e54c94f1eca * cus-dep.el (generated-custom-dependencies-file): New variable.
Andreas Schwab <schwab@suse.de>
parents: 48335
diff changeset
86 (message "Generating %s..." generated-custom-dependencies-file)
1e54c94f1eca * cus-dep.el (generated-custom-dependencies-file): New variable.
Andreas Schwab <schwab@suse.de>
parents: 48335
diff changeset
87 (set-buffer (find-file-noselect generated-custom-dependencies-file))
95556
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
88 (setq buffer-undo-list t)
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
89 (erase-buffer)
95556
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
90 (insert (autoload-rubric generated-custom-dependencies-file
105859
658336850f93 Use autoload-rubric's feature argument.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
91 "custom dependencies" t))
95556
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
92 (search-backward " ")
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
93 (mapatoms (lambda (symbol)
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
94 (let ((members (get symbol 'custom-group))
66788
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
95 where found)
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
96 (when members
66788
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
97 (dolist (member
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
98 ;; So x and no-x builds won't differ.
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
99 (sort (mapcar 'car members) 'string<))
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
100 (setq where (get member 'custom-where))
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
101 (unless (or (null where)
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
102 (member where found))
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
103 (push where found)))
17473
83503d0dc576 Fixed generation of empty dependencies lists.
Per Abrahamsen <abraham@dina.kvl.dk>
parents: 17395
diff changeset
104 (when found
66788
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
105 (insert "(put '" (symbol-name symbol)
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
106 " 'custom-loads '")
66860
e60edad917f6 (custom-make-dependencies): Reverse the list of found dependencies.
Juri Linkov <juri@jurta.org>
parents: 66851
diff changeset
107 (prin1 (nreverse found) (current-buffer))
66851
89a5e481928a (custom-make-dependencies): Typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 66788
diff changeset
108 (insert ")\n"))))))
17479
b613ee4fd988 provide `cus-load'.
Per Abrahamsen <abraham@dina.kvl.dk>
parents: 17474
diff changeset
109 (insert "\
66788
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
110 ;; These are for handling :version. We need to have a minimum of
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
111 ;; information so `customize-changed-options' could do its job.
49221
1d842f148f6e Update the description of version handling.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 49219
diff changeset
112
66788
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
113 ;; For groups we set `custom-version', `group-documentation' and
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
114 ;; `custom-tag' (which are shown in the customize buffer), so we
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
115 ;; don't have to load the file containing the group.
22538
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
116
66788
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
117 ;; `custom-versions-load-alist' is an alist that has as car a version
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
118 ;; number and as elts the files that have variables or faces that
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
119 ;; contain that version. These files should be loaded before showing
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
120 ;; the customization buffer that `customize-changed-options'
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
121 ;; generates.
22538
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
122
66788
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
123 ;; This macro is used so we don't modify the information about
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
124 ;; variables and groups if it's already set. (We don't know when
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
125 ;; " (file-name-nondirectory generated-custom-dependencies-file)
48992
1e54c94f1eca * cus-dep.el (generated-custom-dependencies-file): New variable.
Andreas Schwab <schwab@suse.de>
parents: 48335
diff changeset
126 " is going to be loaded and at that time some of the
66788
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
127 ;; files might be loaded and some others might not).
30884
a6155f9c1e66 (custom-make-dependencies): Quote open-paren in string.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 30883
diff changeset
128 \(defmacro custom-put-if-not (symbol propname value)
22538
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
129 `(unless (get ,symbol ,propname)
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
130 (put ,symbol ,propname ,value)))
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
131
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
132 ")
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
133 (let ((version-alist nil))
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
134 (mapatoms (lambda (symbol)
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
135 (let ((version (get symbol 'custom-version))
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
136 where)
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49221
diff changeset
137 (when version
22538
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
138 (setq where (get symbol 'custom-where))
48249
4da41542c6ed Don't require 'autoload.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48187
diff changeset
139 (when where
49219
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
140 (if (or (custom-variable-p symbol)
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
141 (custom-facep symbol))
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
142 ;; This means it's a variable or a face.
22538
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
143 (progn
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
144 (if (assoc version version-alist)
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49221
diff changeset
145 (unless
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49221
diff changeset
146 (member where
22538
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
147 (cdr (assoc version version-alist)))
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
148 (push where (cdr (assoc version version-alist))))
81074
c25ffc6180f9 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
149 (push (list version where) version-alist)))
22538
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
150 ;; This is a group
49588
37645a051842 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49221
diff changeset
151 (insert "(custom-put-if-not '" (symbol-name symbol)
49219
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
152 " 'custom-version ")
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
153 (prin1 version (current-buffer))
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
154 (insert ")\n")
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
155 (insert "(custom-put-if-not '" (symbol-name symbol))
22538
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
156 (insert " 'group-documentation ")
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
157 (prin1 (get symbol 'group-documentation) (current-buffer))
49219
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
158 (insert ")\n")
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
159 (when (get symbol 'custom-tag)
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
160 (insert "(custom-put-if-not '" (symbol-name symbol))
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
161 (insert " 'custom-tag ")
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
162 (prin1 (get symbol 'custom-tag) (current-buffer))
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
163 (insert ")\n"))
e53c0b341ec5 (custom-make-dependencies): Don't set standard-value
Markus Rost <rost@math.uni-bielefeld.de>
parents: 48992
diff changeset
164 ))))))
22538
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
165
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
166 (insert "\n(defvar custom-versions-load-alist "
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
167 (if version-alist "'" ""))
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
168 (prin1 version-alist (current-buffer))
2649d061d370 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21755
diff changeset
169 (insert "\n \"For internal use by custom.\")\n"))
95556
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
170 (save-buffer)
01af78339196 (generated-custom-dependencies-file): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
171 (message "Generating %s...done" generated-custom-dependencies-file))
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
172
30883
869204bacd5f Add local-variable settings to the generated file.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28301
diff changeset
173
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49588
diff changeset
174
66788
a6268c7db403 (custom-make-dependencies): Simplify.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 64762
diff changeset
175 ;; arch-tag: b7b6421a-bf7a-44fd-a382-6f44976bdf68
17393
14c7f7b87c22 Initial revision
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
diff changeset
176 ;;; cus-dep.el ends here