emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/cus-edit.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/cus-edit.el
Date: Mon, 31 Dec 2001 15:13:55 -0500

Index: emacs/lisp/cus-edit.el
diff -c emacs/lisp/cus-edit.el:1.138 emacs/lisp/cus-edit.el:1.139
*** emacs/lisp/cus-edit.el:1.138        Tue Nov 27 00:25:55 2001
--- emacs/lisp/cus-edit.el      Mon Dec 31 15:13:54 2001
***************
*** 2459,2464 ****
--- 2459,2468 ----
    :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
***************
*** 2467,2472 ****
--- 2471,2496 ----
                        (list 'const :format "" :value (nth 0 att))
                        (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."



reply via email to

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