aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-04-13 12:18:40 +0800
committerChong Yidong2012-04-13 12:18:40 +0800
commit03ed9e82adda3f6856a12e718fad023bb8b06502 (patch)
tree8c2bf07ba1e0c4d03603b76088097fc0313027ad
parent05f7d0d3faa5ec129c51bcf0ef698fea45a98677 (diff)
downloademacs-03ed9e82adda3f6856a12e718fad023bb8b06502.tar.gz
emacs-03ed9e82adda3f6856a12e718fad023bb8b06502.zip
* doc/lispref/customize.texi (Custom Themes): Also document load-theme etc.
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/customize.texi74
2 files changed, 59 insertions, 19 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 21050287fcc..e58ef2aa3ec 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,7 @@
12012-04-13 Chong Yidong <cyd@gnu.org>
2
3 * customize.texi (Custom Themes): Also document load-theme etc.
4
12012-04-12 Chong Yidong <cyd@gnu.org> 52012-04-12 Chong Yidong <cyd@gnu.org>
2 6
3 * customize.texi (Applying Customizations): 7 * customize.texi (Applying Customizations):
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 7e6b9ad40ac..ba977c70eb6 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -1330,14 +1330,14 @@ be a call to @code{deftheme}, and the last form should be a call to
1330 1330
1331@defmac deftheme theme &optional doc 1331@defmac deftheme theme &optional doc
1332This macro declares @var{theme} (a symbol) as the name of a Custom 1332This macro declares @var{theme} (a symbol) as the name of a Custom
1333theme. The optional argument @var{doc} specifies a string describing 1333theme. The optional argument @var{doc} should be a string describing
1334the theme; this is the description shown when the user invokes the 1334the theme; this is the description shown when the user invokes the
1335@kbd{?} (@code{describe-theme}) command in the @samp{*Custom Themes*} 1335@code{describe-theme} command or types @kbd{?} in the @samp{*Custom
1336buffer. 1336Themes*} buffer.
1337 1337
1338Two special theme names are disallowed: @code{user} is a ``dummy 1338Two special theme names are disallowed: @code{user} is a ``dummy''
1339theme'' used to store the user's direct customization settings, and 1339theme which stores the user's direct customization settings, and
1340@code{changed} is a ``dummy theme'' used to store changes made outside 1340@code{changed} is a ``dummy'' theme which stores changes made outside
1341of the Customize system. If you specify either of these as the 1341of the Customize system. If you specify either of these as the
1342@var{theme} argument, @code{deftheme} signals an error. 1342@var{theme} argument, @code{deftheme} signals an error.
1343@end defmac 1343@end defmac
@@ -1347,15 +1347,15 @@ This macro declares that the theme named @var{theme} has been fully
1347specified. 1347specified.
1348@end defmac 1348@end defmac
1349 1349
1350 In between @code{deftheme} and @code{provide-theme} are the Lisp 1350 In between @code{deftheme} and @code{provide-theme} are Lisp forms
1351forms specifying the theme settings---usually a call to 1351specifying the theme settings: usually a call to
1352@code{custom-theme-set-variables} and/or a call to 1352@code{custom-theme-set-variables} and/or a call to
1353@code{custom-theme-set-faces}: 1353@code{custom-theme-set-faces}.
1354 1354
1355@defun custom-theme-set-variables theme &rest args 1355@defun custom-theme-set-variables theme &rest args
1356This function declares that the Custom theme @var{theme} (a symbol) 1356This function specifies the Custom theme @var{theme}'s variable
1357customizes the variables in @var{args}. Each argument in @var{args} 1357settings. @var{theme} should be a symbol. Each argument in
1358should be a list of the form 1358@var{args} should be a list of the form
1359 1359
1360@example 1360@example
1361(@var{var} @var{expression} [@var{now} [@var{request} [@var{comment}]]]) 1361(@var{var} @var{expression} [@var{now} [@var{request} [@var{comment}]]])
@@ -1367,9 +1367,9 @@ where the list entries have the same meanings as in
1367@end defun 1367@end defun
1368 1368
1369@defun custom-theme-set-faces theme &rest args 1369@defun custom-theme-set-faces theme &rest args
1370This function declares that the Custom theme @var{theme} (a symbol) 1370This function specifies the Custom theme @var{theme}'s face settings.
1371customizes the faces in @var{args}. Each argument in @var{args} 1371@var{theme} should be a symbol. Each argument in @var{args} should be
1372should be a list of the form 1372a list of the form
1373 1373
1374@example 1374@example
1375(@var{face} @var{spec} [@var{now} [@var{comment}]]) 1375(@var{face} @var{spec} [@var{now} [@var{comment}]])
@@ -1380,7 +1380,43 @@ where the list entries have the same meanings as in
1380@code{custom-set-faces}. @xref{Applying Customizations}. 1380@code{custom-set-faces}. @xref{Applying Customizations}.
1381@end defun 1381@end defun
1382 1382
1383 In principle, a theme file can also contain other Lisp forms, which 1383 In theory, a theme file can also contain other Lisp forms, which
1384would be evaluated when loading the theme; but it is ``bad form'' for 1384would be evaluated when loading the theme, but that is ``bad form''.
1385a theme to do this. (For reasons of security, Emacs prompts the user 1385To protect against loading themes containing malicious code, Emacs
1386before loading any non-built-in theme.) 1386displays the source file and asks for confirmation from the user
1387before loading any non-built-in theme for the first time.
1388
1389 The following functions are useful for programmatically enabling and
1390disabling Custom themes:
1391
1392@defun custom-theme-p theme
1393This function return a non-@code{nil} value if @var{theme} (a symbol)
1394is the name of a Custom theme (i.e.@: a Custom theme which has been
1395loaded into Emacs, whether or not the theme is enabled). Otherwise,
1396it returns @code{nil}.
1397@end defun
1398
1399@deffn Command load-theme theme &optional no-confirm no-enable
1400This function loads the Custom theme named @var{theme} from its source
1401file, looking for the source file in the directories specified by the
1402variable @code{custom-theme-load-path}. @xref{Custom Themes,,, emacs,
1403The GNU Emacs Manual}. It also @dfn{enables} the theme, causing its
1404variable and face settings to take effect.
1405
1406If the optional argument @var{no-confirm} is non-@code{nil}, this
1407skips prompting the user for confirmation before loading the theme.
1408
1409If the optional argument @var{no-enable} is non-@code{nil}, the theme
1410is loaded but not enabled.
1411@end deffn
1412
1413@deffn Command enable-theme theme
1414This function enables the Custom theme named @var{theme}. It signals
1415an error if no such theme has been loaded.
1416@end deffn
1417
1418@deffn Command disable-theme theme
1419This function disables the Custom theme named @var{theme}. The theme
1420remains loaded, so that a subsequent call to @code{enable-theme} will
1421re-enable it.
1422@end deffn