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-theme.el


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/cus-theme.el
Date: Fri, 13 Jan 2006 02:30:05 +0000

Index: emacs/lisp/cus-theme.el
diff -u emacs/lisp/cus-theme.el:1.19 emacs/lisp/cus-theme.el:1.20
--- emacs/lisp/cus-theme.el:1.19        Mon Jan  2 22:02:11 2006
+++ emacs/lisp/cus-theme.el     Fri Jan 13 02:30:03 2006
@@ -156,18 +156,21 @@
   (interactive "vVariable name: ")
   (save-excursion
     (goto-char custom-theme-insert-variable-marker)
-    (if (assq symbol custom-theme-variables)
-       (message "%s is already in the theme" (symbol-name symbol))
-      (widget-insert "\n")
-      (let ((widget (widget-create 'custom-variable
-                                  :tag (custom-unlispify-tag-name symbol)
-                                  :custom-level 0
-                                  :action 'custom-theme-variable-action
-                                  :custom-state 'unknown
-                                  :value symbol)))
-       (push (cons symbol widget) custom-theme-variables)
-       (custom-magic-reset widget))
-      (widget-setup))))
+    (cond ((assq symbol custom-theme-variables)
+          (message "%s is already in the theme" (symbol-name symbol)))
+         ((not (boundp symbol))
+          (message "%s is not defined as a variable" (symbol-name symbol)))
+         (t
+          (widget-insert "\n")
+          (let ((widget (widget-create 'custom-variable
+                                       :tag (custom-unlispify-tag-name symbol)
+                                       :custom-level 0
+                                       :action 'custom-theme-variable-action
+                                       :custom-state 'unknown
+                                       :value symbol)))
+            (push (cons symbol widget) custom-theme-variables)
+            (custom-magic-reset widget))
+          (widget-setup)))))
 
 (defvar custom-theme-variable-menu
   `(("Reset to Current" custom-redraw
@@ -222,18 +225,21 @@
   (interactive (list (read-face-name "Face name" nil nil)))
   (save-excursion
     (goto-char custom-theme-insert-face-marker)
-    (if (assq symbol custom-theme-faces)
-       (message "%s is already in the theme" (symbol-name symbol))
-      (widget-insert "\n")
-      (let ((widget (widget-create 'custom-face
-                                  :tag (custom-unlispify-tag-name symbol)
-                                  :custom-level 0
-                                  :action 'custom-theme-face-action
-                                  :custom-state 'unknown
-                                  :value symbol)))
-       (push (cons symbol widget) custom-theme-faces)
-       (custom-magic-reset widget)
-       (widget-setup)))))
+    (cond ((assq symbol custom-theme-faces)
+          (message "%s is already in the theme" (symbol-name symbol)))
+         ((not (facep symbol))
+          (message "%s is not defined as a face" (symbol-name symbol)))
+         (t
+          (widget-insert "\n")
+          (let ((widget (widget-create 'custom-face
+                                       :tag (custom-unlispify-tag-name symbol)
+                                       :custom-level 0
+                                       :action 'custom-theme-face-action
+                                       :custom-state 'unknown
+                                       :value symbol)))
+            (push (cons symbol widget) custom-theme-faces)
+            (custom-magic-reset widget)
+            (widget-setup))))))
 
 (defvar custom-theme-face-menu
   `(("Reset to Theme Value" custom-face-reset-theme




reply via email to

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