emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r106784: Tweak handling of custom-ena


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106784: Tweak handling of custom-enabled-themes and custom-safe-themes.
Date: Thu, 05 Jan 2012 19:12:11 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106784
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Thu 2012-01-05 19:12:11 +0800
message:
  Tweak handling of custom-enabled-themes and custom-safe-themes.
  
  * lisp/cus-theme.el (custom-theme-merge-theme): Ignore
  custom-enabled-themes and custom-safe-themes.
  
  * lisp/custom.el (enable-theme): Don't set custom-safe-themes.
modified:
  lisp/ChangeLog
  lisp/cus-theme.el
  lisp/custom.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-01-05 09:46:05 +0000
+++ b/lisp/ChangeLog    2012-01-05 11:12:11 +0000
@@ -1,9 +1,16 @@
+2012-01-05  Chong Yidong  <address@hidden>
+
+       * custom.el (enable-theme): Don't set custom-safe-themes.
+
+       * cus-theme.el (custom-theme-merge-theme): Ignore
+       custom-enabled-themes and custom-safe-themes.
+
 2012-01-05  Michael R. Mauger  <address@hidden>
 
        * progmodes/sql.el (sql-login-hook): Add hook to respond to the
        first prompt in `sql-interacive-mode'.
        (sql-mode-oracle-font-lock-keywords): Add CONNECT_BY_* builtin
-       keywords. 
+       keywords.
        (sql-mode-mysql-font-lock-keywords):  Add ELSEIF keyword.
        (sql-product-interactive): Bug fix: Set `sql-buffer' in
        context of original buffer.  Invoke `sql-login-hook'.

=== modified file 'lisp/cus-theme.el'
--- a/lisp/cus-theme.el 2012-01-05 09:46:05 +0000
+++ b/lisp/cus-theme.el 2012-01-05 11:12:11 +0000
@@ -329,11 +329,16 @@
     (load-theme theme nil t))
   (let ((settings (reverse (get theme 'theme-settings))))
     (dolist (setting settings)
-      (funcall (if (eq (car setting) 'theme-value)
-                  'custom-theme-add-variable
-                'custom-theme-add-face)
-              (nth 1 setting)
-              (nth 3 setting))))
+      (let ((option (eq (car setting) 'theme-value))
+           (name   (nth 1 setting))
+           (value  (nth 3 setting)))
+       (unless (and option
+                    (memq name '(custom-enabled-themes
+                                 custom-safe-themes)))
+         (funcall (if option
+                      'custom-theme-add-variable
+                    'custom-theme-add-face)
+                  name value)))))
   theme)
 
 ;; From cus-edit.el

=== modified file 'lisp/custom.el'
--- a/lisp/custom.el    2012-01-05 09:46:05 +0000
+++ b/lisp/custom.el    2012-01-05 11:12:11 +0000
@@ -1110,7 +1110,9 @@
 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."
+If the value is t, Emacs treats all themes as safe.
+
+This variable cannot be set in a Custom theme."
   :type '(choice (repeat :tag "List of safe themes"
                         (choice string
                                 (const :tag "Built-in themes" default)))
@@ -1285,8 +1287,8 @@
         ((eq prop 'theme-face)
          (custom-theme-recalc-face symbol))
         ((eq prop 'theme-value)
-         ;; Don't change `custom-enabled-themes'; that's special.
-         (unless (eq symbol 'custom-enabled-themes)
+         ;; Ignore `custom-enabled-themes' and `custom-safe-themes'.
+         (unless (memq symbol '(custom-enabled-themes custom-safe-themes))
            (custom-theme-recalc-variable symbol)))))))
   (unless (eq theme 'user)
     (setq custom-enabled-themes


reply via email to

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