summaryrefslogtreecommitdiff
path: root/lisp/cus-face.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2000-11-28 07:48:39 +0000
committerMiles Bader <miles@gnu.org>2000-11-28 07:48:39 +0000
commit91fc9992460861aa28295018b088fdd3b4b175c4 (patch)
tree413c71c6052ce28d2e2a34ed12cd086b9b134999 /lisp/cus-face.el
parentf5fc769815a9bffd517c4f8a24f9457f338f86dd (diff)
downloademacs-91fc9992460861aa28295018b088fdd3b4b175c4.tar.gz
(custom-face-attributes): Handle mapping `nil' and `unspecified' to
`off' and `nil' in the :box pre-/post-filters.
Diffstat (limited to 'lisp/cus-face.el')
-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 @@
(const :tag "None" nil))))
;; filter to make value suitable for customize
(lambda (real-value)
- (let ((lwidth
- (or (and (consp real-value) (plist-get real-value :line-width))
- (and (integerp real-value) real-value)
- 1))
- (color
- (or (and (consp real-value) (plist-get real-value :color))
- (and (stringp real-value) real-value)
- nil))
- (style
- (and (consp real-value) (plist-get real-value :style))))
- (list :line-width lwidth :color color :style style)))
+ (if (null real-value)
+ 'off
+ (let ((lwidth
+ (or (and (consp real-value) (plist-get real-value :line-width))
+ (and (integerp real-value) real-value)
+ 1))
+ (color
+ (or (and (consp real-value) (plist-get real-value :color))
+ (and (stringp real-value) real-value)
+ nil))
+ (style
+ (and (consp real-value) (plist-get real-value :style))))
+ (list :line-width lwidth :color color :style style))))
;; filter to make customized-value suitable for storing
(lambda (cus-value)
- (if (consp cus-value)
- (let ((lwidth (plist-get cus-value :line-width))
- (color (plist-get cus-value :color))
- (style (plist-get cus-value :style)))
- (cond ((and (null color) (null style))
- lwidth)
- ((and (null lwidth) (null style))
- ;; actually can't happen, because LWIDTH is always an int
- color)
- (t
- ;; Keep as a plist, but remove null entries
- (nconc (and lwidth `(:line-width ,lwidth))
- (and color `(:color ,color))
- (and style `(:style ,style))))))
- cus-value)))
+ (cond ((null cus-value)
+ 'unspecified)
+ ((eq cus-value 'off)
+ nil)
+ (t
+ (let ((lwidth (plist-get cus-value :line-width))
+ (color (plist-get cus-value :color))
+ (style (plist-get cus-value :style)))
+ (cond ((and (null color) (null style))
+ lwidth)
+ ((and (null lwidth) (null style))
+ ;; actually can't happen, because LWIDTH is always an int
+ color)
+ (t
+ ;; Keep as a plist, but remove null entries
+ (nconc (and lwidth `(:line-width ,lwidth))
+ (and color `(:color ,color))
+ (and style `(:style ,style))))))))))
(:inverse-video
(choice :tag "Inverse-video"