Use find-file-hook instead of find-file-hooks.
[bpt/emacs.git] / lisp / custom.el
index 5138f80..7466913 100644 (file)
@@ -1,7 +1,7 @@
 ;;; custom.el --- tools for declaring and initializing options
 ;;
 ;; Copyright (C) 1996, 1997, 1999, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: FSF
@@ -168,6 +168,10 @@ set to nil, as the value is no longer rogue."
                 (put symbol 'custom-get value))
                ((eq keyword :require)
                 (push value requests))
+               ((eq keyword :risky)
+                (put symbol 'risky-local-variable value))
+               ((eq keyword :safe)
+                (put symbol 'safe-local-variable value))
                ((eq keyword :type)
                 (put symbol 'custom-type (purecopy value)))
                ((eq keyword :options)
@@ -219,6 +223,8 @@ The following keywords are meaningful:
        VALUE should be a feature symbol.  If you save a value
        for this option, then when your `.emacs' file loads the value,
        it does (require VALUE) first.
+:risky Set SYMBOL's `risky-local-variable' property to VALUE.
+:safe  Set SYMBOL's `safe-local-variable' property to VALUE.
 
 The following common keywords are also meaningful.
 
@@ -573,6 +579,15 @@ This recursively follows aliases."
   (or (get variable 'standard-value)
       (get variable 'custom-autoload)))
 
+(defun custom-note-var-changed (variable)
+  "Inform Custom that VARIABLE has been set (changed).
+VARIABLE is a symbol that names a user option.
+The result is that the change is treated as having been made through Custom."
+  (put variable 'customized-value (list (custom-quote (eval variable)))))
+
+\f
+;;; Custom Themes
+
 ;;; Loading files needed to customize a symbol.
 ;;; This is in custom.el because menu-bar.el needs it for toggle cmds.
 
@@ -1161,9 +1176,9 @@ This function returns nil if no custom theme specifies a value for VARIABLE."
 (defun custom-theme-recalc-face (face)
   "Set FACE according to currently enabled custom themes."
   (if (facep face)
-      (let ((theme-faces (reverse (get face 'theme-face))))
-       (dolist (spec theme-faces)
-         (face-spec-set face (cadr spec))))))
+      (face-spec-set face
+                     (get (or (get face 'face-alias) face)
+                          'face-override-spec))))
 \f
 ;;; XEmacs compability functions