diff options
| author | Karoly Lorentey | 2005-12-26 03:16:59 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-12-26 03:16:59 +0000 |
| commit | feba0cd6405ebb80af743e2f978442d9c837bcd2 (patch) | |
| tree | 1cb964aa641bee514d9cda2eafe27a0a97e65ad1 /man | |
| parent | 30663b475e57197c9896a252e1d4ca31c579fa2b (diff) | |
| parent | 7a32e81fb608282314e27db21a00138aaa91f29a (diff) | |
| download | emacs-feba0cd6405ebb80af743e2f978442d9c837bcd2.tar.gz emacs-feba0cd6405ebb80af743e2f978442d9c837bcd2.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 677)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-677
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-463
Diffstat (limited to 'man')
| -rw-r--r-- | man/ChangeLog | 52 | ||||
| -rw-r--r-- | man/custom.texi | 34 | ||||
| -rw-r--r-- | man/faq.texi | 16 | ||||
| -rw-r--r-- | man/files.texi | 41 | ||||
| -rw-r--r-- | man/frames.texi | 2 | ||||
| -rw-r--r-- | man/help.texi | 6 | ||||
| -rw-r--r-- | man/org.texi | 196 | ||||
| -rw-r--r-- | man/programs.texi | 396 |
8 files changed, 418 insertions, 325 deletions
diff --git a/man/ChangeLog b/man/ChangeLog index 490b4f5420e..2c68beb84a3 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,4 +1,44 @@ | |||
| 1 | 2005-12-12 Katsumi Yamaoka <yamaoka@jpl.org> | 1 | 2005-12-20 Juri Linkov <juri@jurta.org> |
| 2 | |||
| 3 | * files.texi (VC Status): Put P and N near p and n. | ||
| 4 | |||
| 5 | 2005-12-20 Carsten Dominik <dominik@science.uva.nl> | ||
| 6 | |||
| 7 | * org.texi: (Tags): Boolean logic documented. | ||
| 8 | (Agenda Views): Document custom commands. | ||
| 9 | |||
| 10 | 2005-12-20 David Kastrup <dak@gnu.org> | ||
| 11 | |||
| 12 | * faq.texi (AUCTeX): Update version and mailing list info. | ||
| 13 | |||
| 14 | 2005-12-19 Richard M. Stallman <rms@gnu.org> | ||
| 15 | |||
| 16 | * programs.texi (Electric C): Delete the info about newline control. | ||
| 17 | (Other C Commands): Minor cleanup. | ||
| 18 | (Left Margin Paren): Minor cleanup. | ||
| 19 | |||
| 20 | 2005-12-19 Luc Teirlinck <teirllm@auburn.edu> | ||
| 21 | |||
| 22 | * custom.texi (Easy Customization): Add "Browsing Custom" to menu. | ||
| 23 | (Customization Groups): Delete text moved to "Browsing Custom". | ||
| 24 | (Browsing Custom): New node. | ||
| 25 | (Specific Customization): Clarify which commands only work for | ||
| 26 | loaded options. | ||
| 27 | |||
| 28 | 2005-12-18 Bill Wohler <wohler@newt.com> | ||
| 29 | |||
| 30 | * frames.texi (Tool Bars): Shorten text of previous change. | ||
| 31 | |||
| 32 | 2005-12-18 Aaron S. Hawley <Aaron.Hawley@uvm.edu> | ||
| 33 | |||
| 34 | * files.texi (VC Status): Document log-view mode. | ||
| 35 | |||
| 36 | 2005-12-18 Bill Wohler <wohler@newt.com> | ||
| 37 | |||
| 38 | * frames.texi (Tool Bars): Mention that you can turn off tool bars | ||
| 39 | permanently via the customize interface. | ||
| 40 | |||
| 41 | 2005-12-17 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | 42 | ||
| 3 | * gnus.texi (MIME Commands): Mention addition of | 43 | * gnus.texi (MIME Commands): Mention addition of |
| 4 | multipart/alternative to gnus-buttonized-mime-types and add xref | 44 | multipart/alternative to gnus-buttonized-mime-types and add xref |
| @@ -10,7 +50,7 @@ | |||
| 10 | 50 | ||
| 11 | 2005-12-16 Carsten Dominik <dominik@science.uva.nl> | 51 | 2005-12-16 Carsten Dominik <dominik@science.uva.nl> |
| 12 | 52 | ||
| 13 | * org.texi: (Tags): New section. | 53 | * org.texi (Tags): New section. |
| 14 | (Agenda Views): Chapter reorganized. | 54 | (Agenda Views): Chapter reorganized. |
| 15 | 55 | ||
| 16 | 2005-12-16 Ralf Angeli <angeli@iwi.uni-sb.de> | 56 | 2005-12-16 Ralf Angeli <angeli@iwi.uni-sb.de> |
| @@ -43,7 +83,7 @@ | |||
| 43 | 83 | ||
| 44 | 2005-12-12 Carsten Dominik <dominik@science.uva.nl> | 84 | 2005-12-12 Carsten Dominik <dominik@science.uva.nl> |
| 45 | 85 | ||
| 46 | * org.texi: (Progress Logging): New section. | 86 | * org.texi (Progress Logging): New section. |
| 47 | 87 | ||
| 48 | 2005-12-12 Richard M. Stallman <rms@gnu.org> | 88 | 2005-12-12 Richard M. Stallman <rms@gnu.org> |
| 49 | 89 | ||
| @@ -355,7 +395,7 @@ | |||
| 355 | * help.texi (Help Echo): By default, help echos are only shown on | 395 | * help.texi (Help Echo): By default, help echos are only shown on |
| 356 | mouse-over, not on point-over. | 396 | mouse-over, not on point-over. |
| 357 | 397 | ||
| 358 | 2005-11-04 J,bi(Br,bt(Bme Marant <jerome@marant.org> | 398 | 2005-11-04 J,Ai(Br,At(Bme Marant <jerome@marant.org> |
| 359 | 399 | ||
| 360 | * misc.texi (Shell Mode): Describe how to activate password echoing. | 400 | * misc.texi (Shell Mode): Describe how to activate password echoing. |
| 361 | 401 | ||
| @@ -4158,7 +4198,7 @@ | |||
| 4158 | (../info/ses, ses.dvi): New targets. | 4198 | (../info/ses, ses.dvi): New targets. |
| 4159 | * ses.texi: New file. | 4199 | * ses.texi: New file. |
| 4160 | 4200 | ||
| 4161 | 2002-09-06 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 4201 | 2002-09-06 Pavel Jan,Am(Bk <Pavel@Janik.cz> |
| 4162 | 4202 | ||
| 4163 | * texinfo.tex: Update to texinfo 4.2. | 4203 | * texinfo.tex: Update to texinfo 4.2. |
| 4164 | 4204 | ||
| @@ -4166,7 +4206,7 @@ | |||
| 4166 | 4206 | ||
| 4167 | * reftex.texi: Update to RefTeX 4.19. | 4207 | * reftex.texi: Update to RefTeX 4.19. |
| 4168 | 4208 | ||
| 4169 | 2002-06-17 Kai Gro,b_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> | 4209 | 2002-06-17 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> |
| 4170 | 4210 | ||
| 4171 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add Tramp. | 4211 | * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add Tramp. |
| 4172 | (../info/tramp, tramp.dvi): New targets. | 4212 | (../info/tramp, tramp.dvi): New targets. |
diff --git a/man/custom.texi b/man/custom.texi index 7750efb04ad..c1442ca2f3c 100644 --- a/man/custom.texi +++ b/man/custom.texi | |||
| @@ -206,6 +206,7 @@ the active fields and other features. | |||
| 206 | 206 | ||
| 207 | @menu | 207 | @menu |
| 208 | * Groups: Customization Groups. How options are classified in a structure. | 208 | * Groups: Customization Groups. How options are classified in a structure. |
| 209 | * Browsing: Browsing Custom. Browsing and searching for options and faces. | ||
| 209 | * Changing a Variable:: How to edit a value and set an option. | 210 | * Changing a Variable:: How to edit a value and set an option. |
| 210 | * Saving Customizations:: Specifying the file for saving customizations. | 211 | * Saving Customizations:: Specifying the file for saving customizations. |
| 211 | * Face Customization:: How to edit the attributes of a face. | 212 | * Face Customization:: How to edit the attributes of a face. |
| @@ -275,9 +276,13 @@ Then you can use the customization buffer to set the options | |||
| 275 | pertaining to that feature. You can also go straight to a particular | 276 | pertaining to that feature. You can also go straight to a particular |
| 276 | group by name, using the command @kbd{M-x customize-group}. | 277 | group by name, using the command @kbd{M-x customize-group}. |
| 277 | 278 | ||
| 279 | @node Browsing Custom | ||
| 280 | @subsection Browsing and Searching for Options and Faces | ||
| 278 | @findex customize-browse | 281 | @findex customize-browse |
| 279 | You can view the structure of customization groups on a larger scale | 282 | You can use @kbd{M-x customize} to browse the groups and options, but |
| 280 | with @kbd{M-x customize-browse}. This command creates a special kind of | 283 | often @kbd{M-x customize-browse} is a more efficient alternative. |
| 284 | That is because it lets you view the structure of customization groups | ||
| 285 | on a larger scale. This command creates a special kind of | ||
| 281 | customization buffer which shows only the names of the groups (and | 286 | customization buffer which shows only the names of the groups (and |
| 282 | variables and faces), and their structure. | 287 | variables and faces), and their structure. |
| 283 | 288 | ||
| @@ -291,6 +296,13 @@ that active field creates an ordinary customization buffer showing just | |||
| 291 | that group and its contents, just that variable, or just that face. | 296 | that group and its contents, just that variable, or just that face. |
| 292 | This is the way to set values in it. | 297 | This is the way to set values in it. |
| 293 | 298 | ||
| 299 | If you can guess part of the name of the options you are interested | ||
| 300 | in, then sometimes @kbd{M-x customize-apropos} can be another useful | ||
| 301 | way to search for options. However, unlike @code{customize} and | ||
| 302 | @code{customize-browse}, @code{customize-apropos} can only find | ||
| 303 | options that are loaded in the current Emacs session. @xref{Specific | ||
| 304 | Customization,, Customizing Specific Items}. | ||
| 305 | |||
| 294 | @node Changing a Variable | 306 | @node Changing a Variable |
| 295 | @subsection Changing a Variable | 307 | @subsection Changing a Variable |
| 296 | 308 | ||
| @@ -627,7 +639,9 @@ buffer, and you know its name, you can use the command @kbd{M-x | |||
| 627 | customize-variable} and specify the variable name. This sets up the | 639 | customize-variable} and specify the variable name. This sets up the |
| 628 | customization buffer with just one variable---the one that you asked | 640 | customization buffer with just one variable---the one that you asked |
| 629 | for. Editing, setting and saving the value work as described above, | 641 | for. Editing, setting and saving the value work as described above, |
| 630 | but only for the specified variable. | 642 | but only for the specified variable. Minibuffer completion is very |
| 643 | handy if you only know part of the name. However, it only finds | ||
| 644 | options that have been loaded in the current Emacs session. | ||
| 631 | 645 | ||
| 632 | @findex customize-face | 646 | @findex customize-face |
| 633 | Likewise, you can modify a specific face, chosen by name, using | 647 | Likewise, you can modify a specific face, chosen by name, using |
| @@ -638,15 +652,16 @@ on the character after point. | |||
| 638 | You can also set up the customization buffer with a specific group, | 652 | You can also set up the customization buffer with a specific group, |
| 639 | using @kbd{M-x customize-group}. The immediate contents of the chosen | 653 | using @kbd{M-x customize-group}. The immediate contents of the chosen |
| 640 | group, including user options, faces, and other groups, all appear | 654 | group, including user options, faces, and other groups, all appear |
| 641 | as well. However, these subgroups' own contents are not included. | 655 | as well (even if not already loaded). However, the subgroups' own |
| 656 | contents are not included. | ||
| 642 | 657 | ||
| 643 | @findex customize-apropos | 658 | @findex customize-apropos |
| 644 | To control more precisely what to customize, you can use @kbd{M-x | 659 | To control more precisely what to customize, you can use @kbd{M-x |
| 645 | customize-apropos}. You specify a regular expression as argument; then | 660 | customize-apropos}. You specify a regular expression as argument; then |
| 646 | all options, faces and groups whose names match this regular expression | 661 | all @emph{loaded} options, faces and groups whose names match this |
| 647 | are set up in the customization buffer. If you specify an empty regular | 662 | regular expression are set up in the customization buffer. If you |
| 648 | expression, this includes @emph{all} groups, options and faces (but | 663 | specify an empty regular expression, this includes @emph{all} groups, |
| 649 | that takes a long time). | 664 | options and faces (but that takes a long time). |
| 650 | 665 | ||
| 651 | @findex customize-changed-options | 666 | @findex customize-changed-options |
| 652 | When you upgrade to a new Emacs version, you might want to customize | 667 | When you upgrade to a new Emacs version, you might want to customize |
| @@ -654,7 +669,8 @@ new options and options whose meanings or default values have changed. | |||
| 654 | To do this, use @kbd{M-x customize-changed-options} and specify a | 669 | To do this, use @kbd{M-x customize-changed-options} and specify a |
| 655 | previous Emacs version number using the minibuffer. It creates a | 670 | previous Emacs version number using the minibuffer. It creates a |
| 656 | customization buffer which shows all the options (and groups) whose | 671 | customization buffer which shows all the options (and groups) whose |
| 657 | definitions have been changed since the specified version. | 672 | definitions have been changed since the specified version. (Not just |
| 673 | those that are already loaded.) | ||
| 658 | 674 | ||
| 659 | @findex customize-saved | 675 | @findex customize-saved |
| 660 | @findex customize-customized | 676 | @findex customize-customized |
diff --git a/man/faq.texi b/man/faq.texi index b7f8311f58f..36564482cc7 100644 --- a/man/faq.texi +++ b/man/faq.texi | |||
| @@ -3844,10 +3844,12 @@ better than the one distributed with Emacs: | |||
| 3844 | AUC@TeX{} is a set of sophisticated major modes for @TeX{}, LaTeX, | 3844 | AUC@TeX{} is a set of sophisticated major modes for @TeX{}, LaTeX, |
| 3845 | ConTeXt, and Texinfo offering context-sensitive syntax highlighting, | 3845 | ConTeXt, and Texinfo offering context-sensitive syntax highlighting, |
| 3846 | indentation, formatting and folding, macro completion, @TeX{} shell | 3846 | indentation, formatting and folding, macro completion, @TeX{} shell |
| 3847 | functionality, and debugging. Some important supplemental packages are | 3847 | functionality, and debugging. Be also sure to check out |
| 3848 | described in @ref{Introduction, RefTeX, Introduction, reftex, Ref@TeX{} | 3848 | @ref{Introduction, RefTeX, Introduction, reftex, Ref@TeX{} User Manual}. |
| 3849 | User Manual}, and | 3849 | Current versions of AUC@TeX{} include the |
| 3850 | @uref{http://preview-latex.sourceforge.net,preview-latex}. | 3850 | @uref{http://www.gnu.org/software/auctex/preview-latex,preview-latex} |
| 3851 | package for WYSIWYG previews of various LaTeX constructs in the Emacs | ||
| 3852 | source buffer. | ||
| 3851 | 3853 | ||
| 3852 | @table @b | 3854 | @table @b |
| 3853 | 3855 | ||
| @@ -3859,7 +3861,7 @@ User Manual}, and | |||
| 3859 | @email{dak@@gnu.org, David Kastrup} | 3861 | @email{dak@@gnu.org, David Kastrup} |
| 3860 | 3862 | ||
| 3861 | @item Latest version | 3863 | @item Latest version |
| 3862 | 11.54 | 3864 | 11.82 |
| 3863 | 3865 | ||
| 3864 | @item Distribution | 3866 | @item Distribution |
| 3865 | @uref{ftp://ftp.gnu.org/pub/gnu/auctex/} | 3867 | @uref{ftp://ftp.gnu.org/pub/gnu/auctex/} |
| @@ -3868,8 +3870,8 @@ User Manual}, and | |||
| 3868 | @uref{http://www.gnu.org/software/auctex/} | 3870 | @uref{http://www.gnu.org/software/auctex/} |
| 3869 | 3871 | ||
| 3870 | @item Mailing list: | 3872 | @item Mailing list: |
| 3871 | Subscription requests to @email{auc-tex-subscribe@@sunsite.dk}@* | 3873 | Subscription requests to @email{auctex-request@@gnu.org}@* |
| 3872 | Submissions to @email{auc-tex@@sunsite.dk} | 3874 | Submissions to @email{auctex@@gnu.org} |
| 3873 | 3875 | ||
| 3874 | @end table | 3876 | @end table |
| 3875 | 3877 | ||
diff --git a/man/files.texi b/man/files.texi index 860b346f91b..d599e576e94 100644 --- a/man/files.texi +++ b/man/files.texi | |||
| @@ -1788,7 +1788,46 @@ Display version control state and change history. | |||
| 1788 | To view the detailed version control status and history of a file, | 1788 | To view the detailed version control status and history of a file, |
| 1789 | type @kbd{C-x v l} (@code{vc-print-log}). It displays the history of | 1789 | type @kbd{C-x v l} (@code{vc-print-log}). It displays the history of |
| 1790 | changes to the current file, including the text of the log entries. The | 1790 | changes to the current file, including the text of the log entries. The |
| 1791 | output appears in a separate window. | 1791 | output appears in a separate window. The point is centered at the |
| 1792 | revision of the file that is currently being visited. | ||
| 1793 | |||
| 1794 | From the change log buffer, the following keys are used to move | ||
| 1795 | between the logs of revisions and files, to view past revisions, and | ||
| 1796 | to view diffs: | ||
| 1797 | |||
| 1798 | @table @kbd | ||
| 1799 | @item p | ||
| 1800 | Move to the previous revision-item in the buffer. (Revision entries in the log | ||
| 1801 | buffer are usually in reverse-chronological order, so the previous | ||
| 1802 | revision-item usually corresponds to a newer revision.) A numeric | ||
| 1803 | prefix argument is a repeat count. | ||
| 1804 | |||
| 1805 | @item n | ||
| 1806 | Move to the next revision-item (which most often corresponds to the | ||
| 1807 | previous revision of the file). A numeric prefix argument is a repeat | ||
| 1808 | count. | ||
| 1809 | |||
| 1810 | @item P | ||
| 1811 | Move to the log of the previous file, when the logs of multiple files | ||
| 1812 | are in the log buffer (@pxref{VC Dired Mode}). Otherwise, just move | ||
| 1813 | to the beginning of the log. A numeric prefix argument is a repeat | ||
| 1814 | count, so @kbd{C-u 10 P} would move backward 10 files. | ||
| 1815 | |||
| 1816 | @item N | ||
| 1817 | Move to the log of the next file, when the logs of multiple files are | ||
| 1818 | in the log buffer (@pxref{VC Dired Mode}). It also takes a numeric | ||
| 1819 | prefix argument as a repeat count. | ||
| 1820 | |||
| 1821 | @item f | ||
| 1822 | Visit the revision indicated at the current line, like typing @kbd{C-x | ||
| 1823 | v ~} and specifying this revision's number (@pxref{Old Versions}). | ||
| 1824 | |||
| 1825 | @item d | ||
| 1826 | Display the diff (@pxref{Comparing Files}) between the revision | ||
| 1827 | indicated at the current line and the next earlier revision. This is | ||
| 1828 | useful to see what actually changed when the revision indicated on the | ||
| 1829 | current line was committed. | ||
| 1830 | @end table | ||
| 1792 | 1831 | ||
| 1793 | @node VC Undo | 1832 | @node VC Undo |
| 1794 | @subsubsection Undoing Version Control Actions | 1833 | @subsubsection Undoing Version Control Actions |
diff --git a/man/frames.texi b/man/frames.texi index daaa9599bf7..9d24f5ca90e 100644 --- a/man/frames.texi +++ b/man/frames.texi | |||
| @@ -963,7 +963,7 @@ XPM icons if Emacs was built with XPM support. Otherwise, the tool | |||
| 963 | bar uses monochrome icons (PBM or XBM format). | 963 | bar uses monochrome icons (PBM or XBM format). |
| 964 | 964 | ||
| 965 | You can turn display of tool bars on or off with @kbd{M-x | 965 | You can turn display of tool bars on or off with @kbd{M-x |
| 966 | tool-bar-mode}. | 966 | tool-bar-mode} or by customizing the option @code{tool-bar-mode}. |
| 967 | 967 | ||
| 968 | @node Dialog Boxes | 968 | @node Dialog Boxes |
| 969 | @section Using Dialog Boxes | 969 | @section Using Dialog Boxes |
diff --git a/man/help.texi b/man/help.texi index 313a002dc28..747f51aaaa7 100644 --- a/man/help.texi +++ b/man/help.texi | |||
| @@ -47,7 +47,7 @@ manual index, then finally look in the FAQ and the package keywords. | |||
| 47 | @item C-h a @var{topics} @key{RET} | 47 | @item C-h a @var{topics} @key{RET} |
| 48 | This searches for commands whose names match @var{topics}, which | 48 | This searches for commands whose names match @var{topics}, which |
| 49 | should be a keyword, a list of keywords, or a regular expression | 49 | should be a keyword, a list of keywords, or a regular expression |
| 50 | (@pxref{Regexps}). This command displays a the matches in a new | 50 | (@pxref{Regexps}). This command displays all the matches in a new |
| 51 | buffer. @xref{Apropos}. | 51 | buffer. @xref{Apropos}. |
| 52 | 52 | ||
| 53 | @item C-h i d m emacs @key{RET} i @var{topic} @key{RET} | 53 | @item C-h i d m emacs @key{RET} i @var{topic} @key{RET} |
| @@ -336,7 +336,7 @@ view, describe, default. | |||
| 336 | @end quotation | 336 | @end quotation |
| 337 | 337 | ||
| 338 | @findex apropos | 338 | @findex apropos |
| 339 | To list all Lisp symbols that contain a match an Apropos pattern, | 339 | To list all Lisp symbols that contain a match for an Apropos pattern, |
| 340 | not just the ones that are defined as commands, use the command | 340 | not just the ones that are defined as commands, use the command |
| 341 | @kbd{M-x apropos} instead of @kbd{C-h a}. This command does not check | 341 | @kbd{M-x apropos} instead of @kbd{C-h a}. This command does not check |
| 342 | key bindings by default; specify a numeric argument if you want it to | 342 | key bindings by default; specify a numeric argument if you want it to |
| @@ -374,7 +374,7 @@ most relevant ones first. | |||
| 374 | By default, Apropos lists the search results for | 374 | By default, Apropos lists the search results for |
| 375 | @code{apropos-documentation} in order of relevance of the match. If | 375 | @code{apropos-documentation} in order of relevance of the match. If |
| 376 | the variable @code{apropos-documentation-sort-by-scores} is | 376 | the variable @code{apropos-documentation-sort-by-scores} is |
| 377 | @code{nil}, Apropos lists the symbosl found in alphabetical order. | 377 | @code{nil}, Apropos lists the symbols found in alphabetical order. |
| 378 | 378 | ||
| 379 | @node Library Keywords | 379 | @node Library Keywords |
| 380 | @section Keyword Search for Lisp Libraries | 380 | @section Keyword Search for Lisp Libraries |
diff --git a/man/org.texi b/man/org.texi index 0477077d91f..5056119b3b2 100644 --- a/man/org.texi +++ b/man/org.texi | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | @setfilename ../info/org | 4 | @setfilename ../info/org |
| 5 | @settitle Org Mode Manual | 5 | @settitle Org Mode Manual |
| 6 | 6 | ||
| 7 | @set VERSION 4.00 | 7 | @set VERSION 4.01 |
| 8 | @set DATE December 2005 | 8 | @set DATE December 2005 |
| 9 | 9 | ||
| 10 | @dircategory Emacs | 10 | @dircategory Emacs |
| @@ -229,7 +229,7 @@ ways, for example | |||
| 229 | 229 | ||
| 230 | @example | 230 | @example |
| 231 | @r{@bullet{} as an outline extension with visibility cycling and structure editing} | 231 | @r{@bullet{} as an outline extension with visibility cycling and structure editing} |
| 232 | @r{@bullet{} as an ASCII system and table editor to take structured notes} | 232 | @r{@bullet{} as an ASCII system and table editor for taking structured notes} |
| 233 | @r{@bullet{} as an ASCII table editor with spreadsheet-like capabilities} | 233 | @r{@bullet{} as an ASCII table editor with spreadsheet-like capabilities} |
| 234 | @r{@bullet{} as a simple hypertext system, with HTML export} | 234 | @r{@bullet{} as a simple hypertext system, with HTML export} |
| 235 | @r{@bullet{} as a TODO list editor} | 235 | @r{@bullet{} as a TODO list editor} |
| @@ -532,7 +532,7 @@ functionality. | |||
| 532 | @node Archiving, Sparse trees, Structure editing, Document Structure | 532 | @node Archiving, Sparse trees, Structure editing, Document Structure |
| 533 | @section Archiving | 533 | @section Archiving |
| 534 | @cindex archiving | 534 | @cindex archiving |
| 535 | @cindex filing subtries | 535 | @cindex filing subtrees |
| 536 | 536 | ||
| 537 | When a project represented by a (sub)tree is finished, you may want | 537 | When a project represented by a (sub)tree is finished, you may want |
| 538 | to move the tree to an archive place, either in the same file under a | 538 | to move the tree to an archive place, either in the same file under a |
| @@ -618,12 +618,24 @@ well. For example, in the list | |||
| 618 | 618 | ||
| 619 | @example | 619 | @example |
| 620 | * Meeting with the French group :WORK: | 620 | * Meeting with the French group :WORK: |
| 621 | ** Summary by Frank :BOSS: | 621 | ** Summary by Frank :BOSS:NOTES: |
| 622 | *** TODO Prepare slides for him :ACTION: | 622 | *** TODO Prepare slides for him :ACTION: |
| 623 | @end example | 623 | @end example |
| 624 | @noindent | 624 | @noindent |
| 625 | the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:}, and | 625 | the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:}, |
| 626 | @samp{:ACTION:}. | 626 | @samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and |
| 627 | Org-mode finds that a certain headline matches the search criterion, | ||
| 628 | it will not check any sublevel headline, assuming that these likely | ||
| 629 | also match, and that the list of matches can become very long. You | ||
| 630 | can influence inheritance and searching using the variables | ||
| 631 | @code{org-use-tag-inheritance} and | ||
| 632 | @code{org-tags-match-list-sublevels}. | ||
| 633 | |||
| 634 | @kindex M-@key{TAB} | ||
| 635 | Tags can simply be typed into the buffer. After a colon, | ||
| 636 | @kbd{M-@key{TAB}} offers completion on all tags being used in the | ||
| 637 | current buffer. There are also special commands for inserting tags, | ||
| 638 | and for executing searches based on tags. | ||
| 627 | 639 | ||
| 628 | @table @kbd | 640 | @table @kbd |
| 629 | @kindex C-c C-c | 641 | @kindex C-c C-c |
| @@ -631,29 +643,33 @@ the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:}, and | |||
| 631 | @cindex completion, of tags | 643 | @cindex completion, of tags |
| 632 | Enter new tags for the current headline. The minibuffer will prompt | 644 | Enter new tags for the current headline. The minibuffer will prompt |
| 633 | for a list of tags and offer completion with respect to all other tags | 645 | for a list of tags and offer completion with respect to all other tags |
| 634 | used in the current buffer. After pressing @key{RET}, the tags will | 646 | used in the current buffer. Several tags, separated by colons, may be |
| 647 | specified at the prompt. After pressing @key{RET}, the tags will | ||
| 635 | be inserted and aligned to @code{org-tags-column}. When called with a | 648 | be inserted and aligned to @code{org-tags-column}. When called with a |
| 636 | @kbd{C-u} prefix, align all tags in the current buffer to that column, | 649 | @kbd{C-u} prefix, align all tags in the current buffer to that column, |
| 637 | just to make things look nice. Tags can also be just typed into the | 650 | just to make things look nice. TAGS are automatically realigned after |
| 638 | buffer, with @kbd{M-@key{TAB}} support. | 651 | promotion, demotion, and TODO state changes (@pxref{TODO basics}). |
| 639 | @cindex M-@key{TAB} | ||
| 640 | @item M-@key{TAB} | ||
| 641 | Tags can also be typed directly into the buffer, using | ||
| 642 | @kbd{M-@key{TAB}} completion. | ||
| 643 | @kindex C-c \ | 652 | @kindex C-c \ |
| 644 | @item C-c \ | 653 | @item C-c \ |
| 645 | Create a sparse tree with all headlines matching a given set of tags. | 654 | Create a sparse tree with all headlines matching a tags search. |
| 646 | The command prompts for the tags to match. The criterion is just a | ||
| 647 | list of tags separated by @samp{+} or @samp{-} for positive and | ||
| 648 | negative selection. For example, @samp{+WORK-BOSS} would select all | ||
| 649 | headlines that are tagged @samp{:WORK:}, but discard those also tagged | ||
| 650 | @samp{:BOSS:}. | ||
| 651 | @kindex C-c a m | 655 | @kindex C-c a m |
| 652 | @item C-c a m | 656 | @item C-c a m |
| 653 | Create a global list of tag matches from all agenda files. | 657 | Create a global list of tag matches from all agenda files. |
| 654 | @xref{Matching headline tags}. | 658 | @xref{Matching headline tags}. |
| 655 | @end table | 659 | @end table |
| 656 | 660 | ||
| 661 | A tags search string can use Boolean operators @samp{&} for AND and | ||
| 662 | @samp{|} for OR. @samp{&} binds more strongly than | ||
| 663 | @samp{|}. Parenthesis are currently no implemented. A tag may also be | ||
| 664 | preceded by @samp{-}, to select against it, and @samp{+} is syntactic | ||
| 665 | sugar for positive selection. The AND operator @samp{&} is optional | ||
| 666 | when @samp{+} or @samp{-} is present. For example, @samp{+WORK-BOSS} | ||
| 667 | would select all headlines that are tagged @samp{:WORK:}, but discard | ||
| 668 | those also tagged @samp{:BOSS:}. The search string @samp{WORK|LAPTOP} | ||
| 669 | selects all lines tagged @samp{:WORK:} or @samp{:LAPTOP:}. The string | ||
| 670 | @samp{WORK|LAPTOP&NIGHT} requires that the @samp{:LAPTOP:} lines are | ||
| 671 | also tagged @samp{NIGHT}. | ||
| 672 | |||
| 657 | @node Plain Lists, , Tags, Document Structure | 673 | @node Plain Lists, , Tags, Document Structure |
| 658 | @section Plain Lists | 674 | @section Plain Lists |
| 659 | @cindex plain lists | 675 | @cindex plain lists |
| @@ -692,7 +708,7 @@ My favorite scenes are (in this order) | |||
| 692 | @end example | 708 | @end example |
| 693 | 709 | ||
| 694 | Org-mode supports these lists by tuning filling and wrapping commands | 710 | Org-mode supports these lists by tuning filling and wrapping commands |
| 695 | to correctly deal with them. Futhermore, the following commands act | 711 | to correctly deal with them. Furthermore, the following commands act |
| 696 | on items when the cursor is in the first line of an item (the line | 712 | on items when the cursor is in the first line of an item (the line |
| 697 | with the bullet or number). | 713 | with the bullet or number). |
| 698 | 714 | ||
| @@ -1322,11 +1338,11 @@ links to other files, Usenet articles, emails and much more. | |||
| 1322 | 1338 | ||
| 1323 | Similar to Wiki implementations, Org-mode interprets words spelled in | 1339 | Similar to Wiki implementations, Org-mode interprets words spelled in |
| 1324 | CamelCase (i.e. mixed case with at least one capital letter following | 1340 | CamelCase (i.e. mixed case with at least one capital letter following |
| 1325 | on a small letter inside the word) as links. While in Wiki | 1341 | on a small letter inside the word) as links. While in Wiki these |
| 1326 | implementations these links usually point to another file, in Org-mode | 1342 | links usually point to another file, in Org-mode they point to a |
| 1327 | they point to a target in the current file. Targets are CamelCased | 1343 | target in the current file. Targets are CamelCased words in double |
| 1328 | words in double angular brackets, and may be located anywhere, also in | 1344 | angular brackets, and may be located anywhere, also in a comment line. |
| 1329 | a comment line. For example | 1345 | For example |
| 1330 | @example | 1346 | @example |
| 1331 | # <<MyTarget>> | 1347 | # <<MyTarget>> |
| 1332 | @end example | 1348 | @end example |
| @@ -2020,32 +2036,16 @@ Choose date in calendar (only if nothing typed into minibuffer). | |||
| 2020 | @chapter Agenda Views | 2036 | @chapter Agenda Views |
| 2021 | @cindex agenda views | 2037 | @cindex agenda views |
| 2022 | 2038 | ||
| 2023 | @ignore | 2039 | Org-mode can select items based of various criteria, and display them |
| 2024 | We have already described three commands to filter important | 2040 | in a separate buffer. The information to be shown is collected from |
| 2025 | information in an org file into a sparse tree (@pxref{Sparse trees}): | 2041 | all @emph{agenda files}, the files listed in the variable |
| 2026 | 2042 | @code{org-agenda-files}. Thus even if you only work with a single | |
| 2027 | @cindex sparse trees | 2043 | Org-mode file, this file must be put into that list@footnote{When |
| 2028 | @itemize @bullet | 2044 | using the dispatcher pressing @kbd{1} before selecting a command will |
| 2029 | @item | 2045 | actually limit the command to the current file, and ignore |
| 2030 | The TODO tree, (@kbd{C-c C-v}), see @ref{TODO items}. | 2046 | @code{org-agenda-files} until the next dispatcher command.}. You can |
| 2031 | @item | 2047 | customize @code{org-agenda-files}, but the easiest way to maintain it |
| 2032 | The occur tree @kbd{C-c /}, see @ref{TODO items}. | 2048 | is through the following commands |
| 2033 | @item | ||
| 2034 | Checking upcoming deadlines with @kbd{C-c C-w}, see @ref{Creating | ||
| 2035 | timestamps}. | ||
| 2036 | @end itemize | ||
| 2037 | @noindent | ||
| 2038 | @end ignore | ||
| 2039 | |||
| 2040 | Org-mode can collect and sort selected items into a separate buffer. | ||
| 2041 | The information to be listed is collected from all @emph{agenda | ||
| 2042 | files}, the files listed in the variable @code{org-agenda-files}. | ||
| 2043 | Thus even if you only work with a single Org-mode file, this file must | ||
| 2044 | be put into that list@footnote{When using the dispatcher pressing | ||
| 2045 | @kbd{1} before selecting a command will actually limit the command to | ||
| 2046 | the current file, and ignore @code{org-agenda-files} until the next | ||
| 2047 | dispatcher command.}. You can customize this variable, but the easiest | ||
| 2048 | way to maintain it is through the following commands | ||
| 2049 | 2049 | ||
| 2050 | @cindex files, adding to agenda list | 2050 | @cindex files, adding to agenda list |
| 2051 | @table @kbd | 2051 | @table @kbd |
| @@ -2084,11 +2084,21 @@ buffer}. This buffer is read-only, but provides commands to visit the | |||
| 2084 | corresponding locations in the original Org-mode files, and even to | 2084 | corresponding locations in the original Org-mode files, and even to |
| 2085 | edit these files remotely. | 2085 | edit these files remotely. |
| 2086 | 2086 | ||
| 2087 | @cindex custom agenda commands | ||
| 2088 | @cindex agenda commands, custom | ||
| 2087 | The views are created through a dispatcher that should be bound to a | 2089 | The views are created through a dispatcher that should be bound to a |
| 2088 | global key, for example @kbd{C-c a} (@pxref{Installation and | 2090 | global key, for example @kbd{C-c a} (@pxref{Installation and |
| 2089 | Activation}). In the following we will assume that @kbd{C-c a} is | 2091 | Activation}). In the following we will assume that @kbd{C-c a} is |
| 2090 | indeed how the dispatcher is accessed and list keyboard access to | 2092 | indeed how the dispatcher is accessed and list keyboard access to |
| 2091 | commands accordingly. | 2093 | commands accordingly. The dispatcher offers a number of default |
| 2094 | commands, for example to create a TODO list or a the calendar-like | ||
| 2095 | agenda. You can also define a number of custom searches for tags and | ||
| 2096 | specific TODO keywords through the variable | ||
| 2097 | @code{org-agenda-custom-commands}. | ||
| 2098 | @kindex C-c a C | ||
| 2099 | These commands will be offered by the dispatcher just like the default | ||
| 2100 | commands. If you press @kbd{C-c a C}, you will get a customization | ||
| 2101 | buffer for this variable. | ||
| 2092 | 2102 | ||
| 2093 | @menu | 2103 | @menu |
| 2094 | * Agenda:: Your weekly planner | 2104 | * Agenda:: Your weekly planner |
| @@ -2230,7 +2240,7 @@ a prefix argument to this command to change the selected TODO keyword, | |||
| 2230 | for example @kbd{3 r}. | 2240 | for example @kbd{3 r}. |
| 2231 | @end table | 2241 | @end table |
| 2232 | 2242 | ||
| 2233 | Remote editing of TDOD items means that you can change the state of a | 2243 | Remote editing of TODO items means that you can change the state of a |
| 2234 | TODO entry with a single key press. The commands available in the | 2244 | TODO entry with a single key press. The commands available in the |
| 2235 | TODO list are described in @ref{Agenda commands}. | 2245 | TODO list are described in @ref{Agenda commands}. |
| 2236 | 2246 | ||
| @@ -2241,15 +2251,15 @@ TODO list are described in @ref{Agenda commands}. | |||
| 2241 | 2251 | ||
| 2242 | If headlines in the agenda files are marked with @emph{tags} | 2252 | If headlines in the agenda files are marked with @emph{tags} |
| 2243 | (@pxref{Tags}), you can select headlines based on the tags that apply | 2253 | (@pxref{Tags}), you can select headlines based on the tags that apply |
| 2244 | to them and collect them into an ageenda buffer. | 2254 | to them and collect them into an agenda buffer. |
| 2245 | 2255 | ||
| 2246 | @table @kbd | 2256 | @table @kbd |
| 2247 | @kindex C-c a m | 2257 | @kindex C-c a m |
| 2248 | @item C-c a m | 2258 | @item C-c a m |
| 2249 | Produce a list of all headlines that match a given set of tags. The | 2259 | Produce a list of all headlines that match a given set of tags. The |
| 2250 | command prompts for a selection criterion, which is a simple list of | 2260 | command prompts for a selection criterion, which is a boolean logic |
| 2251 | TAGS with positive and negative selection, like | 2261 | expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or |
| 2252 | @samp{+WORK+URGENT-WITHBOSS}. | 2262 | @samp{WORK|HOME} (@pxref{Tags}). |
| 2253 | @kindex C-c a M | 2263 | @kindex C-c a M |
| 2254 | @item C-c a M | 2264 | @item C-c a M |
| 2255 | Like @kbd{C-c a m}, but only select headlines that are also TODO | 2265 | Like @kbd{C-c a m}, but only select headlines that are also TODO |
| @@ -2396,6 +2406,10 @@ Digit argument. | |||
| 2396 | Change the TODO state of the item, both in the agenda and in the | 2406 | Change the TODO state of the item, both in the agenda and in the |
| 2397 | original org file. | 2407 | original org file. |
| 2398 | 2408 | ||
| 2409 | @kindex : | ||
| 2410 | @item : | ||
| 2411 | Set tags for the current headline. | ||
| 2412 | |||
| 2399 | @kindex , | 2413 | @kindex , |
| 2400 | @item , | 2414 | @item , |
| 2401 | Set the priority for the current item. Org-mode prompts for the | 2415 | Set the priority for the current item. Org-mode prompts for the |
| @@ -2900,7 +2914,7 @@ After @samp{\}, complete @TeX{} symbols supported by the exporter. | |||
| 2900 | After @samp{*}, complete CamelCase versions of all headlines in the | 2914 | After @samp{*}, complete CamelCase versions of all headlines in the |
| 2901 | buffer. | 2915 | buffer. |
| 2902 | @item | 2916 | @item |
| 2903 | After @samp{:}, complete tags used elswhere in the buffer. | 2917 | After @samp{:}, complete tags used elsewhere in the buffer. |
| 2904 | @item | 2918 | @item |
| 2905 | After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or | 2919 | After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or |
| 2906 | @samp{OPTIONS} which set file-specific options for Org-mode. When the | 2920 | @samp{OPTIONS} which set file-specific options for Org-mode. When the |
| @@ -2917,11 +2931,11 @@ Elsewhere, complete dictionary words using ispell. | |||
| 2917 | @cindex options, for customization | 2931 | @cindex options, for customization |
| 2918 | @cindex variables, for customization | 2932 | @cindex variables, for customization |
| 2919 | 2933 | ||
| 2920 | There is a large number of variables which can be used to customize | 2934 | There are more than 100 variables that can be used to customize |
| 2921 | Org-mode. For the sake of compactness of the manual, we are not | 2935 | Org-mode. For the sake of compactness of the manual, we are not |
| 2922 | describing the variables here. For an overview of customization | 2936 | describing the variables here. A structured overview of customization |
| 2923 | variables, use @kbd{M-x org-customize}. Or select @code{Browse Org | 2937 | variables is available with @kbd{M-x org-customize}. Or select |
| 2924 | Group} from the @code{Org->Customization} menu. | 2938 | @code{Browse Org Group} from the @code{Org->Customization} menu. |
| 2925 | 2939 | ||
| 2926 | @node FAQ, Interaction, Customization, Miscellaneous | 2940 | @node FAQ, Interaction, Customization, Miscellaneous |
| 2927 | @section Frequently asked questions | 2941 | @section Frequently asked questions |
| @@ -3167,59 +3181,63 @@ The exporters work well, but could be made more efficient. | |||
| 3167 | 3181 | ||
| 3168 | Org-mode was written by Carsten Dominik, who still maintains it at the | 3182 | Org-mode was written by Carsten Dominik, who still maintains it at the |
| 3169 | Org-mode homepage @uref{http://www.astro.uva.nl/~dominik/Tools/org/}. | 3183 | Org-mode homepage @uref{http://www.astro.uva.nl/~dominik/Tools/org/}. |
| 3170 | The following people have helped the development along with ideas, | 3184 | The following people (in alphabetic order) have helped the development |
| 3171 | suggestions and patches. | 3185 | along with ideas, suggestions and patches. Many thanks to all of you, |
| 3186 | Org-mode would not be what it is without your input. | ||
| 3172 | 3187 | ||
| 3173 | @itemize @bullet | 3188 | @itemize @bullet |
| 3174 | @item | 3189 | @item |
| 3175 | Matthias Rempe (Oelde) provided ideas, a patch introducing Windows | 3190 | Pavel Chalmoviansky reported bugs and suggested improvements |
| 3176 | NT/2000 support, and quality control. | 3191 | related to the agenda treatment of items with specified time. |
| 3177 | @item | ||
| 3178 | Kevin Rogers contributed code to access VM files on remote hosts. | ||
| 3179 | @item | 3192 | @item |
| 3180 | Juergen Vollmer contributed code generating the table of contents | 3193 | Sacha Chua, the current maintainer of Planner, suggested to copy |
| 3181 | in HTML output, and other export improvements. | 3194 | linking code from Planner (I took code for RMAIL and Wanderlust). |
| 3182 | @item | 3195 | @item |
| 3183 | Christian Egli converted the documentation into TeXInfo format and | 3196 | Christian Egli converted the documentation into TeXInfo format and |
| 3184 | patched basic CSS formatting support into the HTML exporter. He also | 3197 | patched basic CSS formatting support into the HTML exporter. He also |
| 3185 | inspired the agenda by showing me his plans for a multifile summary. | 3198 | inspired the agenda by showing me his plans for a multifile summary. |
| 3186 | @item | 3199 | @item |
| 3200 | Kai Grossjohann pointed out that a number of key bindings in Org-mode | ||
| 3201 | conflict with other packages. | ||
| 3202 | @item | ||
| 3203 | Stefan Monnier provided a patch with lots of little fixes to keep the | ||
| 3204 | Emacs-Lisp compiler happy. | ||
| 3205 | @item | ||
| 3206 | Tim O'Callaghan suggested in-file links, search options for | ||
| 3207 | general file links, and TAGS. | ||
| 3208 | @item | ||
| 3209 | Oliver Oppitz made useful suggestions. | ||
| 3210 | @item | ||
| 3211 | Pete Phillips helped the development of the TAGS feature with beta | ||
| 3212 | testing and suggestions. | ||
| 3213 | @item | ||
| 3214 | Matthias Rempe (Oelde) provided ideas, a patch introducing Windows | ||
| 3215 | NT/2000 support, and quality control. | ||
| 3216 | @item | ||
| 3217 | Kevin Rogers contributed code to access VM files on remote hosts. | ||
| 3218 | @item | ||
| 3187 | Philip Rooke created the Org-mode reference card. He also helped with | 3219 | Philip Rooke created the Org-mode reference card. He also helped with |
| 3188 | beta testing and contributed a number of very useful ideas. | 3220 | beta testing and contributed a number of very useful ideas. |
| 3189 | @item | 3221 | @item |
| 3190 | Christian Schlauer proposed angular brackets around links, among other | 3222 | Christian Schlauer proposed angular brackets around links, among other |
| 3191 | things. | 3223 | things. |
| 3192 | @item | 3224 | @item |
| 3193 | David Wainberg suggested to implement an archiving mechanism and helped | ||
| 3194 | testing. | ||
| 3195 | @item | ||
| 3196 | Linking to VM/BBDB/GNUS was inspired by Tom Shannon's | 3225 | Linking to VM/BBDB/GNUS was inspired by Tom Shannon's |
| 3197 | @file{organizer-mode.el}. | 3226 | @file{organizer-mode.el}. |
| 3198 | @item | 3227 | @item |
| 3199 | Scheduling TODO items was inspired by John Wiegley's @file{planner.el}. | 3228 | Juergen Vollmer contributed code generating the table of contents |
| 3229 | in HTML output, and other export improvements. | ||
| 3200 | @item | 3230 | @item |
| 3201 | Sacha Chua, the current maintainer of Planner, suggested to copy | 3231 | David Wainberg suggested to implement an archiving mechanism and helped |
| 3202 | linking code from Planner (I took code for RMAIL and Wanderlust). | 3232 | testing. |
| 3203 | @item | 3233 | @item |
| 3204 | Oliver Oppitz made useful suggestions. | 3234 | Scheduling TODO items was inspired by John Wiegley's @file{planner.el}. |
| 3205 | @item | 3235 | @item |
| 3206 | Carsten Wimmer suggested some changes and helped fix a bug in linking | 3236 | Carsten Wimmer suggested some changes and helped fix a bug in linking |
| 3207 | to GNUS. | 3237 | to GNUS. |
| 3208 | @item | ||
| 3209 | Pavel Chalmoviansky reported bugs and suggested improvements related | ||
| 3210 | to the agenda treatment of items with specified time. | ||
| 3211 | @item | ||
| 3212 | Stefan Monnier provided a patch with lots of little fixes to keep the | ||
| 3213 | Emacs-Lisp compiler happy. | ||
| 3214 | @item | ||
| 3215 | Kai Grossjohann pointed out that a number of key bindings in Org-mode | ||
| 3216 | conflict with other packages. | ||
| 3217 | @item | 3238 | @item |
| 3218 | Roland Winkler pointed out that additional keybindings are needed to | 3239 | Roland Winkler pointed out that additional keybindings are needed to |
| 3219 | use Org-mode on a tty. | 3240 | use Org-mode on a tty. |
| 3220 | @item | ||
| 3221 | Tim O'Callaghan suggested in-file links, search options for | ||
| 3222 | general file links, and TAGS. | ||
| 3223 | @c @item | 3241 | @c @item |
| 3224 | @c Nic Ferrier and Christian Egli implemented XML export. | 3242 | @c Nic Ferrier and Christian Egli implemented XML export. |
| 3225 | @end itemize | 3243 | @end itemize |
diff --git a/man/programs.texi b/man/programs.texi index 6444a3a6a47..e1806488150 100644 --- a/man/programs.texi +++ b/man/programs.texi | |||
| @@ -128,17 +128,19 @@ place to set up customizations for that major mode. @xref{Hooks}. | |||
| 128 | @node Defuns | 128 | @node Defuns |
| 129 | @section Top-Level Definitions, or Defuns | 129 | @section Top-Level Definitions, or Defuns |
| 130 | 130 | ||
| 131 | In Emacs, a major definition at the top level in the buffer is | 131 | In Emacs, a major definition at the top level in the buffer, |
| 132 | called a @dfn{defun}. The name comes from Lisp, but in Emacs we use | 132 | something like a function, is called a @dfn{defun}. The name comes |
| 133 | it for all languages. | 133 | from Lisp, but in Emacs we use it for all languages. |
| 134 | 134 | ||
| 135 | In most programming language modes, Emacs assumes that a defun is | 135 | In many programming language modes, Emacs assumes that a defun is |
| 136 | any pair of parentheses (or braces, if the language uses braces this | 136 | any pair of parentheses (or braces, if the language uses braces this |
| 137 | way) that starts at the left margin. For example, in C, the body of a | 137 | way) that starts at the left margin. For example, in C, the body of a |
| 138 | function definition is normally a defun, because the open-brace that | 138 | function definition is a defun, usually recognized as an open-brace |
| 139 | begins it is normally at the left margin. A variable's initializer | 139 | that begins at the left margin@footnote{Alternatively, you can set up |
| 140 | can also count as a defun, if the open-brace that begins the | 140 | C Mode to recognize a defun at an opening brace at the outermost |
| 141 | initializer is at the left margin. | 141 | level. @xref{Movement Commands,,, ccmode, the CC Mode Manual}.}. A |
| 142 | variable's initializer can also count as a defun, if the open-brace | ||
| 143 | that begins the initializer is at the left margin. | ||
| 142 | 144 | ||
| 143 | However, some language modes provide their own code for recognizing | 145 | However, some language modes provide their own code for recognizing |
| 144 | defuns in a way that suits the language syntax and conventions better. | 146 | defuns in a way that suits the language syntax and conventions better. |
| @@ -156,14 +158,24 @@ defuns in a way that suits the language syntax and conventions better. | |||
| 156 | 158 | ||
| 157 | @cindex open-parenthesis in leftmost column | 159 | @cindex open-parenthesis in leftmost column |
| 158 | @cindex ( in leftmost column | 160 | @cindex ( in leftmost column |
| 159 | In most major modes, Emacs assumes that any opening delimiter found | 161 | Emacs assumes by default that any opening delimiter found at the |
| 160 | at the left margin is the start of a top-level definition, or defun. | 162 | left margin is the start of a top-level definition, or defun. You can |
| 161 | Therefore, @strong{never put an opening delimiter at the left margin | 163 | override this default by setting this user option: |
| 162 | unless it should have that significance.} For instance, never put an | 164 | |
| 165 | @defvar open-paren-in-column-0-is-defun-start | ||
| 166 | If this user option is set to @code{t} (the default), opening | ||
| 167 | parentheses or braces at column zero always start defuns. When it's | ||
| 168 | @code{nil}, defuns are found by searching for parens or braces at the | ||
| 169 | outermost level. Some major modes, including C and related modes, set | ||
| 170 | @code{open-paren-in-column-0-is-defun-start} buffer-locally to | ||
| 171 | @code{nil} | ||
| 172 | @end defvar | ||
| 173 | |||
| 174 | In modes where @code{open-paren-in-column-0-is-defun-start} is | ||
| 175 | @code{t}, @strong{don't put an opening delimiter at the left margin | ||
| 176 | unless it is a defun start}. For instance, never put an | ||
| 163 | open-parenthesis at the left margin in a Lisp file unless it is the | 177 | open-parenthesis at the left margin in a Lisp file unless it is the |
| 164 | start of a top-level list. Never put an open-brace or other opening | 178 | start of a top-level list. |
| 165 | delimiter at the beginning of a line of C code unless it is at top | ||
| 166 | level. | ||
| 167 | 179 | ||
| 168 | If you don't follow this convention, not only will you have trouble | 180 | If you don't follow this convention, not only will you have trouble |
| 169 | when you explicitly use the commands for motion by defuns; other | 181 | when you explicitly use the commands for motion by defuns; other |
| @@ -173,10 +185,10 @@ mode (@pxref{Font Lock}). | |||
| 173 | 185 | ||
| 174 | The most likely problem case is when you want an opening delimiter | 186 | The most likely problem case is when you want an opening delimiter |
| 175 | at the start of a line inside a string. To avoid trouble, put an | 187 | at the start of a line inside a string. To avoid trouble, put an |
| 176 | escape character (@samp{\}, in C and Emacs Lisp, @samp{/} in some | 188 | escape character (@samp{\}, in Emacs Lisp, @samp{/} in some other Lisp |
| 177 | other Lisp dialects) before the opening delimiter. This will not | 189 | dialects) before the opening delimiter. This will not affect the |
| 178 | affect the contents of the string, but will prevent that opening | 190 | contents of the string, but will prevent that opening delimiter from |
| 179 | delimiter from starting a defun. Here's an example: | 191 | starting a defun. Here's an example: |
| 180 | 192 | ||
| 181 | @example | 193 | @example |
| 182 | (insert "Foo: | 194 | (insert "Foo: |
| @@ -195,8 +207,9 @@ the beginning of the buffer, even for a small function. To speed up | |||
| 195 | the operation, we changed Emacs to assume that any opening delimiter | 207 | the operation, we changed Emacs to assume that any opening delimiter |
| 196 | at the left margin is the start of a defun. This heuristic is nearly | 208 | at the left margin is the start of a defun. This heuristic is nearly |
| 197 | always right, and avoids the need to scan back to the beginning of the | 209 | always right, and avoids the need to scan back to the beginning of the |
| 198 | buffer. However, it mandates following the convention described | 210 | buffer. However, now that modern computers are so powerful, this |
| 199 | above. | 211 | scanning is rarely slow enough to annoy, so we've provided a way to |
| 212 | disable the heuristic. | ||
| 200 | 213 | ||
| 201 | @node Moving by Defuns | 214 | @node Moving by Defuns |
| 202 | @subsection Moving by Defuns | 215 | @subsection Moving by Defuns |
| @@ -399,13 +412,14 @@ behavior is convenient in cases where you have overridden the standard | |||
| 399 | result of @key{TAB} because you find it unaesthetic for a particular | 412 | result of @key{TAB} because you find it unaesthetic for a particular |
| 400 | line. | 413 | line. |
| 401 | 414 | ||
| 402 | Remember that an open-parenthesis, open-brace or other opening delimiter | 415 | By default, an open-parenthesis, open-brace or other opening |
| 403 | at the left margin is assumed by Emacs (including the indentation routines) | 416 | delimiter at the left margin is assumed by Emacs (including the |
| 404 | to be the start of a function. Therefore, you must never have an opening | 417 | indentation routines) to be the start of a function. This speeds up |
| 405 | delimiter in column zero that is not the beginning of a function, not even | 418 | indentation commands. If you will be editing text which contains |
| 406 | inside a string. This restriction is vital for making the indentation | 419 | opening delimiters in column zero that aren't the beginning of a |
| 407 | commands fast; you must simply accept it. @xref{Left Margin Paren}, | 420 | functions, even inside strings or comments, you must set |
| 408 | for more information on this. | 421 | @code{open-paren-in-column-0-is-defun-start}. @xref{Left Margin |
| 422 | Paren}, for more information on this. | ||
| 409 | 423 | ||
| 410 | Normally, lines are indented with tabs and spaces. If you want Emacs | 424 | Normally, lines are indented with tabs and spaces. If you want Emacs |
| 411 | to use spaces only, see @ref{Just Spaces}. | 425 | to use spaces only, see @ref{Just Spaces}. |
| @@ -560,16 +574,16 @@ onto the indentation of the @dfn{anchor statement}. | |||
| 560 | Select a predefined style @var{style} (@code{c-set-style}). | 574 | Select a predefined style @var{style} (@code{c-set-style}). |
| 561 | @end table | 575 | @end table |
| 562 | 576 | ||
| 563 | A @dfn{style} is a named collection of customizations that can | 577 | A @dfn{style} is a named collection of customizations that can be |
| 564 | be used in C mode and the related modes. Emacs comes with several | 578 | used in C mode and the related modes. @ref{Styles,,, ccmode, The CC |
| 579 | Mode Manual}, for a complete description. Emacs comes with several | ||
| 565 | predefined styles, including @code{gnu}, @code{k&r}, @code{bsd}, | 580 | predefined styles, including @code{gnu}, @code{k&r}, @code{bsd}, |
| 566 | @code{stroustrup}, @code{linux}, @code{python}, @code{java}, | 581 | @code{stroustrup}, @code{linux}, @code{python}, @code{java}, |
| 567 | @code{whitesmith}, @code{ellemtel}, @code{cc-mode}, and @code{user}. | 582 | @code{whitesmith}, @code{ellemtel}, and @code{awk}. Some of these |
| 568 | Some of these styles are primarily intended for one language, but any | 583 | styles are primarily intended for one language, but any of them can be |
| 569 | of them can be used with any of the languages supported by these | 584 | used with any of the languages supported by these modes. To find out |
| 570 | modes. To find out what a style looks like, select it and reindent | 585 | what a style looks like, select it and reindent some code, e.g., by |
| 571 | some code, e.g., by typing @key{C-M-q} at the start of a function | 586 | typing @key{C-M-q} at the start of a function definition. |
| 572 | definition. | ||
| 573 | 587 | ||
| 574 | @kindex C-c . @r{(C mode)} | 588 | @kindex C-c . @r{(C mode)} |
| 575 | @findex c-set-style | 589 | @findex c-set-style |
| @@ -577,8 +591,8 @@ definition. | |||
| 577 | .}. Specify a style name as an argument (case is not significant). | 591 | .}. Specify a style name as an argument (case is not significant). |
| 578 | This command affects the current buffer only, and it affects only | 592 | This command affects the current buffer only, and it affects only |
| 579 | future invocations of the indentation commands; it does not reindent | 593 | future invocations of the indentation commands; it does not reindent |
| 580 | the code in the buffer. To reindent the whole buffer in the new | 594 | the code already in the buffer. To reindent the whole buffer in the |
| 581 | style, you can type @kbd{C-x h C-M-\}. | 595 | new style, you can type @kbd{C-x h C-M-\}. |
| 582 | 596 | ||
| 583 | @vindex c-default-style | 597 | @vindex c-default-style |
| 584 | You can also set the variable @code{c-default-style} to specify the | 598 | You can also set the variable @code{c-default-style} to specify the |
| @@ -589,23 +603,24 @@ example, | |||
| 589 | 603 | ||
| 590 | @example | 604 | @example |
| 591 | (setq c-default-style | 605 | (setq c-default-style |
| 592 | '((java-mode . "java") (other . "gnu"))) | 606 | '((java-mode . "java") (awk-mode . "awk") (other . "gnu"))) |
| 593 | @end example | 607 | @end example |
| 594 | 608 | ||
| 595 | @noindent | 609 | @noindent |
| 596 | specifies an explicit choice for Java mode, and the default @samp{gnu} | 610 | specifies explicit choices for Java and AWK modes, and the default |
| 597 | style for the other C-like modes. (These settings are actually the | 611 | @samp{gnu} style for the other C-like modes. (These settings are |
| 598 | defaults.) This variable takes effect when you select one of the | 612 | actually the defaults.) This variable takes effect when you select |
| 599 | C-like major modes; thus, if you specify a new default style for Java | 613 | one of the C-like major modes; thus, if you specify a new default |
| 600 | mode, you can make it take effect in an existing Java mode buffer by | 614 | style for Java mode, you can make it take effect in an existing Java |
| 601 | typing @kbd{M-x java-mode} there. | 615 | mode buffer by typing @kbd{M-x java-mode} there. |
| 602 | 616 | ||
| 603 | The @code{gnu} style specifies the formatting recommended by the GNU | 617 | The @code{gnu} style specifies the formatting recommended by the GNU |
| 604 | Project for C; it is the default, so as to encourage use of our | 618 | Project for C; it is the default, so as to encourage use of our |
| 605 | recommended style. | 619 | recommended style. |
| 606 | 620 | ||
| 607 | @xref{Customizing Indentation,,, ccmode, the CC Mode Manual}, for | 621 | @xref{Indentation Engine Basics,,, ccmode, the CC Mode Manual}, and |
| 608 | more information on customizing indentation for C and related modes, | 622 | @ref{Customizing Indentation,,, ccmode, the CC Mode Manual}, for more |
| 623 | information on customizing indentation for C and related modes, | ||
| 609 | including how to override parts of an existing style and how to define | 624 | including how to override parts of an existing style and how to define |
| 610 | your own styles. | 625 | your own styles. |
| 611 | 626 | ||
| @@ -708,11 +723,12 @@ would move over. | |||
| 708 | A somewhat random-sounding command which is nevertheless handy is | 723 | A somewhat random-sounding command which is nevertheless handy is |
| 709 | @kbd{C-M-t} (@code{transpose-sexps}), which drags the previous | 724 | @kbd{C-M-t} (@code{transpose-sexps}), which drags the previous |
| 710 | balanced expression across the next one. An argument serves as a | 725 | balanced expression across the next one. An argument serves as a |
| 711 | repeat count, and a negative argument drags the previous balanced | 726 | repeat count, moving the previous expression over that many following |
| 712 | expression backwards across those before it (thus canceling out the | 727 | ones. A negative argument drags the previous balanced expression |
| 713 | effect of @kbd{C-M-t} with a positive argument). An argument of zero, | 728 | backwards across those before it (thus canceling out the effect of |
| 714 | rather than doing nothing, transposes the balanced expressions ending | 729 | @kbd{C-M-t} with a positive argument). An argument of zero, rather |
| 715 | at or after point and the mark. | 730 | than doing nothing, transposes the balanced expressions ending at or |
| 731 | after point and the mark. | ||
| 716 | 732 | ||
| 717 | @kindex C-M-@@ | 733 | @kindex C-M-@@ |
| 718 | @kindex C-M-@key{SPC} | 734 | @kindex C-M-@key{SPC} |
| @@ -722,9 +738,9 @@ use @kbd{C-M-@@} (@code{mark-sexp}), which sets mark at the same place | |||
| 722 | that @kbd{C-M-f} would move to. @kbd{C-M-@@} takes arguments like | 738 | that @kbd{C-M-f} would move to. @kbd{C-M-@@} takes arguments like |
| 723 | @kbd{C-M-f}. In particular, a negative argument is useful for putting | 739 | @kbd{C-M-f}. In particular, a negative argument is useful for putting |
| 724 | the mark at the beginning of the previous balanced expression. The | 740 | the mark at the beginning of the previous balanced expression. The |
| 725 | alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}. If you use | 741 | alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}. When you |
| 726 | this command repeatedly, or in Transient Mark mode whenever the mark | 742 | repeat this command, or use it in Transient Mark mode when the mark is |
| 727 | is active, it extends the region by one sexp each time. | 743 | active, it extends the region by one sexp each time. |
| 728 | 744 | ||
| 729 | In languages that use infix operators, such as C, it is not possible | 745 | In languages that use infix operators, such as C, it is not possible |
| 730 | to recognize all balanced expressions as such because there can be | 746 | to recognize all balanced expressions as such because there can be |
| @@ -875,7 +891,7 @@ Set comment column (@code{comment-set-column}). | |||
| 875 | @item @kbd{C-M-j} | 891 | @item @kbd{C-M-j} |
| 876 | @itemx @kbd{M-j} | 892 | @itemx @kbd{M-j} |
| 877 | Like @key{RET} followed by inserting and aligning a comment | 893 | Like @key{RET} followed by inserting and aligning a comment |
| 878 | (@code{comment-indent-new-line}). | 894 | (@code{comment-indent-new-line}). @xref{Multi-Line Comments}. |
| 879 | @item @kbd{M-x comment-region} | 895 | @item @kbd{M-x comment-region} |
| 880 | @itemx @kbd{C-c C-c} (in C-like modes) | 896 | @itemx @kbd{C-c C-c} (in C-like modes) |
| 881 | Add or remove comment delimiters on all the lines in the region. | 897 | Add or remove comment delimiters on all the lines in the region. |
| @@ -948,8 +964,13 @@ and by not changing the indentation of a triple-semicolon comment at all. | |||
| 948 | (1+ x)) ; This line adds one. | 964 | (1+ x)) ; This line adds one. |
| 949 | @end example | 965 | @end example |
| 950 | 966 | ||
| 951 | In C code, a comment preceded on its line by nothing but whitespace | 967 | For C-like buffers, you can configure the exact effect of @kbd{M-;} |
| 952 | is indented like a line of code. | 968 | more flexibly than for most buffers by setting the user options |
| 969 | @code{c-indent-comment-alist} and | ||
| 970 | @code{c-indent-comments-syntactically-p}. For example, on a line | ||
| 971 | ending in a closing brace, @kbd{M-;} puts the comment one space after | ||
| 972 | the brace rather than at @code{comment-column}. For full details see | ||
| 973 | @ref{Comment Commands,,, ccmode, The CC Mode Manual}. | ||
| 953 | 974 | ||
| 954 | @node Multi-Line Comments | 975 | @node Multi-Line Comments |
| 955 | @subsection Multiple Lines of Comments | 976 | @subsection Multiple Lines of Comments |
| @@ -958,23 +979,23 @@ is indented like a line of code. | |||
| 958 | @kindex M-j | 979 | @kindex M-j |
| 959 | @cindex blank lines in programs | 980 | @cindex blank lines in programs |
| 960 | @findex comment-indent-new-line | 981 | @findex comment-indent-new-line |
| 982 | |||
| 961 | If you are typing a comment and wish to continue it on another line, | 983 | If you are typing a comment and wish to continue it on another line, |
| 962 | you can use the command @kbd{C-M-j} or @kbd{M-j} | 984 | you can use the command @kbd{C-M-j} or @kbd{M-j} |
| 963 | (@code{comment-indent-new-line}). This terminates the comment you are | 985 | (@code{comment-indent-new-line}). If @code{comment-multi-line} |
| 964 | typing, creates a new blank line afterward, and begins a new comment | 986 | (@pxref{Options for Comments}) is non-@code{nil}, it moves to a new |
| 965 | indented under the old one. When Auto Fill mode is on, going past the | 987 | line within the comment. Otherwise it closes the comment and starts a |
| 988 | new comment on a new line. When Auto Fill mode is on, going past the | ||
| 966 | fill column while typing a comment causes the comment to be continued | 989 | fill column while typing a comment causes the comment to be continued |
| 967 | in just this fashion. If point is not at the end of the line when you | 990 | in just this fashion. |
| 968 | type the command, the text on the rest of the line becomes part of the | ||
| 969 | new comment line. | ||
| 970 | 991 | ||
| 971 | @kindex C-c C-c (C mode) | 992 | @kindex C-c C-c (C mode) |
| 972 | @findex comment-region | 993 | @findex comment-region |
| 973 | To turn existing lines into comment lines, use the @kbd{M-x | 994 | To turn existing lines into comment lines, use the @kbd{M-x |
| 974 | comment-region} command. It adds comment delimiters to the lines that start | 995 | comment-region} command (or type @kbd{C-c C-c} in C-like buffers). It |
| 975 | in the region, thus commenting them out. With a negative argument, it | 996 | adds comment delimiters to the lines that start in the region, thus |
| 976 | does the opposite---it deletes comment delimiters from the lines in the | 997 | commenting them out. With a negative argument, it does the |
| 977 | region. | 998 | opposite---it deletes comment delimiters from the lines in the region. |
| 978 | 999 | ||
| 979 | With a positive argument, @code{comment-region} duplicates the last | 1000 | With a positive argument, @code{comment-region} duplicates the last |
| 980 | character of the comment start sequence it adds; the argument specifies | 1001 | character of the comment start sequence it adds; the argument specifies |
| @@ -985,6 +1006,11 @@ can also affect how the comment is indented. In Lisp, for proper | |||
| 985 | indentation, you should use an argument of two or three, if between defuns; | 1006 | indentation, you should use an argument of two or three, if between defuns; |
| 986 | if within a defun, it must be three. | 1007 | if within a defun, it must be three. |
| 987 | 1008 | ||
| 1009 | You can configure C Mode such that when you type a @samp{/} at the | ||
| 1010 | start of a line in a multi-line block comment, this closes the | ||
| 1011 | comment. Enable the @code{comment-close-slash} clean-up for this. | ||
| 1012 | @xref{Clean-ups,,, ccmode, The CC Mode Manual}. | ||
| 1013 | |||
| 988 | @node Options for Comments | 1014 | @node Options for Comments |
| 989 | @subsection Options Controlling Comments | 1015 | @subsection Options Controlling Comments |
| 990 | 1016 | ||
| @@ -1038,13 +1064,13 @@ can hold the actual string to insert. | |||
| 1038 | @vindex comment-multi-line | 1064 | @vindex comment-multi-line |
| 1039 | The variable @code{comment-multi-line} controls how @kbd{C-M-j} | 1065 | The variable @code{comment-multi-line} controls how @kbd{C-M-j} |
| 1040 | (@code{indent-new-comment-line}) behaves when used inside a comment. | 1066 | (@code{indent-new-comment-line}) behaves when used inside a comment. |
| 1041 | Specifically, when @code{comment-multi-line} is @code{nil} (the | 1067 | Specifically, when @code{comment-multi-line} is @code{nil}, the |
| 1042 | default value), the command inserts a comment terminator, begins a new | 1068 | command inserts a comment terminator, begins a new line, and finally |
| 1043 | line, and finally inserts a comment starter. Otherwise it does not | 1069 | inserts a comment starter. Otherwise it does not insert the |
| 1044 | insert the terminator and starter, so it effectively continues the | 1070 | terminator and starter, so it effectively continues the current |
| 1045 | current comment across multiple lines. In languages that allow | 1071 | comment across multiple lines. In languages that allow multi-line |
| 1046 | multi-line comments, the choice of value for this variable is a matter | 1072 | comments, the choice of value for this variable is a matter of taste. |
| 1047 | of taste. | 1073 | The default for this variable depends on the major mode. |
| 1048 | 1074 | ||
| 1049 | @vindex comment-indent-function | 1075 | @vindex comment-indent-function |
| 1050 | The variable @code{comment-indent-function} should contain a function | 1076 | The variable @code{comment-indent-function} should contain a function |
| @@ -1510,11 +1536,13 @@ Move point to the end of the innermost C statement or sentence; like | |||
| 1510 | 1536 | ||
| 1511 | @item M-x c-backward-into-nomenclature | 1537 | @item M-x c-backward-into-nomenclature |
| 1512 | @findex c-backward-into-nomenclature | 1538 | @findex c-backward-into-nomenclature |
| 1513 | Move point backward to beginning of a C++ nomenclature section or word. | 1539 | Move point backward to beginning of a C++ nomenclature section or |
| 1514 | With prefix argument @var{n}, move @var{n} times. If @var{n} is | 1540 | word. With prefix argument @var{n}, move @var{n} times. If @var{n} |
| 1515 | negative, move forward. C++ nomenclature means a symbol name in the | 1541 | is negative, move forward. C++ nomenclature means a symbol name in |
| 1516 | style of NamingSymbolsWithMixedCaseAndNoUnderlines; each capital letter | 1542 | the style of NamingSymbolsWithMixedCaseAndNoUnderlines; each capital |
| 1517 | begins a section or word. | 1543 | letter begins a section or word. Rather than this command, you might |
| 1544 | well prefer the newer ``Subword Mode'', which does the same thing | ||
| 1545 | better. @xref{Other C Commands}. | ||
| 1518 | 1546 | ||
| 1519 | In the GNU project, we recommend using underscores to separate words | 1547 | In the GNU project, we recommend using underscores to separate words |
| 1520 | within an identifier in C or C++, rather than using case distinctions. | 1548 | within an identifier in C or C++, rather than using case distinctions. |
| @@ -1529,154 +1557,90 @@ With prefix argument @var{n}, move @var{n} times. | |||
| 1529 | @subsection Electric C Characters | 1557 | @subsection Electric C Characters |
| 1530 | 1558 | ||
| 1531 | In C mode and related modes, certain printing characters are | 1559 | In C mode and related modes, certain printing characters are |
| 1532 | ``electric''---in addition to inserting themselves, they also reindent | 1560 | @dfn{electric}---in addition to inserting themselves, they also |
| 1533 | the current line, and optionally also insert newlines. The | 1561 | reindent the current line, and optionally also insert newlines. The |
| 1534 | ``electric'' characters are @kbd{@{}, @kbd{@}}, @kbd{:}, @kbd{#}, | 1562 | ``electric'' characters are @kbd{@{}, @kbd{@}}, @kbd{:}, @kbd{#}, |
| 1535 | @kbd{;}, @kbd{,}, @kbd{<}, @kbd{>}, @kbd{/}, @kbd{*}, @kbd{(}, and | 1563 | @kbd{;}, @kbd{,}, @kbd{<}, @kbd{>}, @kbd{/}, @kbd{*}, @kbd{(}, and |
| 1536 | @kbd{)}. | 1564 | @kbd{)}. |
| 1537 | 1565 | ||
| 1538 | Electric characters insert newlines only when the @dfn{auto-newline} | 1566 | You might find electric indentation inconvenient if you are editing |
| 1539 | feature is enabled (indicated by @samp{/a} in the mode line after the | 1567 | chaotically indented code. If you are new to CC Mode, you might find |
| 1540 | mode name). This feature is controlled by the variable | 1568 | it disconcerting. You can toggle electric action with the command |
| 1541 | @code{c-auto-newline}. You can turn this feature on or off with the | 1569 | @kbd{C-c C-l}; when it is enabled, @samp{/l} appears in the mode line |
| 1542 | command @kbd{C-c C-a}: | 1570 | after the mode name: |
| 1543 | 1571 | ||
| 1544 | @table @kbd | 1572 | @table @kbd |
| 1545 | @item C-c C-a | 1573 | @item C-c C-l |
| 1546 | @kindex C-c C-a @r{(C mode)} | 1574 | @kindex C-c C-l @r{(C mode)} |
| 1547 | @findex c-toggle-auto-state | 1575 | @findex c-toggle-electric-state |
| 1548 | Toggle the auto-newline feature (@code{c-toggle-auto-state}). With a | 1576 | Toggle electric action (@code{c-toggle-electric-state}). With a |
| 1549 | prefix argument, this command turns the auto-newline feature on if the | 1577 | prefix argument, this command enables electric action if the argument |
| 1550 | argument is positive, and off if it is negative. | 1578 | is positive, disables it if it is negative. |
| 1551 | @end table | 1579 | @end table |
| 1552 | 1580 | ||
| 1553 | The colon character is electric because that is appropriate for a | 1581 | Electric characters insert newlines only when, in addition to the |
| 1554 | single colon. But when you want to insert a double colon in C++, the | 1582 | electric state, the @dfn{auto-newline} feature is enabled (indicated |
| 1555 | electric behavior of colon is inconvenient. You can insert a double | 1583 | by @samp{/la} in the mode line after the mode name). You can turn |
| 1556 | colon with no reindentation or newlines by typing @kbd{C-c :}: | 1584 | this feature on or off with the command @kbd{C-c C-a}: |
| 1557 | 1585 | ||
| 1558 | @table @kbd | 1586 | @table @kbd |
| 1559 | @item C-c : | 1587 | @item C-c C-a |
| 1560 | @ifinfo | 1588 | @kindex C-c C-a @r{(C mode)} |
| 1561 | @c This uses ``colon'' instead of a literal `:' because Info cannot | 1589 | @findex c-toggle-auto-newline |
| 1562 | @c cope with a `:' in a menu | 1590 | Toggle the auto-newline feature (@code{c-toggle-auto-newline}). With a |
| 1563 | @kindex C-c @key{colon} @r{(C mode)} | 1591 | prefix argument, this command turns the auto-newline feature on if the |
| 1564 | @end ifinfo | 1592 | argument is positive, and off if it is negative. |
| 1565 | @ifnotinfo | ||
| 1566 | @kindex C-c : @r{(C mode)} | ||
| 1567 | @end ifnotinfo | ||
| 1568 | @findex c-scope-operator | ||
| 1569 | Insert a double colon scope operator at point, without reindenting the | ||
| 1570 | line or adding any newlines (@code{c-scope-operator}). | ||
| 1571 | @end table | 1593 | @end table |
| 1572 | 1594 | ||
| 1573 | @vindex c-electric-pound-behavior | 1595 | Usually the CC Mode style configures the exact circumstances in |
| 1574 | The electric @kbd{#} key reindents the line if it appears to be the | 1596 | which Emacs inserts auto-newlines. You can also configure this |
| 1575 | beginning of a preprocessor directive. This happens when the value of | 1597 | directly. @xref{Custom Auto-newlines,,, ccmode, The CC Mode Manual}. |
| 1576 | @code{c-electric-pound-behavior} is @code{(alignleft)}. You can turn | ||
| 1577 | this feature off by setting @code{c-electric-pound-behavior} to | ||
| 1578 | @code{nil}. | ||
| 1579 | |||
| 1580 | @vindex c-hanging-braces-alist | ||
| 1581 | The variable @code{c-hanging-braces-alist} controls the insertion of | ||
| 1582 | newlines before and after inserted braces. It is an association list | ||
| 1583 | with elements of the following form: @code{(@var{syntactic-symbol} | ||
| 1584 | . @var{nl-list})}. Most of the syntactic symbols that appear in | ||
| 1585 | @code{c-offsets-alist} are meaningful here as well. | ||
| 1586 | |||
| 1587 | The list @var{nl-list} may contain either of the symbols | ||
| 1588 | @code{before} or @code{after}, or both; or it may be @code{nil}. When a | ||
| 1589 | brace is inserted, the syntactic context it defines is looked up in | ||
| 1590 | @code{c-hanging-braces-alist}; if it is found, the @var{nl-list} is used | ||
| 1591 | to determine where newlines are inserted: either before the brace, | ||
| 1592 | after, or both. If not found, the default is to insert a newline both | ||
| 1593 | before and after braces. | ||
| 1594 | |||
| 1595 | @vindex c-hanging-colons-alist | ||
| 1596 | The variable @code{c-hanging-colons-alist} controls the insertion of | ||
| 1597 | newlines before and after inserted colons. It is an association list | ||
| 1598 | with elements of the following form: @code{(@var{syntactic-symbol} | ||
| 1599 | . @var{nl-list})}. The list @var{nl-list} may contain either of the | ||
| 1600 | symbols @code{before} or @code{after}, or both; or it may be @code{nil}. | ||
| 1601 | |||
| 1602 | When a colon is inserted, the syntactic symbol it defines is looked | ||
| 1603 | up in this list, and if found, the @var{nl-list} is used to determine | ||
| 1604 | where newlines are inserted: either before the brace, after, or both. | ||
| 1605 | If the syntactic symbol is not found in this list, no newlines are | ||
| 1606 | inserted. | ||
| 1607 | |||
| 1608 | @vindex c-cleanup-list | ||
| 1609 | Electric characters can also delete newlines automatically when the | ||
| 1610 | auto-newline feature is enabled. This feature makes auto-newline more | ||
| 1611 | acceptable, by deleting the newlines in the most common cases where you | ||
| 1612 | do not want them. Emacs can recognize several cases in which deleting a | ||
| 1613 | newline might be desirable; by setting the variable | ||
| 1614 | @code{c-cleanup-list}, you can specify @emph{which} of these cases that | ||
| 1615 | should happen. The variable's value is a list of symbols, each | ||
| 1616 | describing one case for possible deletion of a newline. Here are the | ||
| 1617 | meaningful symbols, and their meanings: | ||
| 1618 | |||
| 1619 | @table @code | ||
| 1620 | @item brace-catch-brace | ||
| 1621 | Clean up @samp{@} catch (@var{condition}) @{} constructs by placing the | ||
| 1622 | entire construct on a single line. The clean-up occurs when you type | ||
| 1623 | the @samp{@{}, if there is nothing between the braces aside from | ||
| 1624 | @code{catch} and @var{condition}. | ||
| 1625 | |||
| 1626 | @item brace-else-brace | ||
| 1627 | Clean up @samp{@} else @{} constructs by placing the entire construct on | ||
| 1628 | a single line. The clean-up occurs when you type the @samp{@{} after | ||
| 1629 | the @code{else}, but only if there is nothing but white space between | ||
| 1630 | the braces and the @code{else}. | ||
| 1631 | |||
| 1632 | @item brace-elseif-brace | ||
| 1633 | Clean up @samp{@} else if (@dots{}) @{} constructs by placing the entire | ||
| 1634 | construct on a single line. The clean-up occurs when you type the | ||
| 1635 | @samp{@{}, if there is nothing but white space between the @samp{@}} and | ||
| 1636 | @samp{@{} aside from the keywords and the @code{if}-condition. | ||
| 1637 | |||
| 1638 | @item empty-defun-braces | ||
| 1639 | Clean up empty defun braces by placing the braces on the same | ||
| 1640 | line. Clean-up occurs when you type the closing brace. | ||
| 1641 | |||
| 1642 | @item defun-close-semi | ||
| 1643 | Clean up the semicolon after a @code{struct} or similar type | ||
| 1644 | declaration, by placing the semicolon on the same line as the closing | ||
| 1645 | brace. Clean-up occurs when you type the semicolon. | ||
| 1646 | |||
| 1647 | @item list-close-comma | ||
| 1648 | Clean up commas following braces in array and aggregate | ||
| 1649 | initializers. Clean-up occurs when you type the comma. | ||
| 1650 | |||
| 1651 | @item scope-operator | ||
| 1652 | Clean up double colons which may designate a C++ scope operator, by | ||
| 1653 | placing the colons together. Clean-up occurs when you type the second | ||
| 1654 | colon, but only when the two colons are separated by nothing but | ||
| 1655 | whitespace. | ||
| 1656 | @end table | ||
| 1657 | 1598 | ||
| 1658 | @node Hungry Delete | 1599 | @node Hungry Delete |
| 1659 | @subsection Hungry Delete Feature in C | 1600 | @subsection Hungry Delete Feature in C |
| 1660 | @cindex hungry deletion (C Mode) | 1601 | @cindex hungry deletion (C Mode) |
| 1661 | 1602 | ||
| 1662 | When the @dfn{hungry-delete} feature is enabled (indicated by | 1603 | If you want to delete an entire block of whitespace at point, you |
| 1663 | @samp{/h} or @samp{/ah} in the mode line after the mode name), a single | 1604 | can use @dfn{hungry deletion}. This deletes all the contiguous |
| 1664 | @key{DEL} command deletes all preceding whitespace, not just one space. | 1605 | whitespace either before point or after point in a single operation. |
| 1665 | To turn this feature on or off, use @kbd{C-c C-d}: | 1606 | @dfn{Whitespace} here includes tabs and newlines, but not comments or |
| 1607 | preprocessor commands. | ||
| 1666 | 1608 | ||
| 1667 | @table @kbd | 1609 | @table @kbd |
| 1610 | @item C-c C-@key{BS} | ||
| 1611 | @itemx C-c @key{BS} | ||
| 1612 | @findex c-hungry-backspace | ||
| 1613 | @kindex C-c C-@key{BS} (C Mode) | ||
| 1614 | @kindex C-c @key{BS} (C Mode) | ||
| 1615 | @code{c-hungry-backspace}---Delete the entire block of whitespace | ||
| 1616 | preceding point. | ||
| 1617 | |||
| 1668 | @item C-c C-d | 1618 | @item C-c C-d |
| 1669 | @kindex C-c C-d @r{(C mode)} | 1619 | @itemx C-c C-@key{DEL} |
| 1670 | @findex c-toggle-hungry-state | 1620 | @itemx C-c @key{DEL} |
| 1671 | Toggle the hungry-delete feature (@code{c-toggle-hungry-state}). With a | 1621 | @findex c-hungry-delete-forward |
| 1672 | prefix argument, this command turns the hungry-delete feature on if the | 1622 | @kindex C-c C-d (C Mode) |
| 1673 | argument is positive, and off if it is negative. | 1623 | @kindex C-c C-@key{DEL} (C Mode) |
| 1624 | @kindex C-c @key{DEL} (C Mode) | ||
| 1625 | @code{c-hungry-delete-forward}---Delete the entire block of whitespace | ||
| 1626 | following point. | ||
| 1627 | @end table | ||
| 1674 | 1628 | ||
| 1675 | @item C-c C-t | 1629 | As an alternative to the above commands, you can enable @dfn{hungry |
| 1676 | @kindex C-c C-t @r{(C mode)} | 1630 | delete mode}. When this feature is enabled (indicated by @samp{/h} in |
| 1677 | @findex c-toggle-auto-hungry-state | 1631 | the mode line after the mode name), a single @key{BS} command deletes |
| 1678 | Toggle the auto-newline and hungry-delete features, both at once | 1632 | all preceding whitespace, not just one space, and a single @kbd{C-c |
| 1679 | (@code{c-toggle-auto-hungry-state}). | 1633 | C-d} (but @emph{not} @key{delete}) deletes all following whitespace. |
| 1634 | |||
| 1635 | @table @kbd | ||
| 1636 | @item M-x c-toggle-hungry-state | ||
| 1637 | @findex c-toggle-hungry-state | ||
| 1638 | Toggle the hungry-delete feature | ||
| 1639 | (@code{c-toggle-hungry-state})@footnote{This command had the binding | ||
| 1640 | @kbd{C-c C-d} in earlier versions of Emacs. @kbd{C-c C-d} is now | ||
| 1641 | bound to @code{c-hungry-delete-forward}.}. With a prefix argument, | ||
| 1642 | this command turns the hungry-delete feature on if the argument is | ||
| 1643 | positive, and off if it is negative. | ||
| 1680 | @end table | 1644 | @end table |
| 1681 | 1645 | ||
| 1682 | @vindex c-hungry-delete-key | 1646 | @vindex c-hungry-delete-key |
| @@ -1687,6 +1651,16 @@ hungry-delete feature is enabled. | |||
| 1687 | @subsection Other Commands for C Mode | 1651 | @subsection Other Commands for C Mode |
| 1688 | 1652 | ||
| 1689 | @table @kbd | 1653 | @table @kbd |
| 1654 | @item C-c C-w | ||
| 1655 | @itemx M-x c-subword-mode | ||
| 1656 | @findex c-subword-mode | ||
| 1657 | Enable (or disable) @dfn{subword mode}. In subword mode, Emacs's word | ||
| 1658 | commands then recognize upper case letters in | ||
| 1659 | @samp{StudlyCapsIdentifiers} as word boundaries. This is indicated by | ||
| 1660 | the flag @samp{/w} on the mode line after the mode name | ||
| 1661 | (e.g. @samp{C/law}). You can even use @kbd{M-x c-subword-mode} in | ||
| 1662 | non-CC Mode buffers. | ||
| 1663 | |||
| 1690 | @item M-x c-context-line-break | 1664 | @item M-x c-context-line-break |
| 1691 | @findex c-context-line-break | 1665 | @findex c-context-line-break |
| 1692 | This command inserts a line break and indents the new line in a manner | 1666 | This command inserts a line break and indents the new line in a manner |
| @@ -1697,9 +1671,13 @@ it's like @kbd{M-j} (@code{c-indent-new-comment-line}). | |||
| 1697 | 1671 | ||
| 1698 | @code{c-context-line-break} isn't bound to a key by default, but it | 1672 | @code{c-context-line-break} isn't bound to a key by default, but it |
| 1699 | needs a binding to be useful. The following code will bind it to | 1673 | needs a binding to be useful. The following code will bind it to |
| 1700 | @kbd{C-j}. | 1674 | @kbd{C-j}. We use @code{c-initialization-hook} here to make sure |
| 1675 | the keymap is loaded before we try to change it. | ||
| 1676 | |||
| 1701 | @example | 1677 | @example |
| 1702 | (define-key c-mode-base-map "\C-j" 'c-context-line-break) | 1678 | (defun my-bind-clb () |
| 1679 | (define-key c-mode-base-map "\C-j" 'c-context-line-break)) | ||
| 1680 | (add-hook 'c-initialization-hook 'my-bind-clb) | ||
| 1703 | @end example | 1681 | @end example |
| 1704 | 1682 | ||
| 1705 | @item C-M-h | 1683 | @item C-M-h |