annotate lisp/prim/specifier.el @ 108:360340f9fd5f r20-1b6

Import from CVS: tag r20-1b6
author cvs
date Mon, 13 Aug 2007 09:18:39 +0200
parents 131b0175ea99
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; specifier.el --- Lisp interface to specifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995, 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Ben Wing <wing@666.com>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Keywords: internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; first appeared in 19.12.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 30
diff changeset
24 ;; Free Software Foundation, 59 Temple Place - Suite 330,
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
25 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; Synched up with: Not in FSF.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (defun make-specifier-and-init (type spec-list &optional dont-canonicalize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 "Create and initialize a new specifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 This is a front-end onto `make-specifier' that allows you to create a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 specifier and add specs to it at the same time. TYPE specifies the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 specifier type. SPEC-LIST supplies the specification(s) to be added
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 to the specifier. Normally, almost any reasonable abbreviation of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 full spec-list form is accepted, and is converted to the full form;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 however, if optional argument DONT-CANONICALIZE is non-nil, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 conversion is not performed, and the SPEC-LIST must already be in full
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 form. See `canonicalize-spec-list'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (let ((sp (make-specifier type)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (if (not dont-canonicalize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (setq spec-list (canonicalize-spec-list spec-list type)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (add-spec-list-to-specifier sp spec-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 sp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; God damn, do I hate dynamic scoping.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defun map-specifier (ms-specifier ms-func &optional ms-locale ms-maparg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "Apply MS-FUNC to the specification(s) for MS-LOCALE in MS-SPECIFIER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 If MS-LOCALE is a locale, MS-FUNC will be called for that locale.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 If MS-LOCALE is a locale type, MS-FUNC will be mapped over all locales
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 of that type. If MS-LOCALE is 'all or nil, MS-FUNC will be mapped
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 over all locales in MS-SPECIFIER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 MS-FUNC is called with four arguments: the MS-SPECIFIER, the locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 being mapped over, the inst-list for that locale, and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 optional MS-MAPARG. If any invocation of MS-FUNC returns non-nil,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 the mapping will stop and the returned value becomes the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 value returned from `map-specifier'. Otherwise, `map-specifier'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 returns nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (let ((ms-specs (specifier-spec-list ms-specifier ms-locale))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ms-result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (while (and ms-specs (not ms-result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (let ((ms-this-spec (car ms-specs)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (setq ms-result (funcall ms-func ms-specifier (car ms-this-spec)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (cdr ms-this-spec) ms-maparg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (setq ms-specs (cdr ms-specs))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ms-result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (defun canonicalize-inst-pair (inst-pair specifier-type &optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 "Canonicalize the given INST-PAIR.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 SPECIFIER-TYPE specifies the type of specifier that this SPEC-LIST
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 will be used for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 Canonicalizing means converting to the full form for an inst-pair, i.e.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 `(TAG-SET . INSTANTIATOR)'. A single, untagged instantiator is given
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 a tag set of nil (the empty set), and a single tag is converted into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 a tag set consisting only of that tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 If NOERROR is non-nil, signal an error if the inst-pair is invalid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 otherwise return t."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ;; OK, the possibilities are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ;; a) a single instantiator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ;; b) a cons of a tag and an instantiator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ;; c) a cons of a tag set and an instantiator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (cond ((valid-instantiator-p inst-pair specifier-type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ;; case (a)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (cons nil inst-pair))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ((not (consp inst-pair))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ;; not an inst-pair
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (if noerror t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;; this will signal an appropriate error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (check-valid-instantiator inst-pair specifier-type)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ((and (valid-specifier-tag-p (car inst-pair))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (valid-instantiator-p (cdr inst-pair) specifier-type))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ;; case (b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (cons (list (car inst-pair)) (cdr inst-pair)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ((and (valid-specifier-tag-set-p (car inst-pair))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (valid-instantiator-p (cdr inst-pair) specifier-type))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ;; case (c)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 inst-pair)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (if noerror t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (signal 'error (list "Invalid specifier tag set"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (car inst-pair)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (defun canonicalize-inst-list (inst-list specifier-type &optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 "Canonicalize the given INST-LIST (a list of inst-pairs).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 SPECIFIER-TYPE specifies the type of specifier that this INST-LIST
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 will be used for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 Canonicalizing means converting to the full form for an inst-list, i.e.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 `((TAG-SET . INSTANTIATOR) ...)'. This function accepts a single
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
122 inst-pair or any abbreviation thereof or a list of (possibly
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 abbreviated) inst-pairs. (See `canonicalize-inst-pair'.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 If NOERROR is non-nil, signal an error if the inst-list is invalid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 otherwise return t."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;; OK, the possibilities are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ;;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
130 ;; a) an inst-pair or various abbreviations thereof
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ;; b) a list of (a)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (let ((result (canonicalize-inst-pair inst-list specifier-type t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (if (not (eq result t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ;; case (a)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (list result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (if (not (consp inst-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ;; not an inst-list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (if noerror t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ;; this will signal an appropriate error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (check-valid-instantiator inst-list specifier-type))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ;; case (b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (catch 'cann-inst-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ;; don't use mapcar here; we need to catch the case of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;; an invalid list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (let ((rest inst-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (result nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (while rest
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (if (not (consp rest))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (if noerror (throw 'cann-inst-list t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (signal 'error (list "Invalid list format" inst-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (let ((res2 (canonicalize-inst-pair (car rest) specifier-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 noerror)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (if (eq res2 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 ;; at this point, we know we're noerror because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ;; otherwise canonicalize-inst-pair would have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;; signalled an error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (throw 'cann-inst-list t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (setq result (cons res2 result)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (setq rest (cdr rest)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (nreverse result)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (defun canonicalize-spec (spec specifier-type &optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 "Canonicalize the given SPEC (a specification).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 SPECIFIER-TYPE specifies the type of specifier that this SPEC-LIST
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 will be used for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 Canonicalizing means converting to the full form for a spec, i.e.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 `(LOCALE (TAG-SET . INSTANTIATOR) ...)'. This function accepts a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 possibly abbreviated inst-list or a cons of a locale and a possibly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 abbreviated inst-list. (See `canonicalize-inst-list'.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 If NOERROR is nil, signal an error if the specification is invalid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 otherwise return t."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ;; OK, the possibilities are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ;;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
179 ;; a) an inst-list or some abbreviation thereof
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ;; b) a cons of a locale and an inst-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (let ((result (canonicalize-inst-list spec specifier-type t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (if (not (eq result t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ;; case (a)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (cons 'global result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (if (not (consp spec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 ;; not a spec.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (if noerror t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ;; this will signal an appropriate error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (check-valid-instantiator spec specifier-type))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (if (not (valid-specifier-locale-p (car spec)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ;; invalid locale.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (if noerror t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (signal 'error (list "Invalid specifier locale" (car spec))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 ;; case (b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (let ((result (canonicalize-inst-list (cdr spec) specifier-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 noerror)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (if (eq result t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ;; at this point, we know we're noerror because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ;; otherwise canonicalize-inst-list would have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 ;; signalled an error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (cons (car spec) result))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (defun canonicalize-spec-list (spec-list specifier-type &optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 "Canonicalize the given SPEC-LIST (a list of specifications).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 SPECIFIER-TYPE specifies the type of specifier that this SPEC-LIST
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 will be used for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 Canonicalizing means converting to the full form for a spec-list, i.e.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 `((LOCALE (TAG-SET . INSTANTIATOR) ...) ...)'. This function accepts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 a possibly abbreviated specification or a list of such things. (See
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 `canonicalize-spec'.) This is the function used to convert spec-lists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 accepted by `set-specifier' and such into a form suitable for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 `add-spec-list-to-specifier'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 This function tries extremely hard to resolve any ambiguities,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 and the built-in specifier types (font, image, toolbar, etc.) are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 designed so that there won't be any ambiguities.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 If NOERROR is nil, signal an error if the spec-list is invalid;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 otherwise return t."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 ;; OK, the possibilities are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ;; a) a spec or various abbreviations thereof
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 ;; b) a list of (a)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (let ((result (canonicalize-spec spec-list specifier-type t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (if (not (eq result t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ;; case (a)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (list result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (if (not (consp spec-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 ;; not a spec-list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (if noerror t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 ;; this will signal an appropriate error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (check-valid-instantiator spec-list specifier-type))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ;; case (b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (catch 'cann-spec-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ;; don't use mapcar here; we need to catch the case of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;; an invalid list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (let ((rest spec-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (result nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (while rest
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (if (not (consp rest))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (if noerror (throw 'cann-spec-list t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (signal 'error (list "Invalid list format" spec-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (let ((res2 (canonicalize-spec (car rest) specifier-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 noerror)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (if (eq res2 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 ;; at this point, we know we're noerror because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 ;; otherwise canonicalize-spec would have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ;; signalled an error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (throw 'cann-spec-list t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (setq result (cons res2 result)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (setq rest (cdr rest)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (nreverse result)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (defun set-specifier (specifier value &optional locale tag-set how-to-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 "Add a specification or specifications to SPECIFIER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 This function adds a specification of VALUE in locale LOCALE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 LOCALE indicates where this specification is active, and should be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 a buffer, a window, a frame, a device, or the symbol `global' to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 indicate that it applies everywhere. LOCALE usually defaults to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 `global' if omitted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 VALUE is usually what is called an \"instantiator\" (which, roughly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 speaking, corresponds to the \"value\" of the property governed by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 SPECIFIER). The valid instantiators for SPECIFIER depend on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 type of SPECIFIER (which you can determine using `specifier-type').
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 The specifier `scrollbar-width', for example, is of type `integer',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 meaning its valid instantiators are integers. The specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 governing the background color of the `default' face (you can
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
278 retrieve this specifier using `(face-background 'default)') is
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 of type `color', meaning its valid instantiators are strings naming
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 colors and color-instance objects. For some types of specifiers,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 such as `image' and `toolbar', the instantiators can be very
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 complex. Generally this is documented in the appropriate predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 function -- `color-specifier-p', `image-specifier-p',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 `toolbar-specifier-p', etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 NOTE: It does *not* work to give a VALUE of nil as a way of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 removing the specifications for a locale. Use `remove-specifier'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 instead. (And keep in mind that, if you omit the LOCALE argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 to `remove-specifier', it removes *all* specifications! If you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 want to remove just the `global' specification, make sure to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 specify a LOCALE of `global'.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 VALUE can also be a list of instantiators. This means basically,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 \"try each one in turn until you get one that works\". This allows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 you to give funky instantiators that may only work in some cases,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 and provide more normal backups for the other cases. (For example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 you might like the color \"darkseagreen2\", but some X servers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 don't recognize this color, so you could provide a backup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 \"forest green\". Color TTY devices probably won't recognize this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 either, so you could provide a second backup \"green\". You'd
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
301 do this by specifying this list of instantiators:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 '(\"darkseagreen2\" \"forest green\" \"green\")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 VALUE can also be various more complicated forms; see below.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 Optional argument TAG-SET is a tag or a list of tags, to be associated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 with the VALUE. Tags are symbols (usually naming device types, such
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 as `x' and `tty', or device classes, such as `color', `mono', and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 `grayscale'); specifying a TAG-SET restricts the scope of VALUE to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 devices that match all specified tags. (You can also create your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 own tags using `define-specifier-tag', and use them to identify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 specifications added by you, so you can remove them later.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 Optional argument HOW-TO-ADD should be either nil or one of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 symbols `prepend', `append', `remove-tag-set-prepend',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 `remove-tag-set-append', `remove-locale', `remove-locale-type',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 or `remove-all'. This specifies what to do with existing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 specifications in LOCALE (and possibly elsewhere in the specifier).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 Most of the time, you do not need to worry about this argument;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 the default behavior of `remove-tag-set-prepend' is usually fine.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 See `copy-specifier' and `add-spec-to-specifier' for a full
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 description of what each of these means.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 VALUE can actually be anything acceptable to `canonicalize-spec-list';
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 this includes, among other things:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 -- a cons of a locale and an instantiator (or list of instantiators)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 -- a cons of a tag or tag-set and an instantiator (or list of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 instantiators)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 -- a cons of a locale and the previous type of item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 -- a list of one or more of any of the previous types of items
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 However, in these cases, you cannot give a LOCALE or TAG-SET,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 because they do not make sense. (You will probably get an error if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 you try this.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 Finally, VALUE can itself be a specifier (of the same type as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 SPECIFIER), if you want to copy specifications from one specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 to another; this is equivalent to calling `copy-specifier', and
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
341 LOCALE, TAG-SET, and HOW-TO-ADD have the same semantics as with
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
342 that function.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 Note that `set-specifier' is exactly complementary to `specifier-specs'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 except in the case where SPECIFIER has no specs at all in it but nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 is a valid instantiator (in that case, `specifier-specs' will return
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 nil (meaning no specs) and `set-specifier' will interpret the `nil'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 as meaning \"I'm adding a global instantiator and its value is `nil'\"),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 or in strange cases where there is an ambiguity between a spec-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 and an inst-list, etc. (The built-in specifier types are designed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 in such a way as to avoid any such ambiguities.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
353 NOTE: If you want to work with spec-lists, you should probably not
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 use either `set-specifier' or `specifier-specs', but should use the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 lower-level functions `add-spec-list-to-specifier' and `specifier-spec-list'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 These functions always work with fully-qualified spec-lists; thus, there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 is no possibility for ambiguity and no need to go through the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 `canonicalize-spec-list', which is potentially time-consuming."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 ;; backward compatibility: the old function had HOW-TO-ADD as the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 ;; third argument and no arguments after that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 ;; #### this should disappear at some point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (if (and (null how-to-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (memq locale '(prepend append remove-tag-set-prepend
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 remove-tag-set-append remove-locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 remove-locale-type remove-all)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (setq how-to-add locale)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (setq locale nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 ;; proper beginning of the function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (let ((is-valid (valid-instantiator-p value (specifier-type specifier)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (nval value))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (cond ((and (not is-valid) (specifierp nval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (copy-specifier nval specifier locale tag-set nil how-to-add))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (if tag-set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (if (not (listp tag-set))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (setq tag-set (list tag-set)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 ;; You tend to get more accurate errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 ;; for a variety of cases if you call
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 ;; canonicalize-tag-set here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (setq tag-set (canonicalize-tag-set tag-set))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (if (and (not is-valid) (consp nval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (setq nval
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (mapcar #'(lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (check-valid-instantiator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 x (specifier-type specifier))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (cons tag-set x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 nval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (setq nval (cons tag-set nval)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (if locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (setq nval (cons locale nval)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (add-spec-list-to-specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 specifier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (canonicalize-spec-list nval (specifier-type specifier))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 how-to-add))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (define-specifier-tag 'win 'device-on-window-system-p)