comparison lisp/cus-theme.el @ 68161:b219be97e734

Minor fix.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 13 Jan 2006 02:36:49 +0000
parents c9545d6c538f
children 3bd95f4f2941 7beb78bc1f8e
comparison
equal deleted inserted replaced
68160:c9545d6c538f 68161:b219be97e734
152 152
153 ;;; Theme variables 153 ;;; Theme variables
154 154
155 (defun custom-theme-add-variable (symbol) 155 (defun custom-theme-add-variable (symbol)
156 (interactive "vVariable name: ") 156 (interactive "vVariable name: ")
157 (save-excursion 157 (cond ((assq symbol custom-theme-variables)
158 (goto-char custom-theme-insert-variable-marker) 158 (message "%s is already in the theme" (symbol-name symbol)))
159 (cond ((assq symbol custom-theme-variables) 159 ((not (boundp symbol))
160 (message "%s is already in the theme" (symbol-name symbol))) 160 (message "%s is not defined as a variable" (symbol-name symbol)))
161 ((not (boundp symbol)) 161 ((eq symbol 'custom-enabled-themes)
162 (message "%s is not defined as a variable" (symbol-name symbol))) 162 (message "Custom theme cannot contain `custom-enabled-themes'"))
163 ((eq symbol 'custom-enabled-themes) 163 (t
164 (message "Custom theme cannot contain `custom-enabled-themes'")) 164 (save-excursion
165 (t 165 (goto-char custom-theme-insert-variable-marker)
166 (widget-insert "\n") 166 (widget-insert "\n")
167 (let ((widget (widget-create 'custom-variable 167 (let ((widget (widget-create 'custom-variable
168 :tag (custom-unlispify-tag-name symbol) 168 :tag (custom-unlispify-tag-name symbol)
169 :custom-level 0 169 :custom-level 0
170 :action 'custom-theme-variable-action 170 :action 'custom-theme-variable-action
223 223
224 ;;; Theme faces 224 ;;; Theme faces
225 225
226 (defun custom-theme-add-face (symbol) 226 (defun custom-theme-add-face (symbol)
227 (interactive (list (read-face-name "Face name" nil nil))) 227 (interactive (list (read-face-name "Face name" nil nil)))
228 (save-excursion 228 (cond ((assq symbol custom-theme-faces)
229 (goto-char custom-theme-insert-face-marker) 229 (message "%s is already in the theme" (symbol-name symbol)))
230 (cond ((assq symbol custom-theme-faces) 230 ((not (facep symbol))
231 (message "%s is already in the theme" (symbol-name symbol))) 231 (message "%s is not defined as a face" (symbol-name symbol)))
232 ((not (facep symbol)) 232 (t
233 (message "%s is not defined as a face" (symbol-name symbol))) 233 (save-excursion
234 (t 234 (goto-char custom-theme-insert-face-marker)
235 (widget-insert "\n") 235 (widget-insert "\n")
236 (let ((widget (widget-create 'custom-face 236 (let ((widget (widget-create 'custom-face
237 :tag (custom-unlispify-tag-name symbol) 237 :tag (custom-unlispify-tag-name symbol)
238 :custom-level 0 238 :custom-level 0
239 :action 'custom-theme-face-action 239 :action 'custom-theme-face-action