diff options
| author | Richard M. Stallman | 2001-06-29 03:23:32 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-06-29 03:23:32 +0000 |
| commit | d2fab8383d074e6570d703a2919e03f09cafc9f3 (patch) | |
| tree | d79ba493ddaa03fd7d82107929dc6e14630c39a5 | |
| parent | c6fcb73d2a8b2f024885ff52654622b56e993e4e (diff) | |
| download | emacs-d2fab8383d074e6570d703a2919e03f09cafc9f3.tar.gz emacs-d2fab8383d074e6570d703a2919e03f09cafc9f3.zip | |
Explain purpose of mode hooks.
Xref to Tags from Imenu.
Don't use "sections or definitions" in Imenu.
Cindex "pretty printer".
Mention LINEFEED.
Explain uses of values of lisp-indent-function.
Explain why C-M-DEL is sometimes not available.
Doc values of hs-isearch-open.
Minor cleanups.
| -rw-r--r-- | man/programs.texi | 137 |
1 files changed, 82 insertions, 55 deletions
diff --git a/man/programs.texi b/man/programs.texi index 2787a07bf95..ec9c7a70a0e 100644 --- a/man/programs.texi +++ b/man/programs.texi | |||
| @@ -112,12 +112,13 @@ Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL | |||
| 112 | @vindex emacs-lisp-mode-hook | 112 | @vindex emacs-lisp-mode-hook |
| 113 | @vindex lisp-interaction-mode-hook | 113 | @vindex lisp-interaction-mode-hook |
| 114 | @vindex scheme-mode-hook | 114 | @vindex scheme-mode-hook |
| 115 | Turning on a major mode runs a normal hook called the @dfn{mode hook}, | 115 | Turning on a major mode runs a normal hook called the @dfn{mode |
| 116 | which is the value of a Lisp variable. Each major mode has a mode hook, | 116 | hook}, which is the value of a Lisp variable. Each major mode has a |
| 117 | and the hook's name is always made from the mode command's name by | 117 | mode hook, and the hook's name is always made from the mode command's |
| 118 | adding @samp{-hook}. For example, turning on C mode runs the hook | 118 | name by adding @samp{-hook}. For example, turning on C mode runs the |
| 119 | @code{c-mode-hook}, while turning on Lisp mode runs the hook | 119 | hook @code{c-mode-hook}, while turning on Lisp mode runs the hook |
| 120 | @code{lisp-mode-hook}. @xref{Hooks}. | 120 | @code{lisp-mode-hook}. The purpose of the mode hook is to give you a |
| 121 | place to set up customizations for that major mode. @xref{Hooks}. | ||
| 121 | 122 | ||
| 122 | @node Defuns | 123 | @node Defuns |
| 123 | @section Top-Level Definitions, or Defuns | 124 | @section Top-Level Definitions, or Defuns |
| @@ -250,38 +251,40 @@ any or all of these key bindings for that purpose. | |||
| 250 | @cindex buffer content indexes | 251 | @cindex buffer content indexes |
| 251 | @cindex tags | 252 | @cindex tags |
| 252 | 253 | ||
| 253 | The Imenu facility offers a way to find the definitions or sections | 254 | The Imenu facility offers a way to find the definitions in a file by |
| 254 | in a file. | 255 | name. It is also useful in text formatter major modes, where it |
| 256 | treats each chapter, section, etc., as a definition. (@pxref{Tags}, | ||
| 257 | for a more powerful feature that handles multiple files together.) | ||
| 255 | 258 | ||
| 256 | @findex imenu | 259 | @findex imenu |
| 257 | @findex imenu-add-menu-bar-index | 260 | @findex imenu-add-menu-bar-index |
| 258 | If you type @kbd{M-x imenu}, it reads the name of a section or | 261 | If you type @kbd{M-x imenu}, it reads the name of a definition in |
| 259 | definition in the current buffer, then goes to that section or | 262 | the current buffer, then goes to that definition. You can use |
| 260 | definition. You can use completion to specify the name, and a | 263 | completion to specify the name, and a complete list of possible names |
| 261 | complete list of possible names is always displayed. | 264 | is always displayed. |
| 262 | 265 | ||
| 263 | Alternatively you can bind the command @code{imenu} to a mouse | 266 | Alternatively, you can bind the command @code{imenu} to a mouse |
| 264 | click. Then it displays mouse menus for you to select the section or | 267 | click. Then it displays mouse menus for you to select the definition |
| 265 | definition you want. You can also add the buffer's index to the menu | 268 | you want. You can also add the buffer's index to the menu bar by |
| 266 | bar by calling @code{imenu-add-menu-bar-index}. If you want to have | 269 | calling @code{imenu-add-menu-bar-index}. If you want to have this |
| 267 | this menu bar item available for all buffers in a certain major mode, | 270 | menu bar item available for all buffers in a certain major mode, you |
| 268 | you can do this by adding @code{imenu-add-menu-bar-index} to its mode | 271 | can do this by adding @code{imenu-add-menu-bar-index} to its mode |
| 269 | hook. But then you will have to wait for the buffer to be searched | 272 | hook. But then you will have to wait for the buffer to be searched |
| 270 | for sections and definitions, each time you visit a file which uses | 273 | for definitions, each time you visit a file which uses that mode. |
| 271 | that mode. | ||
| 272 | 274 | ||
| 273 | @vindex imenu-auto-rescan | 275 | @vindex imenu-auto-rescan |
| 274 | When you change the contents of a buffer, if you add or delete | 276 | When you change the contents of a buffer, if you add or delete |
| 275 | definitions or sections, you can update the buffer's index to | 277 | definitions, you can update the buffer's index to correspond to the |
| 276 | correspond to the new contents by invoking the @samp{*Rescan*} item in | 278 | new contents by invoking the @samp{*Rescan*} item in the menu. |
| 277 | the menu. Rescanning happens automatically if | 279 | Rescanning happens automatically if @code{imenu-auto-rescan} is |
| 278 | @code{imenu-auto-rescan} is non-@code{nil}. There is no need to | 280 | non-@code{nil}. There is no need to rescan because of small changes |
| 279 | rescan because of small changes in the text. | 281 | in the text. |
| 280 | 282 | ||
| 281 | @vindex imenu-sort-function | 283 | @vindex imenu-sort-function |
| 282 | You can customize the way the menus are sorted via the variable | 284 | You can customize the way the menus are sorted by setting the |
| 283 | @code{imenu-sort-function}. By default names are ordered as they | 285 | variable @code{imenu-sort-function}. By default names are ordered as |
| 284 | occur in the buffer; alphabetic sorting is provided as an alternative. | 286 | they occur in the buffer; alphabetic sorting is provided as an |
| 287 | alternative. | ||
| 285 | 288 | ||
| 286 | Imenu provides the information to guide Which Function mode | 289 | Imenu provides the information to guide Which Function mode |
| 287 | @ifnottex | 290 | @ifnottex |
| @@ -326,22 +329,23 @@ inside a single parenthetical grouping. | |||
| 326 | * Custom C Indent:: Controlling indentation style for C and related modes. | 329 | * Custom C Indent:: Controlling indentation style for C and related modes. |
| 327 | @end menu | 330 | @end menu |
| 328 | 331 | ||
| 332 | @cindex pretty-printer | ||
| 329 | Emacs also provides a Lisp pretty-printer in the library @code{pp}. | 333 | Emacs also provides a Lisp pretty-printer in the library @code{pp}. |
| 330 | This program reformats a Lisp object with indentation chosen to look nice. | 334 | This program reformats a Lisp object with indentation chosen to look nice. |
| 331 | 335 | ||
| 332 | @node Basic Indent | 336 | @node Basic Indent |
| 333 | @subsection Basic Program Indentation Commands | 337 | @subsection Basic Program Indentation Commands |
| 334 | 338 | ||
| 335 | Programming language major modes define the @key{TAB} key to indent | 339 | The basic indentation commands indent a single line according to the |
| 336 | according to the usual conventions of the language you are editing. | 340 | usual conventions of the language you are editing. |
| 337 | @kbd{C-j} is normally defined to do @key{RET} followed by @key{TAB}; | ||
| 338 | thus, it too indents in a mode-specific fashion. | ||
| 339 | 341 | ||
| 340 | @table @kbd | 342 | @table @kbd |
| 341 | @item @key{TAB} | 343 | @item @key{TAB} |
| 342 | Adjust indentation of current line. | 344 | Adjust indentation of current line. |
| 343 | @item C-j | 345 | @item C-j |
| 344 | Equivalent to @key{RET} followed by @key{TAB} (@code{newline-and-indent}). | 346 | Equivalent to @key{RET} followed by @key{TAB} (@code{newline-and-indent}). |
| 347 | @item @key{LINEFEED} | ||
| 348 | This key is a way to enter @kbd{C-j}, on some keyboards. | ||
| 345 | @end table | 349 | @end table |
| 346 | 350 | ||
| 347 | @kindex TAB @r{(programming modes)} | 351 | @kindex TAB @r{(programming modes)} |
| @@ -459,24 +463,25 @@ such lines are always indented @code{lisp-indent-offset} more columns than | |||
| 459 | the containing list. | 463 | the containing list. |
| 460 | 464 | ||
| 461 | @vindex lisp-body-indent | 465 | @vindex lisp-body-indent |
| 462 | The standard pattern is overridden for certain functions. Functions | 466 | Certain functions override the standard pattern. Functions whose |
| 463 | whose names start with @code{def} always indent the second line by | 467 | names start with @code{def} treat the the second lines as the start of |
| 464 | @code{lisp-body-indent} extra columns beyond the open-parenthesis | 468 | a @dfn{body}, by indenting the second line @code{lisp-body-indent} |
| 465 | starting the expression. | 469 | additional columns beyond the open-parenthesis that starts the |
| 470 | expression. | ||
| 466 | 471 | ||
| 467 | The standard pattern can be overridden in various ways for individual | 472 | You can override the standard pattern in various ways for individual |
| 468 | functions, according to the @code{lisp-indent-function} property of the | 473 | functions, according to the @code{lisp-indent-function} property of the |
| 469 | function name. There are four possibilities for this property: | 474 | function name. There are four possibilities for this property: |
| 470 | 475 | ||
| 471 | @table @asis | 476 | @table @asis |
| 472 | @item @code{nil} | 477 | @item @code{nil} |
| 473 | This is the same as no property; the standard indentation pattern is used. | 478 | This is the same as no property---use the standard indentation pattern. |
| 474 | @item @code{defun} | 479 | @item @code{defun} |
| 475 | The pattern used for function names that start with @code{def} is used for | 480 | Handle this function like a @samp{def} construct: treat the second |
| 476 | this function also. | 481 | line the start of a @dfn{body}. |
| 477 | @item a number, @var{number} | 482 | @item a number, @var{number} |
| 478 | The first @var{number} arguments of the function are | 483 | The first @var{number} arguments of the function are |
| 479 | @dfn{distinguished} arguments; the rest are considered the @dfn{body} | 484 | @dfn{distinguished} arguments; the rest are considered the body |
| 480 | of the expression. A line in the expression is indented according to | 485 | of the expression. A line in the expression is indented according to |
| 481 | whether the first argument on it is distinguished or not. If the | 486 | whether the first argument on it is distinguished or not. If the |
| 482 | argument is part of the body, the line is indented @code{lisp-body-indent} | 487 | argument is part of the body, the line is indented @code{lisp-body-indent} |
| @@ -484,7 +489,7 @@ more columns than the open-parenthesis starting the containing | |||
| 484 | expression. If the argument is distinguished and is either the first | 489 | expression. If the argument is distinguished and is either the first |
| 485 | or second argument, it is indented @emph{twice} that many extra columns. | 490 | or second argument, it is indented @emph{twice} that many extra columns. |
| 486 | If the argument is distinguished and not the first or second argument, | 491 | If the argument is distinguished and not the first or second argument, |
| 487 | the standard pattern is followed for that line. | 492 | the line uses the standard pattern. |
| 488 | @item a symbol, @var{symbol} | 493 | @item a symbol, @var{symbol} |
| 489 | @var{symbol} should be a function name; that function is called to | 494 | @var{symbol} should be a function name; that function is called to |
| 490 | calculate the indentation of a line within this expression. The | 495 | calculate the indentation of a line within this expression. The |
| @@ -710,7 +715,11 @@ opposite direction. | |||
| 710 | (@code{kill-sexp}) or @kbd{C-M-@key{DEL}} (@code{backward-kill-sexp}). | 715 | (@code{kill-sexp}) or @kbd{C-M-@key{DEL}} (@code{backward-kill-sexp}). |
| 711 | @kbd{C-M-k} kills the characters that @kbd{C-M-f} would move over, and | 716 | @kbd{C-M-k} kills the characters that @kbd{C-M-f} would move over, and |
| 712 | @kbd{C-M-@key{DEL}} kills the characters that @kbd{C-M-b} would move | 717 | @kbd{C-M-@key{DEL}} kills the characters that @kbd{C-M-b} would move |
| 713 | over. | 718 | over. On some machines, @kbd{C-M-@key{DEL}} typed on the console is a |
| 719 | command to reboot; when that is so, you cannot use it as an Emacs | ||
| 720 | command. This conflict is rare, though: usually the @key{DEL} key for | ||
| 721 | Emacs is really @key{BACKSPACE}, and the reboot command is | ||
| 722 | @kbd{C-M-@key{DELETE}}, so there is no conflict. | ||
| 714 | 723 | ||
| 715 | @cindex transposition of expressions | 724 | @cindex transposition of expressions |
| 716 | @kindex C-M-t | 725 | @kindex C-M-t |
| @@ -787,7 +796,7 @@ parenthesis structure. To move @emph{up} one (or @var{n}) levels, use | |||
| 787 | @kbd{C-M-u} (@code{backward-up-list}). @kbd{C-M-u} moves backward up | 796 | @kbd{C-M-u} (@code{backward-up-list}). @kbd{C-M-u} moves backward up |
| 788 | past one unmatched opening delimiter. A positive argument serves as a | 797 | past one unmatched opening delimiter. A positive argument serves as a |
| 789 | repeat count; a negative argument reverses the direction of motion, so | 798 | repeat count; a negative argument reverses the direction of motion, so |
| 790 | that the command forward and up one or more levels. | 799 | that the command moves forward and up one or more levels. |
| 791 | 800 | ||
| 792 | To move @emph{down} in the parenthesis structure, use @kbd{C-M-d} | 801 | To move @emph{down} in the parenthesis structure, use @kbd{C-M-d} |
| 793 | (@code{down-list}). In Lisp mode, where @samp{(} is the only opening | 802 | (@code{down-list}). In Lisp mode, where @samp{(} is the only opening |
| @@ -1145,13 +1154,15 @@ for ``w/o (without) man,'' since it doesn't use the @code{man} | |||
| 1145 | program.}. Unlike @kbd{M-x man}, it does not run any external | 1154 | program.}. Unlike @kbd{M-x man}, it does not run any external |
| 1146 | programs to format and display the man pages; instead it does the job | 1155 | programs to format and display the man pages; instead it does the job |
| 1147 | in Emacs Lisp, so it works on systems such as MS-Windows, where the | 1156 | in Emacs Lisp, so it works on systems such as MS-Windows, where the |
| 1148 | @code{man} program and the other programs it needs are not readily | 1157 | @code{man} program (and the other programs it uses) are not generally |
| 1149 | available. @kbd{M-x woman} prompts for a name of a manual page, and | 1158 | available. |
| 1150 | provides completion based on the list of manual pages that are | 1159 | |
| 1151 | installed on your machine; the list of available manual pages is | 1160 | @kbd{M-x woman} prompts for a name of a manual page, and provides |
| 1152 | computed automatically the first time you invoke @code{woman}. The | 1161 | completion based on the list of manual pages that are installed on |
| 1153 | word at point in the current buffer is used to suggest the default | 1162 | your machine; the list of available manual pages is computed |
| 1154 | for the name the manual page. | 1163 | automatically the first time you invoke @code{woman}. The word at |
| 1164 | point in the current buffer is used to suggest the default for the | ||
| 1165 | name the manual page. | ||
| 1155 | 1166 | ||
| 1156 | With a numeric argument, @kbd{M-x woman} recomputes the list of the | 1167 | With a numeric argument, @kbd{M-x woman} recomputes the list of the |
| 1157 | manual pages used for completion. This is useful if you add or delete | 1168 | manual pages used for completion. This is useful if you add or delete |
| @@ -1280,10 +1291,26 @@ Hide all blocks @var{n} levels below this block | |||
| 1280 | @table @code | 1291 | @table @code |
| 1281 | @item hs-hide-comments-when-hiding-all | 1292 | @item hs-hide-comments-when-hiding-all |
| 1282 | Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too. | 1293 | Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too. |
| 1294 | |||
| 1283 | @item hs-isearch-open | 1295 | @item hs-isearch-open |
| 1284 | Specifies what kind of hidden blocks to open in Isearch mode. | 1296 | Specifies what kind of hidden blocks to open in Isearch mode. |
| 1297 | The value should be one of these four symbols. | ||
| 1298 | |||
| 1299 | @table @code | ||
| 1300 | @item block | ||
| 1301 | Open only blocks. | ||
| 1302 | @item comment | ||
| 1303 | Open only comments. | ||
| 1304 | @item t | ||
| 1305 | Open both blocks and comments. | ||
| 1306 | @item nil | ||
| 1307 | Open neither blocks nor comments. | ||
| 1308 | @end table | ||
| 1309 | |||
| 1285 | @item hs-special-modes-alist | 1310 | @item hs-special-modes-alist |
| 1286 | Specifies how to initialize Hideshow variables for different modes. | 1311 | A list of elements, each Specifying how to initialize Hideshow |
| 1312 | variables for one major mode. See the variable's documentation string | ||
| 1313 | for more information. | ||
| 1287 | @end table | 1314 | @end table |
| 1288 | 1315 | ||
| 1289 | @node Symbol Completion | 1316 | @node Symbol Completion |
| @@ -1338,8 +1365,8 @@ based on the spell-checker's dictionary. @xref{Spelling}. | |||
| 1338 | @findex glasses-mode | 1365 | @findex glasses-mode |
| 1339 | 1366 | ||
| 1340 | Glasses minor mode makes @samp{unreadableIdentifiersLikeThis} | 1367 | Glasses minor mode makes @samp{unreadableIdentifiersLikeThis} |
| 1341 | readable by altering the display. It can do this in two different | 1368 | readable by altering the display. It knows two different ways to do |
| 1342 | ways: by displaying underscores between an lower-case letter and the | 1369 | this: by displaying underscores between a lower-case letter and the |
| 1343 | following capital letter, or by emboldening the capital letters. It | 1370 | following capital letter, or by emboldening the capital letters. It |
| 1344 | does not alter the buffer text, only the way they display, so you can | 1371 | does not alter the buffer text, only the way they display, so you can |
| 1345 | use it even on read-only buffers. You can use the command @kbd{M-x | 1372 | use it even on read-only buffers. You can use the command @kbd{M-x |