emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109732: Fixes: debbugs:11805


From: Andreas Schwab
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109732: Fixes: debbugs:11805
Date: Tue, 21 Aug 2012 23:41:35 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109732
committer: Andreas Schwab <address@hidden>
branch nick: emacs
timestamp: Tue 2012-08-21 23:41:35 +0200
message:
  Fixes: debbugs:11805
  
  * cus-face.el (custom-face-attributes): Fix customize type for the
  :underline attribute.
modified:
  lisp/ChangeLog
  lisp/cus-face.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-08-21 18:27:14 +0000
+++ b/lisp/ChangeLog    2012-08-21 21:41:35 +0000
@@ -1,3 +1,8 @@
+2012-08-21  Andreas Schwab  <address@hidden>
+
+       * cus-face.el (custom-face-attributes): Fix customize type for the
+       :underline attribute.  (Bug#11805)
+
 2012-08-21  Martin Rudalics  <address@hidden>
 
        * window.el (window-point-1, set-window-point-1): Remove.

=== modified file 'lisp/cus-face.el'
--- a/lisp/cus-face.el  2012-06-17 00:32:36 +0000
+++ b/lisp/cus-face.el  2012-08-21 21:41:35 +0000
@@ -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"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]