2459 |
:tag "Attributes" |
:tag "Attributes" |
2460 |
:extra-offset 12 |
:extra-offset 12 |
2461 |
:button-args '(:help-echo "Control whether this attribute has any effect.") |
:button-args '(:help-echo "Control whether this attribute has any effect.") |
2462 |
|
:value-to-internal 'custom-face-edit-fix-value |
2463 |
|
:match (lambda (widget value) |
2464 |
|
(widget-checklist-match widget |
2465 |
|
(custom-face-edit-fix-value widget value))) |
2466 |
:convert-widget 'custom-face-edit-convert-widget |
:convert-widget 'custom-face-edit-convert-widget |
2467 |
:args (mapcar (lambda (att) |
:args (mapcar (lambda (att) |
2468 |
(list 'group |
(list 'group |
2472 |
(nth 1 att))) |
(nth 1 att))) |
2473 |
custom-face-attributes)) |
custom-face-attributes)) |
2474 |
|
|
2475 |
|
(defun custom-face-edit-fix-value (widget value) |
2476 |
|
"Ignoring WIDGET, convert :bold and :italic in VALUE to new form." |
2477 |
|
(let (result) |
2478 |
|
(while value |
2479 |
|
(assert (cdr value)) |
2480 |
|
(let ((key (car value)) |
2481 |
|
(val (car (cdr value)))) |
2482 |
|
(cond ((eq key :italic) |
2483 |
|
(push :slant result) |
2484 |
|
(push (if val 'italic 'normal) result)) |
2485 |
|
((eq key :bold) |
2486 |
|
(push :weight result) |
2487 |
|
(push (if val 'bold 'normal) result)) |
2488 |
|
(t |
2489 |
|
(push key result) |
2490 |
|
(push val result)))) |
2491 |
|
(setq value (cdr (cdr value)))) |
2492 |
|
(setq result (nreverse result)) |
2493 |
|
result)) |
2494 |
|
|
2495 |
(defun custom-face-edit-convert-widget (widget) |
(defun custom-face-edit-convert-widget (widget) |
2496 |
"Convert :args as widget types in WIDGET." |
"Convert :args as widget types in WIDGET." |
2497 |
(widget-put |
(widget-put |