emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r105974: Allow overriding of theme co


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105974: Allow overriding of theme confirmation via custom-safe-themes.
Date: Sat, 01 Oct 2011 14:27:21 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105974
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2011-10-01 14:27:21 -0400
message:
  Allow overriding of theme confirmation via custom-safe-themes.
  
  See http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00121.html
  
  * lisp/custom.el (custom-safe-themes, load-theme): Treat value of t for
  custom-safe-themes as special.
modified:
  lisp/ChangeLog
  lisp/custom.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-10-01 13:19:17 +0000
+++ b/lisp/ChangeLog    2011-10-01 18:27:21 +0000
@@ -1,3 +1,8 @@
+2011-10-01  Chong Yidong  <address@hidden>
+
+       * custom.el (custom-safe-themes, load-theme): Treat value of t for
+       custom-safe-themes as special.
+
 2011-10-01  Julien Danjou  <address@hidden>
 
        * notifications.el (notifications-notify): Fix docstring.

=== modified file 'lisp/custom.el'
--- a/lisp/custom.el    2011-07-08 17:02:01 +0000
+++ b/lisp/custom.el    2011-10-01 18:27:21 +0000
@@ -1104,13 +1104,17 @@
   (provide (get theme 'theme-feature)))
 
 (defcustom custom-safe-themes '(default)
-  "List of themes that are considered safe to load.
-Each list element should be the `sha1' hash of a theme file, or
-the symbol `default', which stands for any theme in the built-in
-Emacs theme directory (a directory named \"themes\" in
-`data-directory')."
-  :type '(repeat
-         (choice string (const :tag "Built-in themes" default)))
+  "Themes that are considered safe to load.
+If the value is a list, each element should be either the `sha1'
+hash of a safe theme file, or the symbol `default', which stands
+for any theme in the built-in Emacs theme directory (a directory
+named \"themes\" in `data-directory').
+
+If the value is t, Emacs treats all themes as safe."
+  :type '(choice (repeat :tag "List of safe themes"
+                        (choice string
+                                (const :tag "Built-in themes" default)))
+                (const :tag "All themes" t))
   :group 'customize
   :risky t
   :version "24.1")
@@ -1120,8 +1124,9 @@
 The theme file is named THEME-theme.el, in one of the directories
 specified by `custom-theme-load-path'.
 
-If THEME is not in `custom-safe-themes', prompt the user for
-confirmation, unless optional arg NO-CONFIRM is non-nil.
+If optional arg NO-CONFIRM is non-nil, and THEME is not
+considered safe according to `custom-safe-themes', prompt the
+user for confirmation.
 
 Normally, this function also enables THEME; if optional arg
 NO-ENABLE is non-nil, load the theme but don't enable it.
@@ -1158,6 +1163,7 @@
       ;; Check file safety with `custom-safe-themes', prompting the
       ;; user if necessary.
       (when (or no-confirm
+               (eq custom-safe-themes t)
                (and (memq 'default custom-safe-themes)
                     (equal (file-name-directory fn)
                            (expand-file-name "themes/" data-directory)))


reply via email to

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