diff options
| author | Richard M. Stallman | 2006-03-31 15:32:07 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-03-31 15:32:07 +0000 |
| commit | f73dbd9463f67a5fbab6d1e14a240917885303b0 (patch) | |
| tree | 95e11f619311d54b7a537d5c2f1e05df2bbf6901 | |
| parent | 1dafafa38422b38fd5796793a03ad3f69856bb74 (diff) | |
| download | emacs-f73dbd9463f67a5fbab6d1e14a240917885303b0.tar.gz emacs-f73dbd9463f67a5fbab6d1e14a240917885303b0.zip | |
Many cleanups.
(Minor Modes): Don't mention ISO Accents Mode.
(Examining): Update C-h v output example.
(Hooks): Add index and xref for add-hook.
(Locals): Delete list of vars that are always per-buffer. Rearrange.
(Local Keymaps): Don't mention lisp-mode-map, c-mode-map.
| -rw-r--r-- | man/custom.texi | 327 |
1 files changed, 160 insertions, 167 deletions
diff --git a/man/custom.texi b/man/custom.texi index db88f64f839..8429ddaae74 100644 --- a/man/custom.texi +++ b/man/custom.texi | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | @cindex customization | 7 | @cindex customization |
| 8 | 8 | ||
| 9 | This chapter talks about various topics relevant to adapting the | 9 | This chapter talks about various topics relevant to adapting the |
| 10 | behavior of Emacs in minor ways. | 10 | behavior of Emacs in ways we have anticipated. |
| 11 | @iftex | 11 | @iftex |
| 12 | See @cite{The Emacs Lisp Reference Manual} | 12 | See @cite{The Emacs Lisp Reference Manual} |
| 13 | @end iftex | 13 | @end iftex |
| @@ -15,14 +15,14 @@ See @cite{The Emacs Lisp Reference Manual} | |||
| 15 | @xref{Top, Emacs Lisp, Emacs Lisp, elisp, The Emacs Lisp | 15 | @xref{Top, Emacs Lisp, Emacs Lisp, elisp, The Emacs Lisp |
| 16 | Reference Manual}, | 16 | Reference Manual}, |
| 17 | @end ifnottex | 17 | @end ifnottex |
| 18 | for how to make more far-reaching changes. @xref{X Resources}, | 18 | for how to make more far-reaching and open-ended changes. @xref{X |
| 19 | for information on using X resources to customize Emacs. | 19 | Resources}, for information on using X resources to customize Emacs. |
| 20 | 20 | ||
| 21 | Customization that you do within Emacs normally affects only the | 21 | Customization that you do within Emacs normally affects only the |
| 22 | particular Emacs session that you do it in---it does not persist | 22 | particular Emacs session that you do it in---it does not persist |
| 23 | between sessions unless you save the customization in a file such as | 23 | between sessions unless you save the customization in a file such as |
| 24 | @file{.emacs} or @file{.Xdefaults} that will affect future sessions. | 24 | your init file (@file{.emacs}) that will affect future sessions. |
| 25 | @xref{Init File}. In the customization buffer, when you save | 25 | (@xref{Init File}.) When you tell the customization buffer to save |
| 26 | customizations for future sessions, this actually works by editing | 26 | customizations for future sessions, this actually works by editing |
| 27 | @file{.emacs} for you. | 27 | @file{.emacs} for you. |
| 28 | 28 | ||
| @@ -55,17 +55,19 @@ replay sequences of keys. | |||
| 55 | example, Auto Fill mode is a minor mode in which @key{SPC} breaks lines | 55 | example, Auto Fill mode is a minor mode in which @key{SPC} breaks lines |
| 56 | between words as you type. All the minor modes are independent of each | 56 | between words as you type. All the minor modes are independent of each |
| 57 | other and of the selected major mode. Most minor modes say in the mode | 57 | other and of the selected major mode. Most minor modes say in the mode |
| 58 | line when they are on; for example, @samp{Fill} in the mode line means | 58 | line when they are enabled; for example, @samp{Fill} in the mode line means |
| 59 | that Auto Fill mode is on. | 59 | that Auto Fill mode is enabled. |
| 60 | 60 | ||
| 61 | Append @code{-mode} to the name of a minor mode to get the name of a | 61 | You should append @code{-mode} to the name of a minor mode to |
| 62 | command that turns the mode on or off. Thus, the command to | 62 | produce the name of the command that turns the mode on or off. Thus, |
| 63 | enable or disable Auto Fill mode is called @code{auto-fill-mode}. These | 63 | the command to enable or disable Auto Fill mode is called |
| 64 | commands are usually invoked with @kbd{M-x}, but you can bind keys to them | 64 | @code{auto-fill-mode}. These commands are usually invoked with |
| 65 | if you wish. With no argument, the function turns the mode on if it was | 65 | @kbd{M-x}, but you can bind keys to them if you wish. |
| 66 | off and off if it was on. This is known as @dfn{toggling}. A positive | 66 | |
| 67 | argument always turns the mode on, and an explicit zero argument or a | 67 | With no argument, the minor mode function turns the mode on if it |
| 68 | negative argument always turns it off. | 68 | was off, and off if it was on. This is known as @dfn{toggling}. A |
| 69 | positive argument always turns the mode on, and an explicit zero | ||
| 70 | argument or a negative argument always turns it off. | ||
| 69 | 71 | ||
| 70 | Some minor modes are global: while enabled, they affect everything | 72 | Some minor modes are global: while enabled, they affect everything |
| 71 | you do in the Emacs session, in all buffers. Other minor modes are | 73 | you do in the Emacs session, in all buffers. Other minor modes are |
| @@ -94,8 +96,8 @@ a matter of user preference---other users editing the same file might | |||
| 94 | not want the same minor modes you prefer. | 96 | not want the same minor modes you prefer. |
| 95 | 97 | ||
| 96 | The most useful buffer-local minor modes include Abbrev mode, Auto | 98 | The most useful buffer-local minor modes include Abbrev mode, Auto |
| 97 | Fill mode, Auto Save mode, Font-Lock mode, Glasses mode, ISO Accents | 99 | Fill mode, Auto Save mode, Font-Lock mode, Glasses mode, Outline minor |
| 98 | mode, Outline minor mode, Overwrite mode, and Binary Overwrite mode. | 100 | mode, Overwrite mode, and Binary Overwrite mode. |
| 99 | 101 | ||
| 100 | Abbrev mode allows you to define abbreviations that automatically expand | 102 | Abbrev mode allows you to define abbreviations that automatically expand |
| 101 | as you type them. For example, @samp{amd} might expand to @samp{abbrev | 103 | as you type them. For example, @samp{amd} might expand to @samp{abbrev |
| @@ -105,9 +107,8 @@ mode}. @xref{Abbrevs}, for full information. | |||
| 105 | explicitly. Emacs inserts newlines as necessary to prevent lines from | 107 | explicitly. Emacs inserts newlines as necessary to prevent lines from |
| 106 | becoming too long. @xref{Filling}. | 108 | becoming too long. @xref{Filling}. |
| 107 | 109 | ||
| 108 | Auto Save mode causes the contents of a buffer to be saved | 110 | Auto Save mode saves the buffer contents periodically to reduce the |
| 109 | periodically to reduce the amount of work you can lose in case of a | 111 | amount of work you can lose in case of a crash. @xref{Auto Save}. |
| 110 | system crash. @xref{Auto Save}. | ||
| 111 | 112 | ||
| 112 | Enriched mode enables editing and saving of formatted text. | 113 | Enriched mode enables editing and saving of formatted text. |
| 113 | @xref{Formatted Text}. | 114 | @xref{Formatted Text}. |
| @@ -115,16 +116,18 @@ system crash. @xref{Auto Save}. | |||
| 115 | Flyspell mode automatically highlights misspelled words. | 116 | Flyspell mode automatically highlights misspelled words. |
| 116 | @xref{Spelling}. | 117 | @xref{Spelling}. |
| 117 | 118 | ||
| 118 | Font-Lock mode automatically highlights certain textual units found in | 119 | Font-Lock mode automatically highlights certain textual units found |
| 119 | programs, such as comments, strings, and function names being defined. | 120 | in programs, such as comments, strings, and function names being |
| 120 | This requires a graphical display that can show multiple fonts. | 121 | defined. This requires a display that can show multiple fonts or |
| 121 | @xref{Faces}. | 122 | colors. @xref{Faces}. |
| 122 | 123 | ||
| 124 | @ignore | ||
| 123 | ISO Accents mode makes the characters @samp{`}, @samp{'}, @samp{"}, | 125 | ISO Accents mode makes the characters @samp{`}, @samp{'}, @samp{"}, |
| 124 | @samp{^}, @samp{/} and @samp{~} combine with the following letter, to | 126 | @samp{^}, @samp{/} and @samp{~} combine with the following letter, to |
| 125 | produce an accented letter in the ISO Latin-1 character set. The | 127 | produce an accented letter in the ISO Latin-1 character set. The |
| 126 | newer and more general feature of input methods more or less | 128 | newer and more general feature of input methods more or less |
| 127 | supersedes ISO Accents mode. @xref{Unibyte Mode}. | 129 | supersedes ISO Accents mode. @xref{Unibyte Mode}. |
| 130 | @end ignore | ||
| 128 | 131 | ||
| 129 | Outline minor mode provides the same facilities as the major mode | 132 | Outline minor mode provides the same facilities as the major mode |
| 130 | called Outline mode; but since it is a minor mode instead, you can | 133 | called Outline mode; but since it is a minor mode instead, you can |
| @@ -286,15 +289,15 @@ settings. This command creates a special customization buffer which | |||
| 286 | shows only the names of groups and settings, and puts them in a | 289 | shows only the names of groups and settings, and puts them in a |
| 287 | structure. | 290 | structure. |
| 288 | 291 | ||
| 289 | In this buffer, you can show the contents of a group by invoking | 292 | In this buffer, you can show the contents of a group by invoking the |
| 290 | @samp{[+]}. When the group contents are visible, this button changes to | 293 | @samp{[+]} button. When the group contents are visible, this button |
| 291 | @samp{[-]}; invoking that hides the group contents. | 294 | changes to @samp{[-]}; invoking that hides the group contents again. |
| 292 | 295 | ||
| 293 | Each setting in this buffer has a link which says @samp{[Group]}, | 296 | Each group or setting in this buffer has a link which says |
| 294 | @samp{[Option]} or @samp{[Face]}. Invoking this link creates an | 297 | @samp{[Group]}, @samp{[Option]} or @samp{[Face]}. Invoking this link |
| 295 | ordinary customization buffer showing just that group and its | 298 | creates an ordinary customization buffer showing just that group and |
| 296 | contents, just that user option, or just that face. This is the way | 299 | its contents, just that user option, or just that face. This is the |
| 297 | to change settings that you find with @kbd{M-x customize-browse}. | 300 | way to change settings that you find with @kbd{M-x customize-browse}. |
| 298 | 301 | ||
| 299 | If you can guess part of the name of the settings you are interested | 302 | If you can guess part of the name of the settings you are interested |
| 300 | in, @kbd{M-x customize-apropos} is another way to search for settings. | 303 | in, @kbd{M-x customize-apropos} is another way to search for settings. |
| @@ -343,6 +346,8 @@ value: | |||
| 343 | save it. | 346 | save it. |
| 344 | @end smallexample | 347 | @end smallexample |
| 345 | 348 | ||
| 349 | @cindex user options, how to set | ||
| 350 | @cindex variables, how to set | ||
| 346 | @cindex settings, how to set | 351 | @cindex settings, how to set |
| 347 | Editing the value does not actually set the variable. To do that, | 352 | Editing the value does not actually set the variable. To do that, |
| 348 | you must @dfn{set} the variable. To do this, invoke the | 353 | you must @dfn{set} the variable. To do this, invoke the |
| @@ -415,8 +420,8 @@ instance, to specify a function instead of a pair of coding systems. | |||
| 415 | To delete an association from the list, invoke the @samp{[DEL]} button | 420 | To delete an association from the list, invoke the @samp{[DEL]} button |
| 416 | for that item. To add an association, invoke @samp{[INS]} at the | 421 | for that item. To add an association, invoke @samp{[INS]} at the |
| 417 | position where you want to add it. There is an @samp{[INS]} button | 422 | position where you want to add it. There is an @samp{[INS]} button |
| 418 | between each pair of association, another at the beginning and another | 423 | between each pair of associations, another at the beginning and another |
| 419 | at the end, so you can add the new association at any position in the | 424 | at the end, so you can add a new association at any position in the |
| 420 | list. | 425 | list. |
| 421 | 426 | ||
| 422 | @kindex TAB @r{(customization buffer)} | 427 | @kindex TAB @r{(customization buffer)} |
| @@ -469,7 +474,7 @@ and then reset it, which discards the customized value, | |||
| 469 | you can get the customized value back again with this operation. | 474 | you can get the customized value back again with this operation. |
| 470 | @end table | 475 | @end table |
| 471 | 476 | ||
| 472 | @cindex comments on customized options | 477 | @cindex comments on customized settings |
| 473 | Sometimes it is useful to record a comment about a specific | 478 | Sometimes it is useful to record a comment about a specific |
| 474 | customization. Use the @samp{Add Comment} item from the | 479 | customization. Use the @samp{Add Comment} item from the |
| 475 | @samp{[State]} menu to create a field for entering the comment. The | 480 | @samp{[State]} menu to create a field for entering the comment. The |
| @@ -494,13 +499,17 @@ buffer according to the setting of the option | |||
| 494 | Each of the other buttons performs an operation---set, save or | 499 | Each of the other buttons performs an operation---set, save or |
| 495 | reset---on each of the settings in the buffer that could meaningfully | 500 | reset---on each of the settings in the buffer that could meaningfully |
| 496 | be set, saved or reset. They do not operate on settings whose values | 501 | be set, saved or reset. They do not operate on settings whose values |
| 497 | are hidden, nor on subgroups not visible in the buffer. | 502 | are hidden, nor on subgroups which are hidden or not visible in the buffer. |
| 498 | 503 | ||
| 499 | @node Saving Customizations | 504 | @node Saving Customizations |
| 500 | @subsection Saving Customizations | 505 | @subsection Saving Customizations |
| 501 | 506 | ||
| 507 | Saving customizations from the customization buffer works by writing | ||
| 508 | code that future sessions will read, code to set up those | ||
| 509 | customizations again. | ||
| 510 | |||
| 502 | @vindex custom-file | 511 | @vindex custom-file |
| 503 | The customization buffer normally saves customizations in | 512 | Normally this saves customizations in your init file, |
| 504 | @file{~/.emacs}. If you wish, you can save customizations in another | 513 | @file{~/.emacs}. If you wish, you can save customizations in another |
| 505 | file instead. To make this work, your @file{~/.emacs} should set | 514 | file instead. To make this work, your @file{~/.emacs} should set |
| 506 | @code{custom-file} to the name of that file. Then you should load the | 515 | @code{custom-file} to the name of that file. Then you should load the |
| @@ -511,8 +520,8 @@ file by calling @code{load}. For example: | |||
| 511 | (load custom-file) | 520 | (load custom-file) |
| 512 | @end example | 521 | @end example |
| 513 | 522 | ||
| 514 | You can also use @code{custom-file} to specify different | 523 | You can use @code{custom-file} to specify different customization |
| 515 | customization files for different Emacs versions, like this: | 524 | files for different Emacs versions, like this: |
| 516 | 525 | ||
| 517 | @example | 526 | @example |
| 518 | (cond ((< emacs-major-version 21) | 527 | (cond ((< emacs-major-version 21) |
| @@ -650,9 +659,9 @@ on the character after point. | |||
| 650 | @findex customize-group | 659 | @findex customize-group |
| 651 | You can also set up the customization buffer with a specific group, | 660 | You can also set up the customization buffer with a specific group, |
| 652 | using @kbd{M-x customize-group}. The immediate contents of the chosen | 661 | using @kbd{M-x customize-group}. The immediate contents of the chosen |
| 653 | group, including variables, faces, and other groups, all appear | 662 | group, including settings (variables and faces), and other groups, all |
| 654 | as well (even if not already loaded). However, the subgroups' own | 663 | appear as well (even if not already loaded). However, the subgroups' |
| 655 | contents are not included. | 664 | own contents are not included. |
| 656 | 665 | ||
| 657 | @findex customize-apropos | 666 | @findex customize-apropos |
| 658 | To control more precisely what to customize, you can use @kbd{M-x | 667 | To control more precisely what to customize, you can use @kbd{M-x |
| @@ -663,13 +672,13 @@ specify an empty regular expression, this includes @emph{all} loaded | |||
| 663 | groups and settings---which takes a long time to set up. | 672 | groups and settings---which takes a long time to set up. |
| 664 | 673 | ||
| 665 | @findex customize-changed | 674 | @findex customize-changed |
| 666 | When you upgrade to a new Emacs version, you might want to customize | 675 | When you upgrade to a new Emacs version, you might want to consider |
| 667 | new settings and settings whose meanings or default values have | 676 | customizing new settings, and settings whose meanings or default |
| 668 | changed. To do this, use @kbd{M-x customize-changed} and | 677 | values have changed. To do this, use @kbd{M-x customize-changed} and |
| 669 | specify a previous Emacs version number using the minibuffer. It | 678 | specify a previous Emacs version number using the minibuffer. It |
| 670 | creates a customization buffer which shows all the settings and groups | 679 | creates a customization buffer which shows all the settings and groups |
| 671 | whose definitions have been changed since the specified version, loading | 680 | whose definitions have been changed since the specified version, |
| 672 | them if necessary. | 681 | loading them if necessary. |
| 673 | 682 | ||
| 674 | @findex customize-saved | 683 | @findex customize-saved |
| 675 | @findex customize-customized | 684 | @findex customize-customized |
| @@ -712,7 +721,7 @@ by visiting the ``special'' theme named @samp{user}. This theme, which | |||
| 712 | records all the options that you set in the ordinary customization | 721 | records all the options that you set in the ordinary customization |
| 713 | buffer, is always enabled, and always takes precedence over all other | 722 | buffer, is always enabled, and always takes precedence over all other |
| 714 | enabled Custom themes. Additionally, the @samp{user} theme is | 723 | enabled Custom themes. Additionally, the @samp{user} theme is |
| 715 | recorded in your @file{.emacs} file, rather than a | 724 | recorded with code in your @file{.emacs} file, rather than a |
| 716 | @file{user-theme.el} file. | 725 | @file{user-theme.el} file. |
| 717 | 726 | ||
| 718 | @vindex custom-enabled-themes | 727 | @vindex custom-enabled-themes |
| @@ -734,7 +743,7 @@ theme occurring earlier in @code{custom-enabled-themes} takes effect. | |||
| 734 | You can temporarily enable a Custom theme with @kbd{M-x | 743 | You can temporarily enable a Custom theme with @kbd{M-x |
| 735 | enable-theme}. This prompts for a theme name in the minibuffer, loads | 744 | enable-theme}. This prompts for a theme name in the minibuffer, loads |
| 736 | the theme from the theme file if necessary, and enables the theme. | 745 | the theme from the theme file if necessary, and enables the theme. |
| 737 | You can @dfn{disabled} any enabled theme with the command @kbd{M-x | 746 | You can @dfn{disable} any enabled theme with the command @kbd{M-x |
| 738 | disable-theme}; this returns the options specified in the theme to | 747 | disable-theme}; this returns the options specified in the theme to |
| 739 | their original values. To re-enable the theme, type @kbd{M-x | 748 | their original values. To re-enable the theme, type @kbd{M-x |
| 740 | enable-theme} again. If a theme file is changed during your Emacs | 749 | enable-theme} again. If a theme file is changed during your Emacs |
| @@ -755,7 +764,7 @@ have a documentation string which describes what kind of value it should | |||
| 755 | have and how the value will be used. | 764 | have and how the value will be used. |
| 756 | 765 | ||
| 757 | Emacs Lisp allows any variable (with a few exceptions) to have any | 766 | Emacs Lisp allows any variable (with a few exceptions) to have any |
| 758 | kind of value, but most variables that Emacs uses need a value of a | 767 | kind of value, but most variables that Emacs uses expect a value of a |
| 759 | certain type. Often the value should always be a string, or should | 768 | certain type. Often the value should always be a string, or should |
| 760 | always be a number. Sometimes we say that a certain feature is turned | 769 | always be a number. Sometimes we say that a certain feature is turned |
| 761 | on if a variable is ``non-@code{nil},'' meaning that if the variable's | 770 | on if a variable is ``non-@code{nil},'' meaning that if the variable's |
| @@ -766,11 +775,11 @@ variable---is @code{t}. | |||
| 766 | 775 | ||
| 767 | Emacs uses many Lisp variables for internal record keeping, but the | 776 | Emacs uses many Lisp variables for internal record keeping, but the |
| 768 | most interesting variables for a non-programmer user are those meant | 777 | most interesting variables for a non-programmer user are those meant |
| 769 | for users to change---the @dfn{user options}. | 778 | for users to change---these are called @dfn{user options}. |
| 770 | 779 | ||
| 771 | Each user option that you can set with the customization buffer is | 780 | Each user option that you can set with the customization buffer is |
| 772 | in fact a Lisp variable. Emacs does not (usually) change the values | 781 | in fact a Lisp variable. Emacs does not (usually) change the values |
| 773 | of these variables; instead, you set the values, and thereby alter and | 782 | of these variables on its own; instead, you set the values in order to |
| 774 | control the behavior of certain Emacs commands. Use of the | 783 | control the behavior of certain Emacs commands. Use of the |
| 775 | customization buffer is explained above (@pxref{Easy Customization}); | 784 | customization buffer is explained above (@pxref{Easy Customization}); |
| 776 | here we describe other aspects of Emacs variables. | 785 | here we describe other aspects of Emacs variables. |
| @@ -808,21 +817,27 @@ C-h v fill-column @key{RET} | |||
| 808 | displays something like this: | 817 | displays something like this: |
| 809 | 818 | ||
| 810 | @smallexample | 819 | @smallexample |
| 820 | fill-column is a variable defined in `C source code'. | ||
| 811 | fill-column's value is 70 | 821 | fill-column's value is 70 |
| 822 | Local in buffer custom.texi; global value is 70 | ||
| 823 | Automatically becomes buffer-local when set in any fashion. | ||
| 812 | 824 | ||
| 813 | Documentation: | 825 | Documentation: |
| 814 | *Column beyond which automatic line-wrapping should happen. | 826 | *Column beyond which automatic line-wrapping should happen. |
| 815 | Automatically becomes buffer-local when set in any fashion. | 827 | Interactively, you can set the buffer local value using C-x f. |
| 828 | |||
| 829 | You can customize this variable. | ||
| 816 | @end smallexample | 830 | @end smallexample |
| 817 | 831 | ||
| 818 | @noindent | 832 | @noindent |
| 819 | The star at the beginning of the documentation indicates that this | 833 | The line that says you can customize the variable indicates that this |
| 820 | variable is a user option. @kbd{C-h v} is not restricted to user | 834 | variable is a user option. (The star also indicates this, but it is |
| 821 | options; it allows any variable name. | 835 | an obsolete indicator that may eventually disappear.) @kbd{C-h v} is |
| 836 | not restricted to user options; it allows any variable name. | ||
| 822 | 837 | ||
| 823 | @findex set-variable | 838 | @findex set-variable |
| 824 | The most convenient way to set a specific user option variable is | 839 | The most convenient way to set a specific user option variable is with |
| 825 | with @kbd{M-x set-variable}. This reads the variable name with the | 840 | @kbd{M-x set-variable}. This reads the variable name with the |
| 826 | minibuffer (with completion), and then reads a Lisp expression for the | 841 | minibuffer (with completion), and then reads a Lisp expression for the |
| 827 | new value using the minibuffer a second time (you can insert the old | 842 | new value using the minibuffer a second time (you can insert the old |
| 828 | value into the minibuffer for editing via @kbd{M-n}). For example, | 843 | value into the minibuffer for editing via @kbd{M-n}). For example, |
| @@ -889,13 +904,11 @@ as soon as one hook function returns a non-@code{nil} value, the rest | |||
| 889 | are not called at all. The documentation of each abnormal hook variable | 904 | are not called at all. The documentation of each abnormal hook variable |
| 890 | explains in detail what is peculiar about it. | 905 | explains in detail what is peculiar about it. |
| 891 | 906 | ||
| 907 | @findex add-hook | ||
| 892 | You can set a hook variable with @code{setq} like any other Lisp | 908 | You can set a hook variable with @code{setq} like any other Lisp |
| 893 | variable, but the recommended way to add a hook function to a hook | 909 | variable, but the recommended way to add a hook function to a hook |
| 894 | (either normal or abnormal) is by calling @code{add-hook}. You can | 910 | (either normal or abnormal) is by calling @code{add-hook}. |
| 895 | specify any valid Lisp function as the hook function, provided it can | 911 | @xref{Hooks,,, elisp, The Emacs Lisp Reference Manual}. |
| 896 | handle the proper number of arguments (zero arguments, in the case of | ||
| 897 | a normal hook). Of course, not every Lisp function is @emph{useful} | ||
| 898 | in any particular hook. | ||
| 899 | 912 | ||
| 900 | For example, here's how to set up a hook to turn on Auto Fill mode | 913 | For example, here's how to set up a hook to turn on Auto Fill mode |
| 901 | when entering Text mode and other modes based on Text mode: | 914 | when entering Text mode and other modes based on Text mode: |
| @@ -936,11 +949,12 @@ they are executed does not matter. Any dependence on the order is | |||
| 936 | ``asking for trouble.'' However, the order is predictable: the most | 949 | ``asking for trouble.'' However, the order is predictable: the most |
| 937 | recently added hook functions are executed first. | 950 | recently added hook functions are executed first. |
| 938 | 951 | ||
| 952 | @findex remove-hook | ||
| 939 | If you play with adding various different versions of a hook | 953 | If you play with adding various different versions of a hook |
| 940 | function by calling @code{add-hook} over and over, remember that all | 954 | function by calling @code{add-hook} over and over, remember that all |
| 941 | the versions you added will remain in the hook variable together. You | 955 | the versions you added will remain in the hook variable together. You |
| 942 | can clear out individual functions with @code{remove-hook}, or do | 956 | can clear out individual functions by calling @code{remove-hook}, or |
| 943 | @code{(setq @var{hook-variable} nil)} to remove everything. | 957 | do @code{(setq @var{hook-variable} nil)} to remove everything. |
| 944 | 958 | ||
| 945 | @node Locals | 959 | @node Locals |
| 946 | @subsection Local Variables | 960 | @subsection Local Variables |
| @@ -963,46 +977,41 @@ buffer. Every other Emacs variable has a @dfn{global} value which is in | |||
| 963 | effect in all buffers that have not made the variable local. | 977 | effect in all buffers that have not made the variable local. |
| 964 | 978 | ||
| 965 | @findex make-local-variable | 979 | @findex make-local-variable |
| 966 | @kbd{M-x make-local-variable} reads the name of a variable and makes it | 980 | @kbd{M-x make-local-variable} reads the name of a variable and makes |
| 967 | local to the current buffer. Further changes in this buffer will not | 981 | it local to the current buffer. Changing its value subsequently in |
| 968 | affect others, and further changes in the global value will not affect this | 982 | this buffer will not affect others, and changes in its global value |
| 969 | buffer. | 983 | will not affect this buffer. |
| 970 | 984 | ||
| 971 | @findex make-variable-buffer-local | 985 | @findex make-variable-buffer-local |
| 972 | @cindex per-buffer variables | 986 | @cindex per-buffer variables |
| 973 | @kbd{M-x make-variable-buffer-local} reads the name of a variable and | 987 | @kbd{M-x make-variable-buffer-local} marks a variable so it will |
| 974 | changes the future behavior of the variable so that it will become local | 988 | become local automatically whenever it is set. More precisely, once a |
| 975 | automatically when it is set. More precisely, once a variable has been | 989 | variable has been marked in this way, the usual ways of setting the |
| 976 | marked in this way, the usual ways of setting the variable automatically | 990 | variable automatically do @code{make-local-variable} first. We call |
| 977 | do @code{make-local-variable} first. We call such variables | 991 | such variables @dfn{per-buffer} variables. Many variables in Emacs |
| 978 | @dfn{per-buffer} variables. | 992 | are normally per-buffer; the variable's document string tells you when |
| 993 | this is so. A per-buffer variable's global value is normally never | ||
| 994 | effective in any buffer, but it still has a meaning: it is the initial | ||
| 995 | value of the variable for each new buffer. | ||
| 979 | 996 | ||
| 980 | Major modes (@pxref{Major Modes}) always make variables local to the | 997 | Major modes (@pxref{Major Modes}) always make variables local to the |
| 981 | buffer before setting the variables. This is why changing major modes | 998 | buffer before setting the variables. This is why changing major modes |
| 982 | in one buffer has no effect on other buffers. Minor modes also work by | 999 | in one buffer has no effect on other buffers. Minor modes also work |
| 983 | setting variables---normally, each minor mode has one controlling | 1000 | by setting variables---normally, each minor mode has one controlling |
| 984 | variable which is non-@code{nil} when the mode is enabled (@pxref{Minor | 1001 | variable which is non-@code{nil} when the mode is enabled |
| 985 | Modes}). For most minor modes, the controlling variable is per buffer. | 1002 | (@pxref{Minor Modes}). For many minor modes, the controlling variable |
| 986 | 1003 | is per buffer, and thus always buffer-local. Otherwise, you can make | |
| 987 | Emacs contains a number of variables that are always per-buffer. | 1004 | it local in a specific buffer like any other variable. |
| 988 | These include @code{abbrev-mode}, @code{auto-fill-function}, | ||
| 989 | @code{case-fold-search}, @code{comment-column}, @code{ctl-arrow}, | ||
| 990 | @code{fill-column}, @code{fill-prefix}, @code{indent-tabs-mode}, | ||
| 991 | @code{left-margin}, @code{mode-line-format}, @code{overwrite-mode}, | ||
| 992 | @code{selective-display-ellipses}, @code{selective-display}, | ||
| 993 | @code{tab-width}, and @code{truncate-lines}. Some other variables are | ||
| 994 | always local in every buffer, but they are used for internal | ||
| 995 | purposes.@refill | ||
| 996 | 1005 | ||
| 997 | A few variables cannot be local to a buffer because they are always | 1006 | A few variables cannot be local to a buffer because they are always |
| 998 | local to each display instead (@pxref{Multiple Displays}). If you try to | 1007 | local to each display instead (@pxref{Multiple Displays}). If you try to |
| 999 | make one of these variables buffer-local, you'll get an error message. | 1008 | make one of these variables buffer-local, you'll get an error message. |
| 1000 | 1009 | ||
| 1001 | @findex kill-local-variable | 1010 | @findex kill-local-variable |
| 1002 | @kbd{M-x kill-local-variable} reads the name of a variable and makes | 1011 | @kbd{M-x kill-local-variable} makes a specified variable cease to be |
| 1003 | it cease to be local to the current buffer. The global value of the | 1012 | local to the current buffer. The global value of the variable |
| 1004 | variable henceforth is in effect in this buffer. Setting the major mode | 1013 | henceforth is in effect in this buffer. Setting the major mode kills |
| 1005 | kills all the local variables of the buffer except for a few variables | 1014 | all the local variables of the buffer except for a few variables |
| 1006 | specially marked as @dfn{permanent locals}. | 1015 | specially marked as @dfn{permanent locals}. |
| 1007 | 1016 | ||
| 1008 | @findex setq-default | 1017 | @findex setq-default |
| @@ -1082,9 +1091,9 @@ the first line as well. | |||
| 1082 | 1091 | ||
| 1083 | @cindex shell scripts, and local file variables | 1092 | @cindex shell scripts, and local file variables |
| 1084 | In shell scripts, the first line is used to identify the script | 1093 | In shell scripts, the first line is used to identify the script |
| 1085 | interpreter, so you cannot put any local variables there. To accommodate | 1094 | interpreter, so you cannot put any local variables there. To |
| 1086 | for this, when Emacs visits a shell script, it looks for local variable | 1095 | accommodate this, Emacs looks for local variable specifications in the |
| 1087 | specifications in the @emph{second} line. | 1096 | @emph{second} line when the first line specifies an interpreter. |
| 1088 | 1097 | ||
| 1089 | A @dfn{local variables list} goes near the end of the file, in the | 1098 | A @dfn{local variables list} goes near the end of the file, in the |
| 1090 | last page. (It is often best to put it on a page by itself.) The local | 1099 | last page. (It is often best to put it on a page by itself.) The local |
| @@ -1108,9 +1117,9 @@ variables list afterward. | |||
| 1108 | ;;; End: *** | 1117 | ;;; End: *** |
| 1109 | @end example | 1118 | @end example |
| 1110 | 1119 | ||
| 1111 | As you see, each line starts with the prefix @samp{;;; } and each line | 1120 | Each line starts with the prefix @samp{;;; } and each line ends with |
| 1112 | ends with the suffix @samp{ ***}. Emacs recognizes these as the prefix | 1121 | the suffix @samp{ ***}. Emacs recognizes these as the prefix and |
| 1113 | and suffix based on the first line of the list, by finding them | 1122 | suffix based on the first line of the list, by finding them |
| 1114 | surrounding the magic string @samp{Local Variables:}; then it | 1123 | surrounding the magic string @samp{Local Variables:}; then it |
| 1115 | automatically discards them from the other lines of the list. | 1124 | automatically discards them from the other lines of the list. |
| 1116 | 1125 | ||
| @@ -1155,8 +1164,7 @@ as part of their initialization. | |||
| 1155 | as the major modes; in fact, you can use it more than once, first to | 1164 | as the major modes; in fact, you can use it more than once, first to |
| 1156 | set the major mode and then to set minor modes which are specific to | 1165 | set the major mode and then to set minor modes which are specific to |
| 1157 | particular buffers. But most minor modes should not be specified in | 1166 | particular buffers. But most minor modes should not be specified in |
| 1158 | the file at all, regardless of how, because they represent user | 1167 | the file at all, because they represent user preferences. |
| 1159 | preferences. | ||
| 1160 | 1168 | ||
| 1161 | For example, you may be tempted to try to turn on Auto Fill mode with | 1169 | For example, you may be tempted to try to turn on Auto Fill mode with |
| 1162 | a local variable list. That is a mistake. The choice of Auto Fill mode | 1170 | a local variable list. That is a mistake. The choice of Auto Fill mode |
| @@ -1197,10 +1205,10 @@ answer @samp{n}. | |||
| 1197 | 1205 | ||
| 1198 | Emacs normally recognizes certain variables/value pairs as safe. | 1206 | Emacs normally recognizes certain variables/value pairs as safe. |
| 1199 | For instance, it is safe to give @code{comment-column} or | 1207 | For instance, it is safe to give @code{comment-column} or |
| 1200 | @code{fill-column} any integer value. If a file specifies only safe | 1208 | @code{fill-column} any integer value. If a file specifies only |
| 1201 | variable/value pairs, Emacs does not ask for confirmation before | 1209 | known-safe variable/value pairs, Emacs does not ask for confirmation |
| 1202 | setting them. Otherwise, you can tell Emacs to record that all the | 1210 | before setting them. Otherwise, you can tell Emacs to record all the |
| 1203 | variable/value pairs in the file are safe, by typing @kbd{!} at the | 1211 | variable/value pairs in this file as safe, by typing @kbd{!} at the |
| 1204 | confirmation prompt. When Emacs encounters these variable/value pairs | 1212 | confirmation prompt. When Emacs encounters these variable/value pairs |
| 1205 | subsequently, in the same file or others, it will assume they are | 1213 | subsequently, in the same file or others, it will assume they are |
| 1206 | safe. | 1214 | safe. |
| @@ -1232,9 +1240,10 @@ is neither @code{t} nor @code{nil}, so normally Emacs does ask for | |||
| 1232 | confirmation about processes @code{eval} variables. | 1240 | confirmation about processes @code{eval} variables. |
| 1233 | 1241 | ||
| 1234 | @vindex safe-local-eval-forms | 1242 | @vindex safe-local-eval-forms |
| 1235 | The @code{safe-local-eval-forms} is a customizable list of eval | 1243 | But there is an exception. The @code{safe-local-eval-forms} is a |
| 1236 | forms which are safe to eval, so Emacs should not ask for | 1244 | customizable list of eval forms which are safe. Emacs does not ask |
| 1237 | confirmation to evaluate these forms. | 1245 | for confirmation when it finds these forms for the @code{eval} |
| 1246 | variable. | ||
| 1238 | 1247 | ||
| 1239 | @node Key Bindings | 1248 | @node Key Bindings |
| 1240 | @section Customizing Key Bindings | 1249 | @section Customizing Key Bindings |
| @@ -1246,7 +1255,7 @@ to customize key bindings. | |||
| 1246 | 1255 | ||
| 1247 | Recall that a command is a Lisp function whose definition provides for | 1256 | Recall that a command is a Lisp function whose definition provides for |
| 1248 | interactive use. Like every Lisp function, a command has a function | 1257 | interactive use. Like every Lisp function, a command has a function |
| 1249 | name which usually consists of lower-case letters and hyphens. | 1258 | name, which usually consists of lower-case letters and hyphens. |
| 1250 | 1259 | ||
| 1251 | @menu | 1260 | @menu |
| 1252 | * Keymaps:: Generalities. The global keymap. | 1261 | * Keymaps:: Generalities. The global keymap. |
| @@ -1405,19 +1414,6 @@ mode. | |||
| 1405 | in effect, the definitions in its keymap override both the major | 1414 | in effect, the definitions in its keymap override both the major |
| 1406 | mode's local keymap and the global keymap. | 1415 | mode's local keymap and the global keymap. |
| 1407 | 1416 | ||
| 1408 | @vindex c-mode-map | ||
| 1409 | @vindex lisp-mode-map | ||
| 1410 | The local keymaps for Lisp mode and several other major modes always | ||
| 1411 | exist even when not in use. These are kept in variables named | ||
| 1412 | @code{lisp-mode-map} and so on. For major modes less often used, the | ||
| 1413 | local keymap is normally constructed only when the mode is used for the | ||
| 1414 | first time in a session. This is to save space. If you wish to change | ||
| 1415 | one of these keymaps, you must use the major mode's @dfn{mode | ||
| 1416 | hook}---see below. | ||
| 1417 | |||
| 1418 | All minor mode keymaps are created in advance. There is no way to | ||
| 1419 | defer their creation until the first time the minor mode is enabled. | ||
| 1420 | |||
| 1421 | A local keymap can locally redefine a key as a prefix key by defining | 1417 | A local keymap can locally redefine a key as a prefix key by defining |
| 1422 | it as a prefix keymap. If the key is also defined globally as a prefix, | 1418 | it as a prefix keymap. If the key is also defined globally as a prefix, |
| 1423 | then its local and global definitions (both keymaps) effectively | 1419 | then its local and global definitions (both keymaps) effectively |
| @@ -1433,17 +1429,16 @@ sequence by looking in several keymaps, one by one, for a binding of the | |||
| 1433 | whole key sequence. First it checks the minor mode keymaps for minor | 1429 | whole key sequence. First it checks the minor mode keymaps for minor |
| 1434 | modes that are enabled, then it checks the major mode's keymap, and then | 1430 | modes that are enabled, then it checks the major mode's keymap, and then |
| 1435 | it checks the global keymap. This is not precisely how key lookup | 1431 | it checks the global keymap. This is not precisely how key lookup |
| 1436 | works, but it's good enough for understanding ordinary circumstances. | 1432 | works, but it's good enough for understanding the results in ordinary |
| 1433 | circumstances. | ||
| 1437 | 1434 | ||
| 1438 | @cindex rebinding major mode keys | 1435 | @cindex rebinding major mode keys |
| 1439 | @findex define-key | 1436 | Most major modes construct their keymaps when the mode is used for |
| 1440 | To change the local bindings of a major mode, you must change the | 1437 | the first time in a session. If you wish to change one of these |
| 1441 | mode's local keymap. Normally you must wait until the first time the | 1438 | keymaps, you must use the major mode's @dfn{mode hook} |
| 1442 | mode is used, because most major modes don't create their keymaps until | 1439 | (@pxref{Hooks}). |
| 1443 | then. If you want to specify something in your @file{~/.emacs} file to | ||
| 1444 | change a major mode's bindings, you must use the mode's mode hook to | ||
| 1445 | delay the change until the mode is first used. | ||
| 1446 | 1440 | ||
| 1441 | @findex define-key | ||
| 1447 | For example, the command @code{texinfo-mode} to select Texinfo mode | 1442 | For example, the command @code{texinfo-mode} to select Texinfo mode |
| 1448 | runs the hook @code{texinfo-mode-hook}. Here's how you can use the hook | 1443 | runs the hook @code{texinfo-mode-hook}. Here's how you can use the hook |
| 1449 | to add local bindings (not very useful, we admit) for @kbd{C-c n} and | 1444 | to add local bindings (not very useful, we admit) for @kbd{C-c n} and |
| @@ -1458,8 +1453,6 @@ to add local bindings (not very useful, we admit) for @kbd{C-c n} and | |||
| 1458 | 'forward-paragraph))) | 1453 | 'forward-paragraph))) |
| 1459 | @end example | 1454 | @end example |
| 1460 | 1455 | ||
| 1461 | @xref{Hooks}. | ||
| 1462 | |||
| 1463 | @node Minibuffer Maps | 1456 | @node Minibuffer Maps |
| 1464 | @subsection Minibuffer Keymaps | 1457 | @subsection Minibuffer Keymaps |
| 1465 | 1458 | ||
| @@ -1545,10 +1538,10 @@ key to rebind. | |||
| 1545 | You can rebind a key that contains more than one event in the same | 1538 | You can rebind a key that contains more than one event in the same |
| 1546 | way. Emacs keeps reading the key to rebind until it is a complete key | 1539 | way. Emacs keeps reading the key to rebind until it is a complete key |
| 1547 | (that is, not a prefix key). Thus, if you type @kbd{C-f} for | 1540 | (that is, not a prefix key). Thus, if you type @kbd{C-f} for |
| 1548 | @var{key}, that's the end; the minibuffer is entered immediately to | 1541 | @var{key}, that's the end; it enters the minibuffer immediately to |
| 1549 | read @var{cmd}. But if you type @kbd{C-x}, another character is read; | 1542 | read @var{cmd}. But if you type @kbd{C-x}, since that's a prefix, it |
| 1550 | if that is @kbd{4}, another character is read, and so on. For | 1543 | reads another character; if that is @kbd{4}, another prefix character, |
| 1551 | example, | 1544 | it reads one more character, and so on. For example, |
| 1552 | 1545 | ||
| 1553 | @example | 1546 | @example |
| 1554 | M-x global-set-key @key{RET} C-x 4 $ spell-other-window @key{RET} | 1547 | M-x global-set-key @key{RET} C-x 4 $ spell-other-window @key{RET} |
| @@ -1572,9 +1565,9 @@ definition (or lack of one) come back into effect in that major mode. | |||
| 1572 | If you have redefined (or undefined) a key and you subsequently wish | 1565 | If you have redefined (or undefined) a key and you subsequently wish |
| 1573 | to retract the change, undefining the key will not do the job---you need | 1566 | to retract the change, undefining the key will not do the job---you need |
| 1574 | to redefine the key with its standard definition. To find the name of | 1567 | to redefine the key with its standard definition. To find the name of |
| 1575 | the standard definition of a key, go to a Fundamental mode buffer and | 1568 | the standard definition of a key, go to a Fundamental mode buffer in a |
| 1576 | use @kbd{C-h c}. The documentation of keys in this manual also lists | 1569 | fresh Emacs and use @kbd{C-h c}. The documentation of keys in this |
| 1577 | their command names. | 1570 | manual also lists their command names. |
| 1578 | 1571 | ||
| 1579 | If you want to prevent yourself from invoking a command by mistake, it | 1572 | If you want to prevent yourself from invoking a command by mistake, it |
| 1580 | is better to disable the command than to undefine the key. A disabled | 1573 | is better to disable the command than to undefine the key. A disabled |
| @@ -1669,8 +1662,8 @@ rewrite the first six examples above to use vectors: | |||
| 1669 | 1662 | ||
| 1670 | @noindent | 1663 | @noindent |
| 1671 | As you see, you represent a multi-character key sequence with a vector | 1664 | As you see, you represent a multi-character key sequence with a vector |
| 1672 | by listing all of the characters in order within the square brackets that | 1665 | by listing all of the characters, in order, within the square brackets |
| 1673 | delimit the vector. | 1666 | that delimit the vector. |
| 1674 | 1667 | ||
| 1675 | Language and coding systems can cause problems with key bindings | 1668 | Language and coding systems can cause problems with key bindings |
| 1676 | for non-@acronym{ASCII} characters. @xref{Non-ASCII Rebinding}. | 1669 | for non-@acronym{ASCII} characters. @xref{Non-ASCII Rebinding}. |
| @@ -1819,10 +1812,10 @@ because the terminal sends the same character in both cases. | |||
| 1819 | @cindex rebinding non-@acronym{ASCII} keys | 1812 | @cindex rebinding non-@acronym{ASCII} keys |
| 1820 | @cindex non-@acronym{ASCII} keys, binding | 1813 | @cindex non-@acronym{ASCII} keys, binding |
| 1821 | 1814 | ||
| 1822 | If your keyboard has keys that send non-@acronym{ASCII} | 1815 | If your keyboard has keys that send non-@acronym{ASCII} |
| 1823 | characters, such as accented letters, rebinding these keys | 1816 | characters, such as accented letters, rebinding these keys |
| 1824 | must be done by using a vector like this@footnote{Note that | 1817 | must be done by using a vector like this@footnote{You must |
| 1825 | you should avoid the string syntax for binding | 1818 | avoid the string syntax for binding |
| 1826 | non-@acronym{ASCII} characters, since they will be | 1819 | non-@acronym{ASCII} characters, since they will be |
| 1827 | interpreted as meta keys. @xref{Strings of Events,,,elisp, | 1820 | interpreted as meta keys. @xref{Strings of Events,,,elisp, |
| 1828 | The Emacs Lisp Reference Manual}.}: | 1821 | The Emacs Lisp Reference Manual}.}: |
| @@ -1834,11 +1827,11 @@ The Emacs Lisp Reference Manual}.}: | |||
| 1834 | @noindent | 1827 | @noindent |
| 1835 | Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}. | 1828 | Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}. |
| 1836 | 1829 | ||
| 1837 | Since this puts a non-@acronym{ASCII} character in the @file{.emacs}, | 1830 | Since this puts a non-@acronym{ASCII} character in the @file{.emacs}, |
| 1838 | you should specify a coding system for that file that supports the | 1831 | you should specify a coding system for that file that supports the |
| 1839 | character in question. @xref{Init Syntax}. | 1832 | character in question. @xref{Init Non-ASCII}. |
| 1840 | 1833 | ||
| 1841 | @strong{Warning:} if you change the keyboard encoding, or change | 1834 | @strong{Warning:} if you change the keyboard encoding, or change |
| 1842 | between multibyte and unibyte mode, or anything that would alter which | 1835 | between multibyte and unibyte mode, or anything that would alter which |
| 1843 | code @kbd{C-q} would insert for that character, you'll need to edit | 1836 | code @kbd{C-q} would insert for that character, you'll need to edit |
| 1844 | the Lisp expression accordingly, to use the character code generated | 1837 | the Lisp expression accordingly, to use the character code generated |
| @@ -1980,19 +1973,19 @@ usual to do so. | |||
| 1980 | @subsection Disabling Commands | 1973 | @subsection Disabling Commands |
| 1981 | @cindex disabled command | 1974 | @cindex disabled command |
| 1982 | 1975 | ||
| 1983 | Disabling a command marks the command as requiring confirmation before it | 1976 | Disabling a command menas it requires confirmation before it can be |
| 1984 | can be executed. The purpose of disabling a command is to prevent | 1977 | executed. The purpose of disabling a command is to prevent users from |
| 1985 | beginning users from executing it by accident and being confused. | 1978 | executing it by accident and being confused. |
| 1986 | 1979 | ||
| 1987 | An attempt to invoke a disabled command interactively in Emacs | 1980 | An attempt to invoke a disabled command interactively in Emacs |
| 1988 | displays a window containing the command's name, its documentation, and | 1981 | displays a window containing the command's name, its documentation, |
| 1989 | some instructions on what to do immediately; then Emacs asks for input | 1982 | and some instructions on what to do immediately; then Emacs asks for |
| 1990 | saying whether to execute the command as requested, enable it and | 1983 | input saying whether to execute the command as requested, enable it |
| 1991 | execute it, or cancel. If you decide to enable the command, you are | 1984 | and execute it, or cancel. If you decide to enable the command, you |
| 1992 | asked whether to do this permanently or just for the current session. | 1985 | must then answer another question---whether to do this permanently, or |
| 1993 | (Enabling permanently works by automatically editing your @file{.emacs} | 1986 | just for the current session. (Enabling permanently works by |
| 1994 | file.) You can also type @kbd{!} to enable @emph{all} commands, | 1987 | automatically editing your @file{.emacs} file.) You can also type |
| 1995 | for the current session only. | 1988 | @kbd{!} to enable @emph{all} commands, for the current session only. |
| 1996 | 1989 | ||
| 1997 | The direct mechanism for disabling a command is to put a | 1990 | The direct mechanism for disabling a command is to put a |
| 1998 | non-@code{nil} @code{disabled} property on the Lisp symbol for the | 1991 | non-@code{nil} @code{disabled} property on the Lisp symbol for the |
| @@ -2013,15 +2006,14 @@ is included in the message displayed when the command is used: | |||
| 2013 | @findex disable-command | 2006 | @findex disable-command |
| 2014 | @findex enable-command | 2007 | @findex enable-command |
| 2015 | You can make a command disabled either by editing the @file{.emacs} | 2008 | You can make a command disabled either by editing the @file{.emacs} |
| 2016 | file directly or with the command @kbd{M-x disable-command}, which edits | 2009 | file directly, or with the command @kbd{M-x disable-command}, which edits |
| 2017 | the @file{.emacs} file for you. Likewise, @kbd{M-x enable-command} | 2010 | the @file{.emacs} file for you. Likewise, @kbd{M-x enable-command} |
| 2018 | edits @file{.emacs} to enable a command permanently. @xref{Init File}. | 2011 | edits @file{.emacs} to enable a command permanently. @xref{Init File}. |
| 2019 | 2012 | ||
| 2020 | If Emacs was invoked with the @option{-q} or @option{--no-init-file} | 2013 | If Emacs was invoked with the @option{-q} or @option{--no-init-file} |
| 2021 | options (@pxref{Initial Options}), it will not edit your | 2014 | options (@pxref{Initial Options}), it will not edit your |
| 2022 | @file{~/.emacs} init file. This is because editing the init file from | 2015 | @file{~/.emacs} init file. Doing so could lose information |
| 2023 | such a session might overwrite the lines you might have on your init | 2016 | because Emacs has not read your init file. |
| 2024 | file which enable and disable commands. | ||
| 2025 | 2017 | ||
| 2026 | Whether a command is disabled is independent of what key is used to | 2018 | Whether a command is disabled is independent of what key is used to |
| 2027 | invoke it; disabling also applies if the command is invoked using | 2019 | invoke it; disabling also applies if the command is invoked using |
| @@ -2040,7 +2032,7 @@ one of fifteen-odd @dfn{syntax classes}. In some cases it specifies | |||
| 2040 | some additional information also. | 2032 | some additional information also. |
| 2041 | 2033 | ||
| 2042 | Each major mode has its own syntax table (though related major modes | 2034 | Each major mode has its own syntax table (though related major modes |
| 2043 | sometimes share one syntax table) which it installs in each buffer | 2035 | sometimes share one syntax table), which it installs in each buffer |
| 2044 | that uses the mode. The syntax table installed in the current buffer | 2036 | that uses the mode. The syntax table installed in the current buffer |
| 2045 | is the one that all commands use, so we call it ``the'' syntax table. | 2037 | is the one that all commands use, so we call it ``the'' syntax table. |
| 2046 | 2038 | ||
| @@ -2048,7 +2040,7 @@ is the one that all commands use, so we call it ``the'' syntax table. | |||
| 2048 | @findex describe-syntax | 2040 | @findex describe-syntax |
| 2049 | To display a description of the contents of the current syntax | 2041 | To display a description of the contents of the current syntax |
| 2050 | table, type @kbd{C-h s} (@code{describe-syntax}). The description of | 2042 | table, type @kbd{C-h s} (@code{describe-syntax}). The description of |
| 2051 | each character includes both the string you would have to give to | 2043 | each character includes the string you would have to give to |
| 2052 | @code{modify-syntax-entry} to set up that character's current syntax, | 2044 | @code{modify-syntax-entry} to set up that character's current syntax, |
| 2053 | starting with the character which designates its syntax class, plus | 2045 | starting with the character which designates its syntax class, plus |
| 2054 | some English text to explain its meaning. | 2046 | some English text to explain its meaning. |
| @@ -2176,7 +2168,8 @@ a Meta character, as in @samp{\M-a} for @kbd{Meta-A} or @samp{\M-\C-a} for | |||
| 2176 | 2168 | ||
| 2177 | @cindex international characters in @file{.emacs} | 2169 | @cindex international characters in @file{.emacs} |
| 2178 | @cindex non-@acronym{ASCII} characters in @file{.emacs} | 2170 | @cindex non-@acronym{ASCII} characters in @file{.emacs} |
| 2179 | If you want to include non-@acronym{ASCII} characters in strings in your init | 2171 | @anchor{Init Non-ASCII}If you want to include non-@acronym{ASCII} |
| 2172 | characters in strings in your init | ||
| 2180 | file, you should consider putting a @w{@samp{-*-coding: | 2173 | file, you should consider putting a @w{@samp{-*-coding: |
| 2181 | @var{coding-system}-*-}} tag on the first line which states the coding | 2174 | @var{coding-system}-*-}} tag on the first line which states the coding |
| 2182 | system used to save your @file{.emacs}, as explained in @ref{Recognize | 2175 | system used to save your @file{.emacs}, as explained in @ref{Recognize |
| @@ -2241,7 +2234,7 @@ is not what you probably want to do in an init file. | |||
| 2241 | Specify your own email address, if Emacs can't figure it out correctly. | 2234 | Specify your own email address, if Emacs can't figure it out correctly. |
| 2242 | 2235 | ||
| 2243 | @example | 2236 | @example |
| 2244 | (setq user-mail-address "coon@@yoyodyne.com") | 2237 | (setq user-mail-address "rumsfeld@@torture.gov") |
| 2245 | @end example | 2238 | @end example |
| 2246 | 2239 | ||
| 2247 | Various Emacs packages that need your own email address use the value of | 2240 | Various Emacs packages that need your own email address use the value of |