From d75fa08f60c8334d9b7c4f0e29cb6f9473f355a0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 31 Dec 2001 20:13:54 +0000 Subject: [PATCH] (custom-face-edit-fix-value): New function. (custom-face-edit): Use it, to convert :italic and :bold to new forms. --- lisp/cus-edit.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 2f037bfe45e..c78bce11aad 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2459,6 +2459,10 @@ restoring it to the state of a variable that has never been customized." :tag "Attributes" :extra-offset 12 :button-args '(:help-echo "Control whether this attribute has any effect.") + :value-to-internal 'custom-face-edit-fix-value + :match (lambda (widget value) + (widget-checklist-match widget + (custom-face-edit-fix-value widget value))) :convert-widget 'custom-face-edit-convert-widget :args (mapcar (lambda (att) (list 'group @@ -2468,6 +2472,26 @@ restoring it to the state of a variable that has never been customized." (nth 1 att))) custom-face-attributes)) +(defun custom-face-edit-fix-value (widget value) + "Ignoring WIDGET, convert :bold and :italic in VALUE to new form." + (let (result) + (while value + (assert (cdr value)) + (let ((key (car value)) + (val (car (cdr value)))) + (cond ((eq key :italic) + (push :slant result) + (push (if val 'italic 'normal) result)) + ((eq key :bold) + (push :weight result) + (push (if val 'bold 'normal) result)) + (t + (push key result) + (push val result)))) + (setq value (cdr (cdr value)))) + (setq result (nreverse result)) + result)) + (defun custom-face-edit-convert-widget (widget) "Convert :args as widget types in WIDGET." (widget-put -- 2.39.5