comparison man/xemacs/custom.texi @ 2681:f15523a6da7a

[xemacs-hg @ 2005-03-24 12:17:51 by aidan] Move to XEmacs for X11 app class, frame name.
author aidan
date Thu, 24 Mar 2005 12:18:02 +0000
parents f43f9ca6c7d9
children 40dc584fce16
comparison
equal deleted inserted replaced
2680:b26d8b5d0d30 2681:f15523a6da7a
2143 @node X Resources 2143 @node X Resources
2144 @section X Resources 2144 @section X Resources
2145 @cindex X resources 2145 @cindex X resources
2146 @findex x-create-frame 2146 @findex x-create-frame
2147 2147
2148 Historically, XEmacs has used the X resource application class @samp{Emacs} 2148 Historically, XEmacs used the X resource application class @samp{Emacs}
2149 for its resources. Unfortunately, GNU Emacs uses the same application 2149 for its resources. Unfortunately, GNU Emacs uses the same application
2150 class, and resources are not compatible between the two Emacsen. This 2150 class, and resources are not compatible between the two Emacsen. This
2151 sharing of the application class often leads to trouble if you want to 2151 sharing of the application class often led to trouble if you wanted to
2152 run both variants. 2152 run both variants.
2153 2153
2154 Starting with XEmacs 21, XEmacs uses the class @samp{XEmacs} if it finds 2154 XEmacs now uses the X resource application class @samp{XEmacs}.
2155 any XEmacs resources in the resource database when the X connection is 2155 Versions since 21.5.21 normally do this without any acrobatics of code,
2156 initialized. Otherwise, it will use the class @samp{Emacs} for 2156 but previous versions checked the X resource database for resources
2157 backwards compatibility. The variable @code{x-emacs-application-class} 2157 starting in @samp{XEmacs}, and if none were found, they used
2158 may be consulted to determine the application class being used. 2158 @samp{Emacs}, for greater backward compatibility. Currently, we advise
2159 2159 moving your X resources to using the @samp{XEmacs} class, but if, in the
2160 The examples in this section assume the application class is @samp{Emacs}. 2160 short term, you want to stay with the old behavior, you can start XEmacs
2161 2161 with the environment variable @b{USE_EMACS_AS_DEFAULT_APPLICATION_CLASS}
2162 The Emacs resources are generally set per-frame. Each Emacs frame can have 2162 set to some value; this will restore the pre-21.5.21 behavior.
2163 its own name or the same name as another, depending on the name passed to the 2163
2164 @code{make-frame} function. 2164 The examples in this section assume the application class is
2165 @samp{XEmacs}. From Lisp, you can examine the
2166 @code{x-emacs-application-class} variable to determine which is being
2167 used in the running application.
2168
2169 XEmacs' resources are generally set per-frame. Each XEmacs frame can
2170 have its own name or the same name as another, depending on the name
2171 passed to the @code{make-frame} function. Up until 21.5.21, the default
2172 frame name was @samp{emacs}; since then, it has been @samp{XEmacs}, but
2173 in the short term the old default can be restored by the
2174 @b{USE_EMACS_AS_DEFAULT_APPLICATION_CLASS} environment variable
2175 mentioned above. See the docstring for the Lisp variable
2176 `default-frame-name'.
2165 2177
2166 You can specify resources for all frames with the syntax: 2178 You can specify resources for all frames with the syntax:
2167 2179
2168 @example 2180 @example
2169 Emacs*parameter: value 2181 XEmacs*parameter: value
2170 @end example 2182 @end example
2171 @noindent 2183 @noindent
2172 2184
2173 or 2185 or
2174 2186
2175 @example 2187 @example
2176 Emacs*EmacsFrame.parameter:value 2188 XEmacs*EmacsFrame.parameter:value
2177 @end example 2189 @end example
2178 @noindent 2190 @noindent
2179 2191
2180 You can specify resources for a particular frame with the syntax: 2192 You can specify resources for a particular frame with the syntax:
2181 2193
2182 @example 2194 @example
2183 Emacs*FRAME-NAME.parameter: value 2195 XEmacs*FRAME-NAME.parameter: value
2184 @end example 2196 @end example
2185 @noindent 2197 @noindent
2186 2198
2187 @menu 2199 @menu
2188 * Geometry Resources:: Controlling the size and position of frames. 2200 * Geometry Resources:: Controlling the size and position of frames.
2194 @end menu 2206 @end menu
2195 2207
2196 @node Geometry Resources 2208 @node Geometry Resources
2197 @subsection Geometry Resources 2209 @subsection Geometry Resources
2198 2210
2199 To make the default size of all Emacs frames be 80 columns by 55 lines, 2211 To make the default size of all XEmacs frames be 80 columns by 55 lines,
2200 do this: 2212 do this:
2201 2213
2202 @example 2214 @example
2203 Emacs*EmacsFrame.geometry: 80x55 2215 XEmacs*EmacsFrame.geometry: 80x55
2204 @end example 2216 @end example
2205 @noindent 2217 @noindent
2206 2218
2207 To set the geometry of a particular frame named @samp{fred}, do this: 2219 To set the geometry of a particular frame named @samp{fred}, do this:
2208 2220
2209 @example 2221 @example
2210 Emacs*fred.geometry: 80x55 2222 XEmacs*fred.geometry: 80x55
2211 @end example 2223 @end example
2212 @noindent 2224 @noindent
2213 2225
2214 Important! Do not use the following syntax: 2226 Important! Do not use the following syntax:
2215 2227
2216 @example 2228 @example
2217 Emacs*geometry: 80x55 2229 XEmacs*geometry: 80x55
2218 @end example 2230 @end example
2219 @noindent 2231 @noindent
2220 2232
2221 You should never use @code{*geometry} with any X application. It does 2233 You should never use @code{*geometry} with any X application. It does
2222 not say "make the geometry of Emacs be 80 columns by 55 lines." It 2234 not say "make the geometry of XEmacs be 80 columns by 55 lines." It
2223 really says, "make Emacs and all subwindows thereof be 80x55 in whatever 2235 really says, "make XEmacs and all subwindows thereof be 80x55 in whatever
2224 units they care to measure in." In particular, that is both telling the 2236 units they care to measure in." In particular, that is both telling the
2225 Emacs text pane to be 80x55 in characters, and telling the menubar pane 2237 XEmacs text pane to be 80x55 in characters, and telling the menubar pane
2226 to be 80x55 pixels, which is surely not what you want. 2238 to be 80x55 pixels, which is surely not what you want.
2227 2239
2228 As a special case, this geometry specification also works (and sets the 2240 As a special case, this geometry specification also works (and sets the
2229 default size of all Emacs frames to 80 columns by 55 lines): 2241 default size of all XEmacs frames to 80 columns by 55 lines):
2230 2242
2231 @example 2243 @example
2232 Emacs.geometry: 80x55 2244 XEmacs.geometry: 80x55
2233 @end example 2245 @end example
2234 @noindent 2246 @noindent
2235 2247
2236 since that is the syntax used with most other applications (since most 2248 since that is the syntax used with most other applications (since most
2237 other applications have only one top-level window, unlike Emacs). In 2249 other applications have only one top-level window, unlike XEmacs). In
2238 general, however, the top-level shell (the unmapped ApplicationShell 2250 general, however, the top-level shell (the unmapped ApplicationShell
2239 widget named @samp{Emacs} that is the parent of the shell widgets that 2251 widget named @samp{XEmacs} that is the parent of the shell widgets that
2240 actually manage the individual frames) does not have any interesting 2252 actually manage the individual frames) does not have any interesting
2241 resources on it, and you should set the resources on the frames instead. 2253 resources on it, and you should set the resources on the frames instead.
2242 2254
2243 The @code{-geometry} command-line argument sets only the geometry of the 2255 The @code{-geometry} command-line argument sets only the geometry of the
2244 initial frame created by Emacs. 2256 initial frame created by XEmacs.
2245 2257
2246 A more complete explanation of geometry-handling is 2258 A more complete explanation of geometry-handling is
2247 2259
2248 @itemize @bullet 2260 @itemize @bullet
2249 @item 2261 @item
2250 The @code{-geometry} command-line option sets the @code{Emacs.geometry} 2262 The @code{-geometry} command-line option sets the @code{XEmacs.geometry}
2251 resource, that is, the geometry of the ApplicationShell. 2263 resource, that is, the geometry of the ApplicationShell.
2252 2264
2253 @item 2265 @item
2254 For the first frame created, the size of the frame is taken from the 2266 For the first frame created, the size of the frame is taken from the
2255 ApplicationShell if it is specified, otherwise from the geometry of the 2267 ApplicationShell if it is specified, otherwise from the geometry of the
2259 For subsequent frames, the order is reversed: First the frame, and then 2271 For subsequent frames, the order is reversed: First the frame, and then
2260 the ApplicationShell. 2272 the ApplicationShell.
2261 2273
2262 @item 2274 @item
2263 For the first frame created, the position of the frame is taken from the 2275 For the first frame created, the position of the frame is taken from the
2264 ApplicationShell (@code{Emacs.geometry}) if it is specified, otherwise 2276 ApplicationShell (@code{XEmacs.geometry}) if it is specified, otherwise
2265 from the geometry of the frame. 2277 from the geometry of the frame.
2266 2278
2267 @item 2279 @item
2268 For subsequent frames, the position is taken only from the frame, and 2280 For subsequent frames, the position is taken only from the frame, and
2269 never from the ApplicationShell. 2281 never from the ApplicationShell.
2275 2287
2276 @node Iconic Resources 2288 @node Iconic Resources
2277 @subsection Iconic Resources 2289 @subsection Iconic Resources
2278 2290
2279 Analogous to @code{-geometry}, the @code{-iconic} command-line option 2291 Analogous to @code{-geometry}, the @code{-iconic} command-line option
2280 sets the iconic flag of the ApplicationShell (@code{Emacs.iconic}) and 2292 sets the iconic flag of the ApplicationShell (@code{XEmacs.iconic}) and
2281 always applies to the first frame created regardless of its name. 2293 always applies to the first frame created regardless of its name.
2282 However, it is possible to set the iconic flag on particular frames (by 2294 However, it is possible to set the iconic flag on particular frames (by
2283 name) by using the @code{Emacs*FRAME-NAME.iconic} resource. 2295 name) by using the @code{XEmacs*FRAME-NAME.iconic} resource.
2284 2296
2285 @node Resource List 2297 @node Resource List
2286 @subsection Resource List 2298 @subsection Resource List
2287 2299
2288 Emacs frames accept the following resources: 2300 XEmacs frames accept the following resources:
2289 2301
2290 @table @asis 2302 @table @asis
2291 @item @code{geometry} (class @code{Geometry}): string 2303 @item @code{geometry} (class @code{Geometry}): string
2292 Initial geometry for the frame. @xref{Geometry Resources}, for a 2304 Initial geometry for the frame. @xref{Geometry Resources}, for a
2293 complete discussion of how this works. 2305 complete discussion of how this works.
2380 the amount of X traffic necessary to update the screen, and is useful 2392 the amount of X traffic necessary to update the screen, and is useful
2381 when the connection to the X server goes over a low-bandwidth line 2393 when the connection to the X server goes over a low-bandwidth line
2382 such as a modem connection. 2394 such as a modem connection.
2383 @end table 2395 @end table
2384 2396
2385 Emacs devices accept the following resources: 2397 XEmacs devices accept the following resources:
2386 2398
2387 @table @asis 2399 @table @asis
2388 @item @code{textPointer} (class @code{Cursor}): cursor-name 2400 @item @code{textPointer} (class @code{Cursor}): cursor-name
2389 The cursor to use when the mouse is over text. This resource is used to 2401 The cursor to use when the mouse is over text. This resource is used to
2390 initialize the variable @code{x-pointer-shape}. 2402 initialize the variable @code{x-pointer-shape}.
2423 @subsection Face Resources 2435 @subsection Face Resources
2424 2436
2425 The attributes of faces are also per-frame. They can be specified as: 2437 The attributes of faces are also per-frame. They can be specified as:
2426 2438
2427 @example 2439 @example
2428 Emacs.FACE_NAME.parameter: value 2440 XEmacs.FACE_NAME.parameter: value
2429 @end example 2441 @end example
2430 @noindent 2442 @noindent
2431 2443
2432 or 2444 or
2433 2445
2434 @example 2446 @example
2435 Emacs*FRAME_NAME.FACE_NAME.parameter: value 2447 XEmacs*FRAME_NAME.FACE_NAME.parameter: value
2436 @end example 2448 @end example
2437 @noindent 2449 @noindent
2438 2450
2439 Faces accept the following resources: 2451 Faces accept the following resources:
2440 2452
2445 @item @code{attributeForeground} (class @code{AttributeForeground}): color-name 2457 @item @code{attributeForeground} (class @code{AttributeForeground}): color-name
2446 @itemx @code{attributeBackground} (class @code{AttributeBackground}): color-name 2458 @itemx @code{attributeBackground} (class @code{AttributeBackground}): color-name
2447 The foreground and background colors of this face. 2459 The foreground and background colors of this face.
2448 2460
2449 @item @code{attributeBackgroundPixmap} (class @code{AttributeBackgroundPixmap}): file-name 2461 @item @code{attributeBackgroundPixmap} (class @code{AttributeBackgroundPixmap}): file-name
2450 The name of an @sc{xbm} file (or @sc{xpm} file, if your version of Emacs 2462 The name of an @sc{xbm} file (or @sc{xpm} file, if your version of XEmacs
2451 supports @sc{xpm}), to use as a background stipple. 2463 supports @sc{xpm}), to use as a background stipple.
2452 2464
2453 @item @code{attributeUnderline} (class @code{AttributeUnderline}): boolean 2465 @item @code{attributeUnderline} (class @code{AttributeUnderline}): boolean
2454 Whether text in this face should be underlined. 2466 Whether text in this face should be underlined.
2455 @end table 2467 @end table
2456 2468
2457 All text is displayed in some face, defaulting to the face named 2469 All text is displayed in some face, defaulting to the face named
2458 @code{default}. To set the font of normal text, use 2470 @code{default}. To set the font of normal text, use
2459 @code{Emacs*default.attributeFont}. To set it in the frame named 2471 @code{XEmacs*default.attributeFont}. To set it in the frame named
2460 @code{fred}, use @code{Emacs*fred.default.attributeFont}. 2472 @code{fred}, use @code{XEmacs*fred.default.attributeFont}.
2461 2473
2462 These are the names of the predefined faces: 2474 These are the names of the predefined faces:
2463 2475
2464 @table @code 2476 @table @code
2465 @item default 2477 @item default
2466 Everything inherits from this. 2478 Everything inherits from this.
2467 2479
2468 @item bold 2480 @item bold
2469 If this is not specified in the resource database, Emacs tries to find a 2481 If this is not specified in the resource database, XEmacs tries to find a
2470 bold version of the font of the default face. 2482 bold version of the font of the default face.
2471 2483
2472 @item italic 2484 @item italic
2473 If this is not specified in the resource database, Emacs tries to find 2485 If this is not specified in the resource database, XEmacs tries to find
2474 an italic version of the font of the default face. 2486 an italic version of the font of the default face.
2475 2487
2476 @item bold-italic 2488 @item bold-italic
2477 If this is not specified in the resource database, Emacs tries to find a 2489 If this is not specified in the resource database, XEmacs tries to find a
2478 bold-italic version of the font of the default face. 2490 bold-italic version of the font of the default face.
2479 2491
2480 @item modeline 2492 @item modeline
2481 This is the face that the modeline is displayed in. If not specified in 2493 This is the face that the modeline is displayed in. If not specified in
2482 the resource database, it is determined from the default face by 2494 the resource database, it is determined from the default face by
2567 As the menubar is implemented as a widget which is not a part of XEmacs 2579 As the menubar is implemented as a widget which is not a part of XEmacs
2568 proper, it does not use the face mechanism for specifying fonts and 2580 proper, it does not use the face mechanism for specifying fonts and
2569 colors: It uses whatever resources are appropriate to the type of widget 2581 colors: It uses whatever resources are appropriate to the type of widget
2570 which is used to implement it. 2582 which is used to implement it.
2571 2583
2572 If Emacs was compiled to use only the Lucid Motif-lookalike menu widgets, 2584 If XEmacs was compiled to use only the Lucid Motif-lookalike menu widgets,
2573 then one way to specify the font of the menubar would be 2585 then one way to specify the font of the menubar would be
2574 2586
2575 @example 2587 @example
2576 Emacs*menubar*font: *-courier-medium-r-*-*-*-120-*-*-*-*-*-* 2588 XEmacs*menubar*font: *-courier-medium-r-*-*-*-120-*-*-*-*-*-*
2577 @end example 2589 @end example
2578 2590
2579 If both the Lucid Motif-lookalike menu widgets and X Font Sets are 2591 If both the Lucid Motif-lookalike menu widgets and X Font Sets are
2580 configured to allow multilingual menubars, then one uses 2592 configured to allow multilingual menubars, then one uses
2581 2593
2591 .fontSet resources. 2603 .fontSet resources.
2592 2604
2593 If the Motif library is being used, then one would have to use 2605 If the Motif library is being used, then one would have to use
2594 2606
2595 @example 2607 @example
2596 Emacs*menubar*fontList: *-courier-medium-r-*-*-*-120-*-*-*-*-*-* 2608 XEmacs*menubar*fontList: *-courier-medium-r-*-*-*-120-*-*-*-*-*-*
2597 @end example 2609 @end example
2598 2610
2599 because the Motif library uses the @code{fontList} resource name instead 2611 because the Motif library uses the @code{fontList} resource name instead
2600 of @code{font}, which has subtly different semantics. 2612 of @code{font}, which has subtly different semantics.
2601 2613