diff options
| -rw-r--r-- | doc/emacs/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/emacs/xresources.texi | 170 |
2 files changed, 79 insertions, 95 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 566a60715ca..352ce8feaf1 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2009-05-12 Chong Yidong <cyd@stupidchicken.com> | 1 | 2009-05-12 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 2 | ||
| 3 | * xresources.texi (Resources): Simplify descriptions. Shorten | ||
| 4 | description of editres, which is not very useful these days. | ||
| 5 | (Table of Resources): Document fontBackend resource. | ||
| 6 | |||
| 3 | * trouble.texi (Quitting): Add other undo bindings to table. | 7 | * trouble.texi (Quitting): Add other undo bindings to table. |
| 4 | (DEL Does Not Delete): Note that the erasure key is usually labelled | 8 | (DEL Does Not Delete): Note that the erasure key is usually labelled |
| 5 | "Backspace". Remove discussion of obscure Xmodmap issue. | 9 | "Backspace". Remove discussion of obscure Xmodmap issue. |
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi index e0c95bace59..a2deb1530ae 100644 --- a/doc/emacs/xresources.texi +++ b/doc/emacs/xresources.texi | |||
| @@ -10,7 +10,7 @@ resources, as is usual for programs that use X. On MS-Windows, you | |||
| 10 | can customize some of the same aspects using the system registry. | 10 | can customize some of the same aspects using the system registry. |
| 11 | @xref{MS-Windows Registry}. | 11 | @xref{MS-Windows Registry}. |
| 12 | 12 | ||
| 13 | o When Emacs is built using an ``X toolkit'', such as Lucid or | 13 | When Emacs is built using an ``X toolkit'', such as Lucid or |
| 14 | LessTif, you need to use X resources to customize the appearance of | 14 | LessTif, you need to use X resources to customize the appearance of |
| 15 | the widgets, including the menu-bar, scroll-bar, and dialog boxes. | 15 | the widgets, including the menu-bar, scroll-bar, and dialog boxes. |
| 16 | This is because the libraries that implement these don't provide for | 16 | This is because the libraries that implement these don't provide for |
| @@ -45,63 +45,49 @@ manual. | |||
| 45 | 45 | ||
| 46 | Programs running under the X Window System organize their user | 46 | Programs running under the X Window System organize their user |
| 47 | options under a hierarchy of classes and resources. You can specify | 47 | options under a hierarchy of classes and resources. You can specify |
| 48 | default values for these options in your X resources file, usually | 48 | default values for these options in your @dfn{X resource file}, |
| 49 | named @file{~/.Xdefaults} or @file{~/.Xresources}. | 49 | usually named @file{~/.Xdefaults} or @file{~/.Xresources}. Changes in |
| 50 | If changes in @file{~/.Xdefaults} do not | 50 | this file do not take effect immediately, because the X server stores |
| 51 | take effect, it is because your X server stores its own list of | 51 | its own list of resources; to update it, use the command |
| 52 | resources; to update them, use the shell command @command{xrdb}---for | 52 | @command{xrdb}---for instance, @samp{xrdb ~/.Xdefaults}. |
| 53 | instance, @samp{xrdb ~/.Xdefaults}. | ||
| 54 | |||
| 55 | Each line in the file specifies a value for one option or for a | ||
| 56 | collection of related options, for one program or for several programs | ||
| 57 | (optionally even for all programs). | ||
| 58 | 53 | ||
| 59 | @cindex Registry (MS-Windows) | 54 | @cindex Registry (MS-Windows) |
| 60 | MS-Windows systems do not support @file{~/.Xdefaults} files, so | 55 | (MS-Windows systems do not support X resource files; on Windows, |
| 61 | instead Emacs compiled for Windows looks for X resources in the | 56 | Emacs looks for X resources in the Windows Registry, first under the |
| 62 | Windows Registry, first under the key | 57 | key @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} and then under the key |
| 63 | @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} and then under the key | ||
| 64 | @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs}. The menu and scroll | 58 | @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs}. The menu and scroll |
| 65 | bars are native widgets on MS-Windows, so they are only customizable | 59 | bars are native widgets on MS-Windows, so they are only customizable |
| 66 | via the system-wide settings in the Display Control Panel. You can | 60 | via the system-wide settings in the Display Control Panel. You can |
| 67 | also set resources using the @samp{-xrm} command line option (see | 61 | also set resources using the @samp{-xrm} command line option, as |
| 68 | below.) | 62 | explained below.) |
| 69 | |||
| 70 | @iftex | ||
| 71 | Applications such as Emacs look for resources with specific names | ||
| 72 | and their particular meanings. Case distinctions are significant in | ||
| 73 | these names. Each resource specification in @file{~/.Xdefaults} | ||
| 74 | states the name of the program and the name of the resource. For | ||
| 75 | Emacs, the program name is @samp{Emacs}. It looks like this: | ||
| 76 | 63 | ||
| 77 | @example | 64 | Each line in the X resource file specifies a value for one option or |
| 78 | Emacs.borderWidth: 2 | 65 | for a collection of related options. Each resource specification |
| 79 | @end example | 66 | consists of a @dfn{program name} and a @dfn{resource name}. Case |
| 80 | @end iftex | 67 | distinctions are significant in each of these names. Here is an |
| 81 | @ifnottex | 68 | example: |
| 82 | Programs define named resources with particular meanings. They also | ||
| 83 | define how to group resources into named classes. For instance, in | ||
| 84 | Emacs, the @samp{internalBorder} resource controls the width of the | ||
| 85 | internal border, and the @samp{borderWidth} resource controls the width | ||
| 86 | of the external border. Both of these resources are part of the | ||
| 87 | @samp{BorderWidth} class. Case distinctions are significant in these | ||
| 88 | names. | ||
| 89 | |||
| 90 | Every resource definition is associated with a specific program | ||
| 91 | name---the name of the executable file that you ran. For Emacs, that | ||
| 92 | is normally @samp{emacs}. To specify a definition for all instances | ||
| 93 | of Emacs, regardless of their names, use @samp{Emacs}. | ||
| 94 | |||
| 95 | In @file{~/.Xdefaults}, you can specify a value for a single resource | ||
| 96 | on one line, like this: | ||
| 97 | 69 | ||
| 98 | @example | 70 | @example |
| 99 | emacs.borderWidth: 2 | 71 | emacs.borderWidth: 2 |
| 100 | @end example | 72 | @end example |
| 101 | 73 | ||
| 102 | @noindent | 74 | @ifnottex |
| 103 | Or you can use a class name to specify the same value for all resources | 75 | The program name is the name of the executable file to which the |
| 104 | in that class. Here's an example: | 76 | resource applies. For Emacs, this is normally @samp{emacs}. To |
| 77 | specify a definition that applies to all instances of Emacs, | ||
| 78 | regardless of the name of the Emacs executable, use @samp{Emacs}. | ||
| 79 | |||
| 80 | The resource name is the name of a program setting. For instance, | ||
| 81 | Emacs recognizes a @samp{borderWidth} resource that controls the width | ||
| 82 | of the external border for graphical frames. | ||
| 83 | |||
| 84 | Resources are grouped into named classes. For instance, the | ||
| 85 | @samp{BorderWidth} class contains both the @samp{borderWidth} resource | ||
| 86 | (which we just described), as well as the @samp{internalBorder} | ||
| 87 | resource, which controls the width of the internal border for | ||
| 88 | graphical frames. Instead of using a resource name, you can use a | ||
| 89 | class name to specify the same value for all resources in that class. | ||
| 90 | Here's an example: | ||
| 105 | 91 | ||
| 106 | @example | 92 | @example |
| 107 | emacs.BorderWidth: 2 | 93 | emacs.BorderWidth: 2 |
| @@ -109,9 +95,10 @@ emacs.BorderWidth: 2 | |||
| 109 | 95 | ||
| 110 | If you specify a value for a class, it becomes the default for all | 96 | If you specify a value for a class, it becomes the default for all |
| 111 | resources in that class. You can specify values for individual | 97 | resources in that class. You can specify values for individual |
| 112 | resources as well; these override the class value, for those particular | 98 | resources as well; these override the class value, for those |
| 113 | resources. Thus, this example specifies 2 as the default width for all | 99 | particular resources. The following example specifies 2 as the |
| 114 | borders, but overrides this value with 4 for the external border: | 100 | default width for all borders, but overrides this value with 4 for the |
| 101 | external border: | ||
| 115 | 102 | ||
| 116 | @example | 103 | @example |
| 117 | emacs.BorderWidth: 2 | 104 | emacs.BorderWidth: 2 |
| @@ -123,66 +110,49 @@ emacs.borderWidth: 4 | |||
| 123 | Also, command-line options always override the X resources file. | 110 | Also, command-line options always override the X resources file. |
| 124 | 111 | ||
| 125 | @ifnottex | 112 | @ifnottex |
| 126 | Here is a list of X command-line options and their corresponding | 113 | The following X command-line options affect how X resources are |
| 127 | resource names. | 114 | processed: |
| 128 | 115 | ||
| 129 | @table @samp | 116 | @table @samp |
| 130 | @item -name @var{name} | 117 | @item -name @var{name} |
| 131 | @opindex --name | 118 | @opindex --name |
| 132 | @itemx --name=@var{name} | 119 | @itemx --name=@var{name} |
| 133 | @cindex resource name, command-line argument | 120 | @cindex resource name, command-line argument |
| 134 | Use @var{name} as the resource name (and the title) for the initial | 121 | This option sets the program name of the initial Emacs frame to |
| 135 | Emacs frame. This option does not affect subsequent frames, but Lisp | 122 | @var{name}. It also sets the title of the initial frame to |
| 136 | programs can specify frame names when they create frames. | 123 | @var{name}. This option does not affect subsequent frames. |
| 137 | 124 | ||
| 138 | If you don't specify this option, the default is to use the Emacs | 125 | If you don't specify this option, the default is to use the Emacs |
| 139 | executable's name as the resource name. | 126 | executable's name as the program name. |
| 127 | |||
| 128 | For consistency, @samp{-name} also specifies the name to use for other | ||
| 129 | resource values that do not belong to any particular frame. | ||
| 130 | |||
| 131 | The resources that name Emacs invocations also belong to a class, | ||
| 132 | named @samp{Emacs}. If you write @samp{Emacs} instead of | ||
| 133 | @samp{emacs}, the resource applies to all frames in all Emacs jobs, | ||
| 134 | regardless of frame titles and regardless of the name of the | ||
| 135 | executable file. | ||
| 140 | 136 | ||
| 141 | @item -xrm @var{resource-values} | 137 | @item -xrm @var{resource-values} |
| 142 | @opindex --xrm | 138 | @opindex --xrm |
| 143 | @itemx --xrm=@var{resource-values} | 139 | @itemx --xrm=@var{resource-values} |
| 144 | @cindex resource values, command-line argument | 140 | @cindex resource values, command-line argument |
| 145 | Specify X resource values for this Emacs job (see below). | 141 | This option specifies X resource values for the present Emacs job. |
| 142 | |||
| 143 | @var{resource-values} should have the same format that you would use | ||
| 144 | inside a file of X resources. To include multiple resource | ||
| 145 | specifications in @var{resource-values}, put a newline between them, | ||
| 146 | just as you would in a file. You can also use @samp{#include | ||
| 147 | "@var{filename}"} to include a file full of resource specifications. | ||
| 148 | Resource values specified with @samp{-xrm} take precedence over all | ||
| 149 | other resource specifications. | ||
| 146 | @end table | 150 | @end table |
| 147 | 151 | @end ifnottex | |
| 148 | For consistency, @samp{-name} also specifies the name to use for | ||
| 149 | other resource values that do not belong to any particular frame. | ||
| 150 | |||
| 151 | The resources that name Emacs invocations also belong to a class; its | ||
| 152 | name is @samp{Emacs}. If you write @samp{Emacs} instead of | ||
| 153 | @samp{emacs}, the resource applies to all frames in all Emacs jobs, | ||
| 154 | regardless of frame titles and regardless of the name of the executable | ||
| 155 | file. Here is an example: | ||
| 156 | |||
| 157 | @example | ||
| 158 | Emacs.BorderWidth: 2 | ||
| 159 | Emacs.borderWidth: 4 | ||
| 160 | @end example | ||
| 161 | |||
| 162 | You can specify a string of additional resource values for Emacs to | ||
| 163 | use with the command line option @samp{-xrm @var{resources}}. The text | ||
| 164 | @var{resources} should have the same format that you would use inside a file | ||
| 165 | of X resources. To include multiple resource specifications in | ||
| 166 | @var{resources}, put a newline between them, just as you would in a file. | ||
| 167 | You can also use @samp{#include "@var{filename}"} to include a file full | ||
| 168 | of resource specifications. Resource values specified with @samp{-xrm} | ||
| 169 | take precedence over all other resource specifications. | ||
| 170 | 152 | ||
| 171 | One way to experiment with the effect of different resource settings | 153 | One way to experiment with the effect of different resource settings |
| 172 | is to use the @code{editres} program. Select @samp{Get Tree} from the | 154 | is to use the @code{editres} program. See the @code{editres} man page |
| 173 | @end ifnottex | 155 | for more details. |
| 174 | @iftex | ||
| 175 | You can experiment with the effect of different resource settings | ||
| 176 | with the @code{editres} program. Select @samp{Get Tree} from the | ||
| 177 | @end iftex | ||
| 178 | @samp{Commands} menu, then click on an Emacs frame. This will display | ||
| 179 | a tree showing the structure of X toolkit widgets used in an Emacs | ||
| 180 | frame. Select one of them, such as @samp{menubar}, then select | ||
| 181 | @samp{Show Resource Box} from the @samp{Commands} menu. This displays | ||
| 182 | a list of all the meaningful X resources for that widget, and allows | ||
| 183 | you to edit them. Changes take effect when you click on the | ||
| 184 | @samp{Apply} button. (See the @code{editres} man page for more | ||
| 185 | details.) | ||
| 186 | 156 | ||
| 187 | @node Table of Resources | 157 | @node Table of Resources |
| 188 | @appendixsec Table of X Resources for Emacs | 158 | @appendixsec Table of X Resources for Emacs |
| @@ -219,7 +189,17 @@ Specifies whether to make the cursor blink. The default is @samp{on}. Use | |||
| 219 | @end ifnottex | 189 | @end ifnottex |
| 220 | 190 | ||
| 221 | @item @code{font} (class @code{Font}) | 191 | @item @code{font} (class @code{Font}) |
| 222 | Font name (or fontset name, @pxref{Fontsets}) for @code{default} font. | 192 | Font name for the @code{default} font. @xref{Font X}. You can also |
| 193 | specify a fontset name (@pxref{Fontsets}). | ||
| 194 | |||
| 195 | @item @code{fontBackend} (class @code{FontBackend}) | ||
| 196 | The backend(s) to use for drawing fonts; if multiple backends are | ||
| 197 | specified, they must be comma-delimited and given in order of | ||
| 198 | precedence. On X, for instance, the value @samp{x,xft} tells Emacs to | ||
| 199 | draw fonts using the X core font driver, falling back on the Xft font | ||
| 200 | driver if that fails. Normally, you can leave this resource unset, in | ||
| 201 | which case Emacs tries using all font backends available on your | ||
| 202 | graphical device. | ||
| 223 | 203 | ||
| 224 | @item @code{foreground} (class @code{Foreground}) | 204 | @item @code{foreground} (class @code{Foreground}) |
| 225 | Color name for text. | 205 | Color name for text. |