home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / E17INFO.ZIP / EMACS-5 < prev    next >
Encoding:
GNU Info File  |  1993-07-18  |  48.3 KB  |  1,139 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Horizontal Scrolling,  Next: Selective Display,  Prev: Scrolling,  Up: Display
  6.  
  7. Horizontal Scrolling
  8. ====================
  9.  
  10. `C-x <'
  11.      Scroll text in current window to the left (`scroll-left').
  12.  
  13. `C-x >'
  14.      Scroll to the right (`scroll-right').
  15.  
  16.    The text in a window can also be scrolled horizontally.  This means
  17. that each line of text is shifted sideways in the window, and one or
  18. more characters at the beginning of each line are not displayed at all.
  19. When a window has been scrolled horizontally in this way, text lines
  20. are truncated rather than continued (*note Continuation Lines::.), with
  21. a `$' appearing in the first column when there is text truncated to the
  22. left, and in the last column when there is text truncated to the right.
  23.  
  24.    The command `C-x <' (`scroll-left') scrolls the selected window to
  25. the left by N columns with argument N.  This moves part of the
  26. beginning of each line off the left edge of the window.  With no
  27. argument, it scrolls by almost the full width of the window (two
  28. columns less, to be precise).
  29.  
  30.    `C-x >' (`scroll-right') scrolls similarly to the right.  The window
  31. cannot be scrolled any farther to the right once it is displaying
  32. normally (with each line starting at the window's left margin);
  33. attempting to do so has no effect.  This means that you don't have to
  34. calculate the argument precisely for `C-x >'; any sufficiently large
  35. argument will restore normally display.
  36.  
  37. 
  38. File: emacs,  Node: Selective Display,  Next: Optional Display,  Prev: Horizontal Scrolling,  Up: Display
  39.  
  40. Selective Display
  41. =================
  42.  
  43.    Emacs has the ability to hide lines indented more than a certain
  44. number of columns (you specify how many columns).  You can use this to
  45. get an overview of a part of a program.
  46.  
  47.    To hide lines, type `C-x $' (`set-selective-display') with a numeric
  48. argument N.  Then lines with at least N columns of indentation
  49. disappear from the screen.  The only indication of their presence is
  50. that three dots (`...') appear at the end of each visible line that is
  51. followed by one or more invisible ones.
  52.  
  53.    The commands `C-n' and `C-p' move across the invisible lines as if
  54. they were not there.
  55.  
  56.    The invisible lines are still present in the buffer, and most editing
  57. commands see them as usual, so you may find point in the middle of
  58. invisible text.  When this happens, the cursor appears at the end of the
  59. previous line, after the three dots.  If point is at the end of the
  60. visible line, before the newline that ends it, the cursor appears before
  61. the three dots.
  62.  
  63.    To make everything visible again, type `C-x $' with no argument.
  64.  
  65. 
  66. File: emacs,  Node: European Display,  Next: Display Vars,  Prev: Optional Display,  Up: Display
  67.  
  68. European Character Set Display
  69. ==============================
  70.  
  71.    Emacs can display accented characters, assuming the font in use
  72. supports them.  The `M-x standard-display-european' command toggles
  73. European character display.  When enabled, Emacs displays characters
  74. according to the ISO 8859 Latin-1 encoding for European languages; when
  75. disabled, Emacs uses octal notation for all characters not specified by
  76. the ordinary ASCII standard.  Load the library `iso-syntax' to specify
  77. the correct syntactic properties for the character codes 128 and above.
  78.  
  79.    With a prefix argument, `M-x standard-display-european' enables
  80. European character display if and only if the argument is positive.
  81.  
  82.    If your terminal can send character codes 128 and up to represent
  83. ISO Latin-1 characters, execute the following expression to enable
  84. Emacs to understand them:
  85.  
  86.      (set-input-mode (car (current-input-mode))
  87.                      (nth 1 (current-input-mode))
  88.                      0)
  89.  
  90. Otherwise, you can load the library `iso-insert' to turn the key `C-x
  91. 8' into a "compose character" prefix for insertion of the extra ISO
  92. Latin-1 printing characters.
  93.  
  94. 
  95. File: emacs,  Node: Optional Display,  Next: European Display,  Prev: Selective Display,  Up: Display
  96.  
  97. Optional Display Features
  98. =========================
  99.  
  100.    To add the current line number of point to the mode line, enable Line
  101. Number mode with the command `M-x line-number-mode'.  The line number
  102. appears before POS, with the letter `L' to indicate what it is.  *Note
  103. Minor Modes::, for more information about minor modes and about how to
  104. use this command.
  105.  
  106.    If the buffer is very large (larger than the value of
  107. `line-number-display-limit'), then the line number doesn't appear.
  108. Emacs doesn't compute the line number when the buffer is large, because
  109. that would be too slow.
  110.  
  111.    Emacs can optionally display the time and system load in all mode
  112. lines.  To enable this feature, type `M-x display-time'.  The
  113. information added to the mode line usually appears after the buffer
  114. name, before the mode names and their parentheses.  It looks like this:
  115.  
  116.      HH:MMpm L.LL [D]
  117.  
  118. Here HH and MM are the hour and minute, followed always by `am' or
  119. `pm'.  L.LL is the average number of running processes in the whole
  120. system recently.  D is an approximate index of the ratio of disk
  121. activity to cpu activity for all users.  (Some fields may be missing if
  122. your operating system cannot support them.)
  123.  
  124.    The word `Mail' appears after the load level if there is mail for
  125. you that you have not read yet.
  126.  
  127.    Customization note: the variable `mode-line-inverse-video' controls
  128. whether the mode line is displayed in inverse video (assuming the
  129. terminal supports it); `nil' means no inverse video.  The default is
  130. `t'.  *Note Display Vars::.
  131.  
  132. 
  133. File: emacs,  Node: Display Vars,  Prev: European Display,  Up: Display
  134.  
  135. Variables Controlling Display
  136. =============================
  137.  
  138.    This section contains information for customization only.  Beginning
  139. users should skip it.
  140.  
  141.    The variable `mode-line-inverse-video' controls whether the mode
  142. line is displayed in inverse video (assuming the terminal supports it);
  143. `nil' means don't do so.  *Note Mode Line::.
  144.  
  145.    If the variable `inverse-video' is non-`nil', Emacs attempts to
  146. invert all the lines of the display from what they normally are.
  147.  
  148.    If the variable `visible-bell' is non-`nil', Emacs attempts to make
  149. the whole screen blink when it would normally make an audible bell
  150. sound.  This variable has no effect if your terminal does not have a way
  151. to make the screen blink.
  152.  
  153.    When you reenter Emacs after suspending, Emacs normally clears the
  154. screen and redraws the entire display.  On some terminals with more than
  155. one page of memory, it is possible to arrange the termcap entry so that
  156. the `ti' and `te' strings (output to the terminal when Emacs is entered
  157. and exited, respectively) switch between pages of memory so as to use
  158. one page for Emacs and another page for other output.  Then you might
  159. want to set the variable `no-redraw-on-reenter' non-`nil'; this tells
  160. Emacs to assume, when resumed, that the screen page it is using still
  161. contains what Emacs last wrote there.
  162.  
  163.    The variable `echo-keystrokes' controls the echoing of
  164. multi-character keys; its value is the number of seconds of pause
  165. required to cause echoing to start, or zero meaning don't echo at all.
  166. *Note Echo Area::.
  167.  
  168.    If the variable `ctl-arrow' is `nil', control characters in the
  169. buffer are displayed with octal escape sequences, all except newline
  170. and tab.  Altering the value of `ctl-arrow' makes it local to the
  171. current buffer; until that time, the default value is in effect.  The
  172. default is initially `t'.  *Note Display Tables: (elisp)Display Tables.
  173.  
  174.    Normally, a tab character in the buffer is displayed as whitespace
  175. which extends to the next display tab stop position, and display tab
  176. stops come at intervals equal to eight spaces.  The number of spaces
  177. per tab is controlled by the variable `tab-width', which is made local
  178. by changing it, just like `ctl-arrow'.  Note that how the tab character
  179. in the buffer is displayed has nothing to do with the definition of TAB
  180. as a command.  The variable `tab-width' must have an integer value
  181. between 1 and 1000, inclusive.
  182.  
  183.    If you set the variable `selective-display-ellipses' to `nil', the
  184. three dots do not appear at the end of a line that precedes invisible
  185. lines.  Then there is no visible indication of the invisible lines.
  186. This variable too becomes local automatically when set.
  187.  
  188.    If the variable `truncate-lines' is non-`nil', then each line of
  189. text gets just one screen line for display; if the text line is too
  190. long, display shows only the part that fits.  If `truncate-lines' is
  191. `nil', then long text lines display as more than one screen line,
  192. enough to show the whole text of the line.  *Note Continuation Lines::.
  193. Altering the value of `truncate-lines' makes it local to the current
  194. buffer; until that time, the default value is in effect.  The default
  195. is initially `nil'.
  196.  
  197.    If the variable `truncate-partial-width-windows' is non-`nil', it
  198. forces truncation rather than continuation in any window less than the
  199. full width of the screen or frame, regardless of the value of
  200. `truncate-lines'.  For information about side-by-side windows, see
  201. *Note Split Window::.  See also *Note Display: (elisp)Display.
  202.  
  203.    The variable `baud-rate' holds the the output speed of the terminal,
  204. as far as Emacs knows.  Setting this variable does not change the speed
  205. of actual data transmission, but the value is used for calculations
  206. such as padding.  It also affects decisions about whether to scroll
  207. part of the screen or redraw it instead--even when using a window
  208. system, (We designed it this way, despite the fact that a window system
  209. has no true "output speed", to give you a way to tune these decisions.)
  210.  
  211. 
  212. File: emacs,  Node: Search,  Next: Fixit,  Prev: Display,  Up: Top
  213.  
  214. Searching and Replacement
  215. *************************
  216.  
  217.    Like other editors, Emacs has commands for searching for occurrences
  218. of a string.  The principal search command is unusual in that it is
  219. "incremental"; it begins to search before you have finished typing the
  220. search string.  There are also nonincremental search commands more like
  221. those of other editors.
  222.  
  223.    Besides the usual `replace-string' command that finds all
  224. occurrences of one string and replaces them with another, Emacs has a
  225. fancy replacement command called `query-replace' which asks
  226. interactively which occurrences to replace.
  227.  
  228. * Menu:
  229.  
  230. * Incremental Search::      Search happens as you type the string.
  231. * Nonincremental Search::   Specify entire string and then search.
  232. * Word Search::             Search for sequence of words.
  233. * Regexp Search::           Search for match for a regexp.
  234. * Regexps::                 Syntax of regular expressions.
  235. * Search Case::             To ignore case while searching, or not.
  236. * Replace::                 Search, and replace some or all matches.
  237. * Other Repeating Search::  Operating on all matches for some regexp.
  238.  
  239. 
  240. File: emacs,  Node: Incremental Search,  Next: Nonincremental Search,  Prev: Search,  Up: Search
  241.  
  242. Incremental Search
  243. ==================
  244.  
  245.    An incremental search begins searching as soon as you type the first
  246. character of the search string.  As you type in the search string, Emacs
  247. shows you where the string (as you have typed it so far) would be
  248. found.  When you have typed enough characters to identify the place you
  249. want, you can stop.  Depending on what you plan to do next, you may or
  250. may not need to terminate the search explicitly with RET.
  251.  
  252. `C-s'
  253.      Incremental search forward (`isearch-forward').
  254.  
  255. `C-r'
  256.      Incremental search backward (`isearch-backward').
  257.  
  258.    `C-s' starts an incremental search.  `C-s' reads characters from the
  259. keyboard and positions the cursor at the first occurrence of the
  260. characters that you have typed.  If you type `C-s' and then `F', the
  261. cursor moves right after the first `F'.  Type an `O', and see the
  262. cursor move to after the first `FO'.  After another `O', the cursor is
  263. after the first `FOO' after the place where you started the search.
  264. Meanwhile, the search string `FOO' has been echoed in the echo area.
  265.  
  266.    If you make a mistake in typing the search string, you can cancel
  267. characters with DEL.  Each DEL cancels the last character of search
  268. string.  This does not happen until Emacs is ready to read another
  269. input character; first it must either find, or fail to find, the
  270. character you want to erase.  If you do not want to wait for this to
  271. happen, use `C-g' as described below.
  272.  
  273.    When you are satisfied with the place you have reached, you can type
  274. RET, which stops searching, leaving the cursor where the search brought
  275. it.  Also, any command not specially meaningful in searches stops the
  276. searching and is then executed.  Thus, typing `C-a' would exit the
  277. search and then move to the beginning of the line.  RET is necessary
  278. only if the next command you want to type is a printing character, DEL,
  279. RET, or another control character that is special within searches
  280. (`C-q', `C-w', `C-r', `C-s', `C-y', `M-r', or `M-s').
  281.  
  282.    Sometimes you search for `FOO' and find it, but not the one you
  283. expected to find.  There was a second `FOO' that you forgot about,
  284. before the one you were looking for.  In this event, type another `C-s'
  285. to move to the next occurrence of the search string.  This can be done
  286. any number of times.  If you overshoot, you can cancel some `C-s'
  287. characters with DEL.
  288.  
  289.    After you exit a search, you can search for the same string again by
  290. typing just `C-s C-s': the first `C-s' is the key that invokes
  291. incremental search, and the second `C-s' means "search again".
  292.  
  293.    To reuse earlier search strings, use the "search ring".  The
  294. commands `M-p' and `M-n' move through the ring to pick a search string
  295. to reuse.  These commands leave the selected search ring element in the
  296. minibuffer, where you can edit it.  Type `C-s' or `C-r' to terminate
  297. editing the string and search for it.
  298.  
  299.    If your string is not found at all, the echo area says `Failing
  300. I-Search'.  The cursor is after the place where Emacs found as much of
  301. your string as it could.  Thus, if you search for `FOOT', and there is
  302. no `FOOT', you might see the cursor after the `FOO' in `FOOL'.  At this
  303. point there are several things you can do.  If your string was
  304. mistyped, you can rub some of it out and correct it.  If you like the
  305. place you have found, you can type RET or some other Emacs command to
  306. "accept what the search offered".  Or you can type `C-g', which removes
  307. from the search string the characters that could not be found (the `T'
  308. in `FOOT'), leaving those that were found (the `FOO' in `FOOT').  A
  309. second `C-g' at that point cancels the search entirely, returning point
  310. to where it was when the search started.
  311.  
  312.    An upper-case letter in the search string makes the search
  313. case-sensitive.  If you delete the upper-case character from the search
  314. string, it ceases to have this effect.  *Note Search Case::.
  315.  
  316.    If a search is failing and you ask to repeat it by typing another
  317. `C-s', it starts again from the beginning of the buffer.  Repeating a
  318. failing reverse search with `C-r' starts again from the end.  This is
  319. called "wrapping around".  `Wrapped' appears in the search prompt once
  320. this has happened.
  321.  
  322.    The `C-g' "quit" character does special things during searches; just
  323. what it does depends on the status of the search.  If the search has
  324. found what you specified and is waiting for input, `C-g' cancels the
  325. entire search.  The cursor moves back to where you started the search.
  326. If `C-g' is typed when there are characters in the search string that
  327. have not been found--because Emacs is still searching for them, or
  328. because it has failed to find them--then the search string characters
  329. which have not been found are discarded from the search string.  With
  330. them gone, the search is now successful and waiting for more input, so
  331. a second `C-g' will cancel the entire search.
  332.  
  333.    To search for a newline, type LFD (also known as `C-j').  To search
  334. for another control character such as control-S or carriage return, you
  335. must quote it by typing `C-q' first.  This function of `C-q' is
  336. analogous to its meaning as an Emacs command: it causes the following
  337. character to be treated the way a graphic character would normally be
  338. treated in the same context.  You can also specify a character by its
  339. octal code: enter `C-q' followed by three octal digits.
  340.  
  341.    You can change to searching backwards with `C-r'.  If a search fails
  342. because the place you started was too late in the file, you should do
  343. this.  Repeated `C-r' keeps looking for more occurrences backwards.  A
  344. `C-s' starts going forwards again.  `C-r' in a search can be cancelled
  345. with DEL.
  346.  
  347.    If you know initially that you want to search backwards, you can use
  348. `C-r' instead of `C-s' to start the search, because `C-r' is also a key
  349. running a command (`isearch-backward') to search backward.
  350.  
  351.    The characters `C-y' and `C-w' can be used in incremental search to
  352. grab text from the buffer into the search string.  This makes it
  353. convenient to search for another occurrence of text at point.  `C-w'
  354. copies the word after point as part of the search string, advancing
  355. point over that word.  Another `C-s' to repeat the search will then
  356. search for a string including that word.  `C-y' is similar to `C-w' but
  357. copies all the rest of the current line into the search string.
  358.  
  359.    To customize the special characters that incremental search
  360. understands, alter their bindings in the keymap `isearch-mode-map'.
  361.  
  362. Slow Terminal Incremental Search
  363. --------------------------------
  364.  
  365.    Incremental search on a slow terminal uses a modified style of
  366. display that is designed to take less time.  Instead of redisplaying
  367. the buffer at each place the search gets to, it creates a new
  368. single-line window and uses that to display the line that the search
  369. has found.  The single-line window comes into play as soon as point
  370. gets outside of the text that is already on the screen.
  371.  
  372.    When you terminate the search, the single-line window is removed.
  373. Then Emacs redisplays the window in which the search was done, to show
  374. its new position of point.
  375.  
  376.    The slow terminal style of display is used when the terminal baud
  377. rate is less than or equal to the value of the variable
  378. `search-slow-speed', initially 1200.
  379.  
  380.    The number of lines to use in slow terminal search display is
  381. controlled by the variable `search-slow-window-lines'.  1 is its normal
  382. value.
  383.  
  384. 
  385. File: emacs,  Node: Nonincremental Search,  Next: Word Search,  Prev: Incremental Search,  Up: Search
  386.  
  387. Nonincremental Search
  388. =====================
  389.  
  390.    Emacs also has conventional nonincremental search commands, which
  391. require you to type the entire search string before searching begins.
  392.  
  393. `C-s RET STRING RET'
  394.      Search for STRING.
  395.  
  396. `C-r RET STRING RET'
  397.      Search backward for STRING.
  398.  
  399.    To do a nonincremental search, first type `C-s RET'.  This enters
  400. the minibuffer to read the search string; terminate the string with
  401. RET, and then the search takes place.  If the string is not found, the
  402. search command gets an error.
  403.  
  404.    The way `C-s RET' works is that the `C-s' invokes incremental
  405. search, which is specially programmed to invoke nonincremental search
  406. if the argument you give it is empty.  (Such an empty argument would
  407. otherwise be useless.)  `C-r RET' also works this way.
  408.  
  409.    However, nonincremental searches performed using `C-s RET' do not
  410. call `search-forward' right away.  The first thing done is to see if
  411. the next character is `C-w', which requests a word search.  *Note Word
  412. Search::.
  413.  
  414.    Forward and backward nonincremental searches are implemented by the
  415. commands `search-forward' and `search-backward'.  These commands may be
  416. bound to keys in the usual manner.  The feature that you can get to
  417. them via the incremental search commands exists for historical reasons,
  418. and to avoid the need to find suitable key sequences for them.
  419.  
  420. 
  421. File: emacs,  Node: Word Search,  Next: Regexp Search,  Prev: Nonincremental Search,  Up: Search
  422.  
  423. Word Search
  424. ===========
  425.  
  426.    Word search searches for a sequence of words without regard to how
  427. the words are separated.  More precisely, you type a string of many
  428. words, using single spaces to separate them, and the string can be
  429. found even if there are multiple spaces, newlines or other punctuation
  430. between the words.
  431.  
  432.    Word search is useful for editing a printed document made with a text
  433. formatter.  If you edit while looking at the printed, formatted version,
  434. you can't tell where the line breaks are in the source file.  With word
  435. search, you can search without having to know them.
  436.  
  437. `C-s RET C-w WORDS RET'
  438.      Search for WORDS, ignoring details of punctuation.
  439.  
  440. `C-r RET C-w WORDS RET'
  441.      Search backward for WORDS, ignoring details of punctuation.
  442.  
  443.    Word search is a special case of nonincremental search and is invoked
  444. with `C-s RET C-w'.  This is followed by the search string, which must
  445. always be terminated with RET.  Being nonincremental, this search does
  446. not start until the argument is terminated.  It works by constructing a
  447. regular expression and searching for that; see *Note Regexp Search::.
  448.  
  449.    Use `C-r RET C-w' to do backward word search.
  450.  
  451.    Forward and backward word searches are implemented by the commands
  452. `word-search-forward' and `word-search-backward'.  These commands may
  453. be bound to keys in the usual manner.  The feature that you can get to
  454. them via the incremental search commands exists for historical reasons,
  455. and to avoid the need to find suitable key sequences for them.
  456.  
  457. 
  458. File: emacs,  Node: Regexp Search,  Next: Regexps,  Prev: Word Search,  Up: Search
  459.  
  460. Regular Expression Search
  461. =========================
  462.  
  463.    A "regular expression" ("regexp", for short) is a pattern that
  464. denotes a class of alternative strings to match, possibly infinitely
  465. many.  In GNU Emacs, you can search for the next match for a regexp
  466. either incrementally or not.
  467.  
  468.    Incremental search for a regexp is done by typing `C-M-s'
  469. (`isearch-forward-regexp').  This command reads a search string
  470. incrementally just like `C-s', but it treats the search string as a
  471. regexp rather than looking for an exact match against the text in the
  472. buffer.  Each time you add text to the search string, you make the
  473. regexp longer, and the new regexp is searched for.  To search backward
  474. in the buffer, use `C-M-r' (`isearch-backward-regexp').
  475.  
  476.    All of the control characters that do special things within an
  477. ordinary incremental search have the same function in incremental regexp
  478. search.  Typing `C-s' or `C-r' immediately after starting the search
  479. retrieves the last incremental search regexp used; that is to say,
  480. incremental regexp and non-regexp searches have independent defaults.
  481. They also have separate search rings that you can access with `M-p' and
  482. `M-n'.
  483.  
  484.    If you type SPC in incremental regexp search, it matches any
  485. sequence of whitespace characters, including newlines.  If you want to
  486. match just a space, type `C-q SPC'.
  487.  
  488.    Note that adding characters to the regexp in an incremental regexp
  489. search can make the cursor move back and start again.  For example, if
  490. you have searched for `foo' and you add `\|bar', the cursor backs up in
  491. case the first `bar' precedes the first `foo'.
  492.  
  493.    Nonincremental search for a regexp is done by the functions
  494. `re-search-forward' and `re-search-backward'.  You can invoke these
  495. with `M-x', or bind them to keys, or invoke them by way of incremental
  496. regexp search with `C-M-s RET' and `C-M-r RET'.
  497.  
  498. 
  499. File: emacs,  Node: Regexps,  Next: Search Case,  Prev: Regexp Search,  Up: Search
  500.  
  501. Syntax of Regular Expressions
  502. =============================
  503.  
  504.    Regular expressions have a syntax in which a few characters are
  505. special constructs and the rest are "ordinary".  An ordinary character
  506. is a simple regular expression which matches that same character and
  507. nothing else.  The special characters are `$', `^', `.', `*', `+', `?',
  508. `[', `]' and `\'.  Any other character appearing in a regular
  509. expression is ordinary, unless a `\' precedes it.
  510.  
  511.    For example, `f' is not a special character, so it is ordinary, and
  512. therefore `f' is a regular expression that matches the string `f' and
  513. no other string.  (It does *not* match the string `ff'.)  Likewise, `o'
  514. is a regular expression that matches only `o'.  (When case distinctions
  515. are being ignored, these regexps also match `F' and `O', but we
  516. consider this a generalization of "the same string", rather than an
  517. exception.)
  518.  
  519.    Any two regular expressions A and B can be concatenated.  The result
  520. is a regular expression which matches a string if A matches some amount
  521. of the beginning of that string and B matches the rest of the string.
  522.  
  523.    As a simple example, we can concatenate the regular expressions `f'
  524. and `o' to get the regular expression `fo', which matches only the
  525. string `fo'.  Still trivial.  To do something nontrivial, you need to
  526. use one of the special characters.  Here is a list of them.
  527.  
  528. `. (Period)'
  529.      is a special character that matches any single character except a
  530.      newline.  Using concatenation, we can make regular expressions
  531.      like `a.b' which matches any three-character string which begins
  532.      with `a' and ends with `b'.
  533.  
  534. `*'
  535.      is not a construct by itself; it is a postfix operator, which
  536.      means to match the preceding regular expression repetitively as
  537.      many times as possible.  Thus, `o*' matches any number of `o's
  538.      (including no `o's).
  539.  
  540.      `*' always applies to the *smallest* possible preceding
  541.      expression.  Thus, `fo*' has a repeating `o', not a repeating
  542.      `fo'.  It matches `f', `fo', `foo', and so on.
  543.  
  544.      The matcher processes a `*' construct by matching, immediately, as
  545.      many repetitions as can be found.  Then it continues with the rest
  546.      of the pattern.  If that fails, backtracking occurs, discarding
  547.      some of the matches of the `*'-modified construct in case that
  548.      makes it possible to match the rest of the pattern.  For example,
  549.      matching `ca*ar' against the string `caaar', the `a*' first tries
  550.      to match all three `a's; but the rest of the pattern is `ar' and
  551.      there is only `r' left to match, so this try fails.  The next
  552.      alternative is for `a*' to match only two `a's.  With this choice,
  553.      the rest of the regexp matches successfully.
  554.  
  555. `+'
  556.      is a postfix character, similar to `*' except that it must match
  557.      the preceding expression at least once.  So, for example, `ca+r'
  558.      matches the strings `car' and `caaaar' but not the string `cr',
  559.      whereas `ca*r' matches all three strings.
  560.  
  561. `?'
  562.      is a postfix character, similar to `*' except that it can match the
  563.      preceding expression either once or not at all.  For example,
  564.      `ca?r' matches `car' or `cr'; nothing else.
  565.  
  566. `[ ... ]'
  567.      is a "character set", which begins with `[' and is terminated by a
  568.      `]'.  In the simplest case, the characters between the two
  569.      brackets are what this set can match.
  570.  
  571.      Thus, `[ad]' matches either one `a' or one `d', and `[ad]*'
  572.      matches any string composed of just `a's and `d's (including the
  573.      empty string), from which it follows that `c[ad]*r' matches `cr',
  574.      `car', `cdr', `caddaar', etc.
  575.  
  576.      You can also include character ranges a character set, by writing
  577.      two characters with a `-' between them.  Thus, `[a-z]' matches any
  578.      lower-case letter.  Ranges may be intermixed freely with individual
  579.      characters, as in `[a-z$%.]', which matches any lower case letter
  580.      or `$', `%' or period.
  581.  
  582.      Note that the usual special characters are not special any more
  583.      inside a character set.  A completely different set of special
  584.      characters exists inside character sets: `]', `-' and `^'.
  585.  
  586.      To include a `]' in a character set, you must make it the first
  587.      character.  For example, `[]a]' matches `]' or `a'.  To include a
  588.      `-', write `-' at the beginning or end of a range.  To include
  589.      `^', make it other than the first character in the set.
  590.  
  591. `[^ ... ]'
  592.      `[^' begins a "complemented character set", which matches any
  593.      character except the ones specified.  Thus, `[^a-z0-9A-Z]' matches
  594.      all characters *except* letters and digits.
  595.  
  596.      `^' is not special in a character set unless it is the first
  597.      character.  The character following the `^' is treated as if it
  598.      were first (`-' and `]' are not special there).
  599.  
  600.      A complemented character set can match a newline, unless newline is
  601.      mentioned as one of the characters not to match.  This is in
  602.      contrast to the handling of regexps in programs such as `grep'.
  603.  
  604. `^'
  605.      is a special character that matches the empty string, but only at
  606.      the beginning of a line in the text being matched.  Otherwise it
  607.      fails to match anything.  Thus, `^foo' matches a `foo' which
  608.      occurs at the beginning of a line.
  609.  
  610. `$'
  611.      is similar to `^' but matches only at the end of a line.  Thus,
  612.      `xx*$' matches a string of one `x' or more at the end of a line.
  613.  
  614. `\'
  615.      has two functions: it quotes the special characters (including
  616.      `\'), and it introduces additional special constructs.
  617.  
  618.      Because `\' quotes special characters, `\$' is a regular
  619.      expression which matches only `$', and `\[' is a regular
  620.      expression which matches only `[', etc.
  621.  
  622.    Note: for historical compatibility, special characters are treated as
  623. ordinary ones if they are in contexts where their special meanings make
  624. no sense.  For example, `*foo' treats `*' as ordinary since there is no
  625. preceding expression on which the `*' can act.  It is poor practice to
  626. depend on this behavior; better to quote the special character anyway,
  627. regardless of where is appears.
  628.  
  629.    For the most part, `\' followed by any character matches only that
  630. character.  However, there are several exceptions: two-character
  631. sequences starting with `\' which have special meanings.  The second
  632. character in the sequence is always an ordinary character on their own.
  633. Here is a table of `\' constructs.
  634.  
  635. `\|'
  636.      specifies an alternative.  Two regular expressions A and B with
  637.      `\|' in between form an expression that matches anything that
  638.      either A or B matches.
  639.  
  640.      Thus, `foo\|bar' matches either `foo' or `bar' but no other string.
  641.  
  642.      `\|' applies to the largest possible surrounding expressions.
  643.      Only a surrounding `\( ... \)' grouping can limit the scope of
  644.      `\|'.
  645.  
  646.      Full backtracking capability exists to handle multiple uses of
  647.      `\|'.
  648.  
  649. `\( ... \)'
  650.      is a grouping construct that serves three purposes:
  651.  
  652.        1. To enclose a set of `\|' alternatives for other operations.
  653.           Thus, `\(foo\|bar\)x' matches either `foox' or `barx'.
  654.  
  655.        2. To enclose a complicated expression for the postfix operators
  656.           `*', `+' and `?' to operate on.  Thus, `ba\(na\)*' matches
  657.           `bananana', etc., with any (zero or more) number of `na'
  658.           strings.
  659.  
  660.        3. To mark a matched substring for future reference.
  661.  
  662.  
  663.      This last application is not a consequence of the idea of a
  664.      parenthetical grouping; it is a separate feature which is assigned
  665.      as a second meaning to the same `\( ... \)' construct.  In practice
  666.      there is no conflict between the two meanings.  Here is an
  667.      explanation of this feature:
  668.  
  669. `\D'
  670.      after the end of a `\( ... \)' construct, the matcher remembers
  671.      the beginning and end of the text matched by that construct.  Then,
  672.      later on in the regular expression, you can use `\' followed by the
  673.      digit D to mean "match the same text matched the Dth time by the
  674.      `\( ... \)' construct."
  675.  
  676.      The strings matching the first nine `\( ... \)' constructs
  677.      appearing in a regular expression are assigned numbers 1 through 9
  678.      in order that the open-parentheses appear in the regular
  679.      expression.  `\1' through `\9' refer to the text previously
  680.      matched by the corresponding `\( ... \)' construct.
  681.  
  682.      For example, `\(.*\)\1' matches any newline-free string that is
  683.      composed of two identical halves.  The `\(.*\)' matches the first
  684.      half, which may be anything, but the `\1' that follows must match
  685.      the same exact text.
  686.  
  687. `\`'
  688.      matches the empty string, provided it is at the beginning of the
  689.      buffer.
  690.  
  691. `\''
  692.      matches the empty string, provided it is at the end of the buffer.
  693.  
  694. `\b'
  695.      matches the empty string, provided it is at the beginning or end
  696.      of a word.  Thus, `\bfoo\b' matches any occurrence of `foo' as a
  697.      separate word.  `\bballs?\b' matches `ball' or `balls' as a
  698.      separate word.
  699.  
  700. `\B'
  701.      matches the empty string, provided it is *not* at the beginning or
  702.      end of a word.
  703.  
  704. `\<'
  705.      matches the empty string, provided it is at the beginning of a
  706.      word.
  707.  
  708. `\>'
  709.      matches the empty string, provided it is at the end of a word.
  710.  
  711. `\w'
  712.      matches any word-constituent character.  The syntax table
  713.      determines which characters these are.
  714.  
  715. `\W'
  716.      matches any character that is not a word-constituent.
  717.  
  718. `\sC'
  719.      matches any character whose syntax is C.  Here C is a character
  720.      which represents a syntax code: thus, `w' for word constituent,
  721.      `(' for open-parenthesis, etc.  Represent a character of
  722.      whitespace (which can be a newline) by either `-' or a space
  723.      character.
  724.  
  725. `\SC'
  726.      matches any character whose syntax is not C.
  727.  
  728.    The constructs that pertain to words and syntax are controlled by the
  729. setting of the syntax table (*note Syntax::.).
  730.  
  731.    Here is a complicated regexp, used by Emacs to recognize the end of a
  732. sentence together with any whitespace that follows.  It is given in Lisp
  733. syntax to enable you to distinguish the spaces from the tab characters.
  734. In Lisp syntax, the string constant begins and ends with a
  735. double-quote.  `\"' stands for a double-quote as part of the regexp,
  736. `\\' for a backslash as part of the regexp, `\t' for a tab and `\n' for
  737. a newline.
  738.  
  739.      "[.?!][]\"')]*\\($\\|\t\\|  \\)[ \t\n]*"
  740.  
  741. This contains four parts in succession: a character set matching period,
  742. `?', or `!'; a character set matching close-brackets, quotes, or
  743. parentheses, repeated any number of times; an alternative in
  744. backslash-parentheses that matches end-of-line, a tab, or two spaces;
  745. and a character set matching whitespace characters, repeated any number
  746. of times.
  747.  
  748.    To enter the same regexp interactively, you would type TAB to enter
  749. a tab, and `C-q C-j' to enter a newline.  You would also type single
  750. slashes as themselves, instead of doubling them for Lisp syntax.
  751.  
  752. 
  753. File: emacs,  Node: Search Case,  Next: Replace,  Prev: Regexps,  Up: Search
  754.  
  755. Searching and Case
  756. ==================
  757.  
  758.    All sorts of searches in Emacs normally ignore the case of the text
  759. they are searching through, if you specify the text in lower case.
  760. Thus, if you specify searching for `foo', then `Foo' and `foo' are also
  761. considered a match.  Regexps, and in particular character sets, are
  762. included: `[ab]' would match `a' or `A' or `b' or `B'.
  763.  
  764.    An upper-case letter in the search string makes the search
  765. case-sensitive.  Thus, searching for `Foo' does not find `foo' or
  766. `FOO'.  This applies to regular expression search also.  If you delete
  767. the upper-case character from the search string, it ceases to have this
  768. effect.
  769.  
  770.    If you set the variable `case-fold-search' to `nil', then all
  771. letters must match exactly, including case.  This is a per-buffer
  772. variable; altering the variable affects only the current buffer, but
  773. there is a default value which you can change as well.  *Note Locals::.
  774.  
  775. 
  776. File: emacs,  Node: Replace,  Next: Other Repeating Search,  Prev: Search Case,  Up: Search
  777.  
  778. Replacement Commands
  779. ====================
  780.  
  781.    Global search-and-replace operations are not needed as often in Emacs
  782. as they are in other editors(1), but they are available.  In addition
  783. to the simple `M-x replace-string' command which is like that found in
  784. most editors, there is a `M-x query-replace' command which asks you, for
  785. each occurrence of the pattern, whether to replace it.
  786.  
  787.    The replace commands all replace one string (or regexp) with one
  788. replacement string.  It is possible to perform several replacements in
  789. parallel using the command `expand-region-abbrevs'.  *Note Expanding
  790. Abbrevs::.
  791.  
  792. * Menu:
  793.  
  794. * Unconditional Replace::  Replacing all matches for a string.
  795. * Regexp Replace::         Replacing all matches for a regexp.
  796. * Replacement and Case::   How replacements preserve case of letters.
  797. * Query Replace::          How to use querying.
  798.  
  799.    ---------- Footnotes ----------
  800.  
  801.    (1)  In some editors, search-and-replace operations are the only
  802. convenient way to make a single change in the text.
  803.  
  804. 
  805. File: emacs,  Node: Unconditional Replace,  Next: Regexp Replace,  Prev: Replace,  Up: Replace
  806.  
  807. Unconditional Replacement
  808. -------------------------
  809.  
  810. `M-x replace-string RET STRING RET NEWSTRING RET'
  811.      Replace every occurrence of STRING with NEWSTRING.
  812.  
  813. `M-x replace-regexp RET REGEXP RET NEWSTRING RET'
  814.      Replace every match for REGEXP with NEWSTRING.
  815.  
  816.    To replace every instance of `foo' after point with `bar', use the
  817. command `M-x replace-string' with the two arguments `foo' and `bar'.
  818. Replacement happens only in the text after point, so if you want to
  819. cover the whole buffer you must go to the beginning first.  All
  820. occurrences up to the end of the buffer are replaced; to limit
  821. replacement to part of the buffer, narrow to that part of the buffer
  822. before doing the replacement (*note Narrowing::.).
  823.  
  824.    When `replace-string' exits, point is left at the last occurrence
  825. replaced.  The position of point where the `replace-string' command was
  826. issued is remembered on the mark ring; use `C-u C-SPC' to move back
  827. there.
  828.  
  829.    A numeric argument restricts replacement to matches that are
  830. surrounded by word boundaries.
  831.  
  832. 
  833. File: emacs,  Node: Regexp Replace,  Next: Replacement and Case,  Prev: Unconditional Replace,  Up: Replace
  834.  
  835. Regexp Replacement
  836. ------------------
  837.  
  838.    The `M-x replace-string' command replaces exact matches for a single
  839. string.  The similar command `M-x replace-regexp' replaces any match
  840. for a specified pattern.
  841.  
  842.    In `replace-regexp', the NEWSTRING need not be constant: it can
  843. refer to all or part of what is matched by the REGEXP.  `\&' in
  844. NEWSTRING stands for the entire text being replaced.  `\D' in
  845. NEWSTRING, where D is a digit, stands for whatever matched the Dth
  846. parenthesized grouping in REGEXP.  To include a `\' in the text to
  847. replace with, you must give `\\'.  For example,
  848.  
  849.      M-x replace-regexp RET c[ad]+r RET \&-safe RET
  850.  
  851. replaces (for example) `cadr' with `cadr-safe' and `cddr' with
  852. `cddr-safe'.
  853.  
  854.      M-x replace-regexp RET \(c[ad]+r\)-safe RET \1 RET
  855.  
  856. performs the inverse transformation.
  857.  
  858. 
  859. File: emacs,  Node: Replacement and Case,  Next: Query Replace,  Prev: Regexp Replace,  Up: Replace
  860.  
  861. Replace Commands and Case
  862. -------------------------
  863.  
  864.    If the arguments to a replace command are in lower case, it preserves
  865. case when it makes a replacement.  Thus, the command
  866.  
  867.      M-x replace-string RET foo RET bar RET
  868.  
  869. replaces a lower case `foo' with a lower case `bar', `FOO' with `BAR',
  870. and `Foo' with `Bar'.  If upper case letters are used in the second
  871. argument, they remain upper case every time that argument is inserted.
  872. If upper case letters are used in the first argument, the second
  873. argument is always substituted exactly as given, with no case
  874. conversion.  Likewise, if the variable `case-replace' is set to `nil',
  875. replacement is done without case conversion.  If `case-fold-search' is
  876. set to `nil', case is significant in matching occurrences of `foo' to
  877. replace; this also inhibits case conversion of the replacement string.
  878.  
  879. 
  880. File: emacs,  Node: Query Replace,  Prev: Replacement and Case,  Up: Replace
  881.  
  882. Query Replace
  883. -------------
  884.  
  885. `M-% STRING RET NEWSTRING RET'
  886. `M-x query-replace RET STRING RET NEWSTRING RET'
  887.      Replace some occurrences of STRING with NEWSTRING.
  888.  
  889. `M-x query-replace-regexp RET REGEXP RET NEWSTRING RET'
  890.      Replace some matches for REGEXP with NEWSTRING.
  891.  
  892.    If you want to change only some of the occurrences of `foo' to
  893. `bar', not all of them, then you cannot use an ordinary
  894. `replace-string'.  Instead, use `M-%' (`query-replace').  This command
  895. finds occurrences of `foo' one by one, displays each occurrence and
  896. asks you whether to replace it.  A numeric argument to `query-replace'
  897. tells it to consider only occurrences that are bounded by
  898. word-delimiter characters.  This preserves case, just like
  899. `replace-string', provided `case-replace' is non-`nil', as it normally
  900. is.
  901.  
  902.    Aside from querying, `query-replace' works just like
  903. `replace-string', and `query-replace-regexp' works just like
  904. `replace-regexp'.  The shortest way to type this command name is `M-x
  905. qu SPC SPC SPC RET'.
  906.  
  907.    The things you can type when you are shown an occurrence of STRING
  908. or a match for REGEXP are:
  909.  
  910. `SPC'
  911.      to replace the occurrence with NEWSTRING.
  912.  
  913. `DEL'
  914.      to skip to the next occurrence without replacing this one.
  915.  
  916. `, (Comma)'
  917.      to replace this occurrence and display the result.  You are then
  918.      asked for another input character, except that since the
  919.      replacement has already been made, DEL and SPC are equivalent.
  920.      You could type `C-r' at this point (see below) to alter the
  921.      replaced text.  You could also type `C-x u' to undo the
  922.      replacement; this exits the `query-replace', so if you want to do
  923.      further replacement you must use `C-x ESC RET' to restart (*note
  924.      Repetition::.).
  925.  
  926. `RET'
  927. `ESC'
  928.      to exit without doing any more replacements.
  929.  
  930. `. (Period)'
  931.      to replace this occurrence and then exit without searching for more
  932.      occurrences.
  933.  
  934. `!'
  935.      to replace all remaining occurrences without asking again.
  936.  
  937. `^'
  938.      to go back to the position of the previous occurrence (or what
  939.      used to be an occurrence), in case you changed it by mistake.
  940.      This works by popping the mark ring.  Only one `^' in a row is
  941.      allowed, because only one previous replacement position is kept
  942.      during `query-replace'.
  943.  
  944. `C-r'
  945.      to enter a recursive editing level, in case the occurrence needs
  946.      to be edited rather than just replaced with NEWSTRING.  When you
  947.      are done, exit the recursive editing level with `C-M-c' to proceed
  948.      to the next occurrence.  *Note Recursive Edit::.
  949.  
  950. `C-w'
  951.      to delete the occurrence, and then enter a recursive editing level
  952.      as in `C-r'.  Use the recursive edit to insert text to replace the
  953.      deleted occurrence of STRING.  When done, exit the recursive
  954.      editing level with `C-M-c' to proceed to the next occurrence.
  955.  
  956. `C-l'
  957.      to redisplay the screen.  Then you must type another character to
  958.      specify what to do with this occurrence.
  959.  
  960. `C-h'
  961.      to display a message summarizing these options.  Then you must type
  962.      another character to specify what to do with this occurrence.
  963.  
  964.    Some other characters are aliases for the ones listed above: `y',
  965. `n' and `q' are equivalent to SPC, DEL and ESC.
  966.  
  967.    Aside from this, any other character exits the `query-replace', and
  968. is then reread as part of a key sequence.  Thus, if you type `C-k', it
  969. exits the `query-replace' and then kills to end of line.
  970.  
  971.    To restart a `query-replace' once it is exited, use `C-x ESC', which
  972. repeats the `query-replace' because it used the minibuffer to read its
  973. arguments.  *Note C-x ESC: Repetition.
  974.  
  975.    See also *Note Transforming File Names::, for Dired commands to
  976. rename, copy, or link files by replacing regexp matches in file names.
  977.  
  978. 
  979. File: emacs,  Node: Other Repeating Search,  Prev: Replace,  Up: Search
  980.  
  981. Other Search-and-Loop Commands
  982. ==============================
  983.  
  984.    Here are some other commands that find matches for a regular
  985. expression.  They all operate from point to the end of the buffer.
  986.  
  987. `M-x occur RET REGEXP RET'
  988.      Print each line that follows point and contains a match for
  989.      REGEXP.  A numeric argument specifies the number of context lines
  990.      to print before and after each matching line; the default is none.
  991.  
  992.      The buffer `*Occur*' containing the output serves as a menu for
  993.      finding the occurrences in their original context.  Find an
  994.      occurrence as listed in `*Occur*', position point there and type
  995.      `C-c C-c'; this switches to the buffer that was searched and moves
  996.      point to the original of the same occurrence.
  997.  
  998. `M-x list-matching-lines'
  999.      Synonym for `M-x occur'.
  1000.  
  1001. `M-x count-matches RET REGEXP RET'
  1002.      Print the number of matches for REGEXP after point.
  1003.  
  1004. `M-x flush-lines RET REGEXP RET'
  1005.      Delete each line that follows point and does not contain a match
  1006.      for REGEXP.
  1007.  
  1008. `M-x keep-lines RET REGEXP RET'
  1009.      Delete each line that follows point and contains a match for
  1010.      REGEXP.
  1011.  
  1012. 
  1013. File: emacs,  Node: Fixit,  Next: Files,  Prev: Search,  Up: Top
  1014.  
  1015. Commands for Fixing Typos
  1016. *************************
  1017.  
  1018.    In this chapter we describe the commands that are especially useful
  1019. for the times when you catch a mistake in your text just after you have
  1020. made it, or change your mind while composing text on line.
  1021.  
  1022. * Menu:
  1023.  
  1024. * Kill Errors:: Commands to kill a batch of recently entered text.
  1025. * Transpose::   Exchanging two characters, words, lines, lists...
  1026. * Fixing Case:: Correcting case of last word entered.
  1027. * Spelling::    Apply spelling checker to a word, or a whole file.
  1028.  
  1029. 
  1030. File: emacs,  Node: Kill Errors,  Next: Transpose,  Up: Fixit
  1031.  
  1032. Killing Your Mistakes
  1033. =====================
  1034.  
  1035. `DEL'
  1036.      Delete last character (`delete-backward-char').
  1037.  
  1038. `M-DEL'
  1039.      Kill last word (`backward-kill-word').
  1040.  
  1041. `C-x DEL'
  1042.      Kill to beginning of sentence (`backward-kill-sentence').
  1043.  
  1044.    The DEL character (`delete-backward-char') is the most important
  1045. correction command.  When used among graphic (self-inserting)
  1046. characters, it can be thought of as canceling the last character typed.
  1047.  
  1048.    When your mistake is longer than a couple of characters, it might be
  1049. more convenient to use `M-DEL' or `C-x DEL'.  `M-DEL' kills back to the
  1050. start of the last word, and `C-x DEL' kills back to the start of the
  1051. last sentence.  `C-x DEL' is particularly useful when you change your
  1052. mind about the phrasing of the text you are writing.  `M-DEL' and `C-x
  1053. DEL' save the killed text for `C-y' and `M-y' to retrieve.  *Note
  1054. Yanking::.
  1055.  
  1056.    `M-DEL' is often useful even when you have typed only a few
  1057. characters wrong, if you know you are confused in your typing and aren't
  1058. sure exactly what you typed.  At such a time, you cannot correct with
  1059. DEL except by looking at the screen to see what you did.  It requires
  1060. less thought to kill the whole word and start over again.
  1061.  
  1062. 
  1063. File: emacs,  Node: Transpose,  Next: Fixing Case,  Prev: Kill Errors,  Up: Fixit
  1064.  
  1065. Transposing Text
  1066. ================
  1067.  
  1068. `C-t'
  1069.      Transpose two characters (`transpose-chars').
  1070.  
  1071. `M-t'
  1072.      Transpose two words (`transpose-words').
  1073.  
  1074. `C-M-t'
  1075.      Transpose two balanced expressions (`transpose-sexps').
  1076.  
  1077. `C-x C-t'
  1078.      Transpose two lines (`transpose-lines').
  1079.  
  1080.    The common error of transposing two characters can be fixed, when
  1081. they are adjacent, with the `C-t' command (`transpose-chars').
  1082. Normally, `C-t' transposes the two characters on either side of point.
  1083. When given at the end of a line, rather than transposing the last
  1084. character of the line with the newline, which would be useless, `C-t'
  1085. transposes the last two characters on the line.  So, if you catch your
  1086. transposition error right away, you can fix it with just a `C-t'.  If
  1087. you don't catch it so fast, you must move the cursor back to between
  1088. the two transposed characters.  If you transposed a space with the last
  1089. character of the word before it, the word motion commands are a good
  1090. way of getting there.  Otherwise, a reverse search (`C-r') is often the
  1091. best way.  *Note Search::.
  1092.  
  1093.    `M-t' (`transpose-words') transposes the word before point with the
  1094. word after point.  It moves point forward over a word, dragging the
  1095. word preceding or containing point forward as well.  The punctuation
  1096. characters between the words do not move.  For example, `FOO, BAR'
  1097. transposes into `BAR, FOO' rather than `BAR FOO,'.
  1098.  
  1099.    `C-M-t' (`transpose-sexps') is a similar command for transposing two
  1100. expressions (*note Lists::.), and `C-x C-t' (`transpose-lines')
  1101. exchanges lines.  They work like `M-t' except in determining the
  1102. division of the text into syntactic units.
  1103.  
  1104.    A numeric argument to a transpose command serves as a repeat count:
  1105. it tells the transpose command to move the character (word, sexp, line)
  1106. before or containing point across several other characters (words,
  1107. sexps, lines).  For example, `C-u 3 C-t' moves the character before
  1108. point forward across three other characters.  It would change
  1109. `f-!-oobar' into `oobf-!-ar'.  This is equivalent to repeating `C-t'
  1110. three times.  `C-u - 4 M-t' moves the word before point backward across
  1111. four words.  `C-u - C-M-t' would cancel the effect of plain `C-M-t'.
  1112.  
  1113.    A numeric argument of zero is assigned a special meaning (because
  1114. otherwise a command with a repeat count of zero would do nothing): to
  1115. transpose the character (word, sexp, line) ending after point with the
  1116. one ending after the mark.
  1117.  
  1118. 
  1119. File: emacs,  Node: Fixing Case,  Next: Spelling,  Prev: Transpose,  Up: Fixit
  1120.  
  1121. Case Conversion
  1122. ===============
  1123.  
  1124. `M-- M-l'
  1125.      Convert last word to lower case.  Note `Meta--' is Meta-minus.
  1126.  
  1127. `M-- M-u'
  1128.      Convert last word to all upper case.
  1129.  
  1130. `M-- M-c'
  1131.      Convert last word to lower case with capital initial.
  1132.  
  1133.    A very common error is to type words in the wrong case.  Because of
  1134. this, the word case-conversion commands `M-l', `M-u' and `M-c' have a
  1135. special feature when used with a negative argument: they do not move the
  1136. cursor.  As soon as you see you have mistyped the last word, you can
  1137. simply case-convert it and go on typing.  *Note Case::.
  1138.  
  1139.