aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMiles Bader2000-11-28 07:48:39 +0000
committerMiles Bader2000-11-28 07:48:39 +0000
commit91fc9992460861aa28295018b088fdd3b4b175c4 (patch)
tree413c71c6052ce28d2e2a34ed12cd086b9b134999 /lisp
parentf5fc769815a9bffd517c4f8a24f9457f338f86dd (diff)
downloademacs-91fc9992460861aa28295018b088fdd3b4b175c4.tar.gz
emacs-91fc9992460861aa28295018b088fdd3b4b175c4.zip
(custom-face-attributes): Handle mapping `nil' and `unspecified' to
`off' and `nil' in the :box pre-/post-filters.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/cus-face.el57
1 files changed, 31 insertions, 26 deletions
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index 90997096291..dc2461c0e1e 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -173,34 +173,39 @@
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"