comparison man/xemacs/custom.texi @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 7d59cb494b73
children 2f8bb876ab1d
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
28 are parsed. 28 are parsed.
29 * Init File:: How to write common customizations in the @file{.emacs} 29 * Init File:: How to write common customizations in the @file{.emacs}
30 file. 30 file.
31 * Audible Bell:: Changing how Emacs sounds the bell. 31 * Audible Bell:: Changing how Emacs sounds the bell.
32 * Faces:: Changing the fonts and colors of a region of text. 32 * Faces:: Changing the fonts and colors of a region of text.
33 * X Resources:: X resources controlling various aspects of the 33 * X Resources:: X resources controlling various aspects of the
34 behavior of XEmacs. 34 behavior of XEmacs.
35 @end menu 35 @end menu
36 36
37 @node Minor Modes 37 @node Minor Modes
38 @section Minor Modes 38 @section Minor Modes
759 If the first line of a file contains two occurrences of @code{`-*-'}, 759 If the first line of a file contains two occurrences of @code{`-*-'},
760 XEmacs uses the information between them to determine what the major 760 XEmacs uses the information between them to determine what the major
761 mode and variable settings should be. For example, these are all legal: 761 mode and variable settings should be. For example, these are all legal:
762 762
763 @example 763 @example
764 ;;; -*- mode: emacs-lisp -*- 764 ;;; -*- mode: emacs-lisp -*-
765 ;;; -*- mode: postscript; version-control: never -*- 765 ;;; -*- mode: postscript; version-control: never -*-
766 ;;; -*- tags-file-name: "/foo/bar/TAGS" -*- 766 ;;; -*- tags-file-name: "/foo/bar/TAGS" -*-
767 @end example 767 @end example
768 768
769 For historical reasons, the syntax @code{`-*- modename -*-'} is allowed 769 For historical reasons, the syntax @code{`-*- modename -*-'} is allowed
770 as well; for example, you can use: 770 as well; for example, you can use:
771 771
772 @example 772 @example
773 ;;; -*- emacs-lisp -*- 773 ;;; -*- emacs-lisp -*-
774 @end example 774 @end example
775 775
776 @vindex enable-local-variables 776 @vindex enable-local-variables
777 The variable @code{enable-local-variables} controls the use of local 777 The variable @code{enable-local-variables} controls the use of local
778 variables lists in files you visit. The value can be @code{t}, 778 variables lists in files you visit. The value can be @code{t},
1091 all major modes except those that have their own overriding local 1091 all major modes except those that have their own overriding local
1092 definitions for the same key. Or you can change the current buffer's 1092 definitions for the same key. Or you can change the current buffer's
1093 local map, which affects all buffers using the same major mode. 1093 local map, which affects all buffers using the same major mode.
1094 1094
1095 @menu 1095 @menu
1096 * Interactive Rebinding:: Changing Key Bindings Interactively 1096 * Interactive Rebinding:: Changing Key Bindings Interactively
1097 * Programmatic Rebinding:: Changing Key Bindings Programmatically 1097 * Programmatic Rebinding:: Changing Key Bindings Programmatically
1098 * Key Bindings Using Strings::Using Strings for Changing Key Bindings 1098 * Key Bindings Using Strings:: Using Strings for Changing Key Bindings
1099 @end menu 1099 @end menu
1100 1100
1101 @node Interactive Rebinding 1101 @node Interactive Rebinding
1102 @subsubsection Changing Key Bindings Interactively 1102 @subsubsection Changing Key Bindings Interactively
1103 @findex global-set-key 1103 @findex global-set-key
1230 Here are some examples of programmatically binding keys: 1230 Here are some examples of programmatically binding keys:
1231 1231
1232 @example 1232 @example
1233 1233
1234 ;;; Bind @code{my-command} to @key{f1} 1234 ;;; Bind @code{my-command} to @key{f1}
1235 (global-set-key 'f1 'my-command) 1235 (global-set-key 'f1 'my-command)
1236 1236
1237 ;;; Bind @code{my-command} to @kbd{Shift-f1} 1237 ;;; Bind @code{my-command} to @kbd{Shift-f1}
1238 (global-set-key '(shift f1) 'my-command) 1238 (global-set-key '(shift f1) 'my-command)
1239 1239
1240 ;;; Bind @code{my-command} to @kbd{C-c Shift-f1} 1240 ;;; Bind @code{my-command} to @kbd{C-c Shift-f1}
1241 (global-set-key '[(control c) (shift f1)] 'my-command) 1241 (global-set-key '[(control c) (shift f1)] 'my-command)
1242 1242
1243 ;;; Bind @code{my-command} to the middle mouse button. 1243 ;;; Bind @code{my-command} to the middle mouse button.
1244 (global-set-key 'button2 'my-command) 1244 (global-set-key 'button2 'my-command)
1245 1245
1246 ;;; Bind @code{my-command} to @kbd{@key{META} @key{CTL} @key{Right Mouse Button}} 1246 ;;; Bind @code{my-command} to @kbd{@key{META} @key{CTL} @key{Right Mouse Button}}
1286 1286
1287 @cindex redefining keys 1287 @cindex redefining keys
1288 After binding a command to two key sequences with a form like: 1288 After binding a command to two key sequences with a form like:
1289 1289
1290 @example 1290 @example
1291 (define-key global-map "\^X\^I" 'command-1) 1291 (define-key global-map "\^X\^I" 'command-1)
1292 @end example 1292 @end example
1293 1293
1294 it is possible to redefine only one of those sequences like so: 1294 it is possible to redefine only one of those sequences like so:
1295 1295
1296 @example 1296 @example
1297 (define-key global-map [(control x) (control i)] 'command-2) 1297 (define-key global-map [(control x) (control i)] 'command-2)
1298 (define-key global-map [(control x) tab] 'command-3) 1298 (define-key global-map [(control x) tab] 'command-3)
1299 @end example 1299 @end example
1300 1300
1301 This applies only when running under a window system. If you are 1301 This applies only when running under a window system. If you are
1302 talking to Emacs through an ASCII-only channel, you do not get any of 1302 talking to Emacs through an ASCII-only channel, you do not get any of
1303 these features. 1303 these features.
1537 @cindex rebinding keys, permanently 1537 @cindex rebinding keys, permanently
1538 1538
1539 When you start Emacs, it normally loads the file @file{.emacs} in your 1539 When you start Emacs, it normally loads the file @file{.emacs} in your
1540 home directory. This file, if it exists, should contain Lisp code. It 1540 home directory. This file, if it exists, should contain Lisp code. It
1541 is called your initialization file or @dfn{init file}. Use the command 1541 is called your initialization file or @dfn{init file}. Use the command
1542 line switches @samp{-q} and @samp{-u} to tell Emacs whether to load an 1542 line switch @samp{-q} to tell Emacs whether to load an
1543 init file (@pxref{Entering Emacs}). 1543 init file (@pxref{Entering Emacs}). Use the command line switch
1544 1544 @samp{-user-init-file} (@pxref{Command Switches}) to tell Emacs to load
1545 @vindex init-file-user 1545 a different file instead of @file{~/.emacs}.
1546 When the @file{.emacs} file is read, the variable @code{init-file-user} 1546
1547 says which user's init file it is. The value may be the null string or a 1547 When the @file{.emacs} file is read, the variable @code{user-init-file}
1548 string containing a user's name. If the value is a null string, it means 1548 says which init file was loaded.
1549 that the init file was taken from the user that originally logged in.
1550
1551 In all cases, @code{(concat "~" init-file-user "/")} evaluates to the
1552 directory name of the directory where the @file{.emacs} file was looked
1553 for.
1554 1549
1555 At some sites there is a @dfn{default init file}, which is the 1550 At some sites there is a @dfn{default init file}, which is the
1556 library named @file{default.el}, found via the standard search path for 1551 library named @file{default.el}, found via the standard search path for
1557 libraries. The Emacs distribution contains no such library; your site 1552 libraries. The Emacs distribution contains no such library; your site
1558 may create one for local customizations. If this library exists, it is 1553 may create one for local customizations. If this library exists, it is
1921 The Emacs command loop catches an error 1916 The Emacs command loop catches an error
1922 1917
1923 @item undefined-key 1918 @item undefined-key
1924 You type a key that is undefined 1919 You type a key that is undefined
1925 1920
1926 @item undefined-click 1921 @item undefined-click
1927 You use an undefined mouse-click combination 1922 You use an undefined mouse-click combination
1928 1923
1929 @item no-completion 1924 @item no-completion
1930 Completion was not possible 1925 Completion was not possible
1931 1926
1932 @item y-or-n-p 1927 @item y-or-n-p
1933 You type something other than the required @code{y} or @code{n} 1928 You type something other than the required @code{y} or @code{n}
1934 1929
1935 @item yes-or-no-p 1930 @item yes-or-no-p
1936 You type something other than @code{yes} or @code{no} 1931 You type something other than @code{yes} or @code{no}
1937 @end table 1932 @end table
1938 1933
1939 @comment node-name, next, previous, up 1934 @comment node-name, next, previous, up
1940 @node Faces 1935 @node Faces
2069 run both variants. 2064 run both variants.
2070 2065
2071 Starting with XEmacs 21, XEmacs uses the class @samp{XEmacs} if it finds 2066 Starting with XEmacs 21, XEmacs uses the class @samp{XEmacs} if it finds
2072 any XEmacs resources in the resource database when the X connection is 2067 any XEmacs resources in the resource database when the X connection is
2073 initialized. Otherwise, it will use the class @samp{Emacs} for 2068 initialized. Otherwise, it will use the class @samp{Emacs} for
2074 backwards compatability. The variable @var{x-emacs-application-class} 2069 backwards compatibility. The variable @var{x-emacs-application-class}
2075 may be consulted to determine the application class being used. 2070 may be consulted to determine the application class being used.
2076 2071
2077 The examples in this section assume the application class is @samp{Emacs}. 2072 The examples in this section assume the application class is @samp{Emacs}.
2078 2073
2079 The Emacs resources are generally set per-frame. Each Emacs frame can have 2074 The Emacs resources are generally set per-frame. Each Emacs frame can have
2101 @end example 2096 @end example
2102 @noindent 2097 @noindent
2103 2098
2104 @menu 2099 @menu
2105 * Geometry Resources:: Controlling the size and position of frames. 2100 * Geometry Resources:: Controlling the size and position of frames.
2106 * Iconic Resources:: Controlling whether frames come up iconic. 2101 * Iconic Resources:: Controlling whether frames come up iconic.
2107 * Resource List:: List of resources settable on a frame or device. 2102 * Resource List:: List of resources settable on a frame or device.
2108 * Face Resources:: Controlling faces using resources. 2103 * Face Resources:: Controlling faces using resources.
2109 * Widgets:: The widget hierarchy for XEmacs. 2104 * Widgets:: The widget hierarchy for XEmacs.
2110 * Menubar Resources:: Specifying resources for the menubar. 2105 * Menubar Resources:: Specifying resources for the menubar.
2111 @end menu 2106 @end menu
2112 2107
2113 @node Geometry Resources 2108 @node Geometry Resources
2114 @subsection Geometry Resources 2109 @subsection Geometry Resources
2115 2110
2362 @item @code{attributeForeground} (class @code{AttributeForeground}): color-name 2357 @item @code{attributeForeground} (class @code{AttributeForeground}): color-name
2363 @itemx @code{attributeBackground} (class @code{AttributeBackground}): color-name 2358 @itemx @code{attributeBackground} (class @code{AttributeBackground}): color-name
2364 The foreground and background colors of this face. 2359 The foreground and background colors of this face.
2365 2360
2366 @item @code{attributeBackgroundPixmap} (class @code{AttributeBackgroundPixmap}): file-name 2361 @item @code{attributeBackgroundPixmap} (class @code{AttributeBackgroundPixmap}): file-name
2367 The name of an @sc{XBM} file (or @sc{XPM} file, if your version of Emacs 2362 The name of an @sc{xbm} file (or @sc{xpm} file, if your version of Emacs
2368 supports @sc{XPM}), to use as a background stipple. 2363 supports @sc{xpm}), to use as a background stipple.
2369 2364
2370 @item @code{attributeUnderline} (class @code{AttributeUnderline}): boolean 2365 @item @code{attributeUnderline} (class @code{AttributeUnderline}): boolean
2371 Whether text in this face should be underlined. 2366 Whether text in this face should be underlined.
2372 @end table 2367 @end table
2373 2368