comparison lisp/custom.el @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 576fb035e263
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
36 ;; The code implementing face declarations is in `cus-face.el' 36 ;; The code implementing face declarations is in `cus-face.el'
37 37
38 ;;; Code: 38 ;;; Code:
39 39
40 (eval-when-compile 40 (eval-when-compile
41 (load "cl-macs")) 41 (load "cl-macs" nil t))
42 42
43 (if (not (fboundp 'defun*)) 43 (autoload 'custom-declare-face "cus-face")
44 (autoload 'defun* "cl-macs")) 44 (autoload 'defun* "cl-macs")
45 45
46 (require 'widget) 46 (require 'widget)
47 47
48 (defvar custom-define-hook nil 48 (defvar custom-define-hook nil
49 ;; Customize information for this option is in `cus-edit.el'. 49 ;; Customize information for this option is in `cus-edit.el'.
183 :get VALUE should be a function to extract the value of symbol. 183 :get VALUE should be a function to extract the value of symbol.
184 The function takes one argument, a symbol, and should return 184 The function takes one argument, a symbol, and should return
185 the current value for that symbol. The default is 185 the current value for that symbol. The default is
186 `default-value'. 186 `default-value'.
187 :require VALUE should be a feature symbol. Each feature will be 187 :require VALUE should be a feature symbol. Each feature will be
188 required after initialization, of the the user have saved this 188 required after initialization, of the user have saved this
189 option. 189 option.
190 190
191 Read the section about customization in the Emacs Lisp manual for more 191 Read the section about customization in the Emacs Lisp manual for more
192 information." 192 information."
193 `(custom-declare-variable (quote ,symbol) (quote ,value) ,doc ,@args)) 193 `(custom-declare-variable (quote ,symbol) (quote ,value) ,doc ,@args))
225 225
226 For the DISPLAY to match a FRAME, the REQ property of the frame must 226 For the DISPLAY to match a FRAME, the REQ property of the frame must
227 match one of the ITEM. The following REQ are defined: 227 match one of the ITEM. The following REQ are defined:
228 228
229 `type' (the value of `window-system') 229 `type' (the value of `window-system')
230 Should be one of `x' or `tty'. 230 Should be one of `x', `mswindows', or `tty'.
231 231
232 `class' (the frame's color support) 232 `class' (the frame's color support)
233 Should be one of `color', `grayscale', or `mono'. 233 Should be one of `color', `grayscale', or `mono'.
234 234
235 `background' (what color is used for the background text) 235 `background' (what color is used for the background text)
393 393
394 (defmacro deftheme (theme &rest body) 394 (defmacro deftheme (theme &rest body)
395 "(deftheme THEME &optional DOC &key KEYWORDS) 395 "(deftheme THEME &optional DOC &key KEYWORDS)
396 396
397 Define a theme labeled by SYMBOL THEME. The optional argument DOC is a 397 Define a theme labeled by SYMBOL THEME. The optional argument DOC is a
398 doc string describing the the theme. It is optionally followed by the 398 doc string describing the theme. It is optionally followed by the
399 following keyboard arguments 399 following keyboard arguments
400 400
401 :short-description DESC 401 :short-description DESC
402 DESC is a short (one line) description of the theme. If not given DOC 402 DESC is a short (one line) description of the theme. If not given DOC
403 is used. 403 is used.
533 (put symbol 'theme-face spec-list) 533 (put symbol 'theme-face spec-list)
534 (custom-theme-reset-internal-face symbol 'user)))))) 534 (custom-theme-reset-internal-face symbol 'user))))))
535 535
536 (defun custom-theme-load-themes (by-theme &rest body) 536 (defun custom-theme-load-themes (by-theme &rest body)
537 "Load the themes specified by BODY and record them as required by 537 "Load the themes specified by BODY and record them as required by
538 theme BY-THEME. BODY is a secuence of 538 theme BY-THEME. BODY is a sequence of
539 - a SYMBOL 539 - a SYMBOL
540 require the theme SYMBOL 540 require the theme SYMBOL
541 - a list (reset THEME) 541 - a list (reset THEME)
542 Undo all the settings made by THEME. 542 Undo all the settings made by THEME.
543 - a list (hidden THEME) 543 - a list (hidden THEME)
563 563
564 564
565 565
566 566
567 (defsubst copy-upto-last (elt list) 567 (defsubst copy-upto-last (elt list)
568 "Copy all the elements of the list upto the last occurence of elt" 568 "Copy all the elements of the list upto the last occurrence of elt"
569 ;; Is it faster to do more work in C than to do less in elisp? 569 ;; Is it faster to do more work in C than to do less in elisp?
570 (nreverse (cdr (member elt (reverse list))))) 570 (nreverse (cdr (member elt (reverse list)))))
571 571
572 (defun custom-theme-value (theme theme-spec-list) 572 (defun custom-theme-value (theme theme-spec-list)
573 "Determine the value for THEME defined by THEME-SPEC-LIST. 573 "Determine the value for THEME defined by THEME-SPEC-LIST.
612 value)) 612 value))
613 613
614 614
615 (defun custom-theme-reset-variables (theme &rest args) 615 (defun custom-theme-reset-variables (theme &rest args)
616 "Reset the value of the variables to values previously defined. 616 "Reset the value of the variables to values previously defined.
617 Assosiate this setting with THEME. 617 Associate this setting with THEME.
618 618
619 ARGS is a list of lists of the form 619 ARGS is a list of lists of the form
620 620
621 (variable to-theme) 621 (variable to-theme)
622 622
627 (custom-push-theme 'theme-value (car arg) theme 'reset (cadr arg))) 627 (custom-push-theme 'theme-value (car arg) theme 'reset (cadr arg)))
628 args)) 628 args))
629 629
630 (defun custom-reset-variables (&rest args) 630 (defun custom-reset-variables (&rest args)
631 "Reset the value of the variables to values previously defined. 631 "Reset the value of the variables to values previously defined.
632 Assosiate this setting with the `user' theme. 632 Associate this setting with the `user' theme.
633 633
634 The ARGS are as in `custom-theme-reset-variables'." 634 The ARGS are as in `custom-theme-reset-variables'."
635 (apply #'custom-theme-reset-variables 'user args)) 635 (apply #'custom-theme-reset-variables 'user args))
636 636
637 637