comparison lisp/cus-face.el @ 33939:70ea62504011

(custom-face-attributes): Handle mapping `nil' and `unspecified' to `off' and `nil' in the :box pre-/post-filters.
author Miles Bader <miles@gnu.org>
date Tue, 28 Nov 2000 07:48:39 +0000
parents ec4bfc5cff03
children b174db545cfd
comparison
equal deleted inserted replaced
33938:ec4bfc5cff03 33939:70ea62504011
171 (const :tag "Raised" released-button) 171 (const :tag "Raised" released-button)
172 (const :tag "Sunken" pressed-button) 172 (const :tag "Sunken" pressed-button)
173 (const :tag "None" nil)))) 173 (const :tag "None" nil))))
174 ;; filter to make value suitable for customize 174 ;; filter to make value suitable for customize
175 (lambda (real-value) 175 (lambda (real-value)
176 (let ((lwidth 176 (if (null real-value)
177 (or (and (consp real-value) (plist-get real-value :line-width)) 177 'off
178 (and (integerp real-value) real-value) 178 (let ((lwidth
179 1)) 179 (or (and (consp real-value) (plist-get real-value :line-width))
180 (color 180 (and (integerp real-value) real-value)
181 (or (and (consp real-value) (plist-get real-value :color)) 181 1))
182 (and (stringp real-value) real-value) 182 (color
183 nil)) 183 (or (and (consp real-value) (plist-get real-value :color))
184 (style 184 (and (stringp real-value) real-value)
185 (and (consp real-value) (plist-get real-value :style)))) 185 nil))
186 (list :line-width lwidth :color color :style style))) 186 (style
187 (and (consp real-value) (plist-get real-value :style))))
188 (list :line-width lwidth :color color :style style))))
187 ;; filter to make customized-value suitable for storing 189 ;; filter to make customized-value suitable for storing
188 (lambda (cus-value) 190 (lambda (cus-value)
189 (if (consp cus-value) 191 (cond ((null cus-value)
190 (let ((lwidth (plist-get cus-value :line-width)) 192 'unspecified)
191 (color (plist-get cus-value :color)) 193 ((eq cus-value 'off)
192 (style (plist-get cus-value :style))) 194 nil)
193 (cond ((and (null color) (null style)) 195 (t
194 lwidth) 196 (let ((lwidth (plist-get cus-value :line-width))
195 ((and (null lwidth) (null style)) 197 (color (plist-get cus-value :color))
196 ;; actually can't happen, because LWIDTH is always an int 198 (style (plist-get cus-value :style)))
197 color) 199 (cond ((and (null color) (null style))
198 (t 200 lwidth)
199 ;; Keep as a plist, but remove null entries 201 ((and (null lwidth) (null style))
200 (nconc (and lwidth `(:line-width ,lwidth)) 202 ;; actually can't happen, because LWIDTH is always an int
201 (and color `(:color ,color)) 203 color)
202 (and style `(:style ,style)))))) 204 (t
203 cus-value))) 205 ;; Keep as a plist, but remove null entries
206 (nconc (and lwidth `(:line-width ,lwidth))
207 (and color `(:color ,color))
208 (and style `(:style ,style))))))))))
204 209
205 (:inverse-video 210 (:inverse-video
206 (choice :tag "Inverse-video" 211 (choice :tag "Inverse-video"
207 :help-echo "Control whether text should be in inverse-video." 212 :help-echo "Control whether text should be in inverse-video."
208 (const :tag "*" nil) 213 (const :tag "*" nil)