summaryrefslogtreecommitdiff
path: root/lisp/cus-face.el
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-09-04 10:10:06 -0600
committerTom Tromey <tromey@redhat.com>2012-09-04 10:10:06 -0600
commitbf69f522a9e135f9aa483cedd53e71e915f2bf75 (patch)
tree3f73c47fb863ef87f420de1d30858da821072bd9 /lisp/cus-face.el
parent303324a9232dbc89369faceb6b3530740d0fc1bd (diff)
parent6ec9a5a7b5efb129807f567709ca858211ed7840 (diff)
downloademacs-bf69f522a9e135f9aa483cedd53e71e915f2bf75.tar.gz
merge from trunk
Diffstat (limited to 'lisp/cus-face.el')
-rw-r--r--lisp/cus-face.el34
1 files changed, 29 insertions, 5 deletions
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index 3680a2648ce..06fd10149d3 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -136,12 +136,36 @@
:help-echo "Control text underlining."
(const :tag "Off" nil)
(list :tag "On"
+ :value (:color foreground-color :style line)
(const :format "" :value :color)
- (choice :tag "Color" (const :tag "Foreground Color" foreground-color) color)
- (const :format "" :value :style)
- (choice :tag "Style"
- (const :tag "Line" line)
- (const :tag "Wave" wave)))))
+ (choice :tag "Color"
+ (const :tag "Foreground Color" foreground-color)
+ color)
+ (const :format "" :value :style)
+ (choice :tag "Style"
+ (const :tag "Line" line)
+ (const :tag "Wave" wave))))
+ ;; filter to make value suitable for customize
+ (lambda (real-value)
+ (and real-value
+ (let ((color
+ (or (and (consp real-value) (plist-get real-value :color))
+ (and (stringp real-value) real-value)
+ 'foreground-color))
+ (style
+ (or (and (consp real-value) (plist-get real-value :style))
+ 'line)))
+ (list :color color :style style))))
+ ;; filter to make customized-value suitable for storing
+ (lambda (cus-value)
+ (and cus-value
+ (let ((color (plist-get cus-value :color))
+ (style (plist-get cus-value :style)))
+ (cond ((eq style 'line)
+ ;; Use simple value for default style
+ (if (eq color 'foreground-color) t color))
+ (t
+ `(:color ,color :style ,style)))))))
(:overline
(choice :tag "Overline"