emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r102003: Revert 2010-10-18 change; us


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102003: Revert 2010-10-18 change; use safe-functions instead.
Date: Tue, 19 Oct 2010 15:22:40 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102003
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Tue 2010-10-19 15:22:40 -0400
message:
  Revert 2010-10-18 change; use safe-functions instead.
  
  * cus-face.el (custom-theme-set-faces): Revert 2010-10-18 change.
  Don't mark as safe.
  
  * custom.el (custom-theme-set-variables): Likewise.
  (load-theme): Add custom-theme-set-faces and
  custom-theme-set-variables to safe-functions while loading.
  (custom-enabled-themes): Mark as risky.
modified:
  lisp/ChangeLog
  lisp/cus-face.el
  lisp/custom.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-10-19 19:20:33 +0000
+++ b/lisp/ChangeLog    2010-10-19 19:22:40 +0000
@@ -1,3 +1,13 @@
+2010-10-19  Chong Yidong  <address@hidden>
+
+       * cus-face.el (custom-theme-set-faces): Revert 2010-10-18 change.
+       Don't mark as safe.
+
+       * custom.el (custom-theme-set-variables): Likewise.
+       (load-theme): Add custom-theme-set-faces and
+       custom-theme-set-variables to safe-functions while loading.
+       (custom-enabled-themes): Mark as risky.
+
 2010-10-18  Julien Danjou  <address@hidden>
 
        * bindings.el: Remove end dashes in default mode-line-format.

=== modified file 'lisp/cus-face.el'
--- a/lisp/cus-face.el  2010-10-18 17:26:25 +0000
+++ b/lisp/cus-face.el  2010-10-19 19:22:40 +0000
@@ -349,8 +349,6 @@
              (put face 'face-override-spec nil)
              (face-spec-set face spec t))))))))
 
-(put 'custom-theme-set-faces 'safe-function t)
-
 ;; XEmacs compability function.  In XEmacs, when you reset a Custom
 ;; Theme, you have to specify the theme to reset it to.  We just apply
 ;; the next theme.

=== modified file 'lisp/custom.el'
--- a/lisp/custom.el    2010-10-18 17:26:25 +0000
+++ b/lisp/custom.el    2010-10-19 19:22:40 +0000
@@ -993,8 +993,6 @@
          (and (or now (default-boundp symbol))
               (put symbol 'variable-comment comment)))))))
 
-(put 'custom-theme-set-variables 'safe-function t)
-
 
 ;;; Defining themes.
 
@@ -1107,6 +1105,8 @@
     (let ((custom-enabling-themes t))
       (enable-theme 'user))))
 
+(defvar safe-functions) ; From unsafep.el
+
 (defun load-theme (theme &optional no-enable)
   "Load a theme's settings from its file.
 Normally, this also enables the theme; use `disable-theme' to
@@ -1135,7 +1135,11 @@
     ;; Instead of simply loading the theme file, read it manually.
     (with-temp-buffer
       (insert-file-contents fn)
+      (require 'unsafep)
       (let ((custom--inhibit-theme-enable no-enable)
+           (safe-functions (append '(custom-theme-set-variables
+                                     custom-theme-set-faces)
+                                   safe-functions))
            form scar)
        (while (setq form (let ((read-circle nil))
                            (condition-case nil
@@ -1234,6 +1238,7 @@
   :group 'customize
   :type  '(repeat symbol)
   :set-after '(custom-theme-directory custom-theme-load-path)
+  :risky t
   :set (lambda (symbol themes)
         ;; Avoid an infinite loop when custom-enabled-themes is
         ;; defined in a theme (e.g. `user').  Enabling the theme sets


reply via email to

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