diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 51 | ||||
| -rw-r--r-- | doc/emacs/Makefile.in | 2 | ||||
| -rw-r--r-- | doc/emacs/ack.texi | 18 | ||||
| -rw-r--r-- | doc/emacs/cmdargs.texi | 9 | ||||
| -rw-r--r-- | doc/emacs/custom.texi | 183 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 53 | ||||
| -rw-r--r-- | doc/emacs/frames.texi | 181 | ||||
| -rw-r--r-- | doc/emacs/glossary.texi | 5 | ||||
| -rw-r--r-- | doc/emacs/help.texi | 10 | ||||
| -rw-r--r-- | doc/emacs/indent.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/killing.texi | 339 | ||||
| -rw-r--r-- | doc/emacs/major.texi | 237 | ||||
| -rw-r--r-- | doc/emacs/makefile.w32-in | 2 | ||||
| -rw-r--r-- | doc/emacs/misc.texi | 4 | ||||
| -rw-r--r-- | doc/emacs/modes.texi | 410 | ||||
| -rw-r--r-- | doc/emacs/mule.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/programs.texi | 5 | ||||
| -rw-r--r-- | doc/emacs/screen.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/search.texi | 13 | ||||
| -rw-r--r-- | doc/emacs/text.texi | 95 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 8 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 9 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 15 |
23 files changed, 814 insertions, 841 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 87d1211587f..ae732a7db0f 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,54 @@ | |||
| 1 | 2011-07-11 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * killing.texi (Killing, Deletion and Killing, Killing by Lines) | ||
| 4 | (Other Kill Commands, Kill Options): Copyedits. | ||
| 5 | (Deletion and Killing, Kill Ring): Kill/yank now use clipboard. | ||
| 6 | (Yanking): Move yank-excluded properties discussion here. | ||
| 7 | (Cut and Paste): Move from frames.texi. Update subnodes to | ||
| 8 | describe x-select-enable-clipboard case. | ||
| 9 | |||
| 10 | * frames.texi: Move Cut and Paste node and subnodes into | ||
| 11 | killing.texi, except Mouse Commands and Word and Line Mouse. | ||
| 12 | |||
| 13 | 2011-07-10 Andy Moreton <andrewjmoreton@gmail.com> (tiny change) | ||
| 14 | |||
| 15 | * makefile.w32-in (EMACSSOURCES): Replace major.texi with modes.texi. | ||
| 16 | |||
| 17 | 2011-07-10 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 18 | |||
| 19 | * screen.texi (Mode Line): Clarify that coding systems are | ||
| 20 | characters, not letters (bug#1749). | ||
| 21 | |||
| 22 | * cmdargs.texi (Environment): Mention removing variables | ||
| 23 | (bug#1615). Text suggested by Kevin Rodgers. | ||
| 24 | |||
| 25 | 2011-07-10 Chong Yidong <cyd@stupidchicken.com> | ||
| 26 | |||
| 27 | * misc.texi (Amusements): Don't mention Yow; it's crippled. | ||
| 28 | |||
| 29 | * modes.texi: Rename from major.texi. | ||
| 30 | (Modes): New node. Make Major Modes and Minor Modes subsections | ||
| 31 | of this. All callers changed. | ||
| 32 | |||
| 33 | * custom.texi (Minor Modes): Move to modes.texi. | ||
| 34 | |||
| 35 | 2011-07-10 Chong Yidong <cyd@stupidchicken.com> | ||
| 36 | |||
| 37 | * custom.texi (Syntax): Node deleted. | ||
| 38 | |||
| 39 | * help.texi (Help Summary): | ||
| 40 | * major.texi (Major Modes): | ||
| 41 | * programs.texi (Parentheses): | ||
| 42 | * search.texi (Regexp Backslash, Regexp Backslash) | ||
| 43 | (Regexp Backslash): | ||
| 44 | * text.texi (Words): Callers changed. | ||
| 45 | |||
| 46 | * text.texi (Refill, Longlines): Delete nodes. | ||
| 47 | |||
| 48 | * ack.texi (Acknowledgments): Longlines removed from manual. | ||
| 49 | |||
| 50 | * emacs.texi (Top): Update node listing. | ||
| 51 | |||
| 1 | 2011-07-09 Glenn Morris <rgm@gnu.org> | 52 | 2011-07-09 Glenn Morris <rgm@gnu.org> |
| 2 | 53 | ||
| 3 | * fortran-xtra.texi (Fortran): Update handled extensions. | 54 | * fortran-xtra.texi (Fortran): Update handled extensions. |
diff --git a/doc/emacs/Makefile.in b/doc/emacs/Makefile.in index aca17ce817d..9465c726eba 100644 --- a/doc/emacs/Makefile.in +++ b/doc/emacs/Makefile.in | |||
| @@ -84,7 +84,7 @@ EMACSSOURCES= \ | |||
| 84 | ${srcdir}/windows.texi \ | 84 | ${srcdir}/windows.texi \ |
| 85 | ${srcdir}/frames.texi \ | 85 | ${srcdir}/frames.texi \ |
| 86 | ${srcdir}/mule.texi \ | 86 | ${srcdir}/mule.texi \ |
| 87 | ${srcdir}/major.texi \ | 87 | ${srcdir}/modes.texi \ |
| 88 | ${srcdir}/indent.texi \ | 88 | ${srcdir}/indent.texi \ |
| 89 | ${srcdir}/text.texi \ | 89 | ${srcdir}/text.texi \ |
| 90 | ${srcdir}/programs.texi \ | 90 | ${srcdir}/programs.texi \ |
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi index e554c71703f..1cfb3d9ffe9 100644 --- a/doc/emacs/ack.texi +++ b/doc/emacs/ack.texi | |||
| @@ -190,9 +190,7 @@ prior to Emacs 23 for Mac OS. | |||
| 190 | 190 | ||
| 191 | @item | 191 | @item |
| 192 | Chong Yidong was the Emacs co-maintainer for Emacs 23. He made many | 192 | Chong Yidong was the Emacs co-maintainer for Emacs 23. He made many |
| 193 | improvements to the Emacs display engine; and, together with Kai | 193 | improvements to the Emacs display engine. |
| 194 | Großjohann and Alex Schroeder, wrote @file{longlines.el}, a minor | ||
| 195 | mode for wrapping long lines. | ||
| 196 | 194 | ||
| 197 | @item | 195 | @item |
| 198 | James Clark wrote SGML mode, a mode for editing SGML documents; and | 196 | James Clark wrote SGML mode, a mode for editing SGML documents; and |
| @@ -689,14 +687,12 @@ the current window on which point is; @file{cap-words.el}, a minor mode | |||
| 689 | for motion in ``CapitalizedWordIdentifiers''; @file{latin1-disp.el}, a | 687 | for motion in ``CapitalizedWordIdentifiers''; @file{latin1-disp.el}, a |
| 690 | package that lets you display ISO 8859 characters on Latin-1 terminals | 688 | package that lets you display ISO 8859 characters on Latin-1 terminals |
| 691 | by setting up appropriate display tables; @file{python.el}, a major mode | 689 | by setting up appropriate display tables; @file{python.el}, a major mode |
| 692 | for the Python programming language; @file{refill.el}, a mode for | 690 | for the Python programming language; @file{smiley.el}, a facility for |
| 693 | automatic paragraph refilling, akin to typical word processors; | 691 | displaying smiley faces; @file{sym-comp.el}, a library for performing |
| 694 | @file{smiley.el}, a facility for displaying smiley faces; | 692 | mode-dependent symbol completion; @file{benchmark.el} for timing code |
| 695 | @file{sym-comp.el}, a library for performing mode-dependent symbol | 693 | execution; and @file{tool-bar.el}, a mode to control the display of |
| 696 | completion; @file{benchmark.el} for timing code execution; and | 694 | the Emacs tool bar. With Riccardo Murri he wrote @file{vc-bzr.el}, |
| 697 | @file{tool-bar.el}, a mode to control the display of the Emacs tool bar. | 695 | support for the Bazaar version control system. |
| 698 | With Riccardo Murri he wrote @file{vc-bzr.el}, support for the Bazaar | ||
| 699 | version control system. | ||
| 700 | 696 | ||
| 701 | @item | 697 | @item |
| 702 | Eric Ludlam wrote the Speedbar package; @file{checkdoc.el}, for checking | 698 | Eric Ludlam wrote the Speedbar package; @file{checkdoc.el}, for checking |
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 1c3b85559d2..af493ade2f2 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi | |||
| @@ -427,10 +427,11 @@ software) inherit the environment from Emacs, too. | |||
| 427 | @vindex initial-environment | 427 | @vindex initial-environment |
| 428 | Inside Emacs, the command @kbd{M-x getenv} gets the value of an | 428 | Inside Emacs, the command @kbd{M-x getenv} gets the value of an |
| 429 | environment variable. @kbd{M-x setenv} sets a variable in the Emacs | 429 | environment variable. @kbd{M-x setenv} sets a variable in the Emacs |
| 430 | environment. (Environment variable substitutions with @samp{$} work | 430 | environment, and @kbd{C-u M-x setenv} removes a variable. |
| 431 | in the value just as in file names; see @ref{File Names with $}.) The | 431 | (Environment variable substitutions with @samp{$} work in the value |
| 432 | variable @code{initial-environment} stores the initial environment | 432 | just as in file names; see @ref{File Names with $}.) The variable |
| 433 | inherited by Emacs. | 433 | @code{initial-environment} stores the initial environment inherited by |
| 434 | Emacs. | ||
| 434 | 435 | ||
| 435 | The way to set environment variables outside of Emacs depends on the | 436 | The way to set environment variables outside of Emacs depends on the |
| 436 | operating system, and especially the shell that you are using. For | 437 | operating system, and especially the shell that you are using. For |
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 434c574ac42..8465dd93519 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi | |||
| @@ -23,169 +23,16 @@ Reference Manual}. | |||
| 23 | @end ifnottex | 23 | @end ifnottex |
| 24 | 24 | ||
| 25 | @menu | 25 | @menu |
| 26 | * Minor Modes:: Each minor mode is a feature you can turn on | ||
| 27 | independently of any others. | ||
| 28 | * Easy Customization:: Convenient way to browse and change settings. | 26 | * Easy Customization:: Convenient way to browse and change settings. |
| 29 | * Variables:: Many Emacs commands examine Emacs variables | 27 | * Variables:: Many Emacs commands examine Emacs variables |
| 30 | to decide what to do; by setting variables, | 28 | to decide what to do; by setting variables, |
| 31 | you can control their functioning. | 29 | you can control their functioning. |
| 32 | * Key Bindings:: The keymaps say what command each key runs. | 30 | * Key Bindings:: The keymaps say what command each key runs. |
| 33 | By changing them, you can "redefine keys". | 31 | By changing them, you can "redefine keys". |
| 34 | * Syntax:: The syntax table controls how words and | ||
| 35 | expressions are parsed. | ||
| 36 | * Init File:: How to write common customizations in the | 32 | * Init File:: How to write common customizations in the |
| 37 | @file{.emacs} file. | 33 | @file{.emacs} file. |
| 38 | @end menu | 34 | @end menu |
| 39 | 35 | ||
| 40 | @node Minor Modes | ||
| 41 | @section Minor Modes | ||
| 42 | @cindex minor modes | ||
| 43 | @cindex mode, minor | ||
| 44 | |||
| 45 | Minor modes are optional features which you can turn on or off. For | ||
| 46 | example, Auto Fill mode is a minor mode in which @key{SPC} breaks | ||
| 47 | lines between words as you type. Minor modes are independent of one | ||
| 48 | another and of the selected major mode. Most minor modes say in the | ||
| 49 | mode line when they are enabled; for example, @samp{Fill} in the mode | ||
| 50 | line means that Auto Fill mode is enabled. | ||
| 51 | |||
| 52 | Each minor mode is associated with a command, called the @dfn{mode | ||
| 53 | command}, which turns it on or off. The name of this command consists | ||
| 54 | of the name of the minor mode, followed by @samp{-mode}; for instance, | ||
| 55 | the mode command for Auto Fill mode is @code{auto-fill-mode}. Calling | ||
| 56 | the minor mode command with no prefix argument @dfn{toggles} the mode, | ||
| 57 | turning it on if it was off, and off if it was on. A positive | ||
| 58 | argument always turns the mode on, and a zero or negative argument | ||
| 59 | always turns it off. Mode commands are usually invoked with | ||
| 60 | @kbd{M-x}, but you can bind keys to them if you wish (@pxref{Key | ||
| 61 | Bindings}). | ||
| 62 | |||
| 63 | Most minor modes also have a @dfn{mode variable}, with the same name | ||
| 64 | as the mode command. Its value is non-@code{nil} if the mode is | ||
| 65 | enabled, and @code{nil} if it is disabled. In some minor modes---but | ||
| 66 | not all---the value of the variable alone determines whether the mode | ||
| 67 | is active: the mode command works simply by setting the variable, and | ||
| 68 | changing the value of the variable has the same effect as calling the | ||
| 69 | mode command. Because not all minor modes work this way, we recommend | ||
| 70 | that you avoid changing the mode variables directly; use the mode | ||
| 71 | commands instead. | ||
| 72 | |||
| 73 | Some minor modes are @dfn{buffer-local}: they apply only to the | ||
| 74 | current buffer, so you can enable the mode in certain buffers and not | ||
| 75 | others. Other minor modes are @dfn{global}: while enabled, they | ||
| 76 | affect everything you do in the Emacs session, in all buffers. Some | ||
| 77 | global minor modes are enabled by default. | ||
| 78 | |||
| 79 | The following is a list of some buffer-local minor modes: | ||
| 80 | |||
| 81 | @itemize @bullet | ||
| 82 | @item | ||
| 83 | Abbrev mode automatically expands text based on pre-defined | ||
| 84 | abbreviation definitions. @xref{Abbrevs}. | ||
| 85 | |||
| 86 | @item | ||
| 87 | Auto Fill mode inserts newlines as you type to prevent lines from | ||
| 88 | becoming too long. @xref{Filling}. | ||
| 89 | |||
| 90 | @item | ||
| 91 | Auto Save mode saves the buffer contents periodically to reduce the | ||
| 92 | amount of work you can lose in case of a crash. @xref{Auto Save}. | ||
| 93 | |||
| 94 | @item | ||
| 95 | Enriched mode enables editing and saving of formatted text. | ||
| 96 | @xref{Formatted Text}. | ||
| 97 | |||
| 98 | @item | ||
| 99 | Flyspell mode automatically highlights misspelled words. | ||
| 100 | @xref{Spelling}. | ||
| 101 | |||
| 102 | @item | ||
| 103 | Font-Lock mode automatically highlights certain textual units found in | ||
| 104 | programs. It is enabled globally by default, but you can disable it | ||
| 105 | in individual buffers. @xref{Faces}. | ||
| 106 | |||
| 107 | @findex linum-mode | ||
| 108 | @cindex Linum mode | ||
| 109 | @item | ||
| 110 | Linum mode displays each line's line number in the window's left | ||
| 111 | margin. Its mode command is @code{linum-mode}. | ||
| 112 | |||
| 113 | @item | ||
| 114 | Outline minor mode provides similar facilities to the major mode | ||
| 115 | called Outline mode. @xref{Outline Mode}. | ||
| 116 | |||
| 117 | @cindex Overwrite mode | ||
| 118 | @cindex mode, Overwrite | ||
| 119 | @findex overwrite-mode | ||
| 120 | @kindex INSERT | ||
| 121 | @item | ||
| 122 | Overwrite mode causes ordinary printing characters to replace existing | ||
| 123 | text instead of shoving it to the right. For example, if point is in | ||
| 124 | front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing | ||
| 125 | a @kbd{G} changes it to @samp{FOOGAR}, instead of producing | ||
| 126 | @samp{FOOGBAR} as usual. In Overwrite mode, the command @kbd{C-q} | ||
| 127 | inserts the next character whatever it may be, even if it is a | ||
| 128 | digit---this gives you a way to insert a character instead of | ||
| 129 | replacing an existing character. The mode command, | ||
| 130 | @code{overwrite-mode}, is bound to the @key{Insert} key. | ||
| 131 | |||
| 132 | @findex binary-overwrite-mode | ||
| 133 | @item | ||
| 134 | Binary Overwrite mode is a variant of Overwrite mode for editing | ||
| 135 | binary files; it treats newlines and tabs like other characters, so | ||
| 136 | that they overwrite other characters and can be overwritten by them. | ||
| 137 | In Binary Overwrite mode, digits after @kbd{C-q} specify an octal | ||
| 138 | character code, as usual. | ||
| 139 | |||
| 140 | @item | ||
| 141 | Visual Line mode performs ``word wrapping'', causing long lines to be | ||
| 142 | wrapped at word boundaries. @xref{Visual Line Mode}. | ||
| 143 | @end itemize | ||
| 144 | |||
| 145 | Here are some useful global minor modes. Since Line Number mode and | ||
| 146 | Transient Mark mode can be enabled or disabled just by setting the | ||
| 147 | value of the minor mode variable, you @emph{can} set them differently | ||
| 148 | for particular buffers, by explicitly making the corresponding | ||
| 149 | variable local in those buffers. @xref{Locals}. | ||
| 150 | |||
| 151 | @itemize @bullet | ||
| 152 | @item | ||
| 153 | Column Number mode enables display of the current column number in the | ||
| 154 | mode line. @xref{Mode Line}. | ||
| 155 | |||
| 156 | @item | ||
| 157 | Delete Selection mode causes text insertion to first delete the text | ||
| 158 | in the region, if the region is active. @xref{Using Region}. | ||
| 159 | |||
| 160 | @item | ||
| 161 | Icomplete mode displays an indication of available completions when | ||
| 162 | you are in the minibuffer and completion is active. @xref{Completion | ||
| 163 | Options}. | ||
| 164 | |||
| 165 | @item | ||
| 166 | Line Number mode enables display of the current line number in the | ||
| 167 | mode line. It is enabled by default. @xref{Mode Line}. | ||
| 168 | |||
| 169 | @item | ||
| 170 | Menu Bar mode gives each frame a menu bar. It is enabled by default. | ||
| 171 | @xref{Menu Bars}. | ||
| 172 | |||
| 173 | @item | ||
| 174 | Scroll Bar mode gives each window a scroll bar. It is enabled by | ||
| 175 | default, but the scroll bar is only displayed on graphical terminals. | ||
| 176 | @xref{Scroll Bars}. | ||
| 177 | |||
| 178 | @item | ||
| 179 | Tool Bar mode gives each frame a tool bar. It is enabled by default, | ||
| 180 | but the tool bar is only displayed on graphical terminals. @xref{Tool | ||
| 181 | Bars}. | ||
| 182 | |||
| 183 | @item | ||
| 184 | Transient Mark mode highlights the region, and makes many Emacs | ||
| 185 | commands operate on the region when the mark is active. It is enabled | ||
| 186 | by default. @xref{Mark}. | ||
| 187 | @end itemize | ||
| 188 | |||
| 189 | @node Easy Customization | 36 | @node Easy Customization |
| 190 | @section Easy Customization Interface | 37 | @section Easy Customization Interface |
| 191 | 38 | ||
| @@ -2085,36 +1932,6 @@ invoke it; disabling also applies if the command is invoked using | |||
| 2085 | @kbd{M-x}. However, disabling a command has no effect on calling it | 1932 | @kbd{M-x}. However, disabling a command has no effect on calling it |
| 2086 | as a function from Lisp programs. | 1933 | as a function from Lisp programs. |
| 2087 | 1934 | ||
| 2088 | @node Syntax | ||
| 2089 | @section The Syntax Table | ||
| 2090 | @cindex syntax table | ||
| 2091 | |||
| 2092 | All the Emacs commands which parse words or balance parentheses are | ||
| 2093 | controlled by the @dfn{syntax table}. The syntax table says which | ||
| 2094 | characters are opening delimiters, which are parts of words, which are | ||
| 2095 | string quotes, and so on. It does this by assigning each character to | ||
| 2096 | one of fifteen-odd @dfn{syntax classes}. In some cases it specifies | ||
| 2097 | some additional information also. | ||
| 2098 | |||
| 2099 | Each major mode has its own syntax table (though related major modes | ||
| 2100 | sometimes share one syntax table), which it installs in each buffer | ||
| 2101 | that uses the mode. The syntax table installed in the current buffer | ||
| 2102 | is the one that all commands use, so we call it ``the'' syntax table. | ||
| 2103 | |||
| 2104 | @kindex C-h s | ||
| 2105 | @findex describe-syntax | ||
| 2106 | To display a description of the contents of the current syntax | ||
| 2107 | table, type @kbd{C-h s} (@code{describe-syntax}). The description of | ||
| 2108 | each character includes the string you would have to give to | ||
| 2109 | @code{modify-syntax-entry} to set up that character's current syntax, | ||
| 2110 | starting with the character which designates its syntax class, plus | ||
| 2111 | some English text to explain its meaning. | ||
| 2112 | |||
| 2113 | A syntax table is actually a Lisp object, a char-table, whose | ||
| 2114 | elements are cons cells. For full information on the syntax table, | ||
| 2115 | see @ref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp | ||
| 2116 | Reference Manual}. | ||
| 2117 | |||
| 2118 | @node Init File | 1935 | @node Init File |
| 2119 | @section The Init File, @file{~/.emacs} | 1936 | @section The Init File, @file{~/.emacs} |
| 2120 | @cindex init file | 1937 | @cindex init file |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index ed7d48877e5..a35736f4fe7 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -167,16 +167,15 @@ Important Text-Changing Commands | |||
| 167 | * Mark:: The mark: how to delimit a ``region'' of text. | 167 | * Mark:: The mark: how to delimit a ``region'' of text. |
| 168 | * Killing:: Killing (cutting) text. | 168 | * Killing:: Killing (cutting) text. |
| 169 | * Yanking:: Recovering killed text. Moving text. (Pasting.) | 169 | * Yanking:: Recovering killed text. Moving text. (Pasting.) |
| 170 | * Cut and Paste:: Clipboard and selections on graphical displays. | ||
| 170 | * Accumulating Text:: Other ways of copying text. | 171 | * Accumulating Text:: Other ways of copying text. |
| 171 | * Rectangles:: Operating on the text inside a rectangle on the screen. | 172 | * Rectangles:: Operating on text in rectangular areas. |
| 172 | * CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy | 173 | * CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} to kill and yank. |
| 173 | and paste, with enhanced rectangle support. | ||
| 174 | * Registers:: Saving a text string or a location in the buffer. | 174 | * Registers:: Saving a text string or a location in the buffer. |
| 175 | * Display:: Controlling what text is displayed. | 175 | * Display:: Controlling what text is displayed. |
| 176 | * Search:: Finding or replacing occurrences of a string. | 176 | * Search:: Finding or replacing occurrences of a string. |
| 177 | * Fixit:: Commands especially useful for fixing typos. | 177 | * Fixit:: Commands especially useful for fixing typos. |
| 178 | * Keyboard Macros:: A keyboard macro records a sequence of | 178 | * Keyboard Macros:: Recording a sequence of keystrokes to be replayed. |
| 179 | keystrokes to be replayed with a single command. | ||
| 180 | 179 | ||
| 181 | Major Structures of Emacs | 180 | Major Structures of Emacs |
| 182 | * Files:: All about handling files. | 181 | * Files:: All about handling files. |
| @@ -186,13 +185,13 @@ Major Structures of Emacs | |||
| 186 | * International:: Using non-@acronym{ASCII} character sets. | 185 | * International:: Using non-@acronym{ASCII} character sets. |
| 187 | 186 | ||
| 188 | Advanced Features | 187 | Advanced Features |
| 189 | * Major Modes:: Text mode vs. Lisp mode vs. C mode... | 188 | * Modes:: Major and minor modes alter Emacs' basic behavior. |
| 190 | * Indentation:: Editing the white space at the beginnings of lines. | 189 | * Indentation:: Editing the white space at the beginnings of lines. |
| 191 | * Text:: Commands and modes for editing English. | 190 | * Text:: Commands and modes for editing English. |
| 192 | * Programs:: Commands and modes for editing programs. | 191 | * Programs:: Commands and modes for editing programs. |
| 193 | * Building:: Compiling, running and debugging programs. | 192 | * Building:: Compiling, running and debugging programs. |
| 194 | * Maintaining:: Features for maintaining large programs. | 193 | * Maintaining:: Features for maintaining large programs. |
| 195 | * Abbrevs:: How to define text abbreviations to reduce | 194 | * Abbrevs:: Defining text abbreviations to reduce |
| 196 | the number of characters you must type. | 195 | the number of characters you must type. |
| 197 | @c AFAICS, the tex stuff generates its own index and does not use this one. | 196 | @c AFAICS, the tex stuff generates its own index and does not use this one. |
| 198 | @ifnottex | 197 | @ifnottex |
| @@ -204,9 +203,9 @@ Advanced Features | |||
| 204 | * Dired:: You can ``edit'' a directory to manage files in it. | 203 | * Dired:: You can ``edit'' a directory to manage files in it. |
| 205 | * Calendar/Diary:: The calendar and diary facilities. | 204 | * Calendar/Diary:: The calendar and diary facilities. |
| 206 | * Document View:: Viewing PDF, PS and DVI files. | 205 | * Document View:: Viewing PDF, PS and DVI files. |
| 207 | * Gnus:: How to read netnews with Emacs. | 206 | * Gnus:: A flexible mail and news reader. |
| 208 | * Shell:: Executing shell commands from Emacs. | 207 | * Shell:: Executing shell commands from Emacs. |
| 209 | * Emacs Server:: Using Emacs as an editing server for @code{mail}, etc. | 208 | * Emacs Server:: Using Emacs as an editing server. |
| 210 | * Printing:: Printing hardcopies of buffers or regions. | 209 | * Printing:: Printing hardcopies of buffers or regions. |
| 211 | * Sorting:: Sorting lines, paragraphs or pages within Emacs. | 210 | * Sorting:: Sorting lines, paragraphs or pages within Emacs. |
| 212 | * Narrowing:: Restricting display and editing to a portion | 211 | * Narrowing:: Restricting display and editing to a portion |
| @@ -331,6 +330,12 @@ Yanking | |||
| 331 | * Appending Kills:: Several kills in a row all yank together. | 330 | * Appending Kills:: Several kills in a row all yank together. |
| 332 | * Earlier Kills:: Yanking something killed some time ago. | 331 | * Earlier Kills:: Yanking something killed some time ago. |
| 333 | 332 | ||
| 333 | Killing and Yanking on Graphical Displays | ||
| 334 | |||
| 335 | * Clipboard:: How Emacs interacts with the system clipboard. | ||
| 336 | * Primary Selection:: The temporarily selected text selection. | ||
| 337 | * Secondary Selection:: Cutting without altering point and mark. | ||
| 338 | |||
| 334 | Registers | 339 | Registers |
| 335 | 340 | ||
| 336 | * RegPos:: Saving positions in registers. | 341 | * RegPos:: Saving positions in registers. |
| @@ -495,7 +500,8 @@ Multiple Windows | |||
| 495 | 500 | ||
| 496 | Frames and Graphical Displays | 501 | Frames and Graphical Displays |
| 497 | 502 | ||
| 498 | * Cut and Paste:: Mouse commands for cut and paste. | 503 | * Mouse Commands:: Moving, cutting, and pasting, with the mouse. |
| 504 | * Word and Line Mouse:: Mouse commands for selecting whole words or lines. | ||
| 499 | * Mouse References:: Using the mouse to select an item from a list. | 505 | * Mouse References:: Using the mouse to select an item from a list. |
| 500 | * Menu Mouse Clicks:: Mouse clicks that bring up menus. | 506 | * Menu Mouse Clicks:: Mouse clicks that bring up menus. |
| 501 | * Mode Line Mouse:: Mouse clicks on the mode line. | 507 | * Mode Line Mouse:: Mouse clicks on the mode line. |
| @@ -517,14 +523,6 @@ Frames and Graphical Displays | |||
| 517 | * Non-Window Terminals:: Multiple frames on terminals that show only one. | 523 | * Non-Window Terminals:: Multiple frames on terminals that show only one. |
| 518 | * Text-Only Mouse:: Using the mouse in text-only terminals. | 524 | * Text-Only Mouse:: Using the mouse in text-only terminals. |
| 519 | 525 | ||
| 520 | Killing and Yanking on Graphical Displays | ||
| 521 | |||
| 522 | * Mouse Commands:: Moving, cutting, and pasting, with the mouse. | ||
| 523 | * Word and Line Mouse:: Mouse commands for selecting whole words or lines. | ||
| 524 | * Cut/Paste Other App:: Transfering text between Emacs and other apps. | ||
| 525 | * Secondary Selection:: Cutting without altering point and mark. | ||
| 526 | * Clipboard:: Using the clipboard for selections. | ||
| 527 | |||
| 528 | International Character Set Support | 526 | International Character Set Support |
| 529 | 527 | ||
| 530 | * International Chars:: Basic concepts of multibyte characters. | 528 | * International Chars:: Basic concepts of multibyte characters. |
| @@ -551,9 +549,12 @@ International Character Set Support | |||
| 551 | to use without multibyte characters. | 549 | to use without multibyte characters. |
| 552 | * Charsets:: How Emacs groups its internal character codes. | 550 | * Charsets:: How Emacs groups its internal character codes. |
| 553 | 551 | ||
| 554 | Major Modes | 552 | Modes |
| 555 | 553 | ||
| 556 | * Choosing Modes:: How major modes are specified or chosen. | 554 | * Major Modes:: Text mode vs. Lisp mode vs. C mode... |
| 555 | * Minor Modes:: Each minor mode is a feature you can turn on | ||
| 556 | independently of any others. | ||
| 557 | * Choosing Modes:: How modes are chosen when visiting files. | ||
| 557 | 558 | ||
| 558 | Indentation | 559 | Indentation |
| 559 | 560 | ||
| @@ -585,8 +586,6 @@ Filling Text | |||
| 585 | * Fill Prefix:: Filling paragraphs that are indented | 586 | * Fill Prefix:: Filling paragraphs that are indented |
| 586 | or in a comment, etc. | 587 | or in a comment, etc. |
| 587 | * Adaptive Fill:: How Emacs can determine the fill prefix automatically. | 588 | * Adaptive Fill:: How Emacs can determine the fill prefix automatically. |
| 588 | * Refill:: Keeping paragraphs filled. | ||
| 589 | * Longlines:: Editing text with very long lines. | ||
| 590 | 589 | ||
| 591 | Outline Mode | 590 | Outline Mode |
| 592 | 591 | ||
| @@ -1062,16 +1061,12 @@ Hyperlinking and Navigation Features | |||
| 1062 | 1061 | ||
| 1063 | Customization | 1062 | Customization |
| 1064 | 1063 | ||
| 1065 | * Minor Modes:: Each minor mode is a feature you can turn on | ||
| 1066 | independently of any others. | ||
| 1067 | * Easy Customization:: Convenient way to browse and change settings. | 1064 | * Easy Customization:: Convenient way to browse and change settings. |
| 1068 | * Variables:: Many Emacs commands examine Emacs variables | 1065 | * Variables:: Many Emacs commands examine Emacs variables |
| 1069 | to decide what to do; by setting variables, | 1066 | to decide what to do; by setting variables, |
| 1070 | you can control their functioning. | 1067 | you can control their functioning. |
| 1071 | * Key Bindings:: The keymaps say what command each key runs. | 1068 | * Key Bindings:: Keymaps say what command each key runs. |
| 1072 | By changing them, you can "redefine keys". | 1069 | By changing them, you can ``redefine'' keys. |
| 1073 | * Syntax:: The syntax table controls how words and | ||
| 1074 | expressions are parsed. | ||
| 1075 | * Init File:: How to write common customizations in the | 1070 | * Init File:: How to write common customizations in the |
| 1076 | @file{.emacs} file. | 1071 | @file{.emacs} file. |
| 1077 | 1072 | ||
| @@ -1491,7 +1486,7 @@ Lisp programming. | |||
| 1491 | @include windows.texi | 1486 | @include windows.texi |
| 1492 | @include frames.texi | 1487 | @include frames.texi |
| 1493 | @include mule.texi | 1488 | @include mule.texi |
| 1494 | @include major.texi | 1489 | @include modes.texi |
| 1495 | @include indent.texi | 1490 | @include indent.texi |
| 1496 | @include text.texi | 1491 | @include text.texi |
| 1497 | @c Includes fortran-xtra. | 1492 | @c Includes fortran-xtra. |
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 633b65251e4..0fc4dfa427d 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi | |||
| @@ -33,7 +33,8 @@ so that you can use many of the features described in this chapter. | |||
| 33 | @end ifnottex | 33 | @end ifnottex |
| 34 | 34 | ||
| 35 | @menu | 35 | @menu |
| 36 | * Cut and Paste:: Mouse commands for cut and paste. | 36 | * Mouse Commands:: Moving, cutting, and pasting, with the mouse. |
| 37 | * Word and Line Mouse:: Mouse commands for selecting whole words or lines. | ||
| 37 | * Mouse References:: Using the mouse to select an item from a list. | 38 | * Mouse References:: Using the mouse to select an item from a list. |
| 38 | * Menu Mouse Clicks:: Mouse clicks that bring up menus. | 39 | * Menu Mouse Clicks:: Mouse clicks that bring up menus. |
| 39 | * Mode Line Mouse:: Mouse clicks on the mode line. | 40 | * Mode Line Mouse:: Mouse clicks on the mode line. |
| @@ -56,22 +57,8 @@ so that you can use many of the features described in this chapter. | |||
| 56 | * Text-Only Mouse:: Using the mouse in text-only terminals. | 57 | * Text-Only Mouse:: Using the mouse in text-only terminals. |
| 57 | @end menu | 58 | @end menu |
| 58 | 59 | ||
| 59 | @node Cut and Paste | ||
| 60 | @section Cutting and Pasting on Graphical Displays | ||
| 61 | |||
| 62 | This section describes commands for selecting a region, cutting, and | ||
| 63 | pasting using the mouse. | ||
| 64 | |||
| 65 | @menu | ||
| 66 | * Mouse Commands:: Moving, cutting, and pasting, with the mouse. | ||
| 67 | * Word and Line Mouse:: Mouse commands for selecting whole words or lines. | ||
| 68 | * Cut/Paste Other App:: Transfering text between Emacs and other apps. | ||
| 69 | * Secondary Selection:: Cutting without altering point and mark. | ||
| 70 | * Clipboard:: Using the clipboard for selections. | ||
| 71 | @end menu | ||
| 72 | |||
| 73 | @node Mouse Commands | 60 | @node Mouse Commands |
| 74 | @subsection Mouse Commands for Editing | 61 | @section Mouse Commands for Editing |
| 75 | @cindex mouse buttons (what they do) | 62 | @cindex mouse buttons (what they do) |
| 76 | 63 | ||
| 77 | @kindex Mouse-1 | 64 | @kindex Mouse-1 |
| @@ -141,7 +128,7 @@ variable @code{mouse-yank-at-point} to a non-@code{nil} value, | |||
| 141 | @kbd{Mouse-2} does not move point. Then it does not matter where you | 128 | @kbd{Mouse-2} does not move point. Then it does not matter where you |
| 142 | click, or even which of the frame's windows you click on; the yank | 129 | click, or even which of the frame's windows you click on; the yank |
| 143 | occurs at the existing point. This variable also affects yanking the | 130 | occurs at the existing point. This variable also affects yanking the |
| 144 | primary and secondary selections (@pxref{Cut/Paste Other App}). | 131 | primary and secondary selections (@pxref{Primary Selection}). |
| 145 | 132 | ||
| 146 | @findex mouse-save-then-kill | 133 | @findex mouse-save-then-kill |
| 147 | Clicking with the right mouse button, @kbd{Mouse-3}, runs the | 134 | Clicking with the right mouse button, @kbd{Mouse-3}, runs the |
| @@ -195,7 +182,7 @@ make Emacs behave this way by enabling Delete Selection mode. | |||
| 195 | @xref{Using Region}. | 182 | @xref{Using Region}. |
| 196 | 183 | ||
| 197 | @node Word and Line Mouse | 184 | @node Word and Line Mouse |
| 198 | @subsection Mouse Commands for Words and Lines | 185 | @section Mouse Commands for Words and Lines |
| 199 | 186 | ||
| 200 | These variants of @kbd{Mouse-1} select entire words or lines at a | 187 | These variants of @kbd{Mouse-1} select entire words or lines at a |
| 201 | time. Emacs activates the region around the selected text, which is | 188 | time. Emacs activates the region around the selected text, which is |
| @@ -224,164 +211,6 @@ Select the line you click on. | |||
| 224 | Select the text you drag across, in the form of whole lines. | 211 | Select the text you drag across, in the form of whole lines. |
| 225 | @end table | 212 | @end table |
| 226 | 213 | ||
| 227 | @node Cut/Paste Other App | ||
| 228 | @subsection Cut and Paste with Other Window Applications | ||
| 229 | |||
| 230 | @cindex X cutting and pasting | ||
| 231 | @cindex X selection | ||
| 232 | @cindex primary selection | ||
| 233 | @cindex selection, primary | ||
| 234 | When running Emacs under the X window system, you can easily | ||
| 235 | transfer text between Emacs and other X applications using the | ||
| 236 | @dfn{primary selection} (also called the @dfn{X selection}). This is | ||
| 237 | @emph{not} the same thing as the @dfn{clipboard}, which is a separate | ||
| 238 | facility used on desktop environments such as Gnome, and on operating | ||
| 239 | systems such as Microsoft Windows (@pxref{Clipboard}). | ||
| 240 | |||
| 241 | Under X, whenever you select some text in Emacs by dragging or | ||
| 242 | clicking the mouse (@pxref{Mouse Commands}), it is also saved in the | ||
| 243 | primary selection. You can then @dfn{paste} that text into any other | ||
| 244 | X application, usually by clicking @kbd{Mouse-2} in that application. | ||
| 245 | Unlike the Emacs kill ring (@pxref{Kill Ring}), the primary selection | ||
| 246 | has no ``memory'': each time you save something in the primary | ||
| 247 | selection, either in Emacs or in another X application, the previous | ||
| 248 | contents of the primary selection are lost. | ||
| 249 | |||
| 250 | @cindex MS-Windows, and primary selection | ||
| 251 | MS-Windows provides no primary selection, but Emacs emulates it | ||
| 252 | within a single Emacs session, by storing the selected text | ||
| 253 | internally. Therefore, all the features and commands related to the | ||
| 254 | primary selection work on Windows as they do on X, for cutting and | ||
| 255 | pasting within the same session, but not across Emacs sessions or with | ||
| 256 | other applications. | ||
| 257 | |||
| 258 | Whenever you kill some text using a command such as @kbd{C-w} | ||
| 259 | (@code{kill-region}), or copy it into the kill ring using a command | ||
| 260 | such as @kbd{M-w} (@code{kill-ring-save}), that text is also saved in | ||
| 261 | the primary selection. @xref{Killing}. | ||
| 262 | |||
| 263 | @vindex select-active-regions | ||
| 264 | If you set the region using the keyboard---for instance, by typing | ||
| 265 | @kbd{C-@key{SPC}} and moving point away from the mark---the text in | ||
| 266 | the region is not normally saved to the primary selection. However, | ||
| 267 | if you change the variable @code{select-active-regions} to @code{t}, | ||
| 268 | the region is saved to the primary selection whenever you activate the | ||
| 269 | mark. Each change to the region also updates the primary selection. | ||
| 270 | |||
| 271 | @vindex yank-pop-change-selection | ||
| 272 | If you change @code{yank-pop-change-selection} to @code{t}, rotating | ||
| 273 | the kill ring with @kbd{M-y} (@code{yank-pop}) also saves the new yank | ||
| 274 | to the primary selection (@pxref{Yanking}). | ||
| 275 | |||
| 276 | @vindex save-interprogram-paste-before-kill | ||
| 277 | If you change @code{save-interprogram-paste-before-kill} to | ||
| 278 | @code{t}, each kill command first saves the existing selection onto | ||
| 279 | the kill ring. This prevents you from losing the existing selection, | ||
| 280 | at the risk of large memory consumption if other applications generate | ||
| 281 | large selections. | ||
| 282 | |||
| 283 | You can yank the primary selection into Emacs using the usual yank | ||
| 284 | commands, such as @kbd{C-y} (@code{yank}) and @kbd{Mouse-2} | ||
| 285 | (@code{mouse-yank-at-click}). These commands actually check the | ||
| 286 | primary selection before referring to the kill ring; if no primary | ||
| 287 | selection is available, the kill ring contents are used. To prevent | ||
| 288 | yank commands from accessing the primary selection, set the variable | ||
| 289 | @code{x-select-enable-primary} to @code{nil}. | ||
| 290 | |||
| 291 | The standard coding system for the primary selection is | ||
| 292 | @code{compound-text-with-extensions}. You may find that the pasted | ||
| 293 | text is not what you expected. In such a case, you can specify | ||
| 294 | another coding system for the selection by typing @kbd{C-x @key{RET} | ||
| 295 | x} or @kbd{C-x @key{RET} X}. Alternatively, you can request a | ||
| 296 | different data type by modifying the variable | ||
| 297 | @code{x-select-request-type}. @xref{Communication Coding}. | ||
| 298 | |||
| 299 | @node Secondary Selection | ||
| 300 | @subsection Secondary Selection | ||
| 301 | @cindex secondary selection | ||
| 302 | |||
| 303 | In addition to the primary selection, the X Window System provides a | ||
| 304 | second similar facility known as the @dfn{secondary selection}. | ||
| 305 | Nowadays, few X applications make use of the secondary selection, but | ||
| 306 | you can access it using the following Emacs commands: | ||
| 307 | |||
| 308 | @table @kbd | ||
| 309 | @findex mouse-set-secondary | ||
| 310 | @kindex M-Drag-Mouse-1 | ||
| 311 | @item M-Drag-Mouse-1 | ||
| 312 | Set the secondary selection, with one end at the place where you press | ||
| 313 | down the button, and the other end at the place where you release it | ||
| 314 | (@code{mouse-set-secondary}). The selected text is highlighted, using | ||
| 315 | the @code{secondary-selection} face, as you drag. The window scrolls | ||
| 316 | automatically if you drag the mouse off the top or bottom of the | ||
| 317 | window, just like @code{mouse-set-region} (@pxref{Mouse Commands}). | ||
| 318 | |||
| 319 | This command does not alter the kill ring. | ||
| 320 | |||
| 321 | @findex mouse-start-secondary | ||
| 322 | @kindex M-Mouse-1 | ||
| 323 | @item M-Mouse-1 | ||
| 324 | Set one endpoint for the @dfn{secondary selection} | ||
| 325 | (@code{mouse-start-secondary}). | ||
| 326 | |||
| 327 | @findex mouse-secondary-save-then-kill | ||
| 328 | @kindex M-Mouse-3 | ||
| 329 | @item M-Mouse-3 | ||
| 330 | Set the secondary selection, with one end at the position clicked and | ||
| 331 | the other at the position specified with @kbd{M-Mouse-1} | ||
| 332 | (@code{mouse-secondary-save-then-kill}). This also puts the selected | ||
| 333 | text in the kill ring. A second @kbd{M-Mouse-3} at the same place | ||
| 334 | kills the secondary selection just made. | ||
| 335 | |||
| 336 | @findex mouse-yank-secondary | ||
| 337 | @kindex M-Mouse-2 | ||
| 338 | @item M-Mouse-2 | ||
| 339 | Insert the secondary selection where you click, placing point at the | ||
| 340 | end of the yanked text (@code{mouse-yank-secondary}). | ||
| 341 | @end table | ||
| 342 | |||
| 343 | Double or triple clicking of @kbd{M-Mouse-1} operates on words and | ||
| 344 | lines, much like @kbd{Mouse-1}. | ||
| 345 | |||
| 346 | If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-Mouse-2} yanks | ||
| 347 | at point. Then it does not matter precisely where you click, or even | ||
| 348 | which of the frame's windows you click on. @xref{Mouse Commands}. | ||
| 349 | |||
| 350 | @node Clipboard | ||
| 351 | @subsection Using the Clipboard | ||
| 352 | @cindex clipboard | ||
| 353 | |||
| 354 | In desktop environments such as Gnome, and operating systems such as | ||
| 355 | Microsoft Windows and Mac OS X, you can transfer data (usually text) | ||
| 356 | between different applications using the @dfn{clipboard}. The | ||
| 357 | clipboard is distinct from the primary selection and secondary | ||
| 358 | selection discussed earlier. You can access the clipboard through the | ||
| 359 | @samp{Edit} menu of the menu bar (@pxref{Menu Bar}). | ||
| 360 | |||
| 361 | @cindex cut | ||
| 362 | @findex clipboard-kill-region | ||
| 363 | The command @code{clipboard-kill-region}, which is bound to the | ||
| 364 | @code{Cut} menu item, kills the region and saves it in the clipboard. | ||
| 365 | |||
| 366 | @cindex copy | ||
| 367 | @findex clipboard-kill-ring-save | ||
| 368 | The command @code{clipboard-kill-ring-save}, which is bound to the | ||
| 369 | @code{Copy} menu item, copies the region to the kill ring and saves it | ||
| 370 | in the clipboard. | ||
| 371 | |||
| 372 | @findex clipboard-yank | ||
| 373 | @cindex paste | ||
| 374 | The @code{Paste} menu item in the Edit menu yanks the contents of | ||
| 375 | the clipboard at point (@code{clipboard-yank}). | ||
| 376 | |||
| 377 | @vindex x-select-enable-clipboard | ||
| 378 | You can customize the variable @code{x-select-enable-clipboard} to | ||
| 379 | make the Emacs yank functions consult the clipboard before the primary | ||
| 380 | selection, and to make the kill functions to store in the clipboard as | ||
| 381 | well as the primary selection. Otherwise, these commands do not | ||
| 382 | access the clipboard at all. Using the clipboard is the default on | ||
| 383 | MS-Windows and Mac OS, but not on other systems. | ||
| 384 | |||
| 385 | @node Mouse References | 214 | @node Mouse References |
| 386 | @section Following References with the Mouse | 215 | @section Following References with the Mouse |
| 387 | @kindex Mouse-1 @r{(selection)} | 216 | @kindex Mouse-1 @r{(selection)} |
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi index 3cf1cc522bf..e37e80bfab8 100644 --- a/doc/emacs/glossary.texi +++ b/doc/emacs/glossary.texi | |||
| @@ -962,7 +962,7 @@ special Emacs commands for moving over and operating on paragraphs. | |||
| 962 | @item Parsing | 962 | @item Parsing |
| 963 | We say that certain Emacs commands parse words or expressions in the | 963 | We say that certain Emacs commands parse words or expressions in the |
| 964 | text being edited. Really, all they know how to do is find the other | 964 | text being edited. Really, all they know how to do is find the other |
| 965 | end of a word or expression. @xref{Syntax}. | 965 | end of a word or expression. |
| 966 | 966 | ||
| 967 | @item Point | 967 | @item Point |
| 968 | Point is the place in the buffer at which insertion and deletion | 968 | Point is the place in the buffer at which insertion and deletion |
| @@ -1212,7 +1212,8 @@ See `font lock.' | |||
| 1212 | @item Syntax Table | 1212 | @item Syntax Table |
| 1213 | The syntax table tells Emacs which characters are part of a word, | 1213 | The syntax table tells Emacs which characters are part of a word, |
| 1214 | which characters balance each other like parentheses, etc. | 1214 | which characters balance each other like parentheses, etc. |
| 1215 | @xref{Syntax}. | 1215 | @xref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp Reference |
| 1216 | Manual}. | ||
| 1216 | 1217 | ||
| 1217 | @item Super | 1218 | @item Super |
| 1218 | Super is the name of a modifier bit that a keyboard input character may | 1219 | Super is the name of a modifier bit that a keyboard input character may |
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index e00f8b9115a..76a9f2413b1 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi | |||
| @@ -139,8 +139,11 @@ command. | |||
| 139 | @item C-h r | 139 | @item C-h r |
| 140 | Display the Emacs manual in Info (@code{info-emacs-manual}). | 140 | Display the Emacs manual in Info (@code{info-emacs-manual}). |
| 141 | @item C-h s | 141 | @item C-h s |
| 142 | Display the current contents of the syntax table, with an explanation of | 142 | Display the current contents of the @dfn{syntax table}, with an |
| 143 | what they mean (@code{describe-syntax}). @xref{Syntax}. | 143 | explanation of what they mean (@code{describe-syntax}). The syntax |
| 144 | table says which characters are opening delimiters, which are parts of | ||
| 145 | words, which are string quotes, and so on. @xref{Syntax Tables,, | ||
| 146 | Syntax Tables, elisp, The Emacs Lisp Reference Manual}, for details. | ||
| 144 | @item C-h t | 147 | @item C-h t |
| 145 | Enter the Emacs interactive tutorial (@code{help-with-tutorial}). | 148 | Enter the Emacs interactive tutorial (@code{help-with-tutorial}). |
| 146 | @item C-h v @var{var} @key{RET} | 149 | @item C-h v @var{var} @key{RET} |
| @@ -583,7 +586,8 @@ bindings now in effect: first the local bindings of the current minor | |||
| 583 | modes, then the local bindings defined by the current major mode, and | 586 | modes, then the local bindings defined by the current major mode, and |
| 584 | finally the global bindings (@pxref{Key Bindings}). @kbd{C-h s} | 587 | finally the global bindings (@pxref{Key Bindings}). @kbd{C-h s} |
| 585 | displays the contents of the syntax table, with explanations of each | 588 | displays the contents of the syntax table, with explanations of each |
| 586 | character's syntax (@pxref{Syntax}). | 589 | character's syntax (@pxref{Syntax Tables,, Syntax Tables, elisp, The |
| 590 | Emacs Lisp Reference Manual}). | ||
| 587 | 591 | ||
| 588 | You can get a list of subcommands for a particular prefix key by | 592 | You can get a list of subcommands for a particular prefix key by |
| 589 | typing @kbd{C-h} after the prefix key. (There are a few prefix keys | 593 | typing @kbd{C-h} after the prefix key. (There are a few prefix keys |
diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi index c4ef4781aaf..e13b2808f09 100644 --- a/doc/emacs/indent.texi +++ b/doc/emacs/indent.texi | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | @c Copyright (C) 1985-1987, 1993-1995, 1997, 2001-2011 | 2 | @c Copyright (C) 1985-1987, 1993-1995, 1997, 2001-2011 |
| 3 | @c Free Software Foundation, Inc. | 3 | @c Free Software Foundation, Inc. |
| 4 | @c See file emacs.texi for copying conditions. | 4 | @c See file emacs.texi for copying conditions. |
| 5 | @node Indentation, Text, Major Modes, Top | 5 | @node Indentation, Text, Modes, Top |
| 6 | @chapter Indentation | 6 | @chapter Indentation |
| 7 | @cindex indentation | 7 | @cindex indentation |
| 8 | @cindex tabs | 8 | @cindex tabs |
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index 41262e9c2d8..38124fc315a 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi | |||
| @@ -6,20 +6,24 @@ | |||
| 6 | @node Killing, Registers, Mark, Top | 6 | @node Killing, Registers, Mark, Top |
| 7 | @chapter Killing and Moving Text | 7 | @chapter Killing and Moving Text |
| 8 | 8 | ||
| 9 | @dfn{Killing} means erasing text and copying it into the @dfn{kill | 9 | In Emacs, @dfn{killing} means erasing text and copying it into the |
| 10 | ring}, from which you can bring it back into the buffer by | 10 | @dfn{kill ring}. @dfn{Yanking} means bringing text from the kill ring |
| 11 | @dfn{yanking} it. (Some applications use the terms ``cutting'' and | 11 | back into the buffer. (Some applications use the terms ``cutting'' |
| 12 | ``pasting'' for similar operations.) This is the most common way of | 12 | and ``pasting'' for similar operations.) The kill ring is so-named |
| 13 | moving or copying text within Emacs. It is very versatile, because | 13 | because it can be visualized as a set of blocks of text arranged in a |
| 14 | there are commands for killing many different types of syntactic | 14 | ring, which you can access in cyclic order. @xref{Kill Ring}. |
| 15 | units. | 15 | |
| 16 | Killing and yanking are the most common way to move or copy text | ||
| 17 | within Emacs. It is very versatile, because there are commands for | ||
| 18 | killing many different types of syntactic units. | ||
| 16 | 19 | ||
| 17 | @menu | 20 | @menu |
| 18 | * Deletion and Killing:: Commands that remove text. | 21 | * Deletion and Killing:: Commands that remove text. |
| 19 | * Yanking:: Commands that insert text. | 22 | * Yanking:: Commands that insert text. |
| 23 | * Cut and Paste:: Clipboard and selections on graphical displays. | ||
| 20 | * Accumulating Text:: Other methods to add text to the buffer. | 24 | * Accumulating Text:: Other methods to add text to the buffer. |
| 21 | * Rectangles:: Operating on text in rectangular areas. | 25 | * Rectangles:: Operating on text in rectangular areas. |
| 22 | * CUA Bindings:: Using C-x/C-c/C-v to kill and yank. | 26 | * CUA Bindings:: Using @kbd{C-x}/@kbd{C-c}/@kbd{C-v} to kill and yank. |
| 23 | @end menu | 27 | @end menu |
| 24 | 28 | ||
| 25 | @node Deletion and Killing | 29 | @node Deletion and Killing |
| @@ -29,25 +33,28 @@ units. | |||
| 29 | @cindex cutting text | 33 | @cindex cutting text |
| 30 | @cindex deletion | 34 | @cindex deletion |
| 31 | Most commands which erase text from the buffer save it in the kill | 35 | Most commands which erase text from the buffer save it in the kill |
| 32 | ring. These are known as @dfn{kill} commands. The kill ring stores | 36 | ring. These are known as @dfn{kill} commands, and their names |
| 33 | several recent kills, not just the last one, so killing is a very safe | 37 | normally contain the word @samp{kill} (e.g. @code{kill-line}). The |
| 34 | operation: when you make a new kill, you don't have to worry much | 38 | kill ring stores several recent kills, not just the last one, so |
| 35 | about losing text that you previously killed. | 39 | killing is a very safe operation: you don't have to worry much about |
| 40 | losing text that you previously killed. The kill ring is shared by | ||
| 41 | all buffers, so text that is killed in one buffer can be yanked into | ||
| 42 | another buffer. | ||
| 43 | |||
| 44 | When you use @kbd{C-/} (@code{undo}) to undo a kill command | ||
| 45 | (@pxref{Undo}), that brings the killed text back into the buffer, but | ||
| 46 | does not remove it from the kill ring. | ||
| 36 | 47 | ||
| 37 | You can yank text from the kill ring into any position in a buffer, | 48 | On graphical displays, killing text also copies it to the system |
| 38 | including a position in a different buffer; the kill ring is shared by | 49 | clipboard. @xref{Cut and Paste}. |
| 39 | all buffers. The @kbd{C-/} (@code{undo}) command can undo both kill | ||
| 40 | and delete commands (@pxref{Undo}); the importance of the kill ring is | ||
| 41 | that you can yank the text in a different place. | ||
| 42 | 50 | ||
| 43 | Commands that erase text but do not save it in the kill ring are | 51 | Commands that erase text but do not save it in the kill ring are |
| 44 | known as @dfn{delete} commands. These include @kbd{C-d} | 52 | known as @dfn{delete} commands; their names usually contain the word |
| 45 | (@code{delete-char}) and @key{DEL} (@code{delete-backward-char}), | 53 | @samp{delete}. These include @kbd{C-d} (@code{delete-char}) and |
| 46 | which delete only one character at a time, and those commands that | 54 | @key{DEL} (@code{delete-backward-char}), which delete only one |
| 47 | delete only spaces or newlines. Commands that can erase significant | 55 | character at a time, and those commands that delete only spaces or |
| 48 | amounts of nontrivial data generally do a kill operation instead. The | 56 | newlines. Commands that can erase significant amounts of nontrivial |
| 49 | commands' names and individual descriptions use the words @samp{kill} | 57 | data generally do a kill operation instead. |
| 50 | and @samp{delete} to say which kind of operation they perform. | ||
| 51 | 58 | ||
| 52 | You can also use the mouse to kill and yank. @xref{Cut and Paste}. | 59 | You can also use the mouse to kill and yank. @xref{Cut and Paste}. |
| 53 | 60 | ||
| @@ -127,21 +134,22 @@ Kill an entire line at once (@code{kill-whole-line}) | |||
| 127 | 134 | ||
| 128 | @kindex C-k | 135 | @kindex C-k |
| 129 | @findex kill-line | 136 | @findex kill-line |
| 130 | The simplest kill command is @kbd{C-k}. If given at the beginning | 137 | The simplest kill command is @kbd{C-k} (@code{kill-line}). If used |
| 131 | of a line, it kills all the text on the line@footnote{Here, ``line'' | 138 | at the end of a line, it kills the line-ending newline character, |
| 132 | means a logical text line, not a screen line. @xref{Continuation | 139 | merging the next line into the current one (thus, a blank line is |
| 133 | Lines}.}, leaving it blank. When used on a blank line, it kills the | 140 | entirely removed). Otherwise, @kbd{C-k} kills all the text from point |
| 134 | whole line including its newline. | 141 | up to the end of the line; if point was originally at the beginning of |
| 135 | 142 | the line, this leaves the line blank. | |
| 136 | More precisely, @kbd{C-k} kills from point up to the end of the | 143 | |
| 137 | line, unless it is at the end of a line. In that case it kills the | 144 | Spaces and tabs at the end of the line are ignored when deciding |
| 138 | newline following point, thus merging the next line into the current | 145 | which case applies. As long as point is after the last visible |
| 139 | one. Spaces and tabs at the end of the line are ignored when deciding | ||
| 140 | which case applies, so as long as point is after the last visible | ||
| 141 | character in the line, you can be sure that @kbd{C-k} will kill the | 146 | character in the line, you can be sure that @kbd{C-k} will kill the |
| 142 | newline. To kill an entire non-blank line, go to the beginning and | 147 | newline. To kill an entire non-blank line, go to the beginning and |
| 143 | type @kbd{C-k} twice. | 148 | type @kbd{C-k} twice. |
| 144 | 149 | ||
| 150 | In this context, ``line'' means a logical text line, not a screen | ||
| 151 | line (@pxref{Continuation Lines}). | ||
| 152 | |||
| 145 | When @kbd{C-k} is given a positive argument @var{n}, it kills | 153 | When @kbd{C-k} is given a positive argument @var{n}, it kills |
| 146 | @var{n} lines and the newlines that follow them (text on the current | 154 | @var{n} lines and the newlines that follow them (text on the current |
| 147 | line before point is not killed). With a negative argument | 155 | line before point is not killed). With a negative argument |
| @@ -157,10 +165,10 @@ following newline. This variable is normally @code{nil}. | |||
| 157 | 165 | ||
| 158 | @kindex C-S-backspace | 166 | @kindex C-S-backspace |
| 159 | @findex kill-whole-line | 167 | @findex kill-whole-line |
| 160 | @kbd{C-S-backspace} (@code{kill-whole-line}) will kill a whole line | 168 | @kbd{C-S-backspace} (@code{kill-whole-line}) kills a whole line |
| 161 | including its newline regardless of the position of point within the | 169 | including its newline, regardless of the position of point within the |
| 162 | line. Note that many character terminals will prevent you from typing | 170 | line. Note that many text terminals will prevent you from typing the |
| 163 | the key sequence @kbd{C-S-backspace}. | 171 | key sequence @kbd{C-S-backspace}. |
| 164 | 172 | ||
| 165 | @node Other Kill Commands | 173 | @node Other Kill Commands |
| 166 | @subsection Other Kill Commands | 174 | @subsection Other Kill Commands |
| @@ -196,10 +204,8 @@ last set. The mark is deactivated at the end of the command. | |||
| 196 | 204 | ||
| 197 | @kindex M-w | 205 | @kindex M-w |
| 198 | @findex kill-ring-save | 206 | @findex kill-ring-save |
| 199 | The command @kbd{M-w} (@code{kill-ring-save}) copies the region into | 207 | @kbd{M-w} (@code{kill-ring-save}) copies the region into the kill |
| 200 | the kill ring without removing it from the buffer. This is | 208 | ring without removing it from the buffer. |
| 201 | approximately equivalent to @kbd{C-w} followed by @kbd{C-/}, except | ||
| 202 | that @kbd{M-w} does not alter the undo history. | ||
| 203 | 209 | ||
| 204 | Emacs also provides commands to kill specific syntactic units: | 210 | Emacs also provides commands to kill specific syntactic units: |
| 205 | words, with @kbd{M-@key{DEL}} and @kbd{M-d} (@pxref{Words}); balanced | 211 | words, with @kbd{M-@key{DEL}} and @kbd{M-d} (@pxref{Words}); balanced |
| @@ -220,12 +226,10 @@ search backward and kill text before point. | |||
| 220 | @vindex kill-read-only-ok | 226 | @vindex kill-read-only-ok |
| 221 | @cindex read-only text, killing | 227 | @cindex read-only text, killing |
| 222 | Some specialized buffers contain @dfn{read-only text}, which cannot | 228 | Some specialized buffers contain @dfn{read-only text}, which cannot |
| 223 | be modified and therefore cannot be killed. But some users like to | 229 | be modified and therefore cannot be killed. The kill commands work |
| 224 | use the kill commands to copy read-only text into the kill ring, | 230 | specially in a read-only buffer: they move over text and copy it to |
| 225 | without actually changing it. Therefore, the kill commands work | ||
| 226 | specially in a read-only buffer: they move over text, and copy it to | ||
| 227 | the kill ring, without actually deleting it from the buffer. | 231 | the kill ring, without actually deleting it from the buffer. |
| 228 | Normally, kill commands beep and display an error message when this | 232 | Normally, they also beep and display an error message when this |
| 229 | happens. But if you set the variable @code{kill-read-only-ok} to a | 233 | happens. But if you set the variable @code{kill-read-only-ok} to a |
| 230 | non-@code{nil} value, they just print a message in the echo area to | 234 | non-@code{nil} value, they just print a message in the echo area to |
| 231 | explain why the text has not been erased. | 235 | explain why the text has not been erased. |
| @@ -257,10 +261,16 @@ Replace text just yanked with an earlier batch of killed text | |||
| 257 | Append next kill to last batch of killed text (@code{append-next-kill}). | 261 | Append next kill to last batch of killed text (@code{append-next-kill}). |
| 258 | @end table | 262 | @end table |
| 259 | 263 | ||
| 260 | On graphical displays with window systems, if there is a current | 264 | @cindex yanking and text properties |
| 261 | selection in some other application, and you selected it more recently | 265 | @vindex yank-excluded-properties |
| 262 | than you killed any text in Emacs, @kbd{C-y} copies the selection | 266 | The yank commands discard certain properties from the yanked text. |
| 263 | instead of text killed within Emacs. | 267 | These are properties that might lead to annoying results, such as |
| 268 | causing the text to respond to the mouse or specifying key bindings. | ||
| 269 | The list of properties to discard is stored in the variable | ||
| 270 | @code{yank-excluded-properties}. These properties are also discarded | ||
| 271 | when yanking register contents and rectangles. @xref{Text | ||
| 272 | Properties,,, elisp, the Emacs Lisp Reference Manual}, for more | ||
| 273 | information about text properties. | ||
| 264 | 274 | ||
| 265 | @menu | 275 | @menu |
| 266 | * Kill Ring:: Where killed text is stored. Basic yanking. | 276 | * Kill Ring:: Where killed text is stored. Basic yanking. |
| @@ -271,38 +281,34 @@ instead of text killed within Emacs. | |||
| 271 | @node Kill Ring | 281 | @node Kill Ring |
| 272 | @subsection The Kill Ring | 282 | @subsection The Kill Ring |
| 273 | 283 | ||
| 274 | All killed text is recorded in the @dfn{kill ring}, a list of blocks | 284 | The @dfn{kill ring} is a list of blocks of text that were previously |
| 275 | of text that have been killed. There is only one kill ring, shared by | 285 | killed. There is only one kill ring, shared by all buffers, so you |
| 276 | all buffers, so you can kill text in one buffer and yank it in another | 286 | can kill text in one buffer and yank it in another buffer. This is |
| 277 | buffer. This is the usual way to move text from one file to another. | 287 | the usual way to move text from one file to another. (There are |
| 278 | (There are several other methods: for instance, you could store the | 288 | several other methods: for instance, you could store the text in a |
| 279 | text in a register. @xref{Registers}, for information about | 289 | register; see @ref{Registers}. @xref{Accumulating Text}, for some |
| 280 | registers. @xref{Accumulating Text}, for some other ways to move text | 290 | other ways to move text around.) |
| 281 | around.) | ||
| 282 | 291 | ||
| 283 | @kindex C-y | 292 | @kindex C-y |
| 284 | @findex yank | 293 | @findex yank |
| 285 | The command @kbd{C-y} (@code{yank}) reinserts the text of the most | 294 | @kbd{C-y} (@code{yank}) reinserts the text of the most recent kill, |
| 286 | recent kill, leaving the cursor at the end of the text. It also adds | 295 | leaving the cursor at the end of the text. It also adds the position |
| 287 | the position of the beginning of the text to the mark ring, without | 296 | of the beginning of the text to the mark ring, without activating the |
| 288 | activating the mark; this allows you to jump easily to that position | 297 | mark; this allows you to jump easily to that position with @kbd{C-x |
| 289 | with @kbd{C-x C-x} (@pxref{Setting Mark}). With a plain prefix | 298 | C-x} (@pxref{Setting Mark}). |
| 290 | argument (@kbd{C-u C-y}), it instead leaves the cursor in front of the | 299 | |
| 291 | text, and adds the position of the end of the text to the mark ring. | 300 | On graphical displays, @kbd{C-y} first checks if another application |
| 292 | Using other sort of prefix argument specifies an earlier kill; for | 301 | has placed any text in the system clipboard more recently than the |
| 293 | example, @kbd{C-u 4 C-y} reinserts the fourth most recent kill. | 302 | last Emacs kill. If so, it inserts from the clipboard instead of the |
| 294 | @xref{Earlier Kills}. | 303 | kill ring. Conceptually, you can think of the clipboard as an |
| 295 | 304 | ``extra'' entry in the kill ring, which is present if you recently cut | |
| 296 | @cindex yanking and text properties | 305 | or copied some text in another application. @xref{Cut and Paste}. |
| 297 | @vindex yank-excluded-properties | 306 | |
| 298 | The yank commands discard certain properties from the yanked text. | 307 | With a plain prefix argument (@kbd{C-u C-y}), the @code{yank} |
| 299 | These are properties that might lead to annoying results, such as | 308 | command instead leaves the cursor in front of the text, and adds the |
| 300 | causing the text to respond to the mouse or specifying key bindings. | 309 | position of the end of the text to the mark ring. Using any other |
| 301 | The list of properties to discard is stored in the variable | 310 | prefix argument specifies an earlier kill; for example, @kbd{C-u 4 |
| 302 | @code{yank-excluded-properties}. Yanking of register contents and | 311 | C-y} reinserts the fourth most recent kill. @xref{Earlier Kills}. |
| 303 | rectangles also discard these properties. @xref{Text Properties,,, | ||
| 304 | elisp, the Emacs Lisp Reference Manual}, for more information about | ||
| 305 | text properties. | ||
| 306 | 312 | ||
| 307 | @node Appending Kills | 313 | @node Appending Kills |
| 308 | @subsection Appending Kills | 314 | @subsection Appending Kills |
| @@ -418,6 +424,177 @@ saved. | |||
| 418 | @code{kill-ring}; you can view the entire contents of the kill ring with | 424 | @code{kill-ring}; you can view the entire contents of the kill ring with |
| 419 | the command @kbd{C-h v kill-ring}. | 425 | the command @kbd{C-h v kill-ring}. |
| 420 | 426 | ||
| 427 | @node Cut and Paste | ||
| 428 | @section ``Cut and Paste'' Operations on Graphical Displays | ||
| 429 | @cindex cut | ||
| 430 | @cindex copy | ||
| 431 | @cindex paste | ||
| 432 | |||
| 433 | In most graphical desktop environments, you can transfer data | ||
| 434 | (usually text) between different applications using a system facility | ||
| 435 | called the @dfn{clipboard}. On X, two other similar facilities are | ||
| 436 | available: the primary selection and the secondary selection. When | ||
| 437 | Emacs is run on a graphical display, its kill and yank commands | ||
| 438 | integrate with these facilities, so that you can easily transfer text | ||
| 439 | between Emacs and other graphical applications. | ||
| 440 | |||
| 441 | By default, Emacs uses UTF-8 as the coding system for inter-program | ||
| 442 | text transfers. If you find that the pasted text is not what you | ||
| 443 | expected, you can specify another coding system by typing @kbd{C-x | ||
| 444 | @key{RET} x} or @kbd{C-x @key{RET} X}. You can also request a | ||
| 445 | different data type by customizing @code{x-select-request-type}. | ||
| 446 | @xref{Communication Coding}. | ||
| 447 | |||
| 448 | @menu | ||
| 449 | * Clipboard:: How Emacs uses the system clipboard. | ||
| 450 | * Primary Selection:: The temporarily selected text selection. | ||
| 451 | * Secondary Selection:: Cutting without altering point and mark. | ||
| 452 | @end menu | ||
| 453 | |||
| 454 | @node Clipboard | ||
| 455 | @subsection Using the Clipboard | ||
| 456 | @cindex clipboard | ||
| 457 | |||
| 458 | The @dfn{clipboard} is the facility that most graphical applications | ||
| 459 | use for ``cutting and pasting''. When the clipboard exists, the kill | ||
| 460 | and yank commands in Emacs make use of it. | ||
| 461 | |||
| 462 | When you kill some text with a command such as @kbd{C-w} | ||
| 463 | (@code{kill-region}), or copy it to the kill ring with a command such | ||
| 464 | as @kbd{M-w} (@code{kill-ring-save}), that text is also put in the | ||
| 465 | clipboard. @xref{Killing}. | ||
| 466 | |||
| 467 | @vindex save-interprogram-paste-before-kill | ||
| 468 | When an Emacs kill command puts text in the clipboard, the existing | ||
| 469 | clipboard contents are normally lost. Optionally, you can change | ||
| 470 | @code{save-interprogram-paste-before-kill} to @code{t}. Then Emacs | ||
| 471 | will first save the clipboard to its kill ring, preventing you from | ||
| 472 | losing the old clipboard data---at the risk of high memory consumption | ||
| 473 | if that data turns out to be large. | ||
| 474 | |||
| 475 | The usual yank commands, such as @kbd{C-y} (@code{yank}), also use | ||
| 476 | the clipboard. If another application ``owns'' the clipboard---i.e., | ||
| 477 | if you cut or copied text there more recently than your last kill | ||
| 478 | command in Emacs---then Emacs yanks from the clipboard instead of the | ||
| 479 | kill ring. Otherwise, it yanks from the kill ring, as described in | ||
| 480 | @ref{Yanking}. | ||
| 481 | |||
| 482 | @vindex yank-pop-change-selection | ||
| 483 | Normally, rotating the kill ring with @kbd{M-y} (@code{yank-pop}) | ||
| 484 | does not alter the clipboard. However, if you change | ||
| 485 | @code{yank-pop-change-selection} to @code{t}, then @kbd{M-y} saves the | ||
| 486 | new yank to the clipboard. | ||
| 487 | |||
| 488 | @vindex x-select-enable-clipboard | ||
| 489 | To prevent kill and yank commands from accessing the clipboard, | ||
| 490 | change the variable @code{x-select-enable-clipboard} to @code{nil}. | ||
| 491 | |||
| 492 | @vindex x-select-enable-primary | ||
| 493 | @findex clipboard-kill-region | ||
| 494 | @findex clipboard-kill-ring-save | ||
| 495 | @findex clipboard-yank | ||
| 496 | Prior to Emacs 24, the kill and yank commands used the primary | ||
| 497 | selection (@pxref{Primary Selection}), not the clipboard. If you | ||
| 498 | prefer this behavior, change @code{x-select-enable-clipboard} to | ||
| 499 | @code{nil}, @code{x-select-enable-primary} to @code{t}, and | ||
| 500 | @code{mouse-drag-copy-region} to @code{t}. In this case, you can use | ||
| 501 | the following commands to act explicitly on the clipboard: | ||
| 502 | @code{clipboard-kill-region} kills the region and saves it to the | ||
| 503 | clipboard; @code{clipboard-kill-ring-save} copies the region to the | ||
| 504 | kill ring and saves it to the clipboard; and @code{clipboard-yank} | ||
| 505 | yanks the contents of the clipboard at point. | ||
| 506 | |||
| 507 | @node Primary Selection | ||
| 508 | @subsection Cut and Paste with Other Window Applications | ||
| 509 | @cindex X cutting and pasting | ||
| 510 | @cindex X selection | ||
| 511 | @cindex primary selection | ||
| 512 | @cindex selection, primary | ||
| 513 | |||
| 514 | Under the X window system, there exists a @dfn{primary selection} | ||
| 515 | containing the last stretch of text selected in an X application | ||
| 516 | (usually by dragging the mouse). Typically, this text can be inserted | ||
| 517 | into other X applications by @kbd{mouse-2} clicks. The primary | ||
| 518 | selection is separate from the clipboard (@pxref{Clipboard}). Its | ||
| 519 | contents are more ``fragile''; they are overwritten by any mouse | ||
| 520 | selection, whereas the clipboard is only overwritten by explicit | ||
| 521 | ``cut'' or ``copy'' commands. | ||
| 522 | |||
| 523 | Under X, whenever you select some text in Emacs by dragging or | ||
| 524 | clicking the mouse (@pxref{Mouse Commands}), it is also saved to the | ||
| 525 | primary selection. | ||
| 526 | |||
| 527 | @vindex select-active-regions | ||
| 528 | If you set the region using the keyboard---for instance, by typing | ||
| 529 | @kbd{C-@key{SPC}} and moving point away from the mark---the text in | ||
| 530 | the region is also saved to the primary selection. (The updating of | ||
| 531 | the primary selection is done at the end of each command, as long as | ||
| 532 | the region is active and non-empty.) To disable this behavior, change | ||
| 533 | the variable @code{select-active-regions} to @code{nil}. | ||
| 534 | |||
| 535 | To insert the primary selection into an Emacs buffer, click | ||
| 536 | @kbd{mouse-2} (@code{mouse-yank-primary}) where you want to insert it. | ||
| 537 | @xref{Mouse Commands}. | ||
| 538 | |||
| 539 | @cindex MS-Windows, and primary selection | ||
| 540 | MS-Windows provides no primary selection, but Emacs emulates it | ||
| 541 | within a single Emacs session by storing the selected text internally. | ||
| 542 | Therefore, all the features and commands related to the primary | ||
| 543 | selection work on Windows as they do on X, for cutting and pasting | ||
| 544 | within the same session, but not across Emacs sessions or with other | ||
| 545 | applications. | ||
| 546 | |||
| 547 | @node Secondary Selection | ||
| 548 | @subsection Secondary Selection | ||
| 549 | @cindex secondary selection | ||
| 550 | |||
| 551 | In addition to the primary selection, the X Window System provides a | ||
| 552 | second similar facility known as the @dfn{secondary selection}. | ||
| 553 | Nowadays, few X applications make use of the secondary selection, but | ||
| 554 | you can access it using the following Emacs commands: | ||
| 555 | |||
| 556 | @table @kbd | ||
| 557 | @findex mouse-set-secondary | ||
| 558 | @kindex M-Drag-Mouse-1 | ||
| 559 | @item M-Drag-Mouse-1 | ||
| 560 | Set the secondary selection, with one end at the place where you press | ||
| 561 | down the button, and the other end at the place where you release it | ||
| 562 | (@code{mouse-set-secondary}). The selected text is highlighted, using | ||
| 563 | the @code{secondary-selection} face, as you drag. The window scrolls | ||
| 564 | automatically if you drag the mouse off the top or bottom of the | ||
| 565 | window, just like @code{mouse-set-region} (@pxref{Mouse Commands}). | ||
| 566 | |||
| 567 | This command does not alter the kill ring. | ||
| 568 | |||
| 569 | @findex mouse-start-secondary | ||
| 570 | @kindex M-Mouse-1 | ||
| 571 | @item M-Mouse-1 | ||
| 572 | Set one endpoint for the @dfn{secondary selection} | ||
| 573 | (@code{mouse-start-secondary}). | ||
| 574 | |||
| 575 | @findex mouse-secondary-save-then-kill | ||
| 576 | @kindex M-Mouse-3 | ||
| 577 | @item M-Mouse-3 | ||
| 578 | Set the secondary selection, with one end at the position clicked and | ||
| 579 | the other at the position specified with @kbd{M-Mouse-1} | ||
| 580 | (@code{mouse-secondary-save-then-kill}). This also puts the selected | ||
| 581 | text in the kill ring. A second @kbd{M-Mouse-3} at the same place | ||
| 582 | kills the secondary selection just made. | ||
| 583 | |||
| 584 | @findex mouse-yank-secondary | ||
| 585 | @kindex M-Mouse-2 | ||
| 586 | @item M-Mouse-2 | ||
| 587 | Insert the secondary selection where you click, placing point at the | ||
| 588 | end of the yanked text (@code{mouse-yank-secondary}). | ||
| 589 | @end table | ||
| 590 | |||
| 591 | Double or triple clicking of @kbd{M-Mouse-1} operates on words and | ||
| 592 | lines, much like @kbd{Mouse-1}. | ||
| 593 | |||
| 594 | If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-Mouse-2} yanks | ||
| 595 | at point. Then it does not matter precisely where you click, or even | ||
| 596 | which of the frame's windows you click on. @xref{Mouse Commands}. | ||
| 597 | |||
| 421 | @node Accumulating Text | 598 | @node Accumulating Text |
| 422 | @section Accumulating Text | 599 | @section Accumulating Text |
| 423 | @findex append-to-buffer | 600 | @findex append-to-buffer |
diff --git a/doc/emacs/major.texi b/doc/emacs/major.texi deleted file mode 100644 index 9256c712f02..00000000000 --- a/doc/emacs/major.texi +++ /dev/null | |||
| @@ -1,237 +0,0 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011 | ||
| 3 | @c Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Major Modes, Indentation, International, Top | ||
| 6 | @chapter Major Modes | ||
| 7 | @cindex major modes | ||
| 8 | @cindex mode, major | ||
| 9 | @kindex TAB @r{(and major modes)} | ||
| 10 | @kindex DEL @r{(and major modes)} | ||
| 11 | @kindex C-j @r{(and major modes)} | ||
| 12 | |||
| 13 | Emacs provides many alternative @dfn{major modes}, each of which | ||
| 14 | customizes Emacs for editing text of a particular sort. The major modes | ||
| 15 | are mutually exclusive, and each buffer has one major mode at any time. | ||
| 16 | The mode line normally shows the name of the current major mode, in | ||
| 17 | parentheses (@pxref{Mode Line}). | ||
| 18 | |||
| 19 | The least specialized major mode is called @dfn{Fundamental mode}. | ||
| 20 | This mode has no mode-specific redefinitions or variable settings, so | ||
| 21 | that each Emacs command behaves in its most general manner, and each | ||
| 22 | user option variable is in its default state. For editing text of a | ||
| 23 | specific type that Emacs knows about, such as Lisp code or English | ||
| 24 | text, you should switch to the appropriate major mode, such as Lisp | ||
| 25 | mode or Text mode. | ||
| 26 | |||
| 27 | Selecting a major mode changes the meanings of a few keys to become | ||
| 28 | more specifically adapted to the language being edited. The ones that | ||
| 29 | are changed frequently are @key{TAB}, @key{DEL}, and @kbd{C-j}. The | ||
| 30 | prefix key @kbd{C-c} normally contains mode-specific commands. In | ||
| 31 | addition, the commands which handle comments use the mode to determine | ||
| 32 | how comments are to be delimited. Many major modes redefine the | ||
| 33 | syntactical properties of characters appearing in the buffer. | ||
| 34 | @xref{Syntax}. | ||
| 35 | |||
| 36 | The major modes fall into three major groups. The first group | ||
| 37 | contains modes for normal text, either plain or with mark-up. It | ||
| 38 | includes Text mode, HTML mode, SGML mode, @TeX{} mode and Outline | ||
| 39 | mode. The second group contains modes for specific programming | ||
| 40 | languages. These include Lisp mode (which has several variants), C | ||
| 41 | mode, Fortran mode, and others. The remaining major modes are not | ||
| 42 | intended for use on users' files; they are used in buffers created for | ||
| 43 | specific purposes by Emacs, such as Dired mode for buffers made by | ||
| 44 | Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m} | ||
| 45 | (@pxref{Sending Mail}), and Shell mode for buffers used for | ||
| 46 | communicating with an inferior shell process (@pxref{Interactive | ||
| 47 | Shell}). | ||
| 48 | |||
| 49 | Most programming-language major modes specify that only blank lines | ||
| 50 | separate paragraphs. This is to make the paragraph commands useful. | ||
| 51 | (@xref{Paragraphs}.) They also cause Auto Fill mode to use the | ||
| 52 | definition of @key{TAB} to indent the new lines it creates. This is | ||
| 53 | because most lines in a program are usually indented | ||
| 54 | (@pxref{Indentation}). | ||
| 55 | |||
| 56 | @menu | ||
| 57 | * Choosing Modes:: How major modes are specified or chosen. | ||
| 58 | @end menu | ||
| 59 | |||
| 60 | @node Choosing Modes,,Major Modes,Major Modes | ||
| 61 | @section How Major Modes are Chosen | ||
| 62 | |||
| 63 | @cindex choosing a major mode | ||
| 64 | You can select a major mode explicitly for the current buffer, but | ||
| 65 | most of the time Emacs determines which mode to use based on the file | ||
| 66 | name or on special text in the file. | ||
| 67 | |||
| 68 | To explicitly select a new major, you use an @kbd{M-x} command. | ||
| 69 | Take the name of a major mode and add @code{-mode} to get the name of | ||
| 70 | the command to select that mode. Thus, you can enter Lisp mode by | ||
| 71 | executing @kbd{M-x lisp-mode}. | ||
| 72 | |||
| 73 | @vindex auto-mode-alist | ||
| 74 | When you visit a file, Emacs usually chooses the right major mode | ||
| 75 | automatically. Normally, it makes the choice based on the file | ||
| 76 | name---for example, files whose names end in @samp{.c} are normally | ||
| 77 | edited in C mode---but sometimes it chooses the major mode based on | ||
| 78 | the contents of the file. Here is the exact procedure: | ||
| 79 | |||
| 80 | First, Emacs checks whether the file contains a file-local variable | ||
| 81 | that specifies the major mode. If so, it uses that major mode, | ||
| 82 | ignoring all other criteria. @xref{File Variables}. There are | ||
| 83 | several methods to specify a major mode using a file-local variable; | ||
| 84 | the simplest is to put the mode name in the first nonblank line, | ||
| 85 | preceded and followed by @samp{-*-}. Other text may appear on the | ||
| 86 | line as well. For example, | ||
| 87 | |||
| 88 | @example | ||
| 89 | ; -*-Lisp-*- | ||
| 90 | @end example | ||
| 91 | |||
| 92 | @noindent | ||
| 93 | tells Emacs to use Lisp mode. Note how the semicolon is used to make | ||
| 94 | Lisp treat this line as a comment. Alternatively, you could write | ||
| 95 | |||
| 96 | @example | ||
| 97 | ; -*- mode: Lisp;-*- | ||
| 98 | @end example | ||
| 99 | |||
| 100 | @noindent | ||
| 101 | The latter format allows you to specify local variables as well, like | ||
| 102 | this: | ||
| 103 | |||
| 104 | @example | ||
| 105 | ; -*- mode: Lisp; tab-width: 4; -*- | ||
| 106 | @end example | ||
| 107 | |||
| 108 | @vindex interpreter-mode-alist | ||
| 109 | Second, Emacs checks whether the file's contents begin with | ||
| 110 | @samp{#!}. If so, that indicates that the file can serve as an | ||
| 111 | executable shell command, which works by running an interpreter named | ||
| 112 | on the file's first line (the rest of the file is used as input to the | ||
| 113 | interpreter). Therefore, Emacs tries to use the interpreter name to | ||
| 114 | choose a mode. For instance, a file that begins with | ||
| 115 | @samp{#!/usr/bin/perl} is opened in Perl mode. The variable | ||
| 116 | @code{interpreter-mode-alist} specifies the correspondence between | ||
| 117 | interpreter program names and major modes. | ||
| 118 | |||
| 119 | When the first line starts with @samp{#!}, you usually cannot use | ||
| 120 | the @samp{-*-} feature on the first line, because the system would get | ||
| 121 | confused when running the interpreter. So Emacs looks for @samp{-*-} | ||
| 122 | on the second line in such files as well as on the first line. The | ||
| 123 | same is true for man pages which start with the magic string | ||
| 124 | @samp{'\"} to specify a list of troff preprocessors. | ||
| 125 | |||
| 126 | @vindex magic-mode-alist | ||
| 127 | Third, Emacs tries to determine the major mode by looking at the | ||
| 128 | text at the start of the buffer, based on the variable | ||
| 129 | @code{magic-mode-alist}. By default, this variable is @code{nil} (an | ||
| 130 | empty list), so Emacs skips this step; however, you can customize it | ||
| 131 | in your init file (@pxref{Init File}). The value should be a list of | ||
| 132 | elements of the form | ||
| 133 | |||
| 134 | @example | ||
| 135 | (@var{regexp} . @var{mode-function}) | ||
| 136 | @end example | ||
| 137 | |||
| 138 | @noindent | ||
| 139 | where @var{regexp} is a regular expression (@pxref{Regexps}), and | ||
| 140 | @var{mode-function} is a Lisp function that toggles a major mode. If | ||
| 141 | the text at the beginning of the file matches @var{regexp}, Emacs | ||
| 142 | chooses the major mode specified by @var{mode-function}. | ||
| 143 | |||
| 144 | Alternatively, an element of @code{magic-mode-alist} may have the form | ||
| 145 | |||
| 146 | @example | ||
| 147 | (@var{match-function} . @var{mode-function}) | ||
| 148 | @end example | ||
| 149 | |||
| 150 | @noindent | ||
| 151 | where @var{match-function} is a Lisp function that is called at the | ||
| 152 | beginning of the buffer; if the function returns non-@code{nil}, Emacs | ||
| 153 | set the major mode wit @var{mode-function}. | ||
| 154 | |||
| 155 | Fourth---if Emacs still hasn't found a suitable major mode---it | ||
| 156 | looks at the file's name. The correspondence between file names and | ||
| 157 | major modes is controlled by the variable @code{auto-mode-alist}. Its | ||
| 158 | value is a list in which each element has this form, | ||
| 159 | |||
| 160 | @example | ||
| 161 | (@var{regexp} . @var{mode-function}) | ||
| 162 | @end example | ||
| 163 | |||
| 164 | @noindent | ||
| 165 | or this form, | ||
| 166 | |||
| 167 | @example | ||
| 168 | (@var{regexp} @var{mode-function} @var{flag}) | ||
| 169 | @end example | ||
| 170 | |||
| 171 | @noindent | ||
| 172 | For example, one element normally found in the list has the form | ||
| 173 | @code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C | ||
| 174 | mode for files whose names end in @file{.c}. (Note that @samp{\\} is | ||
| 175 | needed in Lisp syntax to include a @samp{\} in the string, which must | ||
| 176 | be used to suppress the special meaning of @samp{.} in regexps.) If | ||
| 177 | the element has the form @code{(@var{regexp} @var{mode-function} | ||
| 178 | @var{flag})} and @var{flag} is non-@code{nil}, then after calling | ||
| 179 | @var{mode-function}, Emacs discards the suffix that matched | ||
| 180 | @var{regexp} and searches the list again for another match. | ||
| 181 | |||
| 182 | @vindex auto-mode-case-fold | ||
| 183 | On systems with case-insensitive file names, such as Microsoft | ||
| 184 | Windows, Emacs performs a single case-insensitive search through | ||
| 185 | @code{auto-mode-alist}. On other systems, Emacs normally performs a | ||
| 186 | single case-sensitive search through the alist. However, if you | ||
| 187 | change the variable @code{auto-mode-case-fold} to @code{t}, Emacs | ||
| 188 | performs a second case-insensitive search if the first search fails. | ||
| 189 | |||
| 190 | @vindex magic-fallback-mode-alist | ||
| 191 | Finally, if Emacs @emph{still} hasn't found a major mode to use, it | ||
| 192 | compares the text at the start of the buffer to the variable | ||
| 193 | @code{magic-fallback-mode-alist}. This variable works like | ||
| 194 | @code{magic-mode-alist}, described above, except that is consulted | ||
| 195 | only after @code{auto-mode-alist}. By default, | ||
| 196 | @code{magic-fallback-mode-alist} contains forms that check for image | ||
| 197 | files, HTML/XML/SGML files, and Postscript files. | ||
| 198 | |||
| 199 | @vindex major-mode | ||
| 200 | Once a major mode is chosen, Emacs sets the value of the variable | ||
| 201 | @code{major-mode} to the symbol for that major mode (e.g., | ||
| 202 | @code{text-mode} for Text mode). This is a per-buffer variable | ||
| 203 | (@pxref{Locals}); its buffer-local value is set automatically, and you | ||
| 204 | should not change it yourself. | ||
| 205 | |||
| 206 | The default value of @code{major-mode} determines the major mode to | ||
| 207 | use for files that do not specify a major mode, and for new buffers | ||
| 208 | created with @kbd{C-x b}. Normally, this default value is the symbol | ||
| 209 | @code{fundamental-mode}, which specifies Fundamental mode. You can | ||
| 210 | change it via the Customization interface (@pxref{Easy | ||
| 211 | Customization}), or by adding a line like this to your init file | ||
| 212 | (@pxref{Init File}): | ||
| 213 | |||
| 214 | @smallexample | ||
| 215 | (setq-default major-mode 'text-mode) | ||
| 216 | @end smallexample | ||
| 217 | |||
| 218 | @noindent | ||
| 219 | If the default value of @code{major-mode} is @code{nil}, the major | ||
| 220 | mode is taken from the previously current buffer. | ||
| 221 | |||
| 222 | @findex normal-mode | ||
| 223 | If you have changed the major mode of a buffer, you can return to | ||
| 224 | the major mode Emacs would have chosen automatically, by typing | ||
| 225 | @kbd{M-x normal-mode}. This is the same function that | ||
| 226 | @code{find-file} calls to choose the major mode. It also processes | ||
| 227 | the file's @samp{-*-} line or local variables list (if any). | ||
| 228 | @xref{File Variables}. | ||
| 229 | |||
| 230 | @vindex change-major-mode-with-file-name | ||
| 231 | The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to | ||
| 232 | a new major mode if the new file name implies a mode (@pxref{Saving}). | ||
| 233 | (@kbd{C-x C-s} does this too, if the buffer wasn't visiting a file.) | ||
| 234 | However, this does not happen if the buffer contents specify a major | ||
| 235 | mode, and certain ``special'' major modes do not allow the mode to | ||
| 236 | change. You can turn off this mode-changing feature by setting | ||
| 237 | @code{change-major-mode-with-file-name} to @code{nil}. | ||
diff --git a/doc/emacs/makefile.w32-in b/doc/emacs/makefile.w32-in index ad976468be9..4064f4ef6a3 100644 --- a/doc/emacs/makefile.w32-in +++ b/doc/emacs/makefile.w32-in | |||
| @@ -76,7 +76,7 @@ EMACSSOURCES= \ | |||
| 76 | $(srcdir)/windows.texi \ | 76 | $(srcdir)/windows.texi \ |
| 77 | $(srcdir)/frames.texi \ | 77 | $(srcdir)/frames.texi \ |
| 78 | $(srcdir)/mule.texi \ | 78 | $(srcdir)/mule.texi \ |
| 79 | $(srcdir)/major.texi \ | 79 | $(srcdir)/modes.texi \ |
| 80 | $(srcdir)/indent.texi \ | 80 | $(srcdir)/indent.texi \ |
| 81 | $(srcdir)/text.texi \ | 81 | $(srcdir)/text.texi \ |
| 82 | $(srcdir)/programs.texi \ | 82 | $(srcdir)/programs.texi \ |
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index f83ac38469a..b7b634af8b1 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -2794,7 +2794,6 @@ userenced and properbose. Have fun. Your buggestions are welcome. | |||
| 2794 | @section Other Amusements | 2794 | @section Other Amusements |
| 2795 | @cindex boredom | 2795 | @cindex boredom |
| 2796 | @findex hanoi | 2796 | @findex hanoi |
| 2797 | @findex yow | ||
| 2798 | @findex gomoku | 2797 | @findex gomoku |
| 2799 | @cindex tower of Hanoi | 2798 | @cindex tower of Hanoi |
| 2800 | 2799 | ||
| @@ -2882,9 +2881,6 @@ Likewise, @kbd{M-x snake} provides an implementation of Snake. | |||
| 2882 | When you are frustrated, try the famous Eliza program. Just do | 2881 | When you are frustrated, try the famous Eliza program. Just do |
| 2883 | @kbd{M-x doctor}. End each input by typing @key{RET} twice. | 2882 | @kbd{M-x doctor}. End each input by typing @key{RET} twice. |
| 2884 | 2883 | ||
| 2885 | @cindex Zippy | ||
| 2886 | When you are feeling strange, type @kbd{M-x yow}. | ||
| 2887 | |||
| 2888 | @findex zone | 2884 | @findex zone |
| 2889 | The command @kbd{M-x zone} plays games with the display when Emacs is | 2885 | The command @kbd{M-x zone} plays games with the display when Emacs is |
| 2890 | idle. | 2886 | idle. |
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi new file mode 100644 index 00000000000..314d5d4347e --- /dev/null +++ b/doc/emacs/modes.texi | |||
| @@ -0,0 +1,410 @@ | |||
| 1 | @c This is part of the Emacs manual. | ||
| 2 | @c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011 | ||
| 3 | @c Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | ||
| 5 | @node Modes, Indentation, International, Top | ||
| 6 | @chapter Editing Modes | ||
| 7 | |||
| 8 | Emacs contains many @dfn{editing modes}, each of which alters its | ||
| 9 | basic behavior in useful ways. These are divided into @dfn{major | ||
| 10 | modes} and @dfn{minor modes}. | ||
| 11 | |||
| 12 | Major modes provide specialized facilities for working on a | ||
| 13 | particular file type, such as a C source file (@pxref{Programs}), or a | ||
| 14 | particular type of non-file buffer, such as a shell buffer | ||
| 15 | (@pxref{Shell}). Major modes are mutually exclusive; each buffer has | ||
| 16 | one and only one major mode at any time. | ||
| 17 | |||
| 18 | Minor modes are optional features which you can turn on or off, not | ||
| 19 | necessarily specific to a type of file or buffer. For example, Auto | ||
| 20 | Fill mode is a minor mode in which @key{SPC} breaks lines between | ||
| 21 | words as you type (@pxref{Auto Fill}). Minor modes are independent of | ||
| 22 | one another, and of the selected major mode. | ||
| 23 | |||
| 24 | @menu | ||
| 25 | * Major Modes:: Text mode vs. Lisp mode vs. C mode... | ||
| 26 | * Minor Modes:: Each minor mode is a feature you can turn on | ||
| 27 | independently of any others. | ||
| 28 | * Choosing Modes:: How modes are chosen when visiting files. | ||
| 29 | @end menu | ||
| 30 | |||
| 31 | @node Major Modes | ||
| 32 | @section Major Modes | ||
| 33 | @cindex major modes | ||
| 34 | @cindex mode, major | ||
| 35 | @kindex TAB @r{(and major modes)} | ||
| 36 | @kindex DEL @r{(and major modes)} | ||
| 37 | @kindex C-j @r{(and major modes)} | ||
| 38 | |||
| 39 | Every buffer possesses a major mode, which determines the editing | ||
| 40 | behavior of Emacs while that buffer is current. The mode line | ||
| 41 | normally shows the name of the current major mode, in parentheses. | ||
| 42 | @xref{Mode Line}. | ||
| 43 | |||
| 44 | Usually, the major mode is automatically set by Emacs, when you | ||
| 45 | first visit a file or create a buffer. @xref{Choosing Modes}. You | ||
| 46 | can explicitly select a new major mode by using an @kbd{M-x} command. | ||
| 47 | Take the name of the mode and add @code{-mode} to get the name of the | ||
| 48 | command to select that mode. Thus, you can enter Lisp mode with | ||
| 49 | @kbd{M-x lisp-mode}. | ||
| 50 | |||
| 51 | The least specialized major mode is called @dfn{Fundamental mode}. | ||
| 52 | This mode has no mode-specific redefinitions or variable settings, so | ||
| 53 | that each Emacs command behaves in its most general manner, and each | ||
| 54 | user option variable is in its default state. | ||
| 55 | |||
| 56 | For editing text of a specific type that Emacs knows about, such as | ||
| 57 | Lisp code or English text, you typically use a more specialized major | ||
| 58 | mode, such as Lisp mode or Text mode. Such major modes change the | ||
| 59 | meanings of some keys to become more specifically adapted to the | ||
| 60 | language being edited. The ones that are commonly changed are | ||
| 61 | @key{TAB}, @key{DEL}, and @kbd{C-j}. The prefix key @kbd{C-c} | ||
| 62 | normally contains mode-specific commands. In addition, the commands | ||
| 63 | which handle comments use the mode to determine how comments are to be | ||
| 64 | delimited. Many major modes redefine the syntactical properties of | ||
| 65 | characters appearing in the buffer. | ||
| 66 | |||
| 67 | The major modes fall into three major groups. The first group | ||
| 68 | contains modes for normal text, either plain or with mark-up. It | ||
| 69 | includes Text mode, HTML mode, SGML mode, @TeX{} mode and Outline | ||
| 70 | mode. The second group contains modes for specific programming | ||
| 71 | languages. These include Lisp mode (which has several variants), C | ||
| 72 | mode, Fortran mode, and others. The remaining major modes are not | ||
| 73 | intended for use on users' files; they are used in buffers created for | ||
| 74 | specific purposes by Emacs, such as Dired mode for buffers made by | ||
| 75 | Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m} | ||
| 76 | (@pxref{Sending Mail}), and Shell mode for buffers used for | ||
| 77 | communicating with an inferior shell process (@pxref{Interactive | ||
| 78 | Shell}). | ||
| 79 | |||
| 80 | Most programming-language major modes specify that only blank lines | ||
| 81 | separate paragraphs. This is to make the paragraph commands useful. | ||
| 82 | (@xref{Paragraphs}.) They also cause Auto Fill mode to use the | ||
| 83 | definition of @key{TAB} to indent the new lines it creates. This is | ||
| 84 | because most lines in a program are usually indented | ||
| 85 | (@pxref{Indentation}). | ||
| 86 | |||
| 87 | @node Minor Modes | ||
| 88 | @section Minor Modes | ||
| 89 | @cindex minor modes | ||
| 90 | @cindex mode, minor | ||
| 91 | |||
| 92 | A minor mode is an optional editing modes that alters the behavior | ||
| 93 | of Emacs in some well-defined way. Unlike major modes, any number of | ||
| 94 | minor modes can be in effect at any time. Some minor modes are | ||
| 95 | @dfn{buffer-local}: they apply only to the current buffer, so you can | ||
| 96 | enable the mode in certain buffers and not others. Other minor modes | ||
| 97 | are @dfn{global}: while enabled, they affect everything you do in the | ||
| 98 | Emacs session, in all buffers. Some global minor modes are enabled by | ||
| 99 | default. | ||
| 100 | |||
| 101 | Most minor modes say in the mode line when they are enabled, just | ||
| 102 | after the major mode indicator. For example, @samp{Fill} in the mode | ||
| 103 | line means that Auto Fill mode is enabled. @xref{Mode Line}. | ||
| 104 | |||
| 105 | Each minor mode is associated with a command, called the @dfn{mode | ||
| 106 | command}, which turns it on or off. The name of this command consists | ||
| 107 | of the name of the minor mode, followed by @samp{-mode}; for instance, | ||
| 108 | the mode command for Auto Fill mode is @code{auto-fill-mode}. Calling | ||
| 109 | the minor mode command with no prefix argument @dfn{toggles} the mode, | ||
| 110 | turning it on if it was off, and off if it was on. A positive | ||
| 111 | argument always turns the mode on, and a zero or negative argument | ||
| 112 | always turns it off. Mode commands are usually invoked with | ||
| 113 | @kbd{M-x}, but you can bind keys to them if you wish (@pxref{Key | ||
| 114 | Bindings}). | ||
| 115 | |||
| 116 | Most minor modes also have a @dfn{mode variable}, with the same name | ||
| 117 | as the mode command. Its value is non-@code{nil} if the mode is | ||
| 118 | enabled, and @code{nil} if it is disabled. In some minor modes---but | ||
| 119 | not all---the value of the variable alone determines whether the mode | ||
| 120 | is active: the mode command works simply by setting the variable, and | ||
| 121 | changing the value of the variable has the same effect as calling the | ||
| 122 | mode command. Because not all minor modes work this way, we recommend | ||
| 123 | that you avoid changing the mode variables directly; use the mode | ||
| 124 | commands instead. | ||
| 125 | |||
| 126 | The following is a list of some buffer-local minor modes: | ||
| 127 | |||
| 128 | @itemize @bullet | ||
| 129 | @item | ||
| 130 | Abbrev mode automatically expands text based on pre-defined | ||
| 131 | abbreviation definitions. @xref{Abbrevs}. | ||
| 132 | |||
| 133 | @item | ||
| 134 | Auto Fill mode inserts newlines as you type to prevent lines from | ||
| 135 | becoming too long. @xref{Filling}. | ||
| 136 | |||
| 137 | @item | ||
| 138 | Auto Save mode saves the buffer contents periodically to reduce the | ||
| 139 | amount of work you can lose in case of a crash. @xref{Auto Save}. | ||
| 140 | |||
| 141 | @item | ||
| 142 | Enriched mode enables editing and saving of formatted text. | ||
| 143 | @xref{Formatted Text}. | ||
| 144 | |||
| 145 | @item | ||
| 146 | Flyspell mode automatically highlights misspelled words. | ||
| 147 | @xref{Spelling}. | ||
| 148 | |||
| 149 | @item | ||
| 150 | Font-Lock mode automatically highlights certain textual units found in | ||
| 151 | programs. It is enabled globally by default, but you can disable it | ||
| 152 | in individual buffers. @xref{Faces}. | ||
| 153 | |||
| 154 | @findex linum-mode | ||
| 155 | @cindex Linum mode | ||
| 156 | @item | ||
| 157 | Linum mode displays each line's line number in the window's left | ||
| 158 | margin. Its mode command is @code{linum-mode}. | ||
| 159 | |||
| 160 | @item | ||
| 161 | Outline minor mode provides similar facilities to the major mode | ||
| 162 | called Outline mode. @xref{Outline Mode}. | ||
| 163 | |||
| 164 | @cindex Overwrite mode | ||
| 165 | @cindex mode, Overwrite | ||
| 166 | @findex overwrite-mode | ||
| 167 | @kindex INSERT | ||
| 168 | @item | ||
| 169 | Overwrite mode causes ordinary printing characters to replace existing | ||
| 170 | text instead of shoving it to the right. For example, if point is in | ||
| 171 | front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing | ||
| 172 | a @kbd{G} changes it to @samp{FOOGAR}, instead of producing | ||
| 173 | @samp{FOOGBAR} as usual. In Overwrite mode, the command @kbd{C-q} | ||
| 174 | inserts the next character whatever it may be, even if it is a | ||
| 175 | digit---this gives you a way to insert a character instead of | ||
| 176 | replacing an existing character. The mode command, | ||
| 177 | @code{overwrite-mode}, is bound to the @key{Insert} key. | ||
| 178 | |||
| 179 | @findex binary-overwrite-mode | ||
| 180 | @item | ||
| 181 | Binary Overwrite mode is a variant of Overwrite mode for editing | ||
| 182 | binary files; it treats newlines and tabs like other characters, so | ||
| 183 | that they overwrite other characters and can be overwritten by them. | ||
| 184 | In Binary Overwrite mode, digits after @kbd{C-q} specify an octal | ||
| 185 | character code, as usual. | ||
| 186 | |||
| 187 | @item | ||
| 188 | Visual Line mode performs ``word wrapping'', causing long lines to be | ||
| 189 | wrapped at word boundaries. @xref{Visual Line Mode}. | ||
| 190 | @end itemize | ||
| 191 | |||
| 192 | Here are some useful global minor modes. Since Line Number mode and | ||
| 193 | Transient Mark mode can be enabled or disabled just by setting the | ||
| 194 | value of the minor mode variable, you @emph{can} set them differently | ||
| 195 | for particular buffers, by explicitly making the corresponding | ||
| 196 | variable local in those buffers. @xref{Locals}. | ||
| 197 | |||
| 198 | @itemize @bullet | ||
| 199 | @item | ||
| 200 | Column Number mode enables display of the current column number in the | ||
| 201 | mode line. @xref{Mode Line}. | ||
| 202 | |||
| 203 | @item | ||
| 204 | Delete Selection mode causes text insertion to first delete the text | ||
| 205 | in the region, if the region is active. @xref{Using Region}. | ||
| 206 | |||
| 207 | @item | ||
| 208 | Icomplete mode displays an indication of available completions when | ||
| 209 | you are in the minibuffer and completion is active. @xref{Completion | ||
| 210 | Options}. | ||
| 211 | |||
| 212 | @item | ||
| 213 | Line Number mode enables display of the current line number in the | ||
| 214 | mode line. It is enabled by default. @xref{Mode Line}. | ||
| 215 | |||
| 216 | @item | ||
| 217 | Menu Bar mode gives each frame a menu bar. It is enabled by default. | ||
| 218 | @xref{Menu Bars}. | ||
| 219 | |||
| 220 | @item | ||
| 221 | Scroll Bar mode gives each window a scroll bar. It is enabled by | ||
| 222 | default, but the scroll bar is only displayed on graphical terminals. | ||
| 223 | @xref{Scroll Bars}. | ||
| 224 | |||
| 225 | @item | ||
| 226 | Tool Bar mode gives each frame a tool bar. It is enabled by default, | ||
| 227 | but the tool bar is only displayed on graphical terminals. @xref{Tool | ||
| 228 | Bars}. | ||
| 229 | |||
| 230 | @item | ||
| 231 | Transient Mark mode highlights the region, and makes many Emacs | ||
| 232 | commands operate on the region when the mark is active. It is enabled | ||
| 233 | by default. @xref{Mark}. | ||
| 234 | @end itemize | ||
| 235 | |||
| 236 | @node Choosing Modes | ||
| 237 | @section Choosing File Modes | ||
| 238 | |||
| 239 | @cindex choosing a major mode | ||
| 240 | @cindex choosing a minor mode | ||
| 241 | @vindex auto-mode-alist | ||
| 242 | When you visit a file, Emacs chooses a major mode automatically. | ||
| 243 | Normally, it makes the choice based on the file name---for example, | ||
| 244 | files whose names end in @samp{.c} are normally edited in C mode---but | ||
| 245 | sometimes it chooses the major mode based on special text in the file. | ||
| 246 | This special text can also be used to enable buffer-local minor modes. | ||
| 247 | |||
| 248 | Here is the exact procedure: | ||
| 249 | |||
| 250 | First, Emacs checks whether the file contains file-local mode | ||
| 251 | variables. @xref{File Variables}. If there is a file-local variable | ||
| 252 | that specifies a major mode, then Emacs uses that major mode, ignoring | ||
| 253 | all other criteria. There are several methods to specify a major mode | ||
| 254 | using a file-local variable; the simplest is to put the mode name in | ||
| 255 | the first nonblank line, preceded and followed by @samp{-*-}. Other | ||
| 256 | text may appear on the line as well. For example, | ||
| 257 | |||
| 258 | @example | ||
| 259 | ; -*-Lisp-*- | ||
| 260 | @end example | ||
| 261 | |||
| 262 | @noindent | ||
| 263 | tells Emacs to use Lisp mode. Note how the semicolon is used to make | ||
| 264 | Lisp treat this line as a comment. Alternatively, you could write | ||
| 265 | |||
| 266 | @example | ||
| 267 | ; -*- mode: Lisp;-*- | ||
| 268 | @end example | ||
| 269 | |||
| 270 | @noindent | ||
| 271 | The latter format allows you to specify local variables as well, like | ||
| 272 | this: | ||
| 273 | |||
| 274 | @example | ||
| 275 | ; -*- mode: Lisp; tab-width: 4; -*- | ||
| 276 | @end example | ||
| 277 | |||
| 278 | If a file variable specifies a buffer-local minor mode, Emacs | ||
| 279 | enables that minor mode in the buffer. | ||
| 280 | |||
| 281 | @vindex interpreter-mode-alist | ||
| 282 | Second, if there is no file variable specifying a major mode, Emacs | ||
| 283 | checks whether the file's contents begin with @samp{#!}. If so, that | ||
| 284 | indicates that the file can serve as an executable shell command, | ||
| 285 | which works by running an interpreter named on the file's first line | ||
| 286 | (the rest of the file is used as input to the interpreter). | ||
| 287 | Therefore, Emacs tries to use the interpreter name to choose a mode. | ||
| 288 | For instance, a file that begins with @samp{#!/usr/bin/perl} is opened | ||
| 289 | in Perl mode. The variable @code{interpreter-mode-alist} specifies | ||
| 290 | the correspondence between interpreter program names and major modes. | ||
| 291 | |||
| 292 | When the first line starts with @samp{#!}, you usually cannot use | ||
| 293 | the @samp{-*-} feature on the first line, because the system would get | ||
| 294 | confused when running the interpreter. So Emacs looks for @samp{-*-} | ||
| 295 | on the second line in such files as well as on the first line. The | ||
| 296 | same is true for man pages which start with the magic string | ||
| 297 | @samp{'\"} to specify a list of troff preprocessors. | ||
| 298 | |||
| 299 | @vindex magic-mode-alist | ||
| 300 | Third, Emacs tries to determine the major mode by looking at the | ||
| 301 | text at the start of the buffer, based on the variable | ||
| 302 | @code{magic-mode-alist}. By default, this variable is @code{nil} (an | ||
| 303 | empty list), so Emacs skips this step; however, you can customize it | ||
| 304 | in your init file (@pxref{Init File}). The value should be a list of | ||
| 305 | elements of the form | ||
| 306 | |||
| 307 | @example | ||
| 308 | (@var{regexp} . @var{mode-function}) | ||
| 309 | @end example | ||
| 310 | |||
| 311 | @noindent | ||
| 312 | where @var{regexp} is a regular expression (@pxref{Regexps}), and | ||
| 313 | @var{mode-function} is a Lisp function that toggles a major mode. If | ||
| 314 | the text at the beginning of the file matches @var{regexp}, Emacs | ||
| 315 | chooses the major mode specified by @var{mode-function}. | ||
| 316 | |||
| 317 | Alternatively, an element of @code{magic-mode-alist} may have the form | ||
| 318 | |||
| 319 | @example | ||
| 320 | (@var{match-function} . @var{mode-function}) | ||
| 321 | @end example | ||
| 322 | |||
| 323 | @noindent | ||
| 324 | where @var{match-function} is a Lisp function that is called at the | ||
| 325 | beginning of the buffer; if the function returns non-@code{nil}, Emacs | ||
| 326 | set the major mode wit @var{mode-function}. | ||
| 327 | |||
| 328 | Fourth---if Emacs still hasn't found a suitable major mode---it | ||
| 329 | looks at the file's name. The correspondence between file names and | ||
| 330 | major modes is controlled by the variable @code{auto-mode-alist}. Its | ||
| 331 | value is a list in which each element has this form, | ||
| 332 | |||
| 333 | @example | ||
| 334 | (@var{regexp} . @var{mode-function}) | ||
| 335 | @end example | ||
| 336 | |||
| 337 | @noindent | ||
| 338 | or this form, | ||
| 339 | |||
| 340 | @example | ||
| 341 | (@var{regexp} @var{mode-function} @var{flag}) | ||
| 342 | @end example | ||
| 343 | |||
| 344 | @noindent | ||
| 345 | For example, one element normally found in the list has the form | ||
| 346 | @code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C | ||
| 347 | mode for files whose names end in @file{.c}. (Note that @samp{\\} is | ||
| 348 | needed in Lisp syntax to include a @samp{\} in the string, which must | ||
| 349 | be used to suppress the special meaning of @samp{.} in regexps.) If | ||
| 350 | the element has the form @code{(@var{regexp} @var{mode-function} | ||
| 351 | @var{flag})} and @var{flag} is non-@code{nil}, then after calling | ||
| 352 | @var{mode-function}, Emacs discards the suffix that matched | ||
| 353 | @var{regexp} and searches the list again for another match. | ||
| 354 | |||
| 355 | @vindex auto-mode-case-fold | ||
| 356 | On systems with case-insensitive file names, such as Microsoft | ||
| 357 | Windows, Emacs performs a single case-insensitive search through | ||
| 358 | @code{auto-mode-alist}. On other systems, Emacs normally performs a | ||
| 359 | single case-sensitive search through the alist. However, if you | ||
| 360 | change the variable @code{auto-mode-case-fold} to @code{t}, Emacs | ||
| 361 | performs a second case-insensitive search if the first search fails. | ||
| 362 | |||
| 363 | @vindex magic-fallback-mode-alist | ||
| 364 | Finally, if Emacs @emph{still} hasn't found a major mode to use, it | ||
| 365 | compares the text at the start of the buffer to the variable | ||
| 366 | @code{magic-fallback-mode-alist}. This variable works like | ||
| 367 | @code{magic-mode-alist}, described above, except that is consulted | ||
| 368 | only after @code{auto-mode-alist}. By default, | ||
| 369 | @code{magic-fallback-mode-alist} contains forms that check for image | ||
| 370 | files, HTML/XML/SGML files, and Postscript files. | ||
| 371 | |||
| 372 | @vindex major-mode | ||
| 373 | Once a major mode is chosen, Emacs sets the value of the variable | ||
| 374 | @code{major-mode} to the symbol for that major mode (e.g., | ||
| 375 | @code{text-mode} for Text mode). This is a per-buffer variable | ||
| 376 | (@pxref{Locals}); its buffer-local value is set automatically, and you | ||
| 377 | should not change it yourself. | ||
| 378 | |||
| 379 | The default value of @code{major-mode} determines the major mode to | ||
| 380 | use for files that do not specify a major mode, and for new buffers | ||
| 381 | created with @kbd{C-x b}. Normally, this default value is the symbol | ||
| 382 | @code{fundamental-mode}, which specifies Fundamental mode. You can | ||
| 383 | change it via the Customization interface (@pxref{Easy | ||
| 384 | Customization}), or by adding a line like this to your init file | ||
| 385 | (@pxref{Init File}): | ||
| 386 | |||
| 387 | @smallexample | ||
| 388 | (setq-default major-mode 'text-mode) | ||
| 389 | @end smallexample | ||
| 390 | |||
| 391 | @noindent | ||
| 392 | If the default value of @code{major-mode} is @code{nil}, the major | ||
| 393 | mode is taken from the previously current buffer. | ||
| 394 | |||
| 395 | @findex normal-mode | ||
| 396 | If you have changed the major mode of a buffer, you can return to | ||
| 397 | the major mode Emacs would have chosen automatically, by typing | ||
| 398 | @kbd{M-x normal-mode}. This is the same function that | ||
| 399 | @code{find-file} calls to choose the major mode. It also processes | ||
| 400 | the file's @samp{-*-} line or local variables list (if any). | ||
| 401 | @xref{File Variables}. | ||
| 402 | |||
| 403 | @vindex change-major-mode-with-file-name | ||
| 404 | The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to | ||
| 405 | a new major mode if the new file name implies a mode (@pxref{Saving}). | ||
| 406 | (@kbd{C-x C-s} does this too, if the buffer wasn't visiting a file.) | ||
| 407 | However, this does not happen if the buffer contents specify a major | ||
| 408 | mode, and certain ``special'' major modes do not allow the mode to | ||
| 409 | change. You can turn off this mode-changing feature by setting | ||
| 410 | @code{change-major-mode-with-file-name} to @code{nil}. | ||
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 3f3da503769..3c970ecb12c 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | @c This is part of the Emacs manual. | 1 | @c This is part of the Emacs manual. |
| 2 | @c Copyright (C) 1997, 1999-2011 Free Software Foundation, Inc. | 2 | @c Copyright (C) 1997, 1999-2011 Free Software Foundation, Inc. |
| 3 | @c See file emacs.texi for copying conditions. | 3 | @c See file emacs.texi for copying conditions. |
| 4 | @node International, Major Modes, Frames, Top | 4 | @node International, Modes, Frames, Top |
| 5 | @chapter International Character Set Support | 5 | @chapter International Character Set Support |
| 6 | @c This node is referenced in the tutorial. When renaming or deleting | 6 | @c This node is referenced in the tutorial. When renaming or deleting |
| 7 | @c it, the tutorial needs to be adjusted. (TUTORIAL.de) | 7 | @c it, the tutorial needs to be adjusted. (TUTORIAL.de) |
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 803f6b6ce49..870986d421a 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -643,8 +643,9 @@ balanced. | |||
| 643 | When talking about these facilities, the term ``parenthesis'' also | 643 | When talking about these facilities, the term ``parenthesis'' also |
| 644 | includes braces, brackets, or whatever delimiters are defined to match | 644 | includes braces, brackets, or whatever delimiters are defined to match |
| 645 | in pairs. The major mode controls which delimiters are significant, | 645 | in pairs. The major mode controls which delimiters are significant, |
| 646 | through the syntax table (@pxref{Syntax}). In Lisp, only parentheses | 646 | through the syntax table (@pxref{Syntax Tables,, Syntax Tables, elisp, |
| 647 | count; in C, these commands apply to braces and brackets too. | 647 | The Emacs Lisp Reference Manual}). In Lisp, only parentheses count; |
| 648 | in C, these commands apply to braces and brackets too. | ||
| 648 | 649 | ||
| 649 | You can use @kbd{M-x check-parens} to find any unbalanced | 650 | You can use @kbd{M-x check-parens} to find any unbalanced |
| 650 | parentheses and unbalanced string quotes in the buffer. | 651 | parentheses and unbalanced string quotes in the buffer. |
diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi index 0bc3ce3db8c..145687270ca 100644 --- a/doc/emacs/screen.texi +++ b/doc/emacs/screen.texi | |||
| @@ -190,7 +190,7 @@ sometimes useful to have this information. | |||
| 190 | Systems}). If it is a dash (@samp{-}), that indicates the default | 190 | Systems}). If it is a dash (@samp{-}), that indicates the default |
| 191 | state of affairs: no special character set handling, except for the | 191 | state of affairs: no special character set handling, except for the |
| 192 | end-of-line translations described in the next paragraph. @samp{=} | 192 | end-of-line translations described in the next paragraph. @samp{=} |
| 193 | means no conversion whatsoever. Letters represent various nontrivial | 193 | means no conversion whatsoever. Characters represent various nontrivial |
| 194 | @dfn{coding systems}---for example, @samp{1} represents ISO Latin-1. | 194 | @dfn{coding systems}---for example, @samp{1} represents ISO Latin-1. |
| 195 | On a text-only terminal, @var{cs} is preceded by two additional | 195 | On a text-only terminal, @var{cs} is preceded by two additional |
| 196 | characters that describe the coding system for keyboard input and the | 196 | characters that describe the coding system for keyboard input and the |
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index b5d426210aa..015f9529b73 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -870,8 +870,9 @@ matches at the end of the buffer only if the contents end with a | |||
| 870 | word-constituent character. | 870 | word-constituent character. |
| 871 | 871 | ||
| 872 | @item \w | 872 | @item \w |
| 873 | matches any word-constituent character. The syntax table | 873 | matches any word-constituent character. The syntax table determines |
| 874 | determines which characters these are. @xref{Syntax}. | 874 | which characters these are. @xref{Syntax Tables,, Syntax Tables, |
| 875 | elisp, The Emacs Lisp Reference Manual}. | ||
| 875 | 876 | ||
| 876 | @item \W | 877 | @item \W |
| 877 | matches any character that is not a word-constituent. | 878 | matches any character that is not a word-constituent. |
| @@ -892,7 +893,8 @@ symbol-constituent character. | |||
| 892 | matches any character whose syntax is @var{c}. Here @var{c} is a | 893 | matches any character whose syntax is @var{c}. Here @var{c} is a |
| 893 | character that designates a particular syntax class: thus, @samp{w} | 894 | character that designates a particular syntax class: thus, @samp{w} |
| 894 | for word constituent, @samp{-} or @samp{ } for whitespace, @samp{.} | 895 | for word constituent, @samp{-} or @samp{ } for whitespace, @samp{.} |
| 895 | for ordinary punctuation, etc. @xref{Syntax}. | 896 | for ordinary punctuation, etc. @xref{Syntax Tables,, Syntax Tables, |
| 897 | elisp, The Emacs Lisp Reference Manual}. | ||
| 896 | 898 | ||
| 897 | @item \S@var{c} | 899 | @item \S@var{c} |
| 898 | matches any character whose syntax is not @var{c}. | 900 | matches any character whose syntax is not @var{c}. |
| @@ -911,8 +913,9 @@ matches any character that does @emph{not} belong to category | |||
| 911 | @var{c}. | 913 | @var{c}. |
| 912 | @end table | 914 | @end table |
| 913 | 915 | ||
| 914 | The constructs that pertain to words and syntax are controlled by the | 916 | The constructs that pertain to words and syntax are controlled by |
| 915 | setting of the syntax table (@pxref{Syntax}). | 917 | the setting of the syntax table. @xref{Syntax Tables,, Syntax Tables, |
| 918 | elisp, The Emacs Lisp Reference Manual}. | ||
| 916 | 919 | ||
| 917 | @node Regexp Example | 920 | @node Regexp Example |
| 918 | @section Regular Expression Example | 921 | @section Regular Expression Example |
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index c0139c60557..dbda771e6a3 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi | |||
| @@ -154,9 +154,10 @@ the mark by one additional word. @kbd{M-@@} also accepts a numeric | |||
| 154 | argument that says how many words to scan for the place to put the | 154 | argument that says how many words to scan for the place to put the |
| 155 | mark. | 155 | mark. |
| 156 | 156 | ||
| 157 | The word commands' understanding of word boundaries is controlled | 157 | The word commands' understanding of word boundaries is controlled by |
| 158 | by the syntax table. Any character can, for example, be declared to | 158 | the syntax table. Any character can, for example, be declared to be a |
| 159 | be a word delimiter. @xref{Syntax}. | 159 | word delimiter. @xref{Syntax Tables,, Syntax Tables, elisp, The Emacs |
| 160 | Lisp Reference Manual}. | ||
| 160 | 161 | ||
| 161 | @node Sentences | 162 | @node Sentences |
| 162 | @section Sentences | 163 | @section Sentences |
| @@ -406,8 +407,6 @@ Text}). | |||
| 406 | * Fill Commands:: Commands to refill paragraphs and center lines. | 407 | * Fill Commands:: Commands to refill paragraphs and center lines. |
| 407 | * Fill Prefix:: Filling paragraphs that are indented or in a comment, etc. | 408 | * Fill Prefix:: Filling paragraphs that are indented or in a comment, etc. |
| 408 | * Adaptive Fill:: How Emacs can determine the fill prefix automatically. | 409 | * Adaptive Fill:: How Emacs can determine the fill prefix automatically. |
| 409 | * Refill:: Keeping paragraphs filled. | ||
| 410 | * Longlines:: Editing text with very long lines. | ||
| 411 | @end menu | 410 | @end menu |
| 412 | 411 | ||
| 413 | @node Auto Fill | 412 | @node Auto Fill |
| @@ -722,92 +721,6 @@ line, and it should return the appropriate fill prefix based on that | |||
| 722 | line. If it returns @code{nil}, @code{adaptive-fill-regexp} gets | 721 | line. If it returns @code{nil}, @code{adaptive-fill-regexp} gets |
| 723 | a chance to find a prefix. | 722 | a chance to find a prefix. |
| 724 | 723 | ||
| 725 | @node Refill | ||
| 726 | @subsection Refill Mode | ||
| 727 | @cindex refilling text, word processor style | ||
| 728 | @cindex modes, Refill | ||
| 729 | @cindex Refill minor mode | ||
| 730 | |||
| 731 | Refill minor mode provides support for keeping paragraphs filled as | ||
| 732 | you type or modify them in other ways. It provides an effect similar | ||
| 733 | to typical word processor behavior. This works by running a | ||
| 734 | paragraph-filling command at suitable times. | ||
| 735 | |||
| 736 | To toggle the use of Refill mode in the current buffer, type | ||
| 737 | @kbd{M-x refill-mode}. When you are typing text, only characters | ||
| 738 | which normally trigger auto filling, like the space character, will | ||
| 739 | trigger refilling. This is to avoid making it too slow. Apart from | ||
| 740 | self-inserting characters, other commands which modify the text cause | ||
| 741 | refilling. | ||
| 742 | |||
| 743 | The current implementation is preliminary and not robust. You can | ||
| 744 | get better ``line wrapping'' behavior using Longlines mode. | ||
| 745 | @xref{Longlines}. However, Longlines mode has an important | ||
| 746 | side-effect: the newlines that it inserts for you are not saved to | ||
| 747 | disk, so the files that you make with Longlines mode will appear to be | ||
| 748 | completely unfilled if you edit them without Longlines mode. | ||
| 749 | |||
| 750 | @node Longlines | ||
| 751 | @subsection Long Lines Mode | ||
| 752 | @cindex refilling text, word processor style | ||
| 753 | @cindex modes, Long Lines | ||
| 754 | @cindex word wrap | ||
| 755 | @cindex Long Lines minor mode | ||
| 756 | |||
| 757 | Sometimes, you may come across ``unfilled'' text files, which Emacs | ||
| 758 | normally displays as a bunch of extremely long lines. Comfortably | ||
| 759 | reading and editing such files normally requires ``word wrap'', a | ||
| 760 | feature that breaks up each long text line into multiple screen lines | ||
| 761 | in a readable manner---by putting the breaks at word boundaries. Many | ||
| 762 | text editors, such as those built into many web browsers, perform word | ||
| 763 | wrapping by default. | ||
| 764 | |||
| 765 | There are two different minor modes in Emacs that perform word | ||
| 766 | wrapping. The first is Visual Line mode, which does it by altering | ||
| 767 | the behavior of screen line continuation. @xref{Visual Line Mode}, | ||
| 768 | for information about Visual Line mode. | ||
| 769 | |||
| 770 | @findex longlines-mode | ||
| 771 | Instead of using Visual Line mode, you can use a minor mode called | ||
| 772 | Long Lines mode. Long Lines mode wraps lines by inserting or deleting | ||
| 773 | @dfn{soft newlines} as you type (@pxref{Hard and Soft Newlines}). | ||
| 774 | These soft newlines won't show up when you save the buffer into a | ||
| 775 | file, or when you copy the text into the kill ring, clipboard, or a | ||
| 776 | register. Unlike Visual Line mode, Lone Lines mode breaks long lines | ||
| 777 | at the fill column (@pxref{Fill Commands}), rather than the right | ||
| 778 | window edge. To enable Long Lines mode, type @kbd{M-x | ||
| 779 | longlines-mode}. If the text is full of long lines, this also | ||
| 780 | immediately ``wraps'' them all. | ||
| 781 | |||
| 782 | @findex longlines-auto-wrap | ||
| 783 | The word wrap performed by Long Lines mode is @emph{not} the same as | ||
| 784 | ordinary filling (@pxref{Fill Commands}). It does not contract | ||
| 785 | multiple spaces into a single space, recognize fill prefixes | ||
| 786 | (@pxref{Fill Prefix}), or perform adaptive filling (@pxref{Adaptive | ||
| 787 | Fill}). The reason for this is that a wrapped line is still, | ||
| 788 | conceptually, a single line. Each soft newline is equivalent to | ||
| 789 | exactly one space in that long line, and vice versa. However, you can | ||
| 790 | still call filling functions such as @kbd{M-q}, and these will work as | ||
| 791 | expected, inserting soft newlines that won't show up on disk or when | ||
| 792 | the text is copied. You can even rely entirely on the normal fill | ||
| 793 | commands by turning off automatic line wrapping, with @kbd{C-u M-x | ||
| 794 | longlines-auto-wrap}. To turn automatic line wrapping back on, type | ||
| 795 | @kbd{M-x longlines-auto-wrap}. | ||
| 796 | |||
| 797 | @findex longlines-show-hard-newlines | ||
| 798 | Type @kbd{RET} to insert a hard newline, one which automatic | ||
| 799 | refilling will not remove. If you want to see where all the hard | ||
| 800 | newlines are, type @kbd{M-x longlines-show-hard-newlines}. This will | ||
| 801 | mark each hard newline with a special symbol. The same command with a | ||
| 802 | prefix argument turns this display off. | ||
| 803 | |||
| 804 | Long Lines mode does not change normal text files that are already | ||
| 805 | filled, since the existing newlines are considered hard newlines. | ||
| 806 | Before Long Lines can do anything, you need to transform each | ||
| 807 | paragraph into a long line. One way is to set @code{fill-column} to a | ||
| 808 | large number (e.g., @kbd{C-u 9999 C-x f}), re-fill all the paragraphs, | ||
| 809 | and then set @code{fill-column} back to its original value. | ||
| 810 | |||
| 811 | @node Case | 724 | @node Case |
| 812 | @section Case Conversion Commands | 725 | @section Case Conversion Commands |
| 813 | @cindex case conversion | 726 | @cindex case conversion |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 7e8dac0cb27..c265b9e878d 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-07-10 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * modes.texi (Mode Line Variables): Document `mode-line-remote' | ||
| 4 | and `mode-line-client' (bug#2974). | ||
| 5 | |||
| 6 | * text.texi (Insertion): Clarify marker movements (bug#1651). | ||
| 7 | Text from Drew Adams. | ||
| 8 | |||
| 1 | 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org> | 9 | 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 10 | ||
| 3 | * text.texi (Special Properties): Clarify the format of `face' | 11 | * text.texi (Special Properties): Clarify the format of `face' |
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 562cc76c3f0..a8a10f750cc 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -1866,6 +1866,15 @@ default value also displays the recursive editing level, information | |||
| 1866 | on the process status, and whether narrowing is in effect. | 1866 | on the process status, and whether narrowing is in effect. |
| 1867 | @end defopt | 1867 | @end defopt |
| 1868 | 1868 | ||
| 1869 | @defopt mode-line-remote | ||
| 1870 | This variable is used to show whether @code{default-directory} for the | ||
| 1871 | current buffer is remote. | ||
| 1872 | @end defopt | ||
| 1873 | |||
| 1874 | @defopt mode-line-client | ||
| 1875 | This variable is used to identify @code{emacsclient} frames. | ||
| 1876 | @end defopt | ||
| 1877 | |||
| 1869 | The following three variables are used in @code{mode-line-modes}: | 1878 | The following three variables are used in @code{mode-line-modes}: |
| 1870 | 1879 | ||
| 1871 | @defvar mode-name | 1880 | @defvar mode-name |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 2d487352243..b91afb044f0 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -364,14 +364,13 @@ after point. Some insertion functions leave point before the inserted | |||
| 364 | text, while other functions leave it after. We call the former | 364 | text, while other functions leave it after. We call the former |
| 365 | insertion @dfn{after point} and the latter insertion @dfn{before point}. | 365 | insertion @dfn{after point} and the latter insertion @dfn{before point}. |
| 366 | 366 | ||
| 367 | Insertion relocates markers that point at positions after the | 367 | Insertion moves markers located at positions after the insertion |
| 368 | insertion point, so that they stay with the surrounding text | 368 | point, so that they stay with the surrounding text (@pxref{Markers}). |
| 369 | (@pxref{Markers}). When a marker points at the place of insertion, | 369 | When a marker points at the place of insertion, insertion may or may |
| 370 | insertion may or may not relocate the marker, depending on the marker's | 370 | not relocate the marker, depending on the marker's insertion type |
| 371 | insertion type (@pxref{Marker Insertion Types}). Certain special | 371 | (@pxref{Marker Insertion Types}). Certain special functions such as |
| 372 | functions such as @code{insert-before-markers} relocate all such markers | 372 | @code{insert-before-markers} relocate all such markers to point after |
| 373 | to point after the inserted text, regardless of the markers' insertion | 373 | the inserted text, regardless of the markers' insertion type. |
| 374 | type. | ||
| 375 | 374 | ||
| 376 | Insertion functions signal an error if the current buffer is | 375 | Insertion functions signal an error if the current buffer is |
| 377 | read-only or if they insert within read-only text. | 376 | read-only or if they insert within read-only text. |