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