Mercurial > emacs
changeset 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 | d7e7743299de |
files | lisp/cus-face.el |
diffstat | 1 files changed, 31 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/cus-face.el Tue Nov 28 06:52:10 2000 +0000 +++ b/lisp/cus-face.el Tue Nov 28 07:48:39 2000 +0000 @@ -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"