diff options
| author | Chong Yidong | 2012-04-13 12:18:40 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-04-13 12:18:40 +0800 |
| commit | 03ed9e82adda3f6856a12e718fad023bb8b06502 (patch) | |
| tree | 8c2bf07ba1e0c4d03603b76088097fc0313027ad | |
| parent | 05f7d0d3faa5ec129c51bcf0ef698fea45a98677 (diff) | |
| download | emacs-03ed9e82adda3f6856a12e718fad023bb8b06502.tar.gz emacs-03ed9e82adda3f6856a12e718fad023bb8b06502.zip | |
* doc/lispref/customize.texi (Custom Themes): Also document load-theme etc.
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/customize.texi | 74 |
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 @@ | |||
| 1 | 2012-04-13 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * customize.texi (Custom Themes): Also document load-theme etc. | ||
| 4 | |||
| 1 | 2012-04-12 Chong Yidong <cyd@gnu.org> | 5 | 2012-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 |
| 1332 | This macro declares @var{theme} (a symbol) as the name of a Custom | 1332 | This macro declares @var{theme} (a symbol) as the name of a Custom |
| 1333 | theme. The optional argument @var{doc} specifies a string describing | 1333 | theme. The optional argument @var{doc} should be a string describing |
| 1334 | the theme; this is the description shown when the user invokes the | 1334 | the 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 |
| 1336 | buffer. | 1336 | Themes*} buffer. |
| 1337 | 1337 | ||
| 1338 | Two special theme names are disallowed: @code{user} is a ``dummy | 1338 | Two special theme names are disallowed: @code{user} is a ``dummy'' |
| 1339 | theme'' used to store the user's direct customization settings, and | 1339 | theme 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 |
| 1341 | of the Customize system. If you specify either of these as the | 1341 | of 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 | |||
| 1347 | specified. | 1347 | specified. |
| 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 |
| 1351 | forms specifying the theme settings---usually a call to | 1351 | specifying 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 |
| 1356 | This function declares that the Custom theme @var{theme} (a symbol) | 1356 | This function specifies the Custom theme @var{theme}'s variable |
| 1357 | customizes the variables in @var{args}. Each argument in @var{args} | 1357 | settings. @var{theme} should be a symbol. Each argument in |
| 1358 | should 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 |
| 1370 | This function declares that the Custom theme @var{theme} (a symbol) | 1370 | This function specifies the Custom theme @var{theme}'s face settings. |
| 1371 | customizes the faces in @var{args}. Each argument in @var{args} | 1371 | @var{theme} should be a symbol. Each argument in @var{args} should be |
| 1372 | should be a list of the form | 1372 | a 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 |
| 1384 | would be evaluated when loading the theme; but it is ``bad form'' for | 1384 | would be evaluated when loading the theme, but that is ``bad form''. |
| 1385 | a theme to do this. (For reasons of security, Emacs prompts the user | 1385 | To protect against loading themes containing malicious code, Emacs |
| 1386 | before loading any non-built-in theme.) | 1386 | displays the source file and asks for confirmation from the user |
| 1387 | before loading any non-built-in theme for the first time. | ||
| 1388 | |||
| 1389 | The following functions are useful for programmatically enabling and | ||
| 1390 | disabling Custom themes: | ||
| 1391 | |||
| 1392 | @defun custom-theme-p theme | ||
| 1393 | This function return a non-@code{nil} value if @var{theme} (a symbol) | ||
| 1394 | is the name of a Custom theme (i.e.@: a Custom theme which has been | ||
| 1395 | loaded into Emacs, whether or not the theme is enabled). Otherwise, | ||
| 1396 | it returns @code{nil}. | ||
| 1397 | @end defun | ||
| 1398 | |||
| 1399 | @deffn Command load-theme theme &optional no-confirm no-enable | ||
| 1400 | This function loads the Custom theme named @var{theme} from its source | ||
| 1401 | file, looking for the source file in the directories specified by the | ||
| 1402 | variable @code{custom-theme-load-path}. @xref{Custom Themes,,, emacs, | ||
| 1403 | The GNU Emacs Manual}. It also @dfn{enables} the theme, causing its | ||
| 1404 | variable and face settings to take effect. | ||
| 1405 | |||
| 1406 | If the optional argument @var{no-confirm} is non-@code{nil}, this | ||
| 1407 | skips prompting the user for confirmation before loading the theme. | ||
| 1408 | |||
| 1409 | If the optional argument @var{no-enable} is non-@code{nil}, the theme | ||
| 1410 | is loaded but not enabled. | ||
| 1411 | @end deffn | ||
| 1412 | |||
| 1413 | @deffn Command enable-theme theme | ||
| 1414 | This function enables the Custom theme named @var{theme}. It signals | ||
| 1415 | an error if no such theme has been loaded. | ||
| 1416 | @end deffn | ||
| 1417 | |||
| 1418 | @deffn Command disable-theme theme | ||
| 1419 | This function disables the Custom theme named @var{theme}. The theme | ||
| 1420 | remains loaded, so that a subsequent call to @code{enable-theme} will | ||
| 1421 | re-enable it. | ||
| 1422 | @end deffn | ||