emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/custom.el


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/custom.el
Date: Sun, 04 Sep 2005 14:00:46 -0400

Index: emacs/lisp/custom.el
diff -c emacs/lisp/custom.el:1.99 emacs/lisp/custom.el:1.100
*** emacs/lisp/custom.el:1.99   Wed Aug 24 11:49:07 2005
--- emacs/lisp/custom.el        Sun Sep  4 18:00:43 2005
***************
*** 953,959 ****
  
  This allows for a file-name convention for autoloading themes:
  Every theme X has a property `provide-theme' whose value is \"X-theme\".
! \(require-theme X) then attempts to load the file `X-theme.el'."
    (intern (concat (symbol-name theme) "-theme")))
  
  ;;; Loading themes.
--- 953,959 ----
  
  This allows for a file-name convention for autoloading themes:
  Every theme X has a property `provide-theme' whose value is \"X-theme\".
! \(load-theme X) then attempts to load the file `X-theme.el'."
    (intern (concat (symbol-name theme) "-theme")))
  
  ;;; Loading themes.
***************
*** 996,1002 ****
         "~/_emacs.d/"
        "~/.emacs.d/")
    "Directory in which Custom theme files should be written.
! `require-theme' searches this directory in addition to load-path.
  The command `customize-create-theme' writes the files it produces
  into this directory."
    :type 'string
--- 996,1002 ----
         "~/_emacs.d/"
        "~/.emacs.d/")
    "Directory in which Custom theme files should be written.
! `load-theme' searches this directory in addition to load-path.
  The command `customize-create-theme' writes the files it produces
  into this directory."
    :type 'string
***************
*** 1031,1041 ****
    ;; `user' must always be the highest-precedence enabled theme.
    ;; Make that remain true.  (This has the effect of making user settings
    ;; override the ones just loaded, too.)
!   (custom-enable-theme 'user))
  
! (defun require-theme (theme)
    "Try to load a theme's settings from its file.
! This also enables the theme; use `custom-disable-theme' to disable it."
  
    ;; THEME's feature is stored in THEME's `theme-feature' property.
    ;; Usually the `theme-feature' property contains a symbol created
--- 1031,1041 ----
    ;; `user' must always be the highest-precedence enabled theme.
    ;; Make that remain true.  (This has the effect of making user settings
    ;; override the ones just loaded, too.)
!   (enable-theme 'user))
  
! (defun load-theme (theme)
    "Try to load a theme's settings from its file.
! This also enables the theme; use `disable-theme' to disable it."
  
    ;; THEME's feature is stored in THEME's `theme-feature' property.
    ;; Usually the `theme-feature' property contains a symbol created
***************
*** 1043,1048 ****
--- 1043,1049 ----
  
    ;; Note we do no check for validity of the theme here.
    ;; This allows to pull in themes by a file-name convention
+   (interactive "SCustom theme name: ")
    (let ((load-path (if (file-directory-p custom-theme-directory)
                       (cons custom-theme-directory load-path)
                     load-path)))
***************
*** 1070,1081 ****
    (let ((themes-loaded (get by-theme 'theme-loads-themes)))
      (dolist (theme body)
        (cond ((and (consp theme) (eq (car theme) 'reset))
!            (custom-disable-theme (cadr theme)))
            ((and (consp theme) (eq (car theme) 'hidden))
!            (require-theme (cadr theme))
!            (custom-disable-theme (cadr theme)))
            (t
!            (require-theme theme)))
        (push theme themes-loaded))
      (put by-theme 'theme-loads-themes themes-loaded)))
  
--- 1071,1082 ----
    (let ((themes-loaded (get by-theme 'theme-loads-themes)))
      (dolist (theme body)
        (cond ((and (consp theme) (eq (car theme) 'reset))
!            (disable-theme (cadr theme)))
            ((and (consp theme) (eq (car theme) 'hidden))
!            (load-theme (cadr theme))
!            (disable-theme (cadr theme)))
            (t
!            (load-theme theme)))
        (push theme themes-loaded))
      (put by-theme 'theme-loads-themes themes-loaded)))
  
***************
*** 1087,1096 ****
  
  ;;; Enabling and disabling loaded themes.
  
! (defun custom-enable-theme (theme)
    "Reenable all variable and face settings defined by THEME.
  The newly enabled theme gets the highest precedence (after `user').
  If it is already enabled, just give it highest precedence (after `user')."
    (let ((settings (get theme 'theme-settings)))
      (dolist (s settings)
        (let* ((prop (car s))
--- 1088,1098 ----
  
  ;;; Enabling and disabling loaded themes.
  
! (defun enable-theme (theme)
    "Reenable all variable and face settings defined by THEME.
  The newly enabled theme gets the highest precedence (after `user').
  If it is already enabled, just give it highest precedence (after `user')."
+   (interactive "SEnable Custom theme: ")
    (let ((settings (get theme 'theme-settings)))
      (dolist (s settings)
        (let* ((prop (car s))
***************
*** 1104,1114 ****
          (cons theme (delq theme custom-enabled-themes)))
    ;; `user' must always be the highest-precedence enabled theme.
    (unless (eq theme 'user)
!     (custom-enable-theme 'user)))
  
! (defun custom-disable-theme (theme)
    "Disable all variable and face settings defined by THEME.
  See `custom-known-themes' for a list of known themes."
    (let ((settings (get theme 'theme-settings)))
      (dolist (s settings)
        (let* ((prop (car s))
--- 1106,1117 ----
          (cons theme (delq theme custom-enabled-themes)))
    ;; `user' must always be the highest-precedence enabled theme.
    (unless (eq theme 'user)
!     (enable-theme 'user)))
  
! (defun disable-theme (theme)
    "Disable all variable and face settings defined by THEME.
  See `custom-known-themes' for a list of known themes."
+   (interactive "SDisable Custom theme: ")
    (let ((settings (get theme 'theme-settings)))
      (dolist (s settings)
        (let* ((prop (car s))




reply via email to

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