diff options
| author | Joakim Verona | 2011-12-28 11:34:15 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-12-28 11:34:15 +0100 |
| commit | 2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f (patch) | |
| tree | 034e65ef002631d0aba8fc1a41e9984fc557e630 /doc | |
| parent | bb29f044aa967831cd664c54eba0de0c701436ce (diff) | |
| parent | d23ab8e8726ecb7e3554644857b4a58e5f7408f1 (diff) | |
| download | emacs-2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f.tar.gz emacs-2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f.zip | |
upstream
Diffstat (limited to 'doc')
46 files changed, 3316 insertions, 3477 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index d16443ccf31..7857295de92 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,232 @@ | |||
| 1 | 2011-12-26 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * dired.texi (Dired Enter, Misc Dired Features): Document | ||
| 4 | dired-use-ls-dired changes. Mention quit-window. | ||
| 5 | (Dired Navigation): Add index entries. | ||
| 6 | (Dired Visiting): Fix View Mode xref. | ||
| 7 | (Marks vs Flags): Prefer C-/ binding for undo. | ||
| 8 | (Subdirectories in Dired): Add xrefs. | ||
| 9 | (Misc Dired Features): Document some Emacs 24 changes. Add index | ||
| 10 | entries. | ||
| 11 | |||
| 12 | * abbrevs.texi (Abbrev Concepts): No need to mention abbrev-mode | ||
| 13 | variable, since it is explained in Minor Modes node. | ||
| 14 | (Defining Abbrevs): Copyedits. | ||
| 15 | (Expanding Abbrevs): State default of abbrev-all-caps. Prefer the | ||
| 16 | C-/ binding for undo. | ||
| 17 | (Dabbrev Customization): Add xrefs for case-fold-search and | ||
| 18 | case-replace. | ||
| 19 | |||
| 20 | * dired-xtra.texi (Subdir Switches): Add xref. | ||
| 21 | |||
| 22 | * maintaining.texi (VC Directory Commands): Mention quit-window. | ||
| 23 | |||
| 24 | 2011-12-25 Chong Yidong <cyd@gnu.org> | ||
| 25 | |||
| 26 | * maintaining.texi (Tags): Mention Semantic. | ||
| 27 | (Create Tags Table, Etags Regexps): Copyedits. | ||
| 28 | (Find Tag): Mention minibuffer completion. | ||
| 29 | (List Tags): Mention completion-at-point. Completion is actually | ||
| 30 | available in M-x list-tags. | ||
| 31 | |||
| 32 | * vc1-xtra.texi (VC Delete/Rename): Rename from Renaming and VC. | ||
| 33 | Document vc-delete-file. | ||
| 34 | |||
| 35 | * files.texi (Misc File Ops): Mention vc-delete-file. | ||
| 36 | |||
| 37 | * programs.texi (Symbol Completion): Mention completion-at-point | ||
| 38 | explicitly. | ||
| 39 | |||
| 40 | 2011-12-22 Chong Yidong <cyd@gnu.org> | ||
| 41 | |||
| 42 | * maintaining.texi (Change Log Commands): Don't specially mention | ||
| 43 | vc-update-change-log which is CVS-only. | ||
| 44 | |||
| 45 | * vc1-xtra.texi (Version Headers): Note that these are for | ||
| 46 | Subversion, CVS, etc. only. | ||
| 47 | (General VC Options): De-document vc-keep-workfiles. Fix | ||
| 48 | RCS-isms. | ||
| 49 | |||
| 50 | 2011-12-22 Eli Zaretskii <eliz@gnu.org> | ||
| 51 | |||
| 52 | * building.texi (Debugger Operation): Fix a typo: "@end iftext" | ||
| 53 | should be @end iftex". | ||
| 54 | |||
| 55 | 2011-12-21 Chong Yidong <cyd@gnu.org> | ||
| 56 | |||
| 57 | * maintaining.texi (Advanced C-x v v): Use fileset terminology. | ||
| 58 | (VC With A Merging VCS, VC Change Log): Add xref to VC Pull node. | ||
| 59 | (VC Pull): Mention vc-log-incoming. | ||
| 60 | (Log Buffer): Add CVS/RCS only disclaimer. | ||
| 61 | |||
| 62 | * vc1-xtra.texi (Remote Repositories): Update introduction. | ||
| 63 | (Local Version Control): Node deleted (obsolete with DVCSes). | ||
| 64 | (Remote Repositories, Version Backups): Node deleted. Move | ||
| 65 | documentation of vc-cvs-stay-local to CVS Options. | ||
| 66 | (CVS Options): Reduce verbosity of description of obscure CVS | ||
| 67 | locking feature. | ||
| 68 | (Making Revision Tags, Revision Tag Caveats): Merge into Revision | ||
| 69 | Tags node. | ||
| 70 | (Revision Tags): Move under Miscellaneous VC subsection. | ||
| 71 | (Change Logs and VC): Note that this is wrong for DVCSs. | ||
| 72 | De-document log entry manipulating features. | ||
| 73 | (Renaming and VC): Describe how it works on modern VCSes. | ||
| 74 | |||
| 75 | * files.texi (Misc File Ops): Mention vc-rename-file. | ||
| 76 | |||
| 77 | * programs.texi (Custom C Indent): Add index entries. | ||
| 78 | |||
| 79 | 2011-12-20 Alan Mackenzie <acm@muc.de> | ||
| 80 | |||
| 81 | * programs.texi (Motion in C): Update the description of C-M-a and | ||
| 82 | C-M-e, they now DTRT in enclosing scopes. | ||
| 83 | (Custom C Indent): Add @dfn{guessing} of the indentation style. | ||
| 84 | |||
| 85 | 2011-12-20 Chong Yidong <cyd@gnu.org> | ||
| 86 | |||
| 87 | * maintaining.texi (VCS Concepts): Add "working tree" terminology. | ||
| 88 | (Old Revisions): Use it. | ||
| 89 | (VCS Repositories): Add "distributed" terminology. | ||
| 90 | (Log Buffer): Remove duplicate description | ||
| 91 | about changesets. Fix "current VC fileset" ambiguity. | ||
| 92 | (Multi-User Branching): Node deleted. | ||
| 93 | (Branches, Switching Branches): Discuss decentralized version | ||
| 94 | control systems. | ||
| 95 | (VC Pull): New node. | ||
| 96 | (Merging): Document merging on decentralized systems. | ||
| 97 | (Creating Branches): Note that this is specific to CVS and related | ||
| 98 | systems. | ||
| 99 | |||
| 100 | 2011-12-19 Chong Yidong <cyd@gnu.org> | ||
| 101 | |||
| 102 | * maintaining.texi (VCS Merging, VCS Changesets): Index entries. | ||
| 103 | (VC Mode Line): Add index entry for "version control status". | ||
| 104 | (VC Undo): Use vc-revert instead of its vc-revert-buffer alias. | ||
| 105 | Document vc-revert-show-diff. De-document vc-rollback. | ||
| 106 | (VC Directory Mode): Rewrite introduction. Move prefix arg | ||
| 107 | documentation here from VC Directory Buffer node. | ||
| 108 | (VC Directory Buffer): Use a decentralized VCS example. | ||
| 109 | (VC Directory Commands): Use a table. Remove material duplicated | ||
| 110 | in previous nodes on multi-file VC filsets. | ||
| 111 | |||
| 112 | 2011-12-17 Chong Yidong <cyd@gnu.org> | ||
| 113 | |||
| 114 | * maintaining.texi (VCS Concepts): Make "revision" terminology | ||
| 115 | less CVS-specific. | ||
| 116 | (VC With A Merging VCS, VC With A Locking VCS): Add xref to | ||
| 117 | Registering node. | ||
| 118 | (Secondary VC Commands): Deleted. Promote subnodes. | ||
| 119 | (Log Buffer): Add command name for C-c C-c. Fix the name of the | ||
| 120 | log buffer. Add index entries. | ||
| 121 | (VCS Changesets, Types of Log File, VC With A Merging VCS): Use | ||
| 122 | "commit" terminology. | ||
| 123 | (Old Revisions): Move it to just before VC Change Log. "Tag" here | ||
| 124 | doesn't refer to tags tables. Note other possible forms of the | ||
| 125 | revision ID. C-x v = does not save. | ||
| 126 | (Registering): Note similarity to C-x v v action. Fix description | ||
| 127 | of how backends are chosen. De-document vc-default-init-revision. | ||
| 128 | (VC Change Log): Document C-x v l in VC-Dir buffer. Document RET | ||
| 129 | in root log buffers. | ||
| 130 | |||
| 131 | 2011-12-16 Chong Yidong <cyd@gnu.org> | ||
| 132 | |||
| 133 | * maintaining.texi (Version Control Systems): Drop Meta-CVS. | ||
| 134 | (Basic VC Editing): Remove redundant descriptions. | ||
| 135 | (VC With A Merging VCS): Make description more general instead of | ||
| 136 | CVS-specific. | ||
| 137 | (VC With A Locking VCS): Use VC fileset terminology. | ||
| 138 | |||
| 139 | 2011-12-12 Chong Yidong <cyd@gnu.org> | ||
| 140 | |||
| 141 | * building.texi (Executing Lisp): Fix xref for C-M-x. | ||
| 142 | (Lisp Libraries): Add xref to node explaining `load' in Lisp | ||
| 143 | manual. Note that load-path is not customizable. | ||
| 144 | (Lisp Eval): Note that listed commands are available globally. | ||
| 145 | Explain the meaning of "defun" in the C-M-x context. | ||
| 146 | (Lisp Interaction): Copyedits. | ||
| 147 | (External Lisp): Fix name of inferior Lisp buffer. Mention | ||
| 148 | Scheme. | ||
| 149 | (Compilation): Define "inferior process". | ||
| 150 | |||
| 151 | 2011-12-10 Eli Zaretskii <eliz@gnu.org> | ||
| 152 | |||
| 153 | * msdog.texi (Windows Fonts): Document how to force GDI font | ||
| 154 | backend on MS-Windows. | ||
| 155 | |||
| 156 | 2011-12-10 Chong Yidong <cyd@gnu.org> | ||
| 157 | |||
| 158 | * building.texi (Compilation): Say what the -k flag to make does. | ||
| 159 | Move subprocess discussion to Compilation Shell. | ||
| 160 | (Compilation Mode): Add xref for grep, occur, and mouse | ||
| 161 | references. Define "locus". | ||
| 162 | (Grep Searching): Use @command. | ||
| 163 | (Debuggers, Commands of GUD, GDB Graphical Interface): Clarify | ||
| 164 | intro. | ||
| 165 | (Starting GUD): Clarify how arguments are specified. | ||
| 166 | (Debugger Operation): Index entry for "GUD interaction buffer", | ||
| 167 | and move basic description here from Commands of GUD node. | ||
| 168 | (GDB User Interface Layout): Copyedits. | ||
| 169 | (Source Buffers): Remove gdb-find-source-frame, which is not in | ||
| 170 | gdb-mi.el. | ||
| 171 | (Other GDB Buffers): Remove gdb-use-separate-io-buffer and | ||
| 172 | toggle-gdb-all-registers, which are not in gdb-mi.el. Don't | ||
| 173 | re-document GUD interaction buffers. | ||
| 174 | |||
| 175 | * programs.texi (Symbol Completion): M-TAB can now use Semantic. | ||
| 176 | (Semantic): Add cindex entries for Semantic. | ||
| 177 | |||
| 178 | 2011-12-06 Chong Yidong <cyd@gnu.org> | ||
| 179 | |||
| 180 | * programs.texi (Man Page): Clarify how to use Man-switches. | ||
| 181 | Don't bother documenting Man-fontify-manpage-flag. | ||
| 182 | (Lisp Doc): Add xref to Name Help node. | ||
| 183 | (Hideshow): Add cindex. Mention role of ellipses, and default | ||
| 184 | value of hs-isearch-open. Don't bother documenting | ||
| 185 | hs-special-modes-alist. | ||
| 186 | (Symbol Completion): Add kindex for C-M-i. Don't recommend | ||
| 187 | changing the window manager binding of M-TAB. | ||
| 188 | |||
| 189 | 2011-12-05 Chong Yidong <cyd@gnu.org> | ||
| 190 | |||
| 191 | * programs.texi (Comment Commands): Fix description of for M-; on | ||
| 192 | blank lines. Move documentation of comment-region here. | ||
| 193 | (Multi-Line Comments): Clarify the role of comment-multi-line. | ||
| 194 | Refer to Comment Commands for comment-region doc. | ||
| 195 | (Options for Comments): Refer to Multi-Line Comments for | ||
| 196 | comment-multi-line doc, instead of duplicating it. Fix default | ||
| 197 | values of comment-padding and comment-start-skip. | ||
| 198 | |||
| 199 | 2011-12-04 Chong Yidong <cyd@gnu.org> | ||
| 200 | |||
| 201 | * programs.texi (Program Modes): Mention modes that are not | ||
| 202 | included with Emacs. Fix references to other manuals for tex. | ||
| 203 | Add index entry for backward-delete-char-untabify. Mention | ||
| 204 | prog-mode-hook. | ||
| 205 | (Which Function): Use "global minor mode" terminology. | ||
| 206 | (Basic Indent, Multi-line Indent): Refer to previous descriptions | ||
| 207 | in Indentation chapter to avoid duplication. | ||
| 208 | (Expressions): Copyedit. | ||
| 209 | (Matching): Document Electric Pair mode. | ||
| 210 | |||
| 211 | * ack.texi (Acknowledgments): | ||
| 212 | * rmail.texi (Movemail, Other Mailbox Formats): | ||
| 213 | * frames.texi (Frames): Don't capitalize "Unix". | ||
| 214 | |||
| 215 | 2011-12-04 Chong Yidong <cyd@gnu.org> | ||
| 216 | |||
| 217 | * text.texi (Nroff Mode): Mention what nroff is. | ||
| 218 | (Text Based Tables, Table Recognition): Don't say "Table mode" | ||
| 219 | since it's not a major or minor mode. | ||
| 220 | (Text Based Tables): Reduce the size of the example. | ||
| 221 | (Table Definition): Clarify definitions. | ||
| 222 | (Table Creation): Add key table. | ||
| 223 | (Cell Commands): Use kbd for commands. | ||
| 224 | (Table Rows and Columns): Combine nodes Row Commands and Column | ||
| 225 | Commands. | ||
| 226 | (Fixed Width Mode): Node deleted; contents moved to parent. | ||
| 227 | (Table Conversion): Shorten example. | ||
| 228 | (Measuring Tables): Merge into Table Misc. | ||
| 229 | |||
| 1 | 2011-12-03 Chong Yidong <cyd@gnu.org> | 230 | 2011-12-03 Chong Yidong <cyd@gnu.org> |
| 2 | 231 | ||
| 3 | * text.texi (TeX Mode): Mention AUCTeX package. | 232 | * text.texi (TeX Mode): Mention AUCTeX package. |
| @@ -1597,7 +1826,7 @@ | |||
| 1597 | 2009-08-31 Nick Roberts <nickrob@snap.net.nz> | 1826 | 2009-08-31 Nick Roberts <nickrob@snap.net.nz> |
| 1598 | 1827 | ||
| 1599 | * building.texi (Threads Buffer, Multithreaded Debugging): | 1828 | * building.texi (Threads Buffer, Multithreaded Debugging): |
| 1600 | Re-organise these two sections. | 1829 | Reorganize these two sections. |
| 1601 | 1830 | ||
| 1602 | 2009-08-29 Eli Zaretskii <eliz@gnu.org> | 1831 | 2009-08-29 Eli Zaretskii <eliz@gnu.org> |
| 1603 | 1832 | ||
diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi index 2eafadf4841..5868010806c 100644 --- a/doc/emacs/abbrevs.texi +++ b/doc/emacs/abbrevs.texi | |||
| @@ -45,17 +45,14 @@ expanding to @samp{find outer otter}, then you can insert @samp{find | |||
| 45 | outer otter.} into the buffer by typing @kbd{f o o .}. | 45 | outer otter.} into the buffer by typing @kbd{f o o .}. |
| 46 | 46 | ||
| 47 | @findex abbrev-mode | 47 | @findex abbrev-mode |
| 48 | @vindex abbrev-mode | ||
| 49 | @cindex Abbrev mode | 48 | @cindex Abbrev mode |
| 50 | @cindex mode, Abbrev | 49 | @cindex mode, Abbrev |
| 51 | Abbrevs expand only when Abbrev mode (a minor mode) is enabled. | 50 | Abbrevs expand only when Abbrev mode, a buffer-local minor mode, is |
| 52 | Disabling Abbrev mode does not cause abbrev definitions to be forgotten, | 51 | enabled. Disabling Abbrev mode does not cause abbrev definitions to |
| 53 | but they do not expand until Abbrev mode is enabled again. The command | 52 | be forgotten, but they do not expand until Abbrev mode is enabled |
| 54 | @kbd{M-x abbrev-mode} toggles Abbrev mode; with a numeric argument, it | 53 | again. The command @kbd{M-x abbrev-mode} toggles Abbrev mode; with a |
| 55 | turns Abbrev mode on if the argument is positive, off otherwise. | 54 | numeric argument, it turns Abbrev mode on if the argument is positive, |
| 56 | @xref{Minor Modes}. @code{abbrev-mode} is also a variable; Abbrev mode is | 55 | off otherwise. @xref{Minor Modes}. |
| 57 | on when the variable is non-@code{nil}. The variable @code{abbrev-mode} | ||
| 58 | automatically becomes local to the current buffer when it is set. | ||
| 59 | 56 | ||
| 60 | Abbrevs can have @dfn{mode-specific} definitions, active only in one major | 57 | Abbrevs can have @dfn{mode-specific} definitions, active only in one major |
| 61 | mode. Abbrevs can also have @dfn{global} definitions that are active in | 58 | mode. Abbrevs can also have @dfn{global} definitions that are active in |
| @@ -108,22 +105,18 @@ region as the expansion of the abbrev being defined. | |||
| 108 | @kindex C-x a l | 105 | @kindex C-x a l |
| 109 | @findex add-mode-abbrev | 106 | @findex add-mode-abbrev |
| 110 | The command @kbd{C-x a l} (@code{add-mode-abbrev}) is similar, but | 107 | The command @kbd{C-x a l} (@code{add-mode-abbrev}) is similar, but |
| 111 | defines a mode-specific abbrev. Mode-specific abbrevs are active only in a | 108 | defines a mode-specific abbrev for the current major mode. The |
| 112 | particular major mode. @kbd{C-x a l} defines an abbrev for the major mode | 109 | arguments work the same as for @kbd{C-x a g}. |
| 113 | in effect at the time @kbd{C-x a l} is typed. The arguments work the same | ||
| 114 | as for @kbd{C-x a g}. | ||
| 115 | 110 | ||
| 116 | @kindex C-x a i g | 111 | @kindex C-x a i g |
| 117 | @findex inverse-add-global-abbrev | 112 | @findex inverse-add-global-abbrev |
| 118 | @kindex C-x a i l | 113 | @kindex C-x a i l |
| 119 | @findex inverse-add-mode-abbrev | 114 | @findex inverse-add-mode-abbrev |
| 120 | If the abbrev text itself is already in the buffer, you can use the | 115 | @kbd{C-x a i g} (@code{inverse-add-global-abbrev}) and @kbd{C-x a i |
| 121 | commands @kbd{C-x a i g} (@code{inverse-add-global-abbrev}) and | 116 | l} (@code{inverse-add-mode-abbrev}) perform the opposite task: if the |
| 122 | @kbd{C-x a i l} (@code{inverse-add-mode-abbrev}) to define it as an | 117 | abbrev text is already in the buffer, you use these commands to define |
| 123 | abbrev by specify the expansion in the minibuffer. These commands are | 118 | an abbrev by specifying the expansion in the minibuffer. These |
| 124 | called ``inverse'' because they invert the meaning of the two text | 119 | commands will expand the abbrev text used for the definition. |
| 125 | strings they use (one from the buffer and one read with the | ||
| 126 | minibuffer). | ||
| 127 | 120 | ||
| 128 | @findex define-mode-abbrev | 121 | @findex define-mode-abbrev |
| 129 | @findex define-global-abbrev | 122 | @findex define-global-abbrev |
| @@ -132,8 +125,8 @@ expansion in the buffer using the command @code{define-global-abbrev}. | |||
| 132 | It reads two arguments---the abbrev, and its expansion. The command | 125 | It reads two arguments---the abbrev, and its expansion. The command |
| 133 | @code{define-mode-abbrev} does likewise for a mode-specific abbrev. | 126 | @code{define-mode-abbrev} does likewise for a mode-specific abbrev. |
| 134 | 127 | ||
| 135 | To change the definition of an abbrev, just define a new definition. | 128 | To change the definition of an abbrev, just make a new definition. |
| 136 | When the abbrev has a prior definition, the abbrev definition commands | 129 | When an abbrev has a prior definition, the abbrev definition commands |
| 137 | ask for confirmation before replacing it. | 130 | ask for confirmation before replacing it. |
| 138 | 131 | ||
| 139 | @findex kill-all-abbrevs | 132 | @findex kill-all-abbrevs |
| @@ -155,11 +148,11 @@ The most common way to use an abbrev is to insert it and then insert a | |||
| 155 | punctuation or whitespace character to expand it. | 148 | punctuation or whitespace character to expand it. |
| 156 | 149 | ||
| 157 | @vindex abbrev-all-caps | 150 | @vindex abbrev-all-caps |
| 158 | Abbrev expansion preserves case; thus, @samp{foo} expands into @samp{find | 151 | Abbrev expansion preserves case: @samp{foo} expands to @samp{find |
| 159 | outer otter}; @samp{Foo} into @samp{Find outer otter}, and @samp{FOO} into | 152 | outer otter}, and @samp{Foo} to @samp{Find outer otter}. @samp{FOO} |
| 160 | @samp{FIND OUTER OTTER} or @samp{Find Outer Otter} according to the | 153 | expands to @samp{Find Outer Otter} by default, but if you change the |
| 161 | variable @code{abbrev-all-caps} (setting it non-@code{nil} specifies | 154 | variable @code{abbrev-all-caps} to a non-@code{nil} value, it expands |
| 162 | @samp{FIND OUTER OTTER}). | 155 | to @samp{FIND OUTER OTTER}. |
| 163 | 156 | ||
| 164 | These commands are used to control abbrev expansion: | 157 | These commands are used to control abbrev expansion: |
| 165 | 158 | ||
| @@ -196,14 +189,14 @@ punctuation with @kbd{C-q}. Thus, @kbd{foo C-q ,} leaves @samp{foo,} in | |||
| 196 | the buffer, not expanding it. | 189 | the buffer, not expanding it. |
| 197 | 190 | ||
| 198 | @findex unexpand-abbrev | 191 | @findex unexpand-abbrev |
| 199 | If you expand an abbrev by mistake, you can undo the expansion and | 192 | If you expand an abbrev by mistake, you can undo the expansion by |
| 200 | bring back the abbrev itself by typing @kbd{C-_} to undo (@pxref{Undo}). | 193 | typing @kbd{C-/} (@code{undo}). @xref{Undo}. This undoes the |
| 201 | This also undoes the insertion of the non-word character that expanded | 194 | insertion of the abbrev expansion and brings back the abbrev text. If |
| 202 | the abbrev. If the result you want is the terminating non-word | 195 | the result you want is the terminating non-word character plus the |
| 203 | character plus the unexpanded abbrev, you must reinsert the terminating | 196 | unexpanded abbrev, you must reinsert the terminating character, |
| 204 | character, quoting it with @kbd{C-q}. You can also use the command | 197 | quoting it with @kbd{C-q}. You can also use the command @kbd{M-x |
| 205 | @kbd{M-x unexpand-abbrev} to cancel the last expansion without | 198 | unexpand-abbrev} to cancel the last expansion without deleting the |
| 206 | deleting the terminating character. | 199 | terminating character. |
| 207 | 200 | ||
| 208 | @findex expand-region-abbrevs | 201 | @findex expand-region-abbrevs |
| 209 | @kbd{M-x expand-region-abbrevs} searches through the region for defined | 202 | @kbd{M-x expand-region-abbrevs} searches through the region for defined |
| @@ -409,12 +402,11 @@ you are expanding. | |||
| 409 | 402 | ||
| 410 | @vindex dabbrev-case-fold-search | 403 | @vindex dabbrev-case-fold-search |
| 411 | This feature is controlled by the variable | 404 | This feature is controlled by the variable |
| 412 | @code{dabbrev-case-fold-search}. If it is @code{t}, case is ignored in | 405 | @code{dabbrev-case-fold-search}. If it is @code{t}, case is ignored |
| 413 | this search; if it is @code{nil}, the word and the expansion must match | 406 | in this search; if it is @code{nil}, the word and the expansion must |
| 414 | in case. If the value of @code{dabbrev-case-fold-search} is | 407 | match in case. If the value is @code{case-fold-search} (the default), |
| 415 | @code{case-fold-search}, which is true by default, then the variable | 408 | then the variable @code{case-fold-search} controls whether to ignore |
| 416 | @code{case-fold-search} controls whether to ignore case while searching | 409 | case while searching for expansions (@pxref{Search Case}). |
| 417 | for expansions. | ||
| 418 | 410 | ||
| 419 | @vindex dabbrev-case-replace | 411 | @vindex dabbrev-case-replace |
| 420 | Normally, dynamic abbrev expansion preserves the case pattern | 412 | Normally, dynamic abbrev expansion preserves the case pattern |
| @@ -425,10 +417,10 @@ expansion to that case pattern. | |||
| 425 | The variable @code{dabbrev-case-replace} controls whether to | 417 | The variable @code{dabbrev-case-replace} controls whether to |
| 426 | preserve the case pattern of the dynamic abbrev. If it is @code{t}, | 418 | preserve the case pattern of the dynamic abbrev. If it is @code{t}, |
| 427 | the dynamic abbrev's case pattern is preserved in most cases; if it is | 419 | the dynamic abbrev's case pattern is preserved in most cases; if it is |
| 428 | @code{nil}, the expansion is always copied verbatim. If the value of | 420 | @code{nil}, the expansion is always copied verbatim. If the value is |
| 429 | @code{dabbrev-case-replace} is @code{case-replace}, which is true by | 421 | @code{case-replace} (the default), then the variable |
| 430 | default, then the variable @code{case-replace} controls whether to | 422 | @code{case-replace} controls whether to copy the expansion verbatim |
| 431 | copy the expansion verbatim. | 423 | (@pxref{Replacement and Case}). |
| 432 | 424 | ||
| 433 | However, if the expansion contains a complex mixed case pattern, and | 425 | However, if the expansion contains a complex mixed case pattern, and |
| 434 | the dynamic abbrev matches this pattern as far as it goes, then the | 426 | the dynamic abbrev matches this pattern as far as it goes, then the |
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi index d7022ba739b..ae6338ce5a6 100644 --- a/doc/emacs/ack.texi +++ b/doc/emacs/ack.texi | |||
| @@ -1272,8 +1272,8 @@ Colin Walters wrote Ibuffer, an enhanced buffer menu. | |||
| 1272 | Barry Warsaw wrote @file{assoc.el}, a set of utility functions for | 1272 | Barry Warsaw wrote @file{assoc.el}, a set of utility functions for |
| 1273 | working with association lists; @file{cc-mode.el}, a mode for editing | 1273 | working with association lists; @file{cc-mode.el}, a mode for editing |
| 1274 | C, C@t{++}, and Java code, based on earlier work by Dave Detlefs, | 1274 | C, C@t{++}, and Java code, based on earlier work by Dave Detlefs, |
| 1275 | Stewart Clamen, and Richard Stallman; @file{elp.el}, a profiler | 1275 | Stewart Clamen, and Richard Stallman; @file{elp.el}, a profiler for |
| 1276 | for Emacs Lisp programs; @file{man.el}, a mode for reading UNIX manual | 1276 | Emacs Lisp programs; @file{man.el}, a mode for reading Unix manual |
| 1277 | pages; @file{regi.el}, providing an AWK-like functionality for use in | 1277 | pages; @file{regi.el}, providing an AWK-like functionality for use in |
| 1278 | lisp programs; @file{reporter.el}, providing customizable bug | 1278 | lisp programs; @file{reporter.el}, providing customizable bug |
| 1279 | reporting for lisp packages; and @file{supercite.el}, a minor mode for | 1279 | reporting for lisp packages; and @file{supercite.el}, a minor mode for |
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 9c5b2e7dcd7..963bd510f67 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi | |||
| @@ -8,9 +8,9 @@ | |||
| 8 | @cindex program building | 8 | @cindex program building |
| 9 | @cindex running Lisp functions | 9 | @cindex running Lisp functions |
| 10 | 10 | ||
| 11 | The previous chapter discusses the Emacs commands that are useful for | 11 | The previous chapter discusses the Emacs commands that are useful |
| 12 | making changes in programs. This chapter deals with commands that assist | 12 | for making changes in programs. This chapter deals with commands that |
| 13 | in the larger process of compiling and testing programs. | 13 | assist in the process of compiling and testing programs. |
| 14 | 14 | ||
| 15 | @menu | 15 | @menu |
| 16 | * Compilation:: Compiling programs in languages other | 16 | * Compilation:: Compiling programs in languages other |
| @@ -24,7 +24,7 @@ in the larger process of compiling and testing programs. | |||
| 24 | * Executing Lisp:: Various modes for editing Lisp programs, | 24 | * Executing Lisp:: Various modes for editing Lisp programs, |
| 25 | with different facilities for running | 25 | with different facilities for running |
| 26 | the Lisp programs. | 26 | the Lisp programs. |
| 27 | * Libraries: Lisp Libraries. Creating Lisp programs to run in Emacs. | 27 | * Libraries: Lisp Libraries. How Lisp programs are loaded into Emacs. |
| 28 | * Eval: Lisp Eval. Executing a single Lisp expression in Emacs. | 28 | * Eval: Lisp Eval. Executing a single Lisp expression in Emacs. |
| 29 | * Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer. | 29 | * Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer. |
| 30 | * External Lisp:: Communicating through Emacs with a separate Lisp. | 30 | * External Lisp:: Communicating through Emacs with a separate Lisp. |
| @@ -37,10 +37,9 @@ in the larger process of compiling and testing programs. | |||
| 37 | @cindex compilation errors | 37 | @cindex compilation errors |
| 38 | @cindex error log | 38 | @cindex error log |
| 39 | 39 | ||
| 40 | Emacs can run compilers for noninteractive languages such as C and | 40 | Emacs can run compilers for languages such as C and Fortran, feeding |
| 41 | Fortran as inferior processes, feeding the error log into an Emacs buffer. | 41 | the compilation log into an Emacs buffer. It can also parse the error |
| 42 | It can also parse the error messages and show you the source lines where | 42 | messages and show you where the errors occurred. |
| 43 | compilation errors occurred. | ||
| 44 | 43 | ||
| 45 | @table @kbd | 44 | @table @kbd |
| 46 | @item M-x compile | 45 | @item M-x compile |
| @@ -54,65 +53,60 @@ Kill the running compilation subprocess. | |||
| 54 | @end table | 53 | @end table |
| 55 | 54 | ||
| 56 | @findex compile | 55 | @findex compile |
| 57 | To run @code{make} or another compilation command, do @kbd{M-x | 56 | To run @code{make} or another compilation command, type @kbd{M-x |
| 58 | compile}. This command reads a shell command line using the minibuffer, | 57 | compile}. This reads a shell command line using the minibuffer, and |
| 59 | and then executes the command in an inferior shell, putting output in | 58 | then executes the command by running a shell as a subprocess (or |
| 60 | the buffer named @samp{*compilation*}. The current buffer's default | 59 | @dfn{inferior process}) of Emacs. The output is inserted in a buffer |
| 61 | directory is used as the working directory for the execution of the | 60 | named @samp{*compilation*}. The current buffer's default directory is |
| 62 | command; normally, therefore, the compilation happens in this | 61 | used as the working directory for the execution of the command; |
| 63 | directory. | 62 | normally, therefore, compilation takes place in this directory. |
| 64 | 63 | ||
| 65 | @vindex compile-command | 64 | @vindex compile-command |
| 66 | The default for the compilation command is normally @samp{make -k}, | 65 | The default compilation command is @samp{make -k}, which is usually |
| 67 | which is correct most of the time for nontrivial programs. | 66 | correct for programs compiled using the @command{make} utility (the |
| 68 | @xref{Top,, Make, make, GNU Make Manual}. If you have done @kbd{M-x | 67 | @samp{-k} flag tells @command{make} to continue compiling as much as |
| 69 | compile} before, the default each time is the command you used the | 68 | possible after an error). @xref{Top,, Make, make, GNU Make Manual}. |
| 70 | previous time. @code{compile} stores this command in the variable | 69 | If you have done @kbd{M-x compile} before, the command that you |
| 71 | @code{compile-command}, so setting that variable specifies the default | 70 | specified is automatically stored in the variable |
| 72 | for the next use of @kbd{M-x compile}. If a file specifies a file | 71 | @code{compile-command}; this is used as the default the next time you |
| 73 | local value for @code{compile-command}, that provides the default when | 72 | type @kbd{M-x compile}. A file can also specify a file-local value |
| 74 | you type @kbd{M-x compile} in that file's buffer. @xref{File | 73 | for @code{compile-command} (@pxref{File Variables}). |
| 75 | Variables}. | 74 | |
| 76 | 75 | Starting a compilation displays the @samp{*compilation*} buffer in | |
| 77 | Starting a compilation displays the buffer @samp{*compilation*} in | 76 | another window but does not select it. While the compilation is |
| 78 | another window but does not select it. The buffer's mode line tells | 77 | running, the word @samp{run} is shown in the major mode indicator for |
| 79 | you whether compilation is finished, with the word @samp{run}, | 78 | the @samp{*compilation*} buffer, and the word @samp{Compiling} appears |
| 80 | @samp{signal} or @samp{exit} inside the parentheses. You do not have | 79 | in all mode lines. You do not have to keep the @samp{*compilation*} |
| 81 | to keep this buffer visible; compilation continues in any case. While | 80 | buffer visible while compilation is running; it continues in any case. |
| 82 | a compilation is going on, the string @samp{Compiling} appears in the | 81 | When the compilation ends, for whatever reason, the mode line of the |
| 83 | mode lines of all windows. When this string disappears, the | 82 | @samp{*compilation*} buffer changes to say @samp{exit} (followed by |
| 84 | compilation is finished. | 83 | the exit code: @samp{[0]} for a normal exit), or @samp{signal} (if a |
| 85 | 84 | signal terminated the process). | |
| 86 | If you want to watch the compilation transcript as it appears, switch | 85 | |
| 87 | to the @samp{*compilation*} buffer and move point to the end of the | 86 | If you want to watch the compilation transcript as it appears, |
| 88 | buffer. When point is at the end, new compilation output is inserted | 87 | switch to the @samp{*compilation*} buffer and move point to the end of |
| 89 | above point, which remains at the end. If point is not at the end of | 88 | the buffer. When point is at the end, new compilation output is |
| 90 | the buffer, it remains fixed while more compilation output is added at | 89 | inserted above point, which remains at the end. Otherwise, point |
| 91 | the end of the buffer. | 90 | remains fixed while compilation output is added at the end of the |
| 91 | buffer. | ||
| 92 | 92 | ||
| 93 | @cindex compilation buffer, keeping point at end | 93 | @cindex compilation buffer, keeping point at end |
| 94 | @vindex compilation-scroll-output | 94 | @vindex compilation-scroll-output |
| 95 | If you change the variable @code{compilation-scroll-output} to a | 95 | If you change the variable @code{compilation-scroll-output} to a |
| 96 | non-@code{nil} value, the compilation buffer will scroll automatically | 96 | non-@code{nil} value, the @samp{*compilation*} buffer scrolls |
| 97 | to follow the output as it comes in. If the value is | 97 | automatically to follow the output. If the value is |
| 98 | @code{first-error}, the scrolling stops at the first error that | 98 | @code{first-error}, scrolling stops when the first error appears, |
| 99 | appears, leaving point at that error. For any other non-@code{nil} | 99 | leaving point at that error. For any other non-@code{nil} value, |
| 100 | value, the buffer continues scrolling until there is no more output. | 100 | scrolling continues until there is no more output. |
| 101 | 101 | ||
| 102 | @findex recompile | 102 | @findex recompile |
| 103 | To rerun the last compilation with the same command, type @kbd{M-x | 103 | To rerun the last compilation with the same command, type @kbd{M-x |
| 104 | recompile}. This automatically reuses the compilation command from | 104 | recompile}. This reuses the compilation command from the last |
| 105 | the last invocation of @kbd{M-x compile}. It also reuses the | 105 | invocation of @kbd{M-x compile}. It also reuses the |
| 106 | @samp{*compilation*} buffer and starts the compilation in its default | 106 | @samp{*compilation*} buffer and starts the compilation in its default |
| 107 | directory, which is the directory in which the previous compilation | 107 | directory, which is the directory in which the previous compilation |
| 108 | was started. | 108 | was started. |
| 109 | 109 | ||
| 110 | When the compiler process terminates, for whatever reason, the mode | ||
| 111 | line of the @samp{*compilation*} buffer changes to say @samp{exit} | ||
| 112 | (followed by the exit code, @samp{[0]} for a normal exit), or | ||
| 113 | @samp{signal} (if a signal terminated the process), instead of | ||
| 114 | @samp{run}. | ||
| 115 | |||
| 116 | @findex kill-compilation | 110 | @findex kill-compilation |
| 117 | Starting a new compilation also kills any compilation already | 111 | Starting a new compilation also kills any compilation already |
| 118 | running in @samp{*compilation*}, as the buffer can only handle one | 112 | running in @samp{*compilation*}, as the buffer can only handle one |
| @@ -126,27 +120,6 @@ the @samp{*compilation*} buffer (perhaps using @code{rename-uniquely}; | |||
| 126 | @pxref{Misc Buffer}), then switch buffers and start the other | 120 | @pxref{Misc Buffer}), then switch buffers and start the other |
| 127 | compilation. This will create a new @samp{*compilation*} buffer. | 121 | compilation. This will create a new @samp{*compilation*} buffer. |
| 128 | 122 | ||
| 129 | Emacs does not expect a compiler process to launch asynchronous | ||
| 130 | subprocesses; if it does, and they keep running after the main | ||
| 131 | compiler process has terminated, Emacs may kill them or their output | ||
| 132 | may not arrive in Emacs. To avoid this problem, make the main process | ||
| 133 | wait for its subprocesses to finish. In a shell script, you can do this | ||
| 134 | using @samp{$!} and @samp{wait}, like this: | ||
| 135 | |||
| 136 | @example | ||
| 137 | (sleep 10; echo 2nd)& pid=$! # @r{Record pid of subprocess} | ||
| 138 | echo first message | ||
| 139 | wait $pid # @r{Wait for subprocess} | ||
| 140 | @end example | ||
| 141 | |||
| 142 | If the background process does not output to the compilation buffer, | ||
| 143 | so you only need to prevent it from being killed when the main | ||
| 144 | compilation process terminates, this is sufficient: | ||
| 145 | |||
| 146 | @example | ||
| 147 | nohup @var{command}; sleep 1 | ||
| 148 | @end example | ||
| 149 | |||
| 150 | @vindex compilation-environment | 123 | @vindex compilation-environment |
| 151 | You can control the environment passed to the compilation command | 124 | You can control the environment passed to the compilation command |
| 152 | with the variable @code{compilation-environment}. Its value is a list | 125 | with the variable @code{compilation-environment}. Its value is a list |
| @@ -159,153 +132,154 @@ variable settings override the usual ones. | |||
| 159 | 132 | ||
| 160 | @cindex Compilation mode | 133 | @cindex Compilation mode |
| 161 | @cindex mode, Compilation | 134 | @cindex mode, Compilation |
| 162 | The @samp{*compilation*} buffer uses a special major mode, | 135 | @cindex locus |
| 163 | Compilation mode, whose main feature is to provide a convenient way to | 136 | The @samp{*compilation*} buffer uses a major mode called Compilation |
| 164 | visit the source line corresponding to an error message. These | 137 | mode. Compilation mode turns each error message in the buffer into a |
| 165 | commands are also available in other special buffers that list | 138 | hyperlink; you can move point to it and type @key{RET}, or click on it |
| 166 | locations in files, including those made by @kbd{M-x grep} and | 139 | with the mouse (@pxref{Mouse References}), to visit the @dfn{locus} of |
| 167 | @kbd{M-x occur}. | 140 | the error message in a separate window. The locus is the specific |
| 141 | position in a file where that error occurred. | ||
| 142 | |||
| 143 | @findex compile-goto-error | ||
| 144 | @vindex compilation-auto-jump-to-first-error | ||
| 145 | If you change the variable | ||
| 146 | @code{compilation-auto-jump-to-first-error} to a non-@code{nil} value, | ||
| 147 | Emacs automatically visits the locus of the first error message that | ||
| 148 | appears in the @samp{*compilation*} buffer. | ||
| 149 | |||
| 150 | Compilation mode provides the following additional commands. These | ||
| 151 | commands can also be used in @samp{*grep*} buffers, where the | ||
| 152 | hyperlinks are search matches rather than error messages (@pxref{Grep | ||
| 153 | Searching}). | ||
| 168 | 154 | ||
| 169 | @table @kbd | 155 | @table @kbd |
| 170 | @item M-g M-n | 156 | @item M-g M-n |
| 171 | @itemx M-g n | 157 | @itemx M-g n |
| 172 | @itemx C-x ` | 158 | @itemx C-x ` |
| 173 | Visit the locus of the next error message or match. | 159 | Visit the locus of the next error message or match (@code{next-error}). |
| 174 | @item M-g M-p | 160 | @item M-g M-p |
| 175 | @itemx M-g p | 161 | @itemx M-g p |
| 176 | Visit the locus of the previous error message or match. | 162 | Visit the locus of the previous error message or match |
| 177 | @item @key{RET} | 163 | (@code{previous-error}). |
| 178 | Visit the locus of the error message that point is on. | ||
| 179 | This command is used in the compilation buffer. | ||
| 180 | @item Mouse-2 | ||
| 181 | Visit the locus of the error message that you click on. | ||
| 182 | @item M-n | 164 | @item M-n |
| 183 | Find and highlight the locus of the next error message, without | 165 | Move point to the next error message or match, without visiting its |
| 184 | selecting the source buffer. | 166 | locus (@code{compilation-next-error}). |
| 185 | @item M-p | 167 | @item M-p |
| 186 | Find and highlight the locus of the previous error message, without | 168 | Move point to the previous error message or match, without visiting |
| 187 | selecting the source buffer. | 169 | its locus (@code{compilation-previous-error}). |
| 188 | @item M-@} | 170 | @item M-@} |
| 189 | Move point to the next error for a different file than the current | 171 | Move point to the next error message or match occurring in a different |
| 190 | one. | 172 | file (@code{compilation-next-file}). |
| 191 | @item M-@{ | 173 | @item M-@{ |
| 192 | Move point to the previous error for a different file than the current | 174 | Move point to the previous error message or match occurring in a |
| 193 | one. | 175 | different file (@code{compilation-previous-file}). |
| 194 | @item C-c C-f | 176 | @item C-c C-f |
| 195 | Toggle Next Error Follow minor mode, which makes cursor motion in the | 177 | Toggle Next Error Follow minor mode, which makes cursor motion in the |
| 196 | compilation buffer produce automatic source display. | 178 | compilation buffer produce automatic source display. |
| 197 | @end table | 179 | @end table |
| 198 | 180 | ||
| 199 | @findex compile-goto-error | ||
| 200 | @vindex compilation-auto-jump-to-first-error | ||
| 201 | You can visit the source for any particular error message by moving | ||
| 202 | point in the @samp{*compilation*} buffer to that error message and | ||
| 203 | typing @key{RET} (@code{compile-goto-error}). Alternatively, you can | ||
| 204 | click @kbd{Mouse-2} on the error message; you need not switch to the | ||
| 205 | @samp{*compilation*} buffer first. If you set the variable | ||
| 206 | @code{compilation-auto-jump-to-first-error} to a non-@code{nil} value, | ||
| 207 | Emacs automatically jumps to the first error, if any, as soon as it | ||
| 208 | appears in the @samp{*compilation*} buffer. | ||
| 209 | |||
| 210 | @kindex M-g M-n | 181 | @kindex M-g M-n |
| 211 | @kindex M-g n | 182 | @kindex M-g n |
| 212 | @kindex C-x ` | 183 | @kindex C-x ` |
| 213 | @findex next-error | 184 | @findex next-error |
| 214 | @vindex next-error-highlight | 185 | @vindex next-error-highlight |
| 215 | To parse the compiler error messages sequentially, type @kbd{C-x `} | 186 | To visit errors sequentially, type @w{@kbd{C-x `}} |
| 216 | (@code{next-error}). The character following the @kbd{C-x} is the | 187 | (@code{next-error}), or equivalently @kbd{M-g M-n} or @kbd{M-g n}. |
| 217 | backquote or ``grave accent,'' not the single-quote. This command is | 188 | This command can be invoked from any buffer, not just a Compilation |
| 218 | available in all buffers, not just in @samp{*compilation*}; it | 189 | mode buffer. The first time you invoke it after a compilation, it |
| 219 | displays the next error message at the top of one window and source | 190 | visits the locus of the first error message. Each subsequent |
| 220 | location of the error in another window. It also temporarily | 191 | @w{@kbd{C-x `}} visits the next error, in a similar fashion. If you |
| 221 | highlights the relevant source line, for a period controlled by the | 192 | visit a specific error with @key{RET} or a mouse click in the |
| 222 | variable @code{next-error-highlight}. | 193 | @samp{*compilation*} buffer, subsequent @w{@kbd{C-x `}} commands |
| 223 | 194 | advance from there. When @w{@kbd{C-x `}} finds no more error messages | |
| 224 | The first time @w{@kbd{C-x `}} is used after the start of a compilation, | 195 | to visit, it signals an error. @w{@kbd{C-u C-x `}} starts again from |
| 225 | it moves to the first error's location. Subsequent uses of @kbd{C-x | 196 | the beginning of the compilation buffer, and visits the first locus. |
| 226 | `} advance down to subsequent errors. If you visit a specific error | 197 | |
| 227 | message with @key{RET} or @kbd{Mouse-2}, subsequent @w{@kbd{C-x `}} | 198 | @kbd{M-g M-p} or @kbd{M-g p} (@code{previous-error}) iterates |
| 228 | commands advance from there. When @w{@kbd{C-x `}} gets to the end of the | 199 | through errors in the opposite direction. |
| 229 | buffer and finds no more error messages to visit, it fails and signals | 200 | |
| 230 | an Emacs error. @w{@kbd{C-u C-x `}} starts scanning from the beginning of | 201 | The @code{next-error} and @code{previous-error} commands don't just |
| 231 | the compilation buffer, and goes to the first error's location. | 202 | act on the errors or matches listed in @samp{*compilation*} and |
| 203 | @samp{*grep*} buffers; they also know how to iterate through error or | ||
| 204 | match lists produced by other commands, such as @kbd{M-x occur} | ||
| 205 | (@pxref{Other Repeating Search}). If you are already in a buffer | ||
| 206 | containing error messages or matches, those are the ones that are | ||
| 207 | iterated through; otherwise, Emacs looks for a buffer containing error | ||
| 208 | messages or matches amongst the windows of the selected frame, then | ||
| 209 | for one that @code{next-error} or @code{previous-error} previously | ||
| 210 | iterated through, and finally amongst all other buffers. If the | ||
| 211 | buffer chosen for iterating through is not currently displayed in a | ||
| 212 | window, it will be displayed. | ||
| 232 | 213 | ||
| 233 | @vindex compilation-skip-threshold | 214 | @vindex compilation-skip-threshold |
| 234 | By default, @w{@kbd{C-x `}} skips less important messages. The variable | 215 | By default, the @code{next-error} and @code{previous-error} commands |
| 235 | @code{compilation-skip-threshold} controls this. If its value is 2, | 216 | skip less important messages. The variable |
| 236 | @w{@kbd{C-x `}} skips anything less than error, 1 skips anything less | 217 | @code{compilation-skip-threshold} controls this. The default value, |
| 237 | than warning, and 0 doesn't skip any messages. The default is 1. | 218 | 1, means to skip anything less important than a warning. A value of 2 |
| 238 | 219 | means to skip anything less important than an error, while 0 means not | |
| 239 | When the window has a left fringe, an arrow in the fringe points to | 220 | to skip any messages. |
| 240 | the current message in the compilation buffer. The variable | 221 | |
| 241 | @code{compilation-context-lines} controls the number of lines of | 222 | When Emacs visits the locus of an error message, it momentarily |
| 242 | leading context to display before the current message. Going to an | 223 | highlights the relevant source line. The duration of this highlight |
| 243 | error message location scrolls the @samp{*compilation*} buffer to put | 224 | is determined by the variable @code{next-error-highlight}. |
| 244 | the message that far down from the top. The value @code{nil} is | 225 | |
| 245 | special: if there's a left fringe, the window doesn't scroll at all | 226 | @vindex compilation-context-lines |
| 246 | if the message is already visible. If there is no left fringe, | 227 | If the @samp{*compilation*} buffer is shown in a window with a left |
| 247 | @code{nil} means display the message at the top of the window. | 228 | fringe (@pxref{Fringes}), the locus-visiting commands put an arrow in |
| 248 | 229 | the fringe, pointing to the current error message. If the window has | |
| 249 | If you're not in the compilation buffer when you run | 230 | no left fringe, such as on a text-only terminal, these commands scroll |
| 250 | @code{next-error}, Emacs will look for a buffer that contains error | 231 | the window so that the current message is at the top of the window. |
| 251 | messages. First, it looks for one displayed in the selected frame, | 232 | If you change the variable @code{compilation-context-lines} to an |
| 252 | then for one that previously had @code{next-error} called on it, and | 233 | integer value @var{n}, these commands scroll the window so that the |
| 253 | then at the current buffer. Finally, Emacs looks at all the remaining | 234 | current error message is @var{n} lines from the top, whether or not |
| 254 | buffers. @code{next-error} signals an error if it can't find any such | 235 | there is a fringe; the default value, @code{nil}, gives the behavior |
| 255 | buffer. | 236 | described above. |
| 256 | 237 | ||
| 257 | @vindex compilation-error-regexp-alist | 238 | @vindex compilation-error-regexp-alist |
| 258 | @vindex grep-regexp-alist | 239 | @vindex grep-regexp-alist |
| 259 | To parse messages from the compiler, Compilation mode uses the | 240 | To parse messages from the compiler, Compilation mode uses the |
| 260 | variable @code{compilation-error-regexp-alist} which lists various | 241 | variable @code{compilation-error-regexp-alist} which lists various |
| 261 | formats of error messages and tells Emacs how to extract the source file | 242 | error message formats and tells Emacs how to extract the locus from |
| 262 | and the line number from the text of a message. If your compiler isn't | 243 | each. A similar variable, @code{grep-regexp-alist}, tells Emacs how |
| 263 | supported, you can tailor Compilation mode to it by adding elements to | 244 | to parse output from a @code{grep} command (@pxref{Grep Searching}). |
| 264 | that list. A similar variable @code{grep-regexp-alist} tells Emacs how | ||
| 265 | to parse output of a @code{grep} command. | ||
| 266 | 245 | ||
| 267 | @findex compilation-next-error | 246 | @findex compilation-next-error |
| 268 | @findex compilation-previous-error | 247 | @findex compilation-previous-error |
| 269 | @findex compilation-next-file | 248 | @findex compilation-next-file |
| 270 | @findex compilation-previous-file | 249 | @findex compilation-previous-file |
| 271 | Compilation mode also redefines the keys @key{SPC} and @key{DEL} to | 250 | Compilation mode also defines the keys @key{SPC} and @key{DEL} to |
| 272 | scroll by screenfuls, and @kbd{M-n} (@code{compilation-next-error}) | 251 | scroll by screenfuls; @kbd{M-n} (@code{compilation-next-error}) and |
| 273 | and @kbd{M-p} (@code{compilation-previous-error}) to move to the next | 252 | @kbd{M-p} (@code{compilation-previous-error}) to move to the next or |
| 274 | or previous error message. You can also use @kbd{M-@{} | 253 | previous error message; and @kbd{M-@{} (@code{compilation-next-file}) |
| 275 | (@code{compilation-next-file} and @kbd{M-@}} | 254 | and @kbd{M-@}} (@code{compilation-previous-file}) to move to the next |
| 276 | (@code{compilation-previous-file}) to move up or down to an error | 255 | or previous error message for a different source file. |
| 277 | message for a different source file. | ||
| 278 | 256 | ||
| 279 | @cindex Next Error Follow mode | 257 | @cindex Next Error Follow mode |
| 280 | @findex next-error-follow-minor-mode | 258 | @findex next-error-follow-minor-mode |
| 281 | You can type @kbd{C-c C-f} to toggle Next Error Follow mode. In | 259 | You can type @kbd{C-c C-f} to toggle Next Error Follow mode. In |
| 282 | this minor mode, ordinary cursor motion in the compilation buffer | 260 | this minor mode, ordinary cursor motion in the compilation buffer |
| 283 | automatically updates the source buffer. For instance, moving the | 261 | automatically updates the source buffer, i.e.@: moving the cursor over |
| 284 | cursor to the next error message causes the location of that error to | 262 | an error message causes the locus of that error to be displayed. |
| 285 | be displayed immediately. | ||
| 286 | 263 | ||
| 287 | The features of Compilation mode are also available in a minor mode | 264 | The features of Compilation mode are also available in a minor mode |
| 288 | called Compilation Minor mode. This lets you parse error messages in | 265 | called Compilation Minor mode. This lets you parse error messages in |
| 289 | any buffer, not just a normal compilation output buffer. Type @kbd{M-x | 266 | any buffer, not just a normal compilation output buffer. Type |
| 290 | compilation-minor-mode} to enable the minor mode. This defines the keys | 267 | @kbd{M-x compilation-minor-mode} to enable the minor mode. For |
| 291 | @key{RET} and @kbd{Mouse-2}, as in the Compilation major mode. | 268 | instance, in an Rlogin buffer (@pxref{Remote Host}), Compilation minor |
| 292 | 269 | mode automatically accesses remote source files by FTP (@pxref{File | |
| 293 | Compilation minor mode works in any buffer, as long as the contents | 270 | Names}). |
| 294 | are in a format that it understands. In an Rlogin buffer (@pxref{Remote | ||
| 295 | Host}), Compilation minor mode automatically accesses remote source | ||
| 296 | files by FTP (@pxref{File Names}). | ||
| 297 | 271 | ||
| 298 | @node Compilation Shell | 272 | @node Compilation Shell |
| 299 | @section Subshells for Compilation | 273 | @section Subshells for Compilation |
| 300 | 274 | ||
| 301 | Emacs uses a shell to run the compilation command, but specifies the | 275 | The @kbd{M-x compile} command uses a shell to run the compilation |
| 302 | option for a noninteractive shell. This means, in particular, that | 276 | command, but specifies the option for a noninteractive shell. This |
| 303 | the shell should start with no prompt. If you find your usual shell | 277 | means, in particular, that the shell should start with no prompt. If |
| 304 | prompt making an unsightly appearance in the @samp{*compilation*} | 278 | you find your usual shell prompt making an unsightly appearance in the |
| 305 | buffer, it means you have made a mistake in your shell's init file by | 279 | @samp{*compilation*} buffer, it means you have made a mistake in your |
| 306 | setting the prompt unconditionally. (This init file's name may be | 280 | shell's init file by setting the prompt unconditionally. (This init |
| 307 | @file{.bashrc}, @file{.profile}, @file{.cshrc}, @file{.shrc}, or | 281 | file may be named @file{.bashrc}, @file{.profile}, @file{.cshrc}, |
| 308 | various other things, depending on the shell you use.) The shell init | 282 | @file{.shrc}, etc., depending on what shell you use.) The shell init |
| 309 | file should set the prompt only if there already is a prompt. Here's | 283 | file should set the prompt only if there already is a prompt. Here's |
| 310 | how to do it in bash: | 284 | how to do it in bash: |
| 311 | 285 | ||
| @@ -322,67 +296,80 @@ And here's how to do it in csh: | |||
| 322 | if ($?prompt) set prompt = @dots{} | 296 | if ($?prompt) set prompt = @dots{} |
| 323 | @end example | 297 | @end example |
| 324 | 298 | ||
| 325 | There may well be other things that your shell's init file | 299 | Emacs does not expect a compiler process to launch asynchronous |
| 326 | ought to do only for an interactive shell. You can use the same | 300 | subprocesses; if it does, and they keep running after the main |
| 327 | method to conditionalize them. | 301 | compiler process has terminated, Emacs may kill them or their output |
| 302 | may not arrive in Emacs. To avoid this problem, make the main | ||
| 303 | compilation process wait for its subprocesses to finish. In a shell | ||
| 304 | script, you can do this using @samp{$!} and @samp{wait}, like this: | ||
| 305 | |||
| 306 | @example | ||
| 307 | (sleep 10; echo 2nd)& pid=$! # @r{Record pid of subprocess} | ||
| 308 | echo first message | ||
| 309 | wait $pid # @r{Wait for subprocess} | ||
| 310 | @end example | ||
| 311 | |||
| 312 | @noindent | ||
| 313 | If the background process does not output to the compilation buffer, | ||
| 314 | so you only need to prevent it from being killed when the main | ||
| 315 | compilation process terminates, this is sufficient: | ||
| 316 | |||
| 317 | @example | ||
| 318 | nohup @var{command}; sleep 1 | ||
| 319 | @end example | ||
| 328 | 320 | ||
| 329 | The MS-DOS ``operating system'' does not support asynchronous | ||
| 330 | subprocesses; to work around this lack, @kbd{M-x compile} runs the | ||
| 331 | compilation command synchronously on MS-DOS. As a consequence, you must | ||
| 332 | wait until the command finishes before you can do anything else in | ||
| 333 | Emacs. | ||
| 334 | @iftex | ||
| 335 | @inforef{MS-DOS,,emacs-xtra}. | ||
| 336 | @end iftex | ||
| 337 | @ifnottex | 321 | @ifnottex |
| 338 | @xref{MS-DOS}. | 322 | On the MS-DOS ``operating system'', asynchronous subprocesses are |
| 323 | not supported, so @kbd{M-x compile} runs the compilation command | ||
| 324 | synchronously (i.e.@: you must wait until the command finishes before | ||
| 325 | you can do anything else in Emacs). @xref{MS-DOS}. | ||
| 339 | @end ifnottex | 326 | @end ifnottex |
| 340 | 327 | ||
| 341 | @node Grep Searching | 328 | @node Grep Searching |
| 342 | @section Searching with Grep under Emacs | 329 | @section Searching with Grep under Emacs |
| 343 | 330 | ||
| 344 | Just as you can run a compiler from Emacs and then visit the lines | 331 | Just as you can run a compiler from Emacs and then visit the lines |
| 345 | with compilation errors, you can also run @code{grep} and then visit | 332 | with compilation errors, you can also run @command{grep} and then |
| 346 | the lines on which matches were found. This works by treating the | 333 | visit the lines on which matches were found. This works by treating |
| 347 | matches reported by @code{grep} as if they were ``errors.'' The | 334 | the matches reported by @command{grep} as if they were ``errors.'' |
| 348 | buffer of matches uses Grep mode, which is a variant of Compilation | 335 | The output buffer uses Grep mode, which is a variant of Compilation |
| 349 | mode (@pxref{Compilation Mode}). | 336 | mode (@pxref{Compilation Mode}). |
| 350 | 337 | ||
| 351 | @table @kbd | 338 | @table @kbd |
| 352 | @item M-x grep | 339 | @item M-x grep |
| 353 | @itemx M-x lgrep | 340 | @itemx M-x lgrep |
| 354 | Run @code{grep} asynchronously under Emacs, with matching lines | 341 | Run @command{grep} asynchronously under Emacs, listing matching lines in |
| 355 | listed in the buffer named @samp{*grep*}. | 342 | the buffer named @samp{*grep*}. |
| 356 | @item M-x grep-find | 343 | @item M-x grep-find |
| 357 | @itemx M-x find-grep | 344 | @itemx M-x find-grep |
| 358 | @itemx M-x rgrep | 345 | @itemx M-x rgrep |
| 359 | Run @code{grep} via @code{find}, and collect output in the buffer | 346 | Run @command{grep} via @code{find}, and collect output in the |
| 360 | named @samp{*grep*}. | 347 | @samp{*grep*} buffer. |
| 361 | @item M-x zrgrep | 348 | @item M-x zrgrep |
| 362 | Run @code{zgrep} and collect output in the buffer named @samp{*grep*}. | 349 | Run @code{zgrep} and collect output in the @samp{*grep*} buffer. |
| 363 | @item M-x kill-grep | 350 | @item M-x kill-grep |
| 364 | Kill the running @code{grep} subprocess. | 351 | Kill the running @command{grep} subprocess. |
| 365 | @end table | 352 | @end table |
| 366 | 353 | ||
| 367 | @findex grep | 354 | @findex grep |
| 368 | To run @code{grep}, type @kbd{M-x grep}, then enter a command line | 355 | To run @command{grep}, type @kbd{M-x grep}, then enter a command line |
| 369 | that specifies how to run @code{grep}. Use the same arguments you | 356 | that specifies how to run @command{grep}. Use the same arguments you |
| 370 | would give @code{grep} when running it normally: a @code{grep}-style | 357 | would give @command{grep} when running it normally: a @command{grep}-style |
| 371 | regexp (usually in single-quotes to quote the shell's special | 358 | regexp (usually in single-quotes to quote the shell's special |
| 372 | characters) followed by file names, which may use wildcards. If you | 359 | characters) followed by file names, which may use wildcards. If you |
| 373 | specify a prefix argument for @kbd{M-x grep}, it finds the tag | 360 | specify a prefix argument for @kbd{M-x grep}, it finds the tag |
| 374 | (@pxref{Tags}) in the buffer around point, and puts that into the | 361 | (@pxref{Tags}) in the buffer around point, and puts that into the |
| 375 | default @code{grep} command. | 362 | default @command{grep} command. |
| 376 | 363 | ||
| 377 | Your command need not simply run @code{grep}; you can use any shell | 364 | Your command need not simply run @command{grep}; you can use any shell |
| 378 | command that produces output in the same format. For instance, you | 365 | command that produces output in the same format. For instance, you |
| 379 | can chain @code{grep} commands, like this: | 366 | can chain @command{grep} commands, like this: |
| 380 | 367 | ||
| 381 | @example | 368 | @example |
| 382 | grep -nH -e foo *.el | grep bar | grep toto | 369 | grep -nH -e foo *.el | grep bar | grep toto |
| 383 | @end example | 370 | @end example |
| 384 | 371 | ||
| 385 | The output from @code{grep} goes in the @samp{*grep*} buffer. You | 372 | The output from @command{grep} goes in the @samp{*grep*} buffer. You |
| 386 | can find the corresponding lines in the original files using @w{@kbd{C-x | 373 | can find the corresponding lines in the original files using @w{@kbd{C-x |
| 387 | `}}, @key{RET}, and so forth, just like compilation errors. | 374 | `}}, @key{RET}, and so forth, just like compilation errors. |
| 388 | 375 | ||
| @@ -397,30 +384,31 @@ match will be highlighted, instead of the entire source line. | |||
| 397 | The command @kbd{M-x grep-find} (also available as @kbd{M-x | 384 | The command @kbd{M-x grep-find} (also available as @kbd{M-x |
| 398 | find-grep}) is similar to @kbd{M-x grep}, but it supplies a different | 385 | find-grep}) is similar to @kbd{M-x grep}, but it supplies a different |
| 399 | initial default for the command---one that runs both @code{find} and | 386 | initial default for the command---one that runs both @code{find} and |
| 400 | @code{grep}, so as to search every file in a directory tree. See also | 387 | @command{grep}, so as to search every file in a directory tree. See also |
| 401 | the @code{find-grep-dired} command, in @ref{Dired and Find}. | 388 | the @code{find-grep-dired} command, in @ref{Dired and Find}. |
| 402 | 389 | ||
| 403 | @findex lgrep | 390 | @findex lgrep |
| 404 | @findex rgrep | 391 | @findex rgrep |
| 405 | @findex zrgrep | 392 | @findex zrgrep |
| 406 | The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep} | 393 | The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep} |
| 407 | (recursive grep) are more user-friendly versions of @code{grep} and | 394 | (recursive grep) are more user-friendly versions of @command{grep} and |
| 408 | @code{grep-find}, which prompt separately for the regular expression | 395 | @code{grep-find}, which prompt separately for the regular expression |
| 409 | to match, the files to search, and the base directory for the search. | 396 | to match, the files to search, and the base directory for the search. |
| 410 | Case sensitivity of the search is controlled by the current value of | 397 | Case sensitivity of the search is controlled by the current value of |
| 411 | @code{case-fold-search}. The command @kbd{M-x zrgrep} is similar to | 398 | @code{case-fold-search}. The command @kbd{M-x zrgrep} is similar to |
| 412 | @code{rgrep}, but it calls @code{zgrep} instead of @code{grep} to | 399 | @kbd{M-x rgrep}, but it calls @command{zgrep} instead of |
| 413 | search the contents of gzipped files. | 400 | @command{grep} to search the contents of gzipped files. |
| 414 | 401 | ||
| 415 | These commands build the shell commands based on the variables | 402 | These commands build the shell commands based on the variables |
| 416 | @code{grep-template} (for @code{lgrep}) and @code{grep-find-template} | 403 | @code{grep-template} (for @code{lgrep}) and @code{grep-find-template} |
| 417 | (for @code{rgrep}). The files to search can use aliases defined in | 404 | (for @code{rgrep}). The files to search can use aliases defined in |
| 418 | the variable @code{grep-files-aliases}. | 405 | the variable @code{grep-files-aliases}. |
| 419 | 406 | ||
| 420 | Subdirectories listed in the variable | 407 | @vindex grep-find-ignored-directories |
| 421 | @code{grep-find-ignored-directories} such as those typically used by | 408 | Directories listed in the variable |
| 422 | various version control systems, like CVS and arch, are automatically | 409 | @code{grep-find-ignored-directories} are automatically skipped by |
| 423 | skipped by @code{rgrep}. | 410 | @kbd{M-x rgrep}. The default value includes the data directories used |
| 411 | by various version control systems. | ||
| 424 | 412 | ||
| 425 | @node Flymake | 413 | @node Flymake |
| 426 | @section Finding Syntax Errors On The Fly | 414 | @section Finding Syntax Errors On The Fly |
| @@ -444,8 +432,13 @@ flymake-goto-next-error} and @kbd{M-x flymake-goto-prev-error}. To | |||
| 444 | display any error messages associated with the current line, use | 432 | display any error messages associated with the current line, use |
| 445 | @kbd{M-x flymake-display-err-menu-for-current-line}. | 433 | @kbd{M-x flymake-display-err-menu-for-current-line}. |
| 446 | 434 | ||
| 447 | For more details about using Flymake, see @ref{Top, Flymake, | 435 | For more details about using Flymake, |
| 448 | Flymake, flymake, The Flymake Manual}. | 436 | @ifnottex |
| 437 | see @ref{Top, Flymake, Flymake, flymake, The Flymake Manual}. | ||
| 438 | @end ifnottex | ||
| 439 | @iftex | ||
| 440 | see the Flymake Info manual, which is distributed with Emacs. | ||
| 441 | @end iftex | ||
| 449 | 442 | ||
| 450 | @node Debuggers | 443 | @node Debuggers |
| 451 | @section Running Debuggers Under Emacs | 444 | @section Running Debuggers Under Emacs |
| @@ -459,16 +452,18 @@ Flymake, flymake, The Flymake Manual}. | |||
| 459 | @cindex JDB | 452 | @cindex JDB |
| 460 | @cindex PDB | 453 | @cindex PDB |
| 461 | 454 | ||
| 462 | @c Do you believe in GUD? | ||
| 463 | The GUD (Grand Unified Debugger) library provides an Emacs interface | 455 | The GUD (Grand Unified Debugger) library provides an Emacs interface |
| 464 | to a wide variety of symbolic debuggers. Unlike the GDB graphical | 456 | to a wide variety of symbolic debuggers. It can run the GNU Debugger |
| 465 | interface, which only runs GDB (@pxref{GDB Graphical Interface}), GUD | 457 | (GDB), as well as DBX, SDB, XDB, Perl's debugging mode, the Python |
| 466 | can also run DBX, SDB, XDB, Perl's debugging mode, the Python debugger | 458 | debugger PDB, and the Java Debugger JDB. |
| 467 | PDB, or the Java Debugger JDB. | ||
| 468 | 459 | ||
| 469 | In addition, Emacs contains a built-in system for debugging Emacs | 460 | Emacs provides a special interface to GDB, which uses extra Emacs |
| 470 | Lisp programs. @xref{Debugging,, The Lisp Debugger, elisp, the Emacs | 461 | windows to display the state of the debugged program. @xref{GDB |
| 471 | Lisp Reference Manual}, for information on the Emacs Lisp debugger. | 462 | Graphical Interface}. |
| 463 | |||
| 464 | Emacs also has a built-in debugger for Emacs Lisp programs. | ||
| 465 | @xref{Debugging,, The Lisp Debugger, elisp, the Emacs Lisp Reference | ||
| 466 | Manual}. | ||
| 472 | 467 | ||
| 473 | @menu | 468 | @menu |
| 474 | * Starting GUD:: How to start a debugger subprocess. | 469 | * Starting GUD:: How to start a debugger subprocess. |
| @@ -483,146 +478,136 @@ Lisp Reference Manual}, for information on the Emacs Lisp debugger. | |||
| 483 | @node Starting GUD | 478 | @node Starting GUD |
| 484 | @subsection Starting GUD | 479 | @subsection Starting GUD |
| 485 | 480 | ||
| 486 | There are several commands for starting a debugger under GUD, each | 481 | There are several commands for starting a debugger subprocess, each |
| 487 | corresponding to a particular debugger program. | 482 | corresponding to a particular debugger program. |
| 488 | 483 | ||
| 489 | @table @kbd | 484 | @table @kbd |
| 490 | @item M-x gdb @key{RET} @var{file} @key{RET} | 485 | @item M-x gdb |
| 491 | @findex gdb | 486 | @findex gdb |
| 492 | Run GDB as a subprocess of Emacs. This uses an IDE-like graphical | 487 | Run GDB as a subprocess, and interact with it via an IDE-like Emacs |
| 493 | interface; see @ref{GDB Graphical Interface}. Only GDB works with the | 488 | interface. @xref{GDB Graphical Interface}, for more information about |
| 494 | graphical interface. | 489 | this command. |
| 495 | 490 | ||
| 496 | @item M-x gud-gdb @key{RET} @var{file} @key{RET} | 491 | @item M-x gud-gdb |
| 497 | @findex gud-gdb | 492 | @findex gud-gdb |
| 498 | Run GDB as a subprocess of Emacs. This command creates a buffer for | 493 | Run GDB, using a GUD interaction buffer for input and output to the |
| 499 | input and output to GDB, and switches to it. If a GDB buffer already | 494 | GDB subprocess (@pxref{Debugger Operation}). If such a buffer already |
| 500 | exists, it just switches to that buffer. | 495 | exists, switch to it; otherwise, create the buffer and switch to it. |
| 501 | |||
| 502 | @item M-x dbx @key{RET} @var{file} @key{RET} | ||
| 503 | @findex dbx | ||
| 504 | Run DBX as a subprocess of Emacs. Since Emacs does not implement a | ||
| 505 | graphical interface for DBX, communication with DBX works by typing | ||
| 506 | commands in the GUD interaction buffer. The same is true for all | ||
| 507 | the other supported debuggers. | ||
| 508 | 496 | ||
| 509 | @item M-x xdb @key{RET} @var{file} @key{RET} | 497 | The other commands in this list do the same, for other debugger |
| 510 | @findex xdb | 498 | programs. |
| 511 | @vindex gud-xdb-directories | ||
| 512 | Run XDB as a subprocess of Emacs. Use the variable | ||
| 513 | @code{gud-xdb-directories} to specify directories to search for source | ||
| 514 | files. | ||
| 515 | |||
| 516 | @item M-x sdb @key{RET} @var{file} @key{RET} | ||
| 517 | @findex sdb | ||
| 518 | Run SDB as a subprocess of Emacs. | ||
| 519 | 499 | ||
| 520 | Some versions of SDB do not mention source file names in their | 500 | @item M-x perldb |
| 521 | messages. When you use them, you need to have a valid tags table | ||
| 522 | (@pxref{Tags}) in order for GUD to find functions in the source code. | ||
| 523 | If you have not visited a tags table or the tags table doesn't list | ||
| 524 | one of the functions, you get a message saying @samp{The sdb support | ||
| 525 | requires a valid tags table to work}. If this happens, generate a | ||
| 526 | valid tags table in the working directory and try again. | ||
| 527 | |||
| 528 | @item M-x perldb @key{RET} @var{file} @key{RET} | ||
| 529 | @findex perldb | 501 | @findex perldb |
| 530 | Run the Perl interpreter in debug mode to debug @var{file}, a Perl program. | 502 | Run the Perl interpreter in debug mode. |
| 531 | 503 | ||
| 532 | @item M-x jdb @key{RET} @var{file} @key{RET} | 504 | @item M-x jdb |
| 533 | @findex jdb | 505 | @findex jdb |
| 534 | Run the Java debugger to debug @var{file}. | 506 | Run the Java debugger. |
| 535 | 507 | ||
| 536 | @item M-x pdb @key{RET} @var{file} @key{RET} | 508 | @item M-x pdb |
| 537 | @findex pdb | 509 | @findex pdb |
| 538 | Run the Python debugger to debug @var{file}. | 510 | Run the Python debugger. |
| 511 | |||
| 512 | @item M-x dbx | ||
| 513 | @findex dbx | ||
| 514 | Run the DBX debugger. | ||
| 515 | |||
| 516 | @item M-x xdb | ||
| 517 | @findex xdb | ||
| 518 | @vindex gud-xdb-directories | ||
| 519 | Run the XDB debugger. | ||
| 520 | |||
| 521 | @item M-x sdb | ||
| 522 | @findex sdb | ||
| 523 | Run the SDB debugger. | ||
| 539 | @end table | 524 | @end table |
| 540 | 525 | ||
| 541 | Each of these commands takes one argument: a command line to invoke | 526 | Each of these commands reads a command line to invoke the debugger, |
| 542 | the debugger. In the simplest case, specify just the name of the | 527 | using the minibuffer. The minibuffer's initial contents contain the |
| 543 | executable file you want to debug. You may also use options that the | 528 | standard executable name and options for the debugger, and sometimes |
| 544 | debugger supports. However, shell wildcards and variables are not | 529 | also a guess for the name of the executable file you want to debug. |
| 545 | allowed. GUD assumes that the first argument not starting with a | 530 | Shell wildcards and variables are not allowed in this command line. |
| 546 | @samp{-} is the executable file name. | 531 | Emacs assumes that the first command argument which does not start |
| 532 | with a @samp{-} is the executable file name. | ||
| 547 | 533 | ||
| 548 | @cindex remote host, debugging on | 534 | @cindex remote host, debugging on |
| 549 | Tramp provides a facility to debug programs on remote hosts | 535 | Tramp provides a facility for remote debugging, whereby both the |
| 550 | (@pxref{Running a debugger on a remote host, Running a debugger on a | 536 | debugger and the program being debugged are on the same remote host. |
| 551 | remote host,, tramp, The Tramp Manual}), whereby both the debugger and | 537 | @xref{Running a debugger on a remote host,,, tramp, The Tramp Manual}, |
| 552 | the program being debugged are on the same remote host. This should | 538 | for details. This is separate from GDB's remote debugging feature, |
| 553 | not be confused with debugging programs remotely, where the program | 539 | where the program and the debugger run on different machines |
| 554 | and the debugger run on different machines, as can be done using the | 540 | (@pxref{Remote Debugging,, Debugging Remote Programs, gdb, The GNU |
| 555 | GDB remote debugging feature, for example (@pxref{Remote Debugging,, | 541 | debugger}). |
| 556 | Debugging Remote Programs, gdb, The GNU debugger}). | ||
| 557 | 542 | ||
| 558 | @node Debugger Operation | 543 | @node Debugger Operation |
| 559 | @subsection Debugger Operation | 544 | @subsection Debugger Operation |
| 545 | @cindex GUD interaction buffer | ||
| 546 | |||
| 547 | The @dfn{GUD interaction buffer} is an Emacs buffer which is used to | ||
| 548 | send text commands to a debugger subprocess, and record its output. | ||
| 549 | This is the basic interface for interacting with a debugger, used by | ||
| 550 | @kbd{M-x gud-gdb} and other commands listed in | ||
| 551 | @iftex | ||
| 552 | the preceding section. | ||
| 553 | @end iftex | ||
| 554 | @ifnottex | ||
| 555 | @ref{Starting GUD}. | ||
| 556 | @end ifnottex | ||
| 557 | The @kbd{M-x gdb} command extends this interface with additional | ||
| 558 | specialized buffers for controlling breakpoints, stack frames, and | ||
| 559 | other aspects of the debugger state (@pxref{GDB Graphical Interface}). | ||
| 560 | 560 | ||
| 561 | @cindex fringes, and current execution line in GUD | 561 | The GUD interaction buffer uses a variant of Shell mode, so the |
| 562 | Generally when you run a debugger with GUD, the debugger uses an Emacs | 562 | Emacs commands defined by Shell mode are available (@pxref{Shell |
| 563 | buffer for its ordinary input and output. This is called the GUD | 563 | Mode}). Completion is available for most debugger commands |
| 564 | buffer. Input and output from the program you are debugging also use | 564 | (@pxref{Completion}), and you can use the usual Shell mode history |
| 565 | this buffer. We call this @dfn{text command mode}. The GDB Graphical | 565 | commands to repeat them. |
| 566 | Interface can use further buffers (@pxref{GDB Graphical Interface}). | 566 | @iftex |
| 567 | 567 | See the next section | |
| 568 | The debugger displays the source files of the program by visiting | 568 | @end iftex |
| 569 | them in Emacs buffers. An arrow in the left fringe indicates the | 569 | @ifnottex |
| 570 | current execution line.@footnote{On a text-only terminal, the arrow | 570 | @xref{Commands of GUD}, |
| 571 | appears as @samp{=>} and overlays the first two text columns.} Moving | 571 | @end ifnottex |
| 572 | point in this buffer does not move the arrow. The arrow is not part | 572 | for special commands that can be used in the GUD interaction buffer. |
| 573 | of the file's text; it appears only on the screen. | 573 | |
| 574 | 574 | As you debug a program, Emacs displays the relevant source files by | |
| 575 | You can start editing these source files at any time in the buffers | 575 | visiting them in Emacs buffers, with an arrow in the left fringe |
| 576 | that display them. If you do modify a source file, keep in mind that | 576 | indicating the current execution line. (On a text-only terminal, the |
| 577 | inserting or deleting lines will throw off the arrow's positioning; | 577 | arrow appears as @samp{=>}, overlaid on the first two text columns.) |
| 578 | GUD has no way of figuring out which line corresponded before your | 578 | Moving point in such a buffer does not move the arrow. You are free |
| 579 | changes to the line number in a debugger message. Also, you'll | 579 | to edit these source files, but note that inserting or deleting lines |
| 580 | typically have to recompile and restart the program for your changes | 580 | will throw off the arrow's positioning, as Emacs has no way to figure |
| 581 | to be reflected in the debugger's tables. | 581 | out which edited source line corresponds to the line reported by the |
| 582 | 582 | debugger subprocess. To update this information, you typically have | |
| 583 | @cindex tooltips with GUD | 583 | to recompile and restart the program. |
| 584 | @vindex tooltip-gud-modes | 584 | |
| 585 | @vindex gud-tooltip-mode | 585 | @cindex GUD Tooltip mode |
| 586 | @cindex mode, GUD Tooltip | ||
| 587 | @findex gud-tooltip-mode | ||
| 586 | @vindex gud-tooltip-echo-area | 588 | @vindex gud-tooltip-echo-area |
| 587 | The Tooltip facility (@pxref{Tooltips}) provides support for GUD@. | 589 | GUD Tooltip mode is a global minor mode that adds tooltip support to |
| 588 | You activate this feature by turning on the minor mode | 590 | GUD. To toggle this mode, type @kbd{M-x gud-tooltip-mode}. It is |
| 589 | @code{gud-tooltip-mode}. Then you can display a variable's value in a | 591 | disabled by default. If enabled, you can move the mouse cursor over a |
| 590 | tooltip simply by pointing at it with the mouse. This operates in the | 592 | variable to show its value in a tooltip (@pxref{Tooltips}); this takes |
| 591 | GUD buffer and in source buffers with major modes in the list | 593 | effect in the GUD interaction buffer, and in all source buffers with |
| 592 | @code{gud-tooltip-modes}. If the variable @code{gud-tooltip-echo-area} | 594 | major modes listed in the variable @code{gud-tooltip-modes}. If the |
| 593 | is non-@code{nil} then the variable's value is displayed in the echo | 595 | variable @code{gud-tooltip-echo-area} is non-@code{nil}, values are |
| 594 | area. When debugging a C program using the GDB Graphical Interface, you | 596 | shown in the echo area instead of a tooltip. |
| 595 | can also display macro definitions associated with an identifier when | 597 | |
| 596 | the program is not executing. | 598 | When using GUD Tooltip mode with @kbd{M-x gud-gdb}, you should note |
| 597 | 599 | that displaying an expression's value in GDB can sometimes expand a | |
| 598 | GUD tooltips are disabled when you use GDB in text command mode | 600 | macro, potentially causing side effects in the debugged program. If |
| 599 | (@pxref{GDB Graphical Interface}), because displaying an expression's | 601 | you use the @kbd{M-x gdb} interface, this problem does not occur, as |
| 600 | value in GDB can sometimes expand a macro and result in a side effect | 602 | there is special code to avoid side-effects; furthermore, you can |
| 601 | that interferes with the program's operation. The GDB graphical | 603 | display macro definitions associated with an identifier when the |
| 602 | interface supports GUD tooltips and assures they will not cause side | 604 | program is not executing. |
| 603 | effects. | ||
| 604 | 605 | ||
| 605 | @node Commands of GUD | 606 | @node Commands of GUD |
| 606 | @subsection Commands of GUD | 607 | @subsection Commands of GUD |
| 607 | 608 | ||
| 608 | The GUD interaction buffer uses a variant of Shell mode, so the | 609 | GUD provides commands for setting and clearing breakpoints, |
| 609 | Emacs commands of Shell mode are available (@pxref{Shell Mode}). All | 610 | selecting stack frames, and stepping through the program. |
| 610 | the usual commands for your debugger are available, and you can use | ||
| 611 | the Shell mode history commands to repeat them. If you wish, you can | ||
| 612 | control your debugger process entirely through this buffer. | ||
| 613 | |||
| 614 | GUD mode also provides commands for setting and clearing | ||
| 615 | breakpoints, for selecting stack frames, and for stepping through the | ||
| 616 | program. These commands are available both in the GUD buffer and | ||
| 617 | globally, but with different key bindings. It also has its own tool | ||
| 618 | bar from which you can invoke the more common commands by clicking on | ||
| 619 | the appropriate icon. This is particularly useful for repetitive | ||
| 620 | commands like @code{gud-next} and @code{gud-step}, and allows you to | ||
| 621 | keep the GUD buffer hidden. | ||
| 622 | |||
| 623 | The breakpoint commands are normally used in source file buffers, | ||
| 624 | because that is the easiest way to specify where to set or clear the | ||
| 625 | breakpoint. Here's the global command to set a breakpoint: | ||
| 626 | 611 | ||
| 627 | @table @kbd | 612 | @table @kbd |
| 628 | @item C-x @key{SPC} | 613 | @item C-x @key{SPC} |
| @@ -630,35 +615,42 @@ breakpoint. Here's the global command to set a breakpoint: | |||
| 630 | Set a breakpoint on the source line that point is on. | 615 | Set a breakpoint on the source line that point is on. |
| 631 | @end table | 616 | @end table |
| 632 | 617 | ||
| 618 | @kbd{C-x @key{SPC}} (@code{gud-break}), when called in a source | ||
| 619 | buffer, sets a debugger breakpoint on the current source line. This | ||
| 620 | command is available only after starting GUD. If you call it in a | ||
| 621 | buffer that is not associated with any debugger subprocess, it signals | ||
| 622 | a error. | ||
| 623 | |||
| 633 | @kindex C-x C-a @r{(GUD)} | 624 | @kindex C-x C-a @r{(GUD)} |
| 634 | Here are the other special commands provided by GUD@. The keys | 625 | The following commands are available both in the GUD interaction |
| 626 | buffer and globally, but with different key bindings. The keys | ||
| 635 | starting with @kbd{C-c} are available only in the GUD interaction | 627 | starting with @kbd{C-c} are available only in the GUD interaction |
| 636 | buffer. The key bindings that start with @kbd{C-x C-a} are available | 628 | buffer, while those starting with @kbd{C-x C-a} are available |
| 637 | in the GUD interaction buffer and also in source files. Some of these | 629 | globally. Some of these commands are also available via the tool bar; |
| 638 | commands are not available to all the supported debuggers. | 630 | some are not supported by certain debuggers. |
| 639 | 631 | ||
| 640 | @table @kbd | 632 | @table @kbd |
| 641 | @item C-c C-l | 633 | @item C-c C-l |
| 642 | @kindex C-c C-l @r{(GUD)} | 634 | @kindex C-c C-l @r{(GUD)} |
| 643 | @itemx C-x C-a C-l | 635 | @itemx C-x C-a C-l |
| 644 | @findex gud-refresh | 636 | @findex gud-refresh |
| 645 | Display in another window the last line referred to in the GUD | 637 | Display, in another window, the last source line referred to in the |
| 646 | buffer (that is, the line indicated in the last location message). | 638 | GUD interaction buffer (@code{gud-refresh}). |
| 647 | This runs the command @code{gud-refresh}. | ||
| 648 | 639 | ||
| 649 | @item C-c C-s | 640 | @item C-c C-s |
| 650 | @kindex C-c C-s @r{(GUD)} | 641 | @kindex C-c C-s @r{(GUD)} |
| 651 | @itemx C-x C-a C-s | 642 | @itemx C-x C-a C-s |
| 652 | @findex gud-step | 643 | @findex gud-step |
| 653 | Execute a single line of code (@code{gud-step}). If the line contains | 644 | Execute the next single line of code (@code{gud-step}). If the line |
| 654 | a function call, execution stops after entering the called function. | 645 | contains a function call, execution stops after entering the called |
| 646 | function. | ||
| 655 | 647 | ||
| 656 | @item C-c C-n | 648 | @item C-c C-n |
| 657 | @kindex C-c C-n @r{(GUD)} | 649 | @kindex C-c C-n @r{(GUD)} |
| 658 | @itemx C-x C-a C-n | 650 | @itemx C-x C-a C-n |
| 659 | @findex gud-next | 651 | @findex gud-next |
| 660 | Execute a single line of code, stepping across entire function calls | 652 | Execute the next single line of code, stepping across function calls |
| 661 | at full speed (@code{gud-next}). | 653 | without stopping inside the functions (@code{gud-next}). |
| 662 | 654 | ||
| 663 | @item C-c C-i | 655 | @item C-c C-i |
| 664 | @kindex C-c C-i @r{(GUD)} | 656 | @kindex C-c C-i @r{(GUD)} |
| @@ -769,17 +761,17 @@ Instead, type @kbd{C-q @key{TAB}} to enter a tab. | |||
| 769 | @vindex perldb-mode-hook | 761 | @vindex perldb-mode-hook |
| 770 | @vindex pdb-mode-hook | 762 | @vindex pdb-mode-hook |
| 771 | @vindex jdb-mode-hook | 763 | @vindex jdb-mode-hook |
| 772 | On startup, GUD runs one of the following hooks: @code{gdb-mode-hook}, | 764 | On startup, GUD runs one of the following hooks: |
| 773 | if you are using GDB; @code{dbx-mode-hook}, if you are using DBX; | 765 | @code{gdb-mode-hook}, if you are using GDB; @code{dbx-mode-hook}, if |
| 774 | @code{sdb-mode-hook}, if you are using SDB; @code{xdb-mode-hook}, if you | 766 | you are using DBX; @code{sdb-mode-hook}, if you are using SDB; |
| 775 | are using XDB; @code{perldb-mode-hook}, for Perl debugging mode; | 767 | @code{xdb-mode-hook}, if you are using XDB; @code{perldb-mode-hook}, |
| 776 | @code{pdb-mode-hook}, for PDB; @code{jdb-mode-hook}, for JDB. You can | 768 | for Perl debugging mode; @code{pdb-mode-hook}, for PDB; |
| 777 | use these hooks to define custom key bindings for the debugger | 769 | @code{jdb-mode-hook}, for JDB. @xref{Hooks}. |
| 778 | interaction buffer. @xref{Hooks}. | 770 | |
| 779 | 771 | The @code{gud-def} Lisp macro (@pxref{Defining Macros,,, elisp, the | |
| 780 | Here is a convenient way to define a command that sends a particular | 772 | Emacs Lisp Reference Manual}) provides a convenient way to define an |
| 781 | command string to the debugger, and set up a key binding for it in the | 773 | Emacs command that sends a particular command string to the debugger, |
| 782 | debugger interaction buffer: | 774 | and set up a key binding for in the GUD interaction buffer: |
| 783 | 775 | ||
| 784 | @findex gud-def | 776 | @findex gud-def |
| 785 | @example | 777 | @example |
| @@ -835,21 +827,22 @@ Fully qualified class name derived from the expression surrounding point | |||
| 835 | @node GDB Graphical Interface | 827 | @node GDB Graphical Interface |
| 836 | @subsection GDB Graphical Interface | 828 | @subsection GDB Graphical Interface |
| 837 | 829 | ||
| 838 | The command @code{gdb} starts GDB in a graphical interface, using | 830 | The command @kbd{M-x gdb} starts GDB in an IDE-like interface, with |
| 839 | Emacs windows for display program state information. With it, you do | 831 | specialized buffers for controlling breakpoints, stack frames, and |
| 840 | not need to use textual GDB commands; you can control the debugging | 832 | other aspects of the debugger state. It also provides additional ways |
| 841 | session with the mouse. For example, you can click in the fringe of a | 833 | to control the debugging session with the mouse, such as clicking in |
| 842 | source buffer to set a breakpoint there, or on a stack frame in the | 834 | the fringe of a source buffer to set a breakpoint there. |
| 843 | stack buffer to select that frame. | ||
| 844 | |||
| 845 | This mode requires telling GDB that its ``screen size'' is | ||
| 846 | unlimited, so it sets the height and width accordingly. For correct | ||
| 847 | operation you must not change these values during the GDB session. | ||
| 848 | 835 | ||
| 849 | @vindex gud-gdb-command-name | 836 | @vindex gud-gdb-command-name |
| 850 | To run GDB in text command mode, like the other debuggers in Emacs, | 837 | To run GDB using just the GUD interaction buffer interface, without |
| 851 | use @kbd{M-x gud-gdb}. You need to use text command mode to debug | 838 | these additional features, use @kbd{M-x gud-gdb} (@pxref{Starting |
| 852 | multiple programs within one Emacs session. | 839 | GUD}). You must use this if you want to debug multiple programs |
| 840 | within one Emacs session, as that is currently unsupported by @kbd{M-x | ||
| 841 | gdb}. | ||
| 842 | |||
| 843 | Internally, @kbd{M-x gdb} informs GDB that its ``screen size'' is | ||
| 844 | unlimited; for correct operation, you must not change GDB's screen | ||
| 845 | height and width values during the debugging session. | ||
| 853 | 846 | ||
| 854 | @menu | 847 | @menu |
| 855 | * GDB User Interface Layout:: Control the number of displayed buffers. | 848 | * GDB User Interface Layout:: Control the number of displayed buffers. |
| @@ -858,8 +851,7 @@ multiple programs within one Emacs session. | |||
| 858 | * Breakpoints Buffer:: A breakpoint control panel. | 851 | * Breakpoints Buffer:: A breakpoint control panel. |
| 859 | * Threads Buffer:: Displays your threads. | 852 | * Threads Buffer:: Displays your threads. |
| 860 | * Stack Buffer:: Select a frame from the call stack. | 853 | * Stack Buffer:: Select a frame from the call stack. |
| 861 | * Other GDB Buffers:: Input/output, locals, registers, | 854 | * Other GDB Buffers:: Other buffers for controlling the GDB state. |
| 862 | assembler, threads and memory buffers. | ||
| 863 | * Watch Expressions:: Monitor variable values in the speedbar. | 855 | * Watch Expressions:: Monitor variable values in the speedbar. |
| 864 | * Multithreaded Debugging:: Debugging programs with several threads. | 856 | * Multithreaded Debugging:: Debugging programs with several threads. |
| 865 | @end menu | 857 | @end menu |
| @@ -869,12 +861,12 @@ multiple programs within one Emacs session. | |||
| 869 | @cindex GDB User Interface layout | 861 | @cindex GDB User Interface layout |
| 870 | 862 | ||
| 871 | @vindex gdb-many-windows | 863 | @vindex gdb-many-windows |
| 872 | If the variable @code{gdb-many-windows} is @code{nil} (the default | 864 | If the variable @code{gdb-many-windows} is @code{nil} (the default), |
| 873 | value) then @kbd{M-x gdb} normally displays only the GUD buffer. | 865 | @kbd{M-x gdb} normally displays only the GUD interaction buffer. |
| 874 | However, if the variable @code{gdb-show-main} is also non-@code{nil}, | 866 | However, if the variable @code{gdb-show-main} is also non-@code{nil}, |
| 875 | it starts with two windows: one displaying the GUD buffer, and the | 867 | it starts with two windows: one displaying the GUD interaction buffer, |
| 876 | other showing the source for the @code{main} function of the program | 868 | and the other showing the source for the @code{main} function of the |
| 877 | you are debugging. | 869 | program you are debugging. |
| 878 | 870 | ||
| 879 | If @code{gdb-many-windows} is non-@code{nil}, then @kbd{M-x gdb} | 871 | If @code{gdb-many-windows} is non-@code{nil}, then @kbd{M-x gdb} |
| 880 | displays the following frame layout: | 872 | displays the following frame layout: |
| @@ -882,7 +874,7 @@ displays the following frame layout: | |||
| 882 | @smallexample | 874 | @smallexample |
| 883 | @group | 875 | @group |
| 884 | +--------------------------------+--------------------------------+ | 876 | +--------------------------------+--------------------------------+ |
| 885 | | GUD buffer (I/O of GDB) | Locals/Registers buffer | | 877 | | GUD interaction buffer | Locals/Registers buffer | |
| 886 | |--------------------------------+--------------------------------+ | 878 | |--------------------------------+--------------------------------+ |
| 887 | | Primary Source buffer | I/O buffer for debugged pgm | | 879 | | Primary Source buffer | I/O buffer for debugged pgm | |
| 888 | |--------------------------------+--------------------------------+ | 880 | |--------------------------------+--------------------------------+ |
| @@ -896,264 +888,233 @@ buffer does not appear and the primary source buffer occupies the full | |||
| 896 | width of the frame. | 888 | width of the frame. |
| 897 | 889 | ||
| 898 | @findex gdb-restore-windows | 890 | @findex gdb-restore-windows |
| 899 | If you change the window layout, for example, while editing and | ||
| 900 | re-compiling your program, then you can restore this standard window | ||
| 901 | layout with the command @code{gdb-restore-windows}. | ||
| 902 | |||
| 903 | @findex gdb-many-windows | 891 | @findex gdb-many-windows |
| 904 | To switch between this standard layout and a simple layout | 892 | If you ever change the window layout, you can restore the ``many |
| 905 | containing just the GUD buffer and a source file, type @kbd{M-x | 893 | windows'' layout by typing @kbd{M-x gdb-restore-windows}. To toggle |
| 906 | gdb-many-windows}. | 894 | between the many windows layout and a simple layout with just the GUD |
| 895 | interaction buffer and a source file, type @kbd{M-x gdb-many-windows}. | ||
| 907 | 896 | ||
| 908 | You may also specify additional GDB-related buffers to display, | 897 | You may also specify additional GDB-related buffers to display, |
| 909 | either in the same frame or a different one. Select the buffers you | 898 | either in the same frame or a different one. Select the buffers you |
| 910 | want with the @samp{GUD->GDB-Windows} and @samp{GUD->GDB-Frames} | 899 | want by typing @code{M-x gdb-display-@var{buffertype}-buffer} or |
| 911 | sub-menus. If the menu-bar is unavailable, type @code{M-x | 900 | @code{M-x gdb-frame-@var{buffertype}-buffer}, where @var{buffertype} |
| 912 | gdb-display-@var{buffertype}-buffer} or @code{M-x | 901 | is the relevant buffer type, such as @samp{breakpoints}. You can do |
| 913 | gdb-frame-@var{buffertype}-buffer} respectively, where | 902 | the same with the menu bar, with the @samp{GDB-Windows} and |
| 914 | @var{buffertype} is the relevant buffer type, such as | 903 | @samp{GDB-Frames} sub-menus of the @samp{GUD} menu. |
| 915 | @samp{breakpoints}. Most of these buffers are read-only, and typing | 904 | |
| 916 | @kbd{q} in them kills them. | 905 | When you finish debugging, kill the GUD interaction buffer with |
| 917 | 906 | @kbd{C-x k}, which will also kill all the buffers associated with the | |
| 918 | When you finish debugging, kill the GUD buffer with @kbd{C-x k}, | 907 | session. However you need not do this if, after editing and |
| 919 | which will also kill all the buffers associated with the session. | 908 | re-compiling your source code within Emacs, you wish to continue |
| 920 | However you need not do this if, after editing and re-compiling your | 909 | debugging. When you restart execution, GDB automatically finds the |
| 921 | source code within Emacs, you wish continue debugging. When you | 910 | new executable. Keeping the GUD interaction buffer has the advantage |
| 922 | restart execution, GDB will automatically find your new executable. | 911 | of keeping the shell history as well as GDB's breakpoints. You do |
| 923 | Keeping the GUD buffer has the advantage of keeping the shell history | 912 | need to check that the breakpoints in recently edited source files are |
| 924 | as well as GDB's breakpoints. You do need to check that the | 913 | still in the right places. |
| 925 | breakpoints in recently edited source files are still in the right | ||
| 926 | places. | ||
| 927 | 914 | ||
| 928 | @node Source Buffers | 915 | @node Source Buffers |
| 929 | @subsubsection Source Buffers | 916 | @subsubsection Source Buffers |
| 930 | @cindex GDB commands in Fringe | 917 | @cindex fringes, for debugging |
| 931 | |||
| 932 | @c @findex gdb-mouse-set-clear-breakpoint | ||
| 933 | @c @findex gdb-mouse-toggle-breakpoint | ||
| 934 | Many GDB commands can be entered using key bindings or the tool bar but | ||
| 935 | sometimes it is quicker to use the fringe. These commands either | ||
| 936 | manipulate breakpoints or control program execution. When there is no | ||
| 937 | fringe, you can use the margin but this is only present when the | ||
| 938 | source file already has a breakpoint. | ||
| 939 | |||
| 940 | You can click @kbd{Mouse-1} in the fringe or display margin of a | ||
| 941 | source buffer to set a breakpoint there and, on a graphical display, a | ||
| 942 | red bullet will appear on that line. If a breakpoint already exists | ||
| 943 | on that line, the same click will remove it. You can also enable or | ||
| 944 | disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet. | ||
| 945 | |||
| 946 | A solid arrow in the left fringe of a source buffer indicates the line | ||
| 947 | of the innermost frame where the debugged program has stopped. A | ||
| 948 | hollow arrow indicates the current execution line of higher level | ||
| 949 | frames. | ||
| 950 | |||
| 951 | If you drag the arrow in the fringe with @kbd{Mouse-1} | ||
| 952 | (@code{gdb-mouse-until}), execution will continue to the line where | ||
| 953 | you release the button, provided it is still in the same frame. | ||
| 954 | Alternatively, you can click @kbd{Mouse-3} at some point in the fringe | ||
| 955 | of this buffer and execution will advance to there. A similar command | ||
| 956 | (@code{gdb-mouse-jump}) allows you to jump to a source line without | ||
| 957 | executing the intermediate lines by clicking @kbd{C-Mouse-3}. This | ||
| 958 | command allows you to go backwards which can be useful for running | ||
| 959 | through code that has already executed, in order to examine its | ||
| 960 | execution in more detail. | ||
| 961 | 918 | ||
| 962 | @table @kbd | 919 | @table @asis |
| 963 | @item Mouse-1 | 920 | @item @kbd{Mouse-1} (in fringe) |
| 964 | Set or clear a breakpoint. | 921 | Set or clear a breakpoint on that line. |
| 965 | 922 | ||
| 966 | @item C-Mouse-1 | 923 | @item @kbd{C-Mouse-1} (in fringe) |
| 967 | Enable or disable a breakpoint. | 924 | Enable or disable a breakpoint on that line. |
| 968 | 925 | ||
| 969 | @item Mouse-3 | 926 | @item @kbd{Mouse-3} (in fringe) |
| 970 | Continue execution to here. | 927 | Continue execution to that line. |
| 971 | 928 | ||
| 972 | @item C-Mouse-3 | 929 | @item @kbd{C-Mouse-3} (in fringe) |
| 973 | Jump to here. | 930 | Jump to that line. |
| 974 | @end table | 931 | @end table |
| 975 | 932 | ||
| 976 | If the variable @code{gdb-find-source-frame} is non-@code{nil} and | 933 | On a graphical display, you can click @kbd{Mouse-1} in the fringe of |
| 977 | execution stops in a frame for which there is no source code e.g after | 934 | a source buffer, to set a breakpoint on that line (@pxref{Fringes}). |
| 978 | an interrupt, then Emacs finds and displays the first frame further up | 935 | A red dot appears in the fringe, where you clicked. If a breakpoint |
| 979 | stack for which there is source. If it is @code{nil} then the source | 936 | already exists there, the click removes it. A @kbd{C-Mouse-1} click |
| 980 | buffer continues to display the last frame which maybe more useful, | 937 | enables or disables an existing breakpoint; a breakpoint that is |
| 981 | for example, when re-setting a breakpoint. | 938 | disabled, but not unset, is indicated by a gray dot. |
| 939 | |||
| 940 | On a text-only terminal, or when fringes are disabled, enabled | ||
| 941 | breakpoints are indicated with a @samp{B} character in the left margin | ||
| 942 | of the window. Disabled breakpoints are indicated with @samp{b}. | ||
| 943 | (The margin is only displayed if a breakpoint is present.) | ||
| 944 | |||
| 945 | A solid arrow in the left fringe of a source buffer indicates the | ||
| 946 | line of the innermost frame where the debugged program has stopped. A | ||
| 947 | hollow arrow indicates the current execution line of a higher-level | ||
| 948 | frame. If you drag the arrow in the fringe with @kbd{Mouse-1}, that | ||
| 949 | causes execution to advance to the line where you release the button. | ||
| 950 | Alternatively, you can click @kbd{Mouse-3} in the fringe to advance to | ||
| 951 | that line. You can click @kbd{C-Mouse-3} in the fringe to jump to | ||
| 952 | that line without executing the intermediate lines. This command | ||
| 953 | allows you to go backwards, which can be useful for running through | ||
| 954 | code that has already executed, in order to examine its execution in | ||
| 955 | more detail. | ||
| 982 | 956 | ||
| 983 | @node Breakpoints Buffer | 957 | @node Breakpoints Buffer |
| 984 | @subsubsection Breakpoints Buffer | 958 | @subsubsection Breakpoints Buffer |
| 985 | 959 | ||
| 986 | The breakpoints buffer shows the existing breakpoints, watchpoints and | 960 | The GDB Breakpoints buffer shows the breakpoints, watchpoints and |
| 987 | catchpoints (@pxref{Breakpoints,,, gdb, The GNU debugger}). It has | 961 | catchpoints in the debugger session. @xref{Breakpoints,,, gdb, The |
| 988 | these special commands, which mostly apply to the @dfn{current | 962 | GNU debugger}. It provides the following commands, which mostly apply |
| 989 | breakpoint}, the breakpoint which point is on. | 963 | to the @dfn{current breakpoint} (the breakpoint which point is on): |
| 990 | 964 | ||
| 991 | @table @kbd | 965 | @table @kbd |
| 992 | @item @key{SPC} | 966 | @item @key{SPC} |
| 993 | @kindex SPC @r{(GDB breakpoints buffer)} | 967 | @kindex SPC @r{(GDB Breakpoints buffer)} |
| 994 | @findex gdb-toggle-breakpoint | 968 | @findex gdb-toggle-breakpoint |
| 995 | Enable/disable current breakpoint (@code{gdb-toggle-breakpoint}). | 969 | Enable/disable current breakpoint (@code{gdb-toggle-breakpoint}). On |
| 996 | On a graphical display, this changes the color of a bullet in the | 970 | a graphical display, this changes the color of the dot in the fringe |
| 997 | margin of a source buffer at the relevant line. This is red when | 971 | of the source buffer at that line. The dot is red when the breakpoint |
| 998 | the breakpoint is enabled and gray when it is disabled. Text-only | 972 | is enabled, and gray when it is disabled. |
| 999 | terminals correspondingly display a @samp{B} or @samp{b}. | ||
| 1000 | 973 | ||
| 1001 | @item D | 974 | @item D |
| 1002 | @kindex D @r{(GDB breakpoints buffer)} | 975 | @kindex D @r{(GDB Breakpoints buffer)} |
| 1003 | @findex gdb-delete-breakpoint | 976 | @findex gdb-delete-breakpoint |
| 1004 | Delete the current breakpoint (@code{gdb-delete-breakpoint}). | 977 | Delete the current breakpoint (@code{gdb-delete-breakpoint}). |
| 1005 | 978 | ||
| 1006 | @item @key{RET} | 979 | @item @key{RET} |
| 1007 | @kindex RET @r{(GDB breakpoints buffer)} | 980 | @kindex RET @r{(GDB Breakpoints buffer)} |
| 1008 | @findex gdb-goto-breakpoint | 981 | @findex gdb-goto-breakpoint |
| 1009 | Visit the source line for the current breakpoint | 982 | Visit the source line for the current breakpoint |
| 1010 | (@code{gdb-goto-breakpoint}). | 983 | (@code{gdb-goto-breakpoint}). |
| 1011 | 984 | ||
| 1012 | @item Mouse-2 | 985 | @item Mouse-2 |
| 1013 | @kindex Mouse-2 @r{(GDB breakpoints buffer)} | 986 | @kindex Mouse-2 @r{(GDB Breakpoints buffer)} |
| 1014 | Visit the source line for the breakpoint you click on. | 987 | Visit the source line for the breakpoint you click on. |
| 1015 | @end table | 988 | @end table |
| 1016 | 989 | ||
| 1017 | @vindex gdb-show-threads-by-default | 990 | @vindex gdb-show-threads-by-default |
| 1018 | When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer | 991 | When @code{gdb-many-windows} is non-@code{nil}, the GDB Breakpoints |
| 1019 | shares its window with the threads buffer. To switch from one to the | 992 | buffer shares its window with the GDB Threads buffer. To switch from |
| 1020 | other click with @kbd{Mouse-1} on the relevant button in the header | 993 | one to the other click with @kbd{Mouse-1} on the relevant button in |
| 1021 | line. If @code{gdb-show-threads-by-default} is non-@code{nil}, the | 994 | the header line. If @code{gdb-show-threads-by-default} is |
| 1022 | threads buffer, rather than the breakpoints buffer, is shown at start | 995 | non-@code{nil}, the GDB Threads buffer is the one shown by default. |
| 1023 | up. | ||
| 1024 | 996 | ||
| 1025 | @node Threads Buffer | 997 | @node Threads Buffer |
| 1026 | @subsubsection Threads Buffer | 998 | @subsubsection Threads Buffer |
| 1027 | 999 | ||
| 1028 | @findex gdb-select-thread | 1000 | @findex gdb-select-thread |
| 1029 | The threads buffer displays a summary of all threads currently in your | 1001 | The GDB Threads buffer displays a summary of the threads in the |
| 1030 | program (@pxref{Threads, Threads, Debugging programs with multiple | 1002 | debugged program. @xref{Threads, Threads, Debugging programs with |
| 1031 | threads, gdb, The GNU debugger}). Move point to any thread in the list | 1003 | multiple threads, gdb, The GNU debugger}. To select a thread, move |
| 1032 | and press @key{RET} to select it (@code{gdb-select-thread}) and | 1004 | point there and type @key{RET} (@code{gdb-select-thread}), or click on |
| 1033 | display the associated source in the primary source buffer. | 1005 | it with @kbd{Mouse-2}. This also displays the associated source |
| 1034 | Alternatively, click @kbd{Mouse-2} on a thread to select it. Contents | 1006 | buffer, and updates the contents of the other GDB buffers. |
| 1035 | of all GDB buffers are updated whenever you select a thread. | ||
| 1036 | 1007 | ||
| 1037 | You can customize variables under @code{gdb-buffers} group to select | 1008 | You can customize variables under @code{gdb-buffers} group to select |
| 1038 | fields included in threads buffer. | 1009 | fields included in GDB Threads buffer. |
| 1039 | 1010 | ||
| 1040 | @table @code | 1011 | @table @code |
| 1041 | @item gdb-thread-buffer-verbose-names | 1012 | @item gdb-thread-buffer-verbose-names |
| 1042 | @vindex gdb-thread-buffer-verbose-names | 1013 | @vindex gdb-thread-buffer-verbose-names |
| 1043 | Show long thread names like @samp{Thread 0x4e2ab70 (LWP 1983)} in | 1014 | Show long thread names like @samp{Thread 0x4e2ab70 (LWP 1983)}. |
| 1044 | threads buffer. | ||
| 1045 | 1015 | ||
| 1046 | @item gdb-thread-buffer-arguments | 1016 | @item gdb-thread-buffer-arguments |
| 1047 | @vindex gdb-thread-buffer-arguments | 1017 | @vindex gdb-thread-buffer-arguments |
| 1048 | Show arguments of thread top frames in threads buffer. | 1018 | Show arguments of thread top frames. |
| 1049 | 1019 | ||
| 1050 | @item gdb-thread-buffer-locations | 1020 | @item gdb-thread-buffer-locations |
| 1051 | @vindex gdb-thread-buffer-locations | 1021 | @vindex gdb-thread-buffer-locations |
| 1052 | Show file information or library names in threads buffer. | 1022 | Show file information or library names. |
| 1053 | 1023 | ||
| 1054 | @item gdb-thread-buffer-addresses | 1024 | @item gdb-thread-buffer-addresses |
| 1055 | @vindex gdb-thread-buffer-addresses | 1025 | @vindex gdb-thread-buffer-addresses |
| 1056 | Show addresses for thread frames in threads buffer. | 1026 | Show addresses for thread frames in threads buffer. |
| 1057 | @end table | 1027 | @end table |
| 1058 | 1028 | ||
| 1059 | It's possible to observe information for several threads | 1029 | To view information for several threads simultaneously, use the |
| 1060 | simultaneously (in addition to buffers which show information for | 1030 | following commands from the GDB Threads buffer. |
| 1061 | currently selected thread) using the following keys from the threads | ||
| 1062 | buffer. | ||
| 1063 | 1031 | ||
| 1064 | @table @kbd | 1032 | @table @kbd |
| 1065 | @item d | 1033 | @item d |
| 1066 | @kindex d @r{(GDB threads buffer)} | 1034 | @kindex d @r{(GDB threads buffer)} |
| 1067 | @findex gdb-display-disassembly-for-thread | 1035 | @findex gdb-display-disassembly-for-thread |
| 1068 | Display disassembly buffer for the thread at current line. | 1036 | Display disassembly buffer for the thread at current line |
| 1069 | (@code{gdb-display-disassembly-for-thread}) | 1037 | (@code{gdb-display-disassembly-for-thread}). |
| 1070 | 1038 | ||
| 1071 | @item f | 1039 | @item f |
| 1072 | @kindex f @r{(GDB threads buffer)} | 1040 | @kindex f @r{(GDB threads buffer)} |
| 1073 | @findex gdb-display-stack-for-thread | 1041 | @findex gdb-display-stack-for-thread |
| 1074 | Display stack buffer for the thread at current line. | 1042 | Display the GDB Stack buffer for the thread at current line |
| 1075 | (@code{gdb-display-stack-for-thread}). | 1043 | (@code{gdb-display-stack-for-thread}). |
| 1076 | 1044 | ||
| 1077 | @item l | 1045 | @item l |
| 1078 | @kindex l @r{(GDB threads buffer)} | 1046 | @kindex l @r{(GDB threads buffer)} |
| 1079 | @findex gdb-display-locals-for-thread | 1047 | @findex gdb-display-locals-for-thread |
| 1080 | Display locals buffer for the thread at current line. | 1048 | Display the GDB Locals buffer for the thread at current line |
| 1081 | (@code{gdb-display-locals-for-thread}). | 1049 | (@code{gdb-display-locals-for-thread}). |
| 1082 | 1050 | ||
| 1083 | @item r | 1051 | @item r |
| 1084 | @kindex r @r{(GDB threads buffer)} | 1052 | @kindex r @r{(GDB threads buffer)} |
| 1085 | @findex gdb-display-registers-for-thread | 1053 | @findex gdb-display-registers-for-thread |
| 1086 | Display registers buffer for the thread at current line. | 1054 | Display the GDB Registers buffer for the thread at current line |
| 1087 | (@code{gdb-display-registers-for-thread}). | 1055 | (@code{gdb-display-registers-for-thread}). |
| 1088 | @end table | 1056 | @end table |
| 1089 | 1057 | ||
| 1090 | Pressing their upper-case counterparts, @kbd{D}, @kbd{F} ,@kbd{L} and | 1058 | @noindent |
| 1091 | @kbd{R} displays the corresponding buffer in a new frame. | 1059 | Their upper-case counterparts, @kbd{D}, @kbd{F} ,@kbd{L} and @kbd{R}, |
| 1060 | display the corresponding buffer in a new frame. | ||
| 1092 | 1061 | ||
| 1093 | When you create a buffer showing information about some specific | 1062 | When you create a buffer showing information about some specific |
| 1094 | thread, it becomes bound to that thread and keeps showing actual | 1063 | thread, it becomes bound to that thread and keeps showing actual |
| 1095 | information while you debug your program. Every GDB buffer contains a | 1064 | information while you debug your program. The mode indicator for each |
| 1096 | number of thread it shows information for in its mode name. Thread | 1065 | GDB buffer shows the number of thread it is showing information about. |
| 1097 | number is also included in the buffer name of bound buffers to prevent | 1066 | The thread number is also included in the buffer name of bound |
| 1098 | buffer names clashing. | 1067 | buffers. |
| 1099 | 1068 | ||
| 1100 | Further commands are available in the threads buffer which depend on the | 1069 | Further commands are available in the GDB Threads buffer which |
| 1101 | mode of GDB that is used for controlling execution of your program. | 1070 | depend on the mode of GDB that is used for controlling execution of |
| 1102 | (@pxref{Multithreaded Debugging, Stopping and Starting Multi-threaded Programs}). | 1071 | your program. @xref{Multithreaded Debugging}. |
| 1103 | 1072 | ||
| 1104 | @node Stack Buffer | 1073 | @node Stack Buffer |
| 1105 | @subsubsection Stack Buffer | 1074 | @subsubsection Stack Buffer |
| 1106 | 1075 | ||
| 1107 | The stack buffer displays a @dfn{call stack}, with one line for each | 1076 | The GDB Stack buffer displays a @dfn{call stack}, with one line for |
| 1108 | of the nested subroutine calls (@dfn{stack frames}) now active in the | 1077 | each of the nested subroutine calls (@dfn{stack frames}) in the |
| 1109 | program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}. | 1078 | debugger session. @xref{Backtrace,, Backtraces, gdb, The GNU |
| 1079 | debugger}. | ||
| 1110 | 1080 | ||
| 1111 | @findex gdb-frames-select | 1081 | @findex gdb-frames-select |
| 1112 | An arrow in the fringe points to the selected frame or, if the fringe is | 1082 | On graphical displays, the selected stack frame is indicated by an |
| 1113 | not present, the number of the selected frame is displayed in reverse | 1083 | arrow in the fringe. On text-only terminals, or when fringes are |
| 1114 | contrast. To select a frame in GDB, move point in the stack buffer to | 1084 | disabled, the selected stack frame is displayed in reverse contrast. |
| 1115 | that stack frame and type @key{RET} (@code{gdb-frames-select}), or click | 1085 | To select a stack frame, move point in its line and type @key{RET} |
| 1116 | @kbd{Mouse-2} on a stack frame. If the locals buffer is visible, | 1086 | (@code{gdb-frames-select}), or click @kbd{Mouse-2} on it. Doing so |
| 1117 | selecting a stack frame updates it to display the local variables of the | 1087 | also updates the Locals buffer |
| 1118 | new frame. | 1088 | @ifnottex |
| 1089 | (@pxref{Other GDB Buffers}). | ||
| 1090 | @end ifnottex | ||
| 1091 | @iftex | ||
| 1092 | (described in the next section). | ||
| 1093 | @end iftex | ||
| 1119 | 1094 | ||
| 1120 | @node Other GDB Buffers | 1095 | @node Other GDB Buffers |
| 1121 | @subsubsection Other Buffers | 1096 | @subsubsection Other GDB Buffers |
| 1122 | 1097 | ||
| 1123 | @table @asis | 1098 | @table @asis |
| 1124 | @item Input/Output Buffer | ||
| 1125 | @vindex gdb-use-separate-io-buffer | ||
| 1126 | If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil}, | ||
| 1127 | the program being debugged takes its input and displays its output | ||
| 1128 | here. Otherwise it uses the GUD buffer for that. To toggle whether | ||
| 1129 | GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}. | ||
| 1130 | This takes effect when you next restart the program you are debugging. | ||
| 1131 | |||
| 1132 | The history and replay commands from Shell mode are available here, | ||
| 1133 | as are the commands to send signals to the debugged program. | ||
| 1134 | @xref{Shell Mode}. | ||
| 1135 | |||
| 1136 | @item Locals Buffer | 1099 | @item Locals Buffer |
| 1137 | The locals buffer displays the values of local variables of the | 1100 | This buffer displays the values of local variables of the current |
| 1138 | current frame for simple data types (@pxref{Frame Info, Frame Info, | 1101 | frame for simple data types (@pxref{Frame Info, Frame Info, |
| 1139 | Information on a frame, gdb, The GNU debugger}). Press @key{RET} or | 1102 | Information on a frame, gdb, The GNU debugger}). Press @key{RET} or |
| 1140 | click @kbd{Mouse-2} on the value if you want to edit it. | 1103 | click @kbd{Mouse-2} on the value if you want to edit it. |
| 1141 | 1104 | ||
| 1142 | Arrays and structures display their type only. With GDB 6.4 or later, | 1105 | Arrays and structures display their type only. With GDB 6.4 or later, |
| 1143 | move point to their name and press @key{RET}, or alternatively click | 1106 | you can examine the value of the local variable at point by typing |
| 1144 | @kbd{Mouse-2} there, to examine their values. With earlier versions | 1107 | @key{RET}, or with a @kbd{Mouse-2} click. With earlier versions of |
| 1145 | of GDB, use @kbd{Mouse-2} or @key{RET} on the type description | 1108 | GDB, use @key{RET} or @kbd{Mouse-2} on the type description |
| 1146 | (@samp{[struct/union]} or @samp{[array]}). @xref{Watch Expressions}. | 1109 | (@samp{[struct/union]} or @samp{[array]}). @xref{Watch Expressions}. |
| 1147 | 1110 | ||
| 1148 | @item Registers Buffer | 1111 | @item Registers Buffer |
| 1149 | @findex toggle-gdb-all-registers | 1112 | @findex toggle-gdb-all-registers |
| 1150 | The registers buffer displays the values held by the registers | 1113 | This buffer displays the values held by the registers |
| 1151 | (@pxref{Registers,,, gdb, The GNU debugger}). Press @key{RET} or | 1114 | (@pxref{Registers,,, gdb, The GNU debugger}). Press @key{RET} or |
| 1152 | click @kbd{Mouse-2} on a register if you want to edit its value. | 1115 | click @kbd{Mouse-2} on a register if you want to edit its value. With |
| 1153 | With GDB 6.4 or later, recently changed register values display with | 1116 | GDB 6.4 or later, recently changed register values display with |
| 1154 | @code{font-lock-warning-face}. With earlier versions of GDB, you can | 1117 | @code{font-lock-warning-face}. |
| 1155 | press @key{SPC} to toggle the display of floating point registers | ||
| 1156 | (@code{toggle-gdb-all-registers}). | ||
| 1157 | 1118 | ||
| 1158 | @item Assembler Buffer | 1119 | @item Assembler Buffer |
| 1159 | The assembler buffer displays the current frame as machine code. An | 1120 | The assembler buffer displays the current frame as machine code. An |
| @@ -1172,8 +1133,8 @@ size for these data items. | |||
| 1172 | @end table | 1133 | @end table |
| 1173 | 1134 | ||
| 1174 | When @code{gdb-many-windows} is non-@code{nil}, the locals buffer | 1135 | When @code{gdb-many-windows} is non-@code{nil}, the locals buffer |
| 1175 | shares its window with the registers buffer, just like breakpoints | 1136 | shares its window with the registers buffer, just like breakpoints and |
| 1176 | and threads buffers. To switch from one to the other click with | 1137 | threads buffers. To switch from one to the other, click with |
| 1177 | @kbd{Mouse-1} on the relevant button in the header line. | 1138 | @kbd{Mouse-1} on the relevant button in the header line. |
| 1178 | 1139 | ||
| 1179 | @node Watch Expressions | 1140 | @node Watch Expressions |
| @@ -1188,14 +1149,15 @@ in the tool bar (@code{gud-watch}) or type @kbd{C-x C-a C-w}. If you | |||
| 1188 | specify a prefix argument, you can enter the variable name in the | 1149 | specify a prefix argument, you can enter the variable name in the |
| 1189 | minibuffer. | 1150 | minibuffer. |
| 1190 | 1151 | ||
| 1191 | Each watch expression is displayed in the speedbar. Complex data | 1152 | Each watch expression is displayed in the speedbar |
| 1192 | types, such as arrays, structures and unions are represented in a tree | 1153 | (@pxref{Speedbar}). Complex data types, such as arrays, structures |
| 1193 | format. Leaves and simple data types show the name of the expression | 1154 | and unions are represented in a tree format. Leaves and simple data |
| 1194 | and its value and, when the speedbar frame is selected, display the | 1155 | types show the name of the expression and its value and, when the |
| 1195 | type as a tooltip. Higher levels show the name, type and address | 1156 | speedbar frame is selected, display the type as a tooltip. Higher |
| 1196 | value for pointers and just the name and type otherwise. Root expressions | 1157 | levels show the name, type and address value for pointers and just the |
| 1197 | also display the frame address as a tooltip to help identify the frame | 1158 | name and type otherwise. Root expressions also display the frame |
| 1198 | in which they were defined. | 1159 | address as a tooltip to help identify the frame in which they were |
| 1160 | defined. | ||
| 1199 | 1161 | ||
| 1200 | To expand or contract a complex data type, click @kbd{Mouse-2} or | 1162 | To expand or contract a complex data type, click @kbd{Mouse-2} or |
| 1201 | press @key{SPC} on the tag to the left of the expression. Emacs asks | 1163 | press @key{SPC} on the tag to the left of the expression. Emacs asks |
| @@ -1243,51 +1205,43 @@ non-@code{nil}. This can be useful if you are debugging with a full | |||
| 1243 | screen Emacs frame. | 1205 | screen Emacs frame. |
| 1244 | 1206 | ||
| 1245 | @node Multithreaded Debugging | 1207 | @node Multithreaded Debugging |
| 1246 | @subsubsection Stopping and Starting Multi-threaded Programs | 1208 | @subsubsection Multithreaded Debugging |
| 1247 | @cindex Multithreaded debugging in GDB | 1209 | @cindex Multithreaded debugging in GDB |
| 1248 | |||
| 1249 | @subsubheading All-stop Debugging | ||
| 1250 | |||
| 1251 | In all-stop mode, whenever your program stops, @emph{all} threads of | ||
| 1252 | execution stop. Likewise, whenever you restart the program, all | ||
| 1253 | threads start executing. @xref{All-Stop Mode, , All-Stop Mode, gdb, | ||
| 1254 | The GNU debugger}. You can enable this behavior in Emacs by setting | ||
| 1255 | @code{gdb-non-stop-setting} to @code{nil} before starting a debugging | ||
| 1256 | session. | ||
| 1257 | |||
| 1258 | @subsubheading Non-stop Debugging | ||
| 1259 | @cindex Non-stop debugging in GDB | 1210 | @cindex Non-stop debugging in GDB |
| 1260 | 1211 | ||
| 1261 | For some multi-threaded targets, GDB supports a further mode of | 1212 | In GDB's @dfn{all-stop mode}, whenever your program stops, all |
| 1262 | operation in which you can examine stopped program threads in the | 1213 | execution threads stop. Likewise, whenever you restart the program, |
| 1263 | debugger while other threads continue to execute freely. | 1214 | all threads start executing. @xref{All-Stop Mode, , All-Stop Mode, |
| 1264 | @xref{Non-Stop Mode, , Non-Stop Mode, gdb, The GNU debugger}. | 1215 | gdb, The GNU debugger}. For some multi-threaded targets, GDB supports |
| 1265 | This is referred to as @dfn{non-stop} mode. | 1216 | a further mode of operation, called @dfn{non-stop mode}, in which you |
| 1266 | 1217 | can examine stopped program threads in the debugger while other | |
| 1267 | Versions of GDB prior to 7.0 do not support non-stop mode and it does | 1218 | threads continue to execute freely. @xref{Non-Stop Mode, , Non-Stop |
| 1268 | not work on all targets. In such cases, Emacs uses all-stop mode | 1219 | Mode, gdb, The GNU debugger}. Versions of GDB prior to 7.0 do not |
| 1269 | regardless of the value of @code{gdb-non-stop-setting}. | 1220 | support non-stop mode, and it does not work on all targets. |
| 1270 | 1221 | ||
| 1271 | @vindex gdb-non-stop-setting | 1222 | @vindex gdb-non-stop-setting |
| 1272 | If the variable @code{gdb-non-stop-setting} is non-@code{nil} (the | 1223 | The variable @code{gdb-non-stop-setting} determines whether Emacs |
| 1273 | default value), Emacs tries to start GDB in non-stop mode. Note that | 1224 | runs GDB in all-stop mode or non-stop mode. The default is @code{t}, |
| 1274 | GDB debugging session needs to be restarted for change of this setting | 1225 | which means it tries to use non-stop mode if that is available. If |
| 1275 | to take effect. | 1226 | you change the value to @code{nil}, or if non-stop mode is |
| 1227 | unavailable, Emacs runs GDB in all-stop mode. The variable takes | ||
| 1228 | effect when Emacs begins a debugging session; if you change its value, | ||
| 1229 | you should restart any active debugging session. | ||
| 1276 | 1230 | ||
| 1277 | @vindex gdb-switch-when-another-stopped | 1231 | @vindex gdb-switch-when-another-stopped |
| 1278 | When a thread stops in non-stop mode, Emacs automatically switches to | 1232 | When a thread stops in non-stop mode, Emacs usually switches to that |
| 1279 | that thread. It may be undesirable to allow switching of current | 1233 | thread. If you don't want Emacs to do this switch if another stopped |
| 1280 | thread when some other stopped thread is already selected. Set | 1234 | thread is already selected, change the variable |
| 1281 | @code{gdb-switch-when-another-stopped} to @code{nil} to prevent this. | 1235 | @code{gdb-switch-when-another-stopped} to @code{nil}. |
| 1282 | 1236 | ||
| 1283 | @vindex gdb-switch-reasons | 1237 | @vindex gdb-switch-reasons |
| 1284 | Emacs can decide whether or not to switch to the stopped thread | 1238 | Emacs can decide whether or not to switch to the stopped thread |
| 1285 | depending on the reason which caused the stop. Customize | 1239 | depending on the reason which caused the stop. Customize the variable |
| 1286 | @code{gdb-switch-reasons} to select stop reasons which make Emacs | 1240 | @code{gdb-switch-reasons} to select the stop reasons which will cause |
| 1287 | switch thread. | 1241 | a thread switch. |
| 1288 | 1242 | ||
| 1289 | @vindex gdb-stopped-hooks | 1243 | @vindex gdb-stopped-hooks |
| 1290 | The variable @code{gdb-stopped-hooks} allows you to execute your | 1244 | The variable @code{gdb-stopped-hooks} allows you to execute your |
| 1291 | functions whenever some thread stops. | 1245 | functions whenever some thread stops. |
| 1292 | 1246 | ||
| 1293 | In non-stop mode, you can switch between different modes for GUD | 1247 | In non-stop mode, you can switch between different modes for GUD |
| @@ -1297,7 +1251,7 @@ execution control commands. | |||
| 1297 | @table @dfn | 1251 | @table @dfn |
| 1298 | @item Non-stop/A | 1252 | @item Non-stop/A |
| 1299 | 1253 | ||
| 1300 | When @code{gdb-gud-control-all-threads} is @code{t} (the default | 1254 | When @code{gdb-gud-control-all-threads} is @code{t} (the default |
| 1301 | value), interruption and continuation commands apply to all threads, | 1255 | value), interruption and continuation commands apply to all threads, |
| 1302 | so you can halt or continue all your threads with one command using | 1256 | so you can halt or continue all your threads with one command using |
| 1303 | @code{gud-stop-subjob} and @code{gud-cont}, respectively. The | 1257 | @code{gud-stop-subjob} and @code{gud-cont}, respectively. The |
| @@ -1318,127 +1272,132 @@ from the tool bar or from @samp{GUD->GDB-MI} menu. | |||
| 1318 | 1272 | ||
| 1319 | Stepping commands always apply to the current thread. | 1273 | Stepping commands always apply to the current thread. |
| 1320 | 1274 | ||
| 1321 | @subsubheading Fine Thread Control | ||
| 1322 | |||
| 1323 | In non-stop mode, you can interrupt/continue your threads without | 1275 | In non-stop mode, you can interrupt/continue your threads without |
| 1324 | selecting them. Hitting @kbd{i} in threads buffer interrupts thread | 1276 | selecting them. Hitting @kbd{i} in threads buffer interrupts thread |
| 1325 | under point, @kbd{c} continues it, @kbd{s} steps through. More such | 1277 | under point, @kbd{c} continues it, @kbd{s} steps through. More such |
| 1326 | commands may be added in the future. | 1278 | commands may be added in the future. |
| 1327 | 1279 | ||
| 1328 | Combined with creating bound buffers for any thread, this allows you | 1280 | Note that when you interrupt a thread, it stops with the |
| 1329 | to change and track state of many threads in the same time. | 1281 | @samp{signal received} reason. If that reason is included in your |
| 1330 | |||
| 1331 | Note that when you interrupt a thread, it stops with @samp{signal | ||
| 1332 | received} reason. If that reason is included in your | ||
| 1333 | @code{gdb-switch-reasons} (it is by default), Emacs will switch to | 1282 | @code{gdb-switch-reasons} (it is by default), Emacs will switch to |
| 1334 | that thread. | 1283 | that thread. |
| 1335 | 1284 | ||
| 1336 | @node Executing Lisp | 1285 | @node Executing Lisp |
| 1337 | @section Executing Lisp Expressions | 1286 | @section Executing Lisp Expressions |
| 1338 | 1287 | ||
| 1339 | Emacs has several different major modes for Lisp and Scheme. They are | 1288 | Emacs has major modes for several variants of Lisp. They use the |
| 1340 | the same in terms of editing commands, but differ in the commands for | 1289 | same editing commands as other programming language modes |
| 1341 | executing Lisp expressions. Each mode has its own purpose. | 1290 | (@pxref{Programs}). In addition, they provide special commands for |
| 1291 | executing Lisp expressions. | ||
| 1342 | 1292 | ||
| 1343 | @table @asis | 1293 | @table @asis |
| 1344 | @item Emacs-Lisp mode | 1294 | @item Emacs Lisp mode |
| 1345 | The mode for editing source files of programs to run in Emacs Lisp. | 1295 | The mode for editing Emacs Lisp source files. It defines @kbd{C-M-x} |
| 1346 | This mode defines @kbd{C-M-x} to evaluate the current defun. | 1296 | to evaluate the current top-level Lisp expression. @xref{Lisp Eval}. |
| 1347 | @xref{Lisp Libraries}. | 1297 | |
| 1348 | @item Lisp Interaction mode | 1298 | @item Lisp Interaction mode |
| 1349 | The mode for an interactive session with Emacs Lisp. It defines | 1299 | The mode for an interactive Emacs Lisp session. It defines @kbd{C-j} |
| 1350 | @kbd{C-j} to evaluate the sexp before point and insert its value in the | 1300 | to evaluate the expression before point and insert its value in the |
| 1351 | buffer. @xref{Lisp Interaction}. | 1301 | buffer. @xref{Lisp Interaction}. |
| 1302 | |||
| 1352 | @item Lisp mode | 1303 | @item Lisp mode |
| 1353 | The mode for editing source files of programs that run in Lisps other | 1304 | The mode for editing source files of programs that run in Lisps other |
| 1354 | than Emacs Lisp. This mode defines @kbd{C-M-x} to send the current defun | 1305 | than Emacs Lisp. It defines @kbd{C-M-x} to evaluate the current |
| 1355 | to an inferior Lisp process. @xref{External Lisp}. | 1306 | top-level expression in an external Lisp. @xref{External Lisp}. |
| 1307 | |||
| 1356 | @item Inferior Lisp mode | 1308 | @item Inferior Lisp mode |
| 1357 | The mode for an interactive session with an inferior Lisp process. | 1309 | The mode for an interactive session with an external Lisp which is |
| 1358 | This mode combines the special features of Lisp mode and Shell mode | 1310 | being run as a subprocess (or @dfn{inferior process}) of Emacs. |
| 1359 | (@pxref{Shell Mode}). | 1311 | @ifnottex |
| 1312 | @xref{External Lisp}. | ||
| 1313 | @end ifnottex | ||
| 1314 | |||
| 1360 | @item Scheme mode | 1315 | @item Scheme mode |
| 1361 | Like Lisp mode but for Scheme programs. | 1316 | Like Lisp mode, but for Scheme programs. |
| 1317 | |||
| 1362 | @item Inferior Scheme mode | 1318 | @item Inferior Scheme mode |
| 1363 | The mode for an interactive session with an inferior Scheme process. | 1319 | Like Inferior Lisp mode, but for Scheme. |
| 1364 | @end table | 1320 | @end table |
| 1365 | 1321 | ||
| 1366 | Most editing commands for working with Lisp programs are in fact | ||
| 1367 | available globally. @xref{Programs}. | ||
| 1368 | |||
| 1369 | @node Lisp Libraries | 1322 | @node Lisp Libraries |
| 1370 | @section Libraries of Lisp Code for Emacs | 1323 | @section Libraries of Lisp Code for Emacs |
| 1371 | @cindex libraries | 1324 | @cindex libraries |
| 1372 | @cindex loading Lisp code | 1325 | @cindex loading Lisp code |
| 1373 | 1326 | ||
| 1374 | Lisp code for Emacs editing commands is stored in files whose names | 1327 | Emacs Lisp code is stored in files whose names conventionally end in |
| 1375 | conventionally end in @file{.el}. This ending tells Emacs to edit them in | 1328 | @file{.el}. Such files are automatically visited in Emacs Lisp mode. |
| 1376 | Emacs-Lisp mode (@pxref{Executing Lisp}). | ||
| 1377 | 1329 | ||
| 1378 | @cindex byte code | 1330 | @cindex byte code |
| 1379 | Emacs Lisp code can be compiled into byte-code, which loads faster, | 1331 | Emacs Lisp code can be compiled into byte-code, which loads faster, |
| 1380 | takes up less space, and executes faster. @xref{Byte Compilation,, | 1332 | takes up less space, and executes faster. By convention, compiled |
| 1381 | Byte Compilation, elisp, the Emacs Lisp Reference Manual}. By | 1333 | Emacs Lisp code goes in a separate file whose name ends in |
| 1382 | convention, the compiled code for a library goes in a separate file | 1334 | @samp{.elc}. For example, the compiled code for @file{foo.el} goes in |
| 1383 | whose name ends in @samp{.elc}. Thus, the compiled code for | 1335 | @file{foo.elc}. @xref{Byte Compilation,, Byte Compilation, elisp, the |
| 1384 | @file{foo.el} goes in @file{foo.elc}. | 1336 | Emacs Lisp Reference Manual}. |
| 1385 | 1337 | ||
| 1386 | @findex load-file | 1338 | @findex load-file |
| 1387 | To execute a file of Emacs Lisp code, use @kbd{M-x load-file}. This | 1339 | To @dfn{load} an Emacs Lisp file, type @kbd{M-x load-file}. This |
| 1388 | command reads a file name using the minibuffer and then executes the | 1340 | command reads a file name using the minibuffer, and executes the |
| 1389 | contents of that file as Lisp code. It is not necessary to visit the | 1341 | contents of that file as Emacs Lisp code. It is not necessary to |
| 1390 | file first; in any case, this command reads the file as found on disk, | 1342 | visit the file first; this command reads the file directly from disk, |
| 1391 | not text in an Emacs buffer. | 1343 | not from an existing Emacs buffer. |
| 1392 | 1344 | ||
| 1393 | @findex load | 1345 | @findex load |
| 1394 | @findex load-library | 1346 | @findex load-library |
| 1395 | Once a file of Lisp code is installed in the Emacs Lisp library | 1347 | @cindex load path for Emacs Lisp |
| 1396 | directories, users can load it using @kbd{M-x load-library}. Programs | 1348 | If an Emacs Lisp file is installed in the Emacs Lisp @dfn{load path} |
| 1397 | can load it by calling @code{load}, a more primitive function that is | 1349 | (defined below), you can load it by typing @kbd{M-x load-library}, |
| 1398 | similar but accepts some additional arguments. | 1350 | instead of using @kbd{M-x load-file}. The @kbd{M-x load-library} |
| 1399 | 1351 | command prompts for a @dfn{library name} rather than a file name; it | |
| 1400 | @kbd{M-x load-library} differs from @kbd{M-x load-file} in that it | 1352 | searches through each directory in the Emacs Lisp load path, trying to |
| 1401 | searches a sequence of directories and tries three file names in each | 1353 | find a file matching that library name. If the library name is |
| 1402 | directory. Suppose your argument is @var{lib}; the three names are | 1354 | @samp{@var{foo}}, it tries looking for files named |
| 1403 | @file{@var{lib}.elc}, @file{@var{lib}.el}, and lastly just | 1355 | @file{@var{foo}.elc}, @file{@var{foo}.el}, and lastly just |
| 1404 | @file{@var{lib}}. If @file{@var{lib}.elc} exists, it is by convention | 1356 | @file{@var{foo}}; the first one found is loaded. This command prefers |
| 1405 | the result of compiling @file{@var{lib}.el}; it is better to load the | 1357 | @file{.elc} files over @file{.el} files because compiled files load |
| 1406 | compiled file, since it will load and run faster. | 1358 | and run faster. If it finds that @file{@var{lib}.el} is newer than |
| 1407 | 1359 | @file{@var{lib}.elc}, it issues a warning, in case someone made | |
| 1408 | If @code{load-library} finds that @file{@var{lib}.el} is newer than | 1360 | changes to the @file{.el} file and forgot to recompile it, but loads |
| 1409 | @file{@var{lib}.elc} file, it issues a warning, because it's likely | 1361 | the @file{.elc} file anyway. (Due to this behavior, you can save |
| 1410 | that somebody made changes to the @file{.el} file and forgot to | 1362 | unfinished edits to Emacs Lisp source files, and not recompile until |
| 1411 | recompile it. Nonetheless, it loads @file{@var{lib}.elc}. This is | 1363 | your changes are ready for use.) |
| 1412 | because people often leave unfinished edits the source file, and don't | 1364 | |
| 1413 | recompile it until they think it is ready to use. | 1365 | Emacs Lisp programs usually load Emacs Lisp files using the |
| 1366 | @code{load} function. This is similar to @code{load-library}, but is | ||
| 1367 | lower-level and accepts additional arguments. @xref{How Programs Do | ||
| 1368 | Loading,,, elisp, the Emacs Lisp Reference Manual}. | ||
| 1414 | 1369 | ||
| 1415 | @vindex load-path | 1370 | @vindex load-path |
| 1416 | The variable @code{load-path} specifies the sequence of directories | 1371 | The Emacs Lisp load path is specified by the variable |
| 1417 | searched by @kbd{M-x load-library}. Its value should be a list of | 1372 | @code{load-path}. Its value should be a list of directory names |
| 1418 | strings that are directory names; in addition, @code{nil} in this list | 1373 | (strings). These directories are searched, in the specified order, by |
| 1419 | stands for the current default directory. (Generally, it is not a | 1374 | the @kbd{M-x load-library} command, the lower-level @code{load} |
| 1420 | good idea to put @code{nil} in the list; if you find yourself wishing | 1375 | function, and other Emacs functions that find Emacs Lisp libraries. A |
| 1376 | list entry in @code{load-path} can also have the special value | ||
| 1377 | @code{nil}, which stands for the current default directory, but it is | ||
| 1378 | almost always a bad idea to use this. (If you find yourself wishing | ||
| 1421 | that @code{nil} were in the list, most likely what you really want is | 1379 | that @code{nil} were in the list, most likely what you really want is |
| 1422 | to do @kbd{M-x load-file} this once.) | 1380 | to use @kbd{M-x load-file}.) |
| 1423 | 1381 | ||
| 1424 | The default value of @code{load-path} is a list of directories where | 1382 | The default value of @code{load-path} is a list of directories where |
| 1425 | the Lisp code for Emacs itself is stored. If you have libraries of | 1383 | the Lisp code for Emacs itself is stored. If you have libraries of |
| 1426 | your own, put them in a single directory and add that directory to | 1384 | your own in another directory, you can add that directory to the load |
| 1427 | @code{load-path}, by adding a line like this to your init file | 1385 | path. Unlike most other variables described in this manual, |
| 1428 | (@pxref{Init File}): | 1386 | @code{load-path} cannot be changed via the Customize interface |
| 1387 | (@pxref{Easy Customization}), but you can add a directory to it by | ||
| 1388 | putting a line like this in your init file (@pxref{Init File}): | ||
| 1429 | 1389 | ||
| 1430 | @example | 1390 | @example |
| 1431 | (add-to-list 'load-path "/path/to/lisp/libraries") | 1391 | (add-to-list 'load-path "/path/to/my/lisp/library") |
| 1432 | @end example | 1392 | @end example |
| 1433 | 1393 | ||
| 1434 | @cindex autoload | 1394 | @cindex autoload |
| 1435 | Some commands are @dfn{autoloaded}: when you run them, Emacs will | 1395 | Some commands are @dfn{autoloaded}: when you run them, Emacs |
| 1436 | automatically load the associated library first. For instance, the | 1396 | automatically loads the associated library first. For instance, the |
| 1437 | @code{compile} and @code{compilation-mode} commands | 1397 | @kbd{M-x compile} command (@pxref{Compilation}) is autoloaded; if you |
| 1438 | (@pxref{Compilation}) are autoloaded; if you call either command, | 1398 | call it, Emacs automatically loads the @code{compile} library first. |
| 1439 | Emacs automatically loads the @code{compile} library. In contrast, | 1399 | In contrast, the command @kbd{M-x recompile} is not autoloaded, so it |
| 1440 | the command @code{recompile} is not autoloaded, so it is unavailable | 1400 | is unavailable until you load the @code{compile} library. |
| 1441 | until you load the @code{compile} library. | ||
| 1442 | 1401 | ||
| 1443 | @vindex load-dangerous-libraries | 1402 | @vindex load-dangerous-libraries |
| 1444 | @cindex Lisp files byte-compiled by XEmacs | 1403 | @cindex Lisp files byte-compiled by XEmacs |
| @@ -1449,38 +1408,35 @@ Emacs to crash. Set the variable @code{load-dangerous-libraries} to | |||
| 1449 | 1408 | ||
| 1450 | @node Lisp Eval | 1409 | @node Lisp Eval |
| 1451 | @section Evaluating Emacs Lisp Expressions | 1410 | @section Evaluating Emacs Lisp Expressions |
| 1452 | @cindex Emacs-Lisp mode | 1411 | @cindex Emacs Lisp mode |
| 1453 | @cindex mode, Emacs-Lisp | 1412 | @cindex mode, Emacs Lisp |
| 1454 | 1413 | ||
| 1455 | @findex emacs-lisp-mode | 1414 | @findex emacs-lisp-mode |
| 1456 | Lisp programs intended to be run in Emacs should be edited in | 1415 | Emacs Lisp mode is the major mode for editing Emacs Lisp. Its mode |
| 1457 | Emacs-Lisp mode; this happens automatically for file names ending in | 1416 | command is @kbd{M-x emacs-lisp-mode}. |
| 1458 | @file{.el}. By contrast, Lisp mode itself is used for editing Lisp | ||
| 1459 | programs intended for other Lisp systems. To switch to Emacs-Lisp mode | ||
| 1460 | explicitly, use the command @kbd{M-x emacs-lisp-mode}. | ||
| 1461 | |||
| 1462 | For testing of Lisp programs to run in Emacs, it is often useful to | ||
| 1463 | evaluate part of the program as it is found in the Emacs buffer. For | ||
| 1464 | example, after changing the text of a Lisp function definition, | ||
| 1465 | evaluating the definition installs the change for future calls to the | ||
| 1466 | function. Evaluation of Lisp expressions is also useful in any kind of | ||
| 1467 | editing, for invoking noninteractive functions (functions that are | ||
| 1468 | not commands). | ||
| 1469 | 1417 | ||
| 1470 | @table @kbd | 1418 | Emacs provides several commands for evaluating Emacs Lisp |
| 1471 | @item M-: | 1419 | expressions. You can use these commands in Emacs Lisp mode, to test |
| 1472 | Read a single Lisp expression in the minibuffer, evaluate it, and print | 1420 | your Emacs Lisp code as it is being written. For example, after |
| 1473 | the value in the echo area (@code{eval-expression}). | 1421 | re-writing a function, you can evaluate the function definition to |
| 1474 | @item C-x C-e | 1422 | make it take effect for subsequent function calls. These commands are |
| 1475 | Evaluate the Lisp expression before point, and print the value in the | 1423 | also available globally, and can be used outside Emacs Lisp mode. |
| 1476 | echo area (@code{eval-last-sexp}). | 1424 | |
| 1477 | @item C-M-x | 1425 | @table @asis |
| 1426 | @item @kbd{M-:} | ||
| 1427 | Read a single Emacs Lisp expression in the minibuffer, evaluate it, | ||
| 1428 | and print the value in the echo area (@code{eval-expression}). | ||
| 1429 | @item @kbd{C-x C-e} | ||
| 1430 | Evaluate the Emacs Lisp expression before point, and print the value | ||
| 1431 | in the echo area (@code{eval-last-sexp}). | ||
| 1432 | @item @kbd{C-M-x} @r{(in Emacs Lisp mode)} | ||
| 1433 | @itemx @kbd{M-x eval-defun} | ||
| 1478 | Evaluate the defun containing or after point, and print the value in | 1434 | Evaluate the defun containing or after point, and print the value in |
| 1479 | the echo area (@code{eval-defun}). | 1435 | the echo area (@code{eval-defun}). |
| 1480 | @item M-x eval-region | 1436 | @item @kbd{M-x eval-region} |
| 1481 | Evaluate all the Lisp expressions in the region. | 1437 | Evaluate all the Emacs Lisp expressions in the region. |
| 1482 | @item M-x eval-buffer | 1438 | @item @kbd{M-x eval-buffer} |
| 1483 | Evaluate all the Lisp expressions in the buffer. | 1439 | Evaluate all the Emacs Lisp expressions in the buffer. |
| 1484 | @end table | 1440 | @end table |
| 1485 | 1441 | ||
| 1486 | @ifinfo | 1442 | @ifinfo |
| @@ -1492,150 +1448,144 @@ Evaluate all the Lisp expressions in the buffer. | |||
| 1492 | @kindex M-: | 1448 | @kindex M-: |
| 1493 | @end ifnotinfo | 1449 | @end ifnotinfo |
| 1494 | @findex eval-expression | 1450 | @findex eval-expression |
| 1495 | @kbd{M-:} (@code{eval-expression}) is the most basic command for evaluating | 1451 | @kbd{M-:} (@code{eval-expression}) reads an expression using the |
| 1496 | a Lisp expression interactively. It reads the expression using the | 1452 | minibuffer, and evaluates it. (Before evaluating the expression, the |
| 1497 | minibuffer, so you can execute any expression on a buffer regardless of | 1453 | current buffer switches back to the buffer that was current when you |
| 1498 | what the buffer contains. When the expression is evaluated, the current | 1454 | typed @kbd{M-:}, not the minibuffer into which you typed the |
| 1499 | buffer is once again the buffer that was current when @kbd{M-:} was | 1455 | expression.) |
| 1500 | typed. | ||
| 1501 | |||
| 1502 | @kindex C-M-x @r{(Emacs-Lisp mode)} | ||
| 1503 | @findex eval-defun | ||
| 1504 | In Emacs-Lisp mode, the key @kbd{C-M-x} is bound to the command | ||
| 1505 | @code{eval-defun}, which parses the defun containing or following point | ||
| 1506 | as a Lisp expression and evaluates it. The value is printed in the echo | ||
| 1507 | area. This command is convenient for installing in the Lisp environment | ||
| 1508 | changes that you have just made in the text of a function definition. | ||
| 1509 | |||
| 1510 | @kbd{C-M-x} treats @code{defvar} expressions specially. Normally, | ||
| 1511 | evaluating a @code{defvar} expression does nothing if the variable it | ||
| 1512 | defines already has a value. But @kbd{C-M-x} unconditionally resets the | ||
| 1513 | variable to the initial value specified in the @code{defvar} expression. | ||
| 1514 | @code{defcustom} expressions are treated similarly. | ||
| 1515 | This special feature is convenient for debugging Lisp programs. | ||
| 1516 | Typing @kbd{C-M-x} on a @code{defface} expression reinitializes | ||
| 1517 | the face according to the @code{defface} specification. | ||
| 1518 | 1456 | ||
| 1519 | @kindex C-x C-e | 1457 | @kindex C-x C-e |
| 1520 | @findex eval-last-sexp | 1458 | @findex eval-last-sexp |
| 1521 | The command @kbd{C-x C-e} (@code{eval-last-sexp}) evaluates the Lisp | 1459 | The command @kbd{C-x C-e} (@code{eval-last-sexp}) evaluates the |
| 1522 | expression preceding point in the buffer, and displays the value in the | 1460 | Emacs Lisp expression preceding point in the buffer, and displays the |
| 1523 | echo area. It is available in all major modes, not just Emacs-Lisp | 1461 | value in the echo area. When the result of an evaluation is an |
| 1524 | mode. It does not treat @code{defvar} specially. | 1462 | integer, you can type @kbd{C-x C-e} a second time to display the value |
| 1525 | 1463 | of the integer result in additional formats (octal, hexadecimal, and | |
| 1526 | When the result of an evaluation is an integer, you can type | 1464 | character). |
| 1527 | @kbd{C-x C-e} a second time to display the value of the integer result | 1465 | |
| 1528 | in additional formats (octal, hexadecimal, and character). | 1466 | If @kbd{M-:} or @kbd{C-x C-e} is given a prefix argument, it inserts |
| 1529 | 1467 | the value into the current buffer at point, rather than displaying it | |
| 1530 | If @kbd{C-x C-e}, or @kbd{M-:} is given a numeric argument, it | 1468 | in the echo area. The argument's value does not matter. |
| 1531 | inserts the value into the current buffer at point, rather than | 1469 | |
| 1532 | displaying it in the echo area. The argument's value does not matter. | 1470 | @kindex C-M-x @r{(Emacs Lisp mode)} |
| 1533 | @kbd{C-M-x} with a numeric argument instruments the function | 1471 | @findex eval-defun |
| 1534 | definition for Edebug (@pxref{Instrumenting, Instrumenting for Edebug,, elisp, the Emacs Lisp Reference Manual}). | 1472 | The @code{eval-defun} command is bound to @kbd{C-M-x} in Emacs Lisp |
| 1473 | mode. It evaluates the top-level Lisp expression containing or | ||
| 1474 | following point, and prints the value in the echo area. In this | ||
| 1475 | context, a top-level expression is referred to as a ``defun'', but it | ||
| 1476 | need not be an actual @code{defun} (function definition). In | ||
| 1477 | particular, this command treats @code{defvar} expressions specially. | ||
| 1478 | Normally, evaluating a @code{defvar} expression does nothing if the | ||
| 1479 | variable it defines already has a value. But this command | ||
| 1480 | unconditionally resets the variable to the initial value specified by | ||
| 1481 | the @code{defvar}; this is convenient for debugging Emacs Lisp | ||
| 1482 | programs. @code{defcustom} and @code{defface} expressions are treated | ||
| 1483 | similarly. Note that the other commands documented in this section do | ||
| 1484 | not have this special feature. | ||
| 1485 | |||
| 1486 | With a prefix argument, @kbd{C-M-x} instruments the function | ||
| 1487 | definition for Edebug, the Emacs Lisp Debugger. @xref{Instrumenting, | ||
| 1488 | Instrumenting for Edebug,, elisp, the Emacs Lisp Reference Manual}. | ||
| 1535 | 1489 | ||
| 1536 | @findex eval-region | 1490 | @findex eval-region |
| 1537 | @findex eval-buffer | 1491 | @findex eval-buffer |
| 1538 | The most general command for evaluating Lisp expressions from a buffer | 1492 | The command @kbd{M-x eval-region} parses the text of the region as |
| 1539 | is @code{eval-region}. @kbd{M-x eval-region} parses the text of the | 1493 | one or more Lisp expressions, evaluating them one by one. @kbd{M-x |
| 1540 | region as one or more Lisp expressions, evaluating them one by one. | 1494 | eval-buffer} is similar but evaluates the entire buffer. |
| 1541 | @kbd{M-x eval-buffer} is similar but evaluates the entire | ||
| 1542 | buffer. This is a reasonable way to install the contents of a file of | ||
| 1543 | Lisp code that you are ready to test. Later, as you find bugs and | ||
| 1544 | change individual functions, use @kbd{C-M-x} on each function that you | ||
| 1545 | change. This keeps the Lisp world in step with the source file. | ||
| 1546 | 1495 | ||
| 1547 | @vindex eval-expression-print-level | 1496 | @vindex eval-expression-print-level |
| 1548 | @vindex eval-expression-print-length | 1497 | @vindex eval-expression-print-length |
| 1549 | @vindex eval-expression-debug-on-error | 1498 | @vindex eval-expression-debug-on-error |
| 1550 | The two customizable variables @code{eval-expression-print-level} and | 1499 | The customizable variables @code{eval-expression-print-level} and |
| 1551 | @code{eval-expression-print-length} control the maximum depth and length | 1500 | @code{eval-expression-print-length} control the maximum depth and |
| 1552 | of lists to print in the result of the evaluation commands before | 1501 | length of lists to print in the result of the evaluation commands |
| 1553 | abbreviating them. @code{eval-expression-debug-on-error} controls | 1502 | before abbreviating them. @code{eval-expression-debug-on-error} |
| 1554 | whether evaluation errors invoke the debugger when these commands are | 1503 | controls whether evaluation errors invoke the debugger when these |
| 1555 | used; its default is @code{t}. | 1504 | commands are used; its default is @code{t}. |
| 1556 | 1505 | ||
| 1557 | @node Lisp Interaction | 1506 | @node Lisp Interaction |
| 1558 | @section Lisp Interaction Buffers | 1507 | @section Lisp Interaction Buffers |
| 1559 | 1508 | ||
| 1509 | @findex lisp-interaction-mode | ||
| 1560 | When Emacs starts up, it contains a buffer named @samp{*scratch*}, | 1510 | When Emacs starts up, it contains a buffer named @samp{*scratch*}, |
| 1561 | which is provided for evaluating Lisp expressions interactively inside | 1511 | which is provided for evaluating Emacs Lisp expressions interactively. |
| 1562 | Emacs. Its major mode is Lisp Interaction mode. | 1512 | Its major mode is Lisp Interaction mode. You can also enable Lisp |
| 1513 | Interaction mode by typing @kbd{M-x lisp-interaction-mode}. | ||
| 1563 | 1514 | ||
| 1564 | @findex eval-print-last-sexp | 1515 | @findex eval-print-last-sexp |
| 1565 | @kindex C-j @r{(Lisp Interaction mode)} | 1516 | @kindex C-j @r{(Lisp Interaction mode)} |
| 1566 | The simplest way to use the @samp{*scratch*} buffer is to insert | 1517 | In the @samp{*scratch*} buffer, and other Lisp Interaction mode |
| 1567 | Lisp expressions and type @kbd{C-j} (@code{eval-print-last-sexp}) | 1518 | buffers, @kbd{C-j} (@code{eval-print-last-sexp}) evaluates the Lisp |
| 1568 | after each expression. This command reads the Lisp expression before | 1519 | expression before point, and inserts the value at point. Thus, as you |
| 1569 | point, evaluates it, and inserts the value in printed representation | 1520 | type expressions into the buffer followed by @kbd{C-j} after each |
| 1570 | before point. The result is a complete typescript of the expressions | 1521 | expression, the buffer records a transcript of the evaluated |
| 1571 | you have evaluated and their values. | 1522 | expressions and their values. All other commands in Lisp Interaction |
| 1523 | mode are the same as in Emacs Lisp mode. | ||
| 1572 | 1524 | ||
| 1573 | @vindex initial-scratch-message | 1525 | @vindex initial-scratch-message |
| 1574 | At startup, the @samp{*scratch*} buffer contains a short message, in | 1526 | At startup, the @samp{*scratch*} buffer contains a short message, in |
| 1575 | the form of a Lisp comment, that explains what it is for. This | 1527 | the form of a Lisp comment, that explains what it is for. This |
| 1576 | message is controlled by the variable @code{initial-scratch-message}, | 1528 | message is controlled by the variable @code{initial-scratch-message}, |
| 1577 | which should be either a string or @code{nil}. If you set it to the | 1529 | which should be either a string, or @code{nil} (which means to |
| 1578 | empty string, or @code{nil}, the initial message is suppressed. | 1530 | suppress the message). |
| 1579 | |||
| 1580 | @findex lisp-interaction-mode | ||
| 1581 | All other commands in Lisp Interaction mode are the same as in Emacs | ||
| 1582 | Lisp mode. You can enable Lisp Interaction mode by typing @kbd{M-x | ||
| 1583 | lisp-interaction-mode}. | ||
| 1584 | 1531 | ||
| 1585 | @findex ielm | 1532 | @findex ielm |
| 1586 | An alternative way of evaluating Emacs Lisp expressions interactively | 1533 | An alternative way of evaluating Emacs Lisp expressions |
| 1587 | is to use Inferior Emacs-Lisp mode, which provides an interface rather | 1534 | interactively is to use Inferior Emacs Lisp mode, which provides an |
| 1588 | like Shell mode (@pxref{Shell Mode}) for evaluating Emacs Lisp | 1535 | interface rather like Shell mode (@pxref{Shell Mode}) for evaluating |
| 1589 | expressions. Type @kbd{M-x ielm} to create an @samp{*ielm*} buffer | 1536 | Emacs Lisp expressions. Type @kbd{M-x ielm} to create an |
| 1590 | which uses this mode. For more information see that command's | 1537 | @samp{*ielm*} buffer which uses this mode. For more information, see |
| 1591 | documentation. | 1538 | that command's documentation. |
| 1592 | 1539 | ||
| 1593 | @node External Lisp | 1540 | @node External Lisp |
| 1594 | @section Running an External Lisp | 1541 | @section Running an External Lisp |
| 1542 | @cindex Lisp mode | ||
| 1543 | @cindex mode, Lisp | ||
| 1544 | @cindex Common Lisp | ||
| 1595 | 1545 | ||
| 1596 | Emacs has facilities for running programs in other Lisp systems. You can | 1546 | Lisp mode is the major mode for editing programs written in |
| 1597 | run a Lisp process as an inferior of Emacs, and pass expressions to it to | 1547 | general-purpose Lisp dialects, such as Common Lisp. Its mode command |
| 1598 | be evaluated. You can also pass changed function definitions directly from | 1548 | is @kbd{M-x lisp-mode}. Emacs uses Lisp mode automatically for files |
| 1599 | the Emacs buffers in which you edit the Lisp programs to the inferior Lisp | 1549 | whose names end in @file{.l}, @file{.lsp}, or @file{.lisp}. |
| 1600 | process. | ||
| 1601 | 1550 | ||
| 1602 | @findex run-lisp | 1551 | @findex run-lisp |
| 1603 | @vindex inferior-lisp-program | 1552 | @vindex inferior-lisp-program |
| 1604 | @kindex C-x C-z | 1553 | @kindex C-x C-z |
| 1605 | To run an inferior Lisp process, type @kbd{M-x run-lisp}. This runs | 1554 | You can run an external Lisp session as a subprocess or |
| 1606 | the program named @code{lisp}, the same program you would run by typing | 1555 | @dfn{inferior process} of Emacs, and pass expressions to it to be |
| 1607 | @code{lisp} as a shell command, with both input and output going through | 1556 | evaluated. To begin an external Lisp session, type @kbd{M-x |
| 1608 | an Emacs buffer named @samp{*lisp*}. That is to say, any ``terminal | 1557 | run-lisp}. This runs the program named @command{lisp}, and sets it up |
| 1609 | output'' from Lisp will go into the buffer, advancing point, and any | 1558 | so that both input and output go through an Emacs buffer named |
| 1610 | ``terminal input'' for Lisp comes from text in the buffer. (You can | 1559 | @samp{*inferior-lisp*}. To change the name of the Lisp program run by |
| 1611 | change the name of the Lisp executable file by setting the variable | 1560 | @kbd{M-x run-lisp}, change the variable @code{inferior-lisp-program}. |
| 1612 | @code{inferior-lisp-program}.) | 1561 | |
| 1613 | 1562 | The major mode for the @samp{*lisp*} buffer is Inferior Lisp mode, | |
| 1614 | To give input to Lisp, go to the end of the buffer and type the input, | 1563 | which combines the characteristics of Lisp mode and Shell mode |
| 1615 | terminated by @key{RET}. The @samp{*lisp*} buffer is in Inferior Lisp | 1564 | (@pxref{Shell Mode}). To send input to the Lisp session, go to the |
| 1616 | mode, which combines the special characteristics of Lisp mode with most | 1565 | end of the @samp{*lisp*} buffer and type the input, followed by |
| 1617 | of the features of Shell mode (@pxref{Shell Mode}). The definition of | 1566 | @key{RET}. Terminal output from the Lisp session is automatically |
| 1618 | @key{RET} to send a line to a subprocess is one of the features of Shell | 1567 | inserted in the buffer. |
| 1619 | mode. | ||
| 1620 | |||
| 1621 | @findex lisp-mode | ||
| 1622 | For the source files of programs to run in external Lisps, use Lisp | ||
| 1623 | mode. You can switch to this mode with @kbd{M-x lisp-mode}, and it is | ||
| 1624 | used automatically for files whose names end in @file{.l}, | ||
| 1625 | @file{.lsp}, or @file{.lisp}. | ||
| 1626 | 1568 | ||
| 1627 | @kindex C-M-x @r{(Lisp mode)} | 1569 | @kindex C-M-x @r{(Lisp mode)} |
| 1628 | @findex lisp-eval-defun | 1570 | @findex lisp-eval-defun |
| 1629 | When you edit a function in a Lisp program you are running, the easiest | 1571 | When you edit a Lisp program in Lisp mode, you can type @kbd{C-M-x} |
| 1630 | way to send the changed definition to the inferior Lisp process is the key | 1572 | (@code{lisp-eval-defun}) to send an expression from the Lisp mode |
| 1631 | @kbd{C-M-x}. In Lisp mode, this runs the function @code{lisp-eval-defun}, | 1573 | buffer to a Lisp session that you had started with @kbd{M-x run-lisp}. |
| 1632 | which finds the defun around or following point and sends it as input to | 1574 | The expression sent is the top-level Lisp expression at or following |
| 1633 | the Lisp process. (Emacs can send input to any inferior process regardless | 1575 | point. The resulting value goes as usual into the |
| 1634 | of what buffer is current.) | 1576 | @samp{*inferior-lisp*} buffer. Note that the effect of @kbd{C-M-x} in |
| 1635 | 1577 | Lisp mode is thus very similar to its effect in Emacs Lisp mode | |
| 1636 | Contrast the meanings of @kbd{C-M-x} in Lisp mode (for editing | 1578 | (@pxref{Lisp Eval}), except that the expression is sent to a different |
| 1637 | programs to be run in another Lisp system) and Emacs-Lisp mode (for | 1579 | Lisp environment instead of being evaluated in Emacs. |
| 1638 | editing Lisp programs to be run in Emacs; see @pxref{Lisp Eval}): in | 1580 | |
| 1639 | both modes it has the effect of installing the function definition | 1581 | @findex scheme-mode |
| 1640 | that point is in, but the way of doing so is different according to | 1582 | @findex run-scheme |
| 1641 | where the relevant Lisp environment is found. | 1583 | @cindex Scheme mode |
| 1584 | @cindex mode, Scheme | ||
| 1585 | @kindex C-M-x @r{(Scheme mode)} | ||
| 1586 | The facilities for editing Scheme code, and for sending expressions | ||
| 1587 | to a Scheme subprocess, are very similar. Scheme source files are | ||
| 1588 | edited in Scheme mode, which can be explicitly enabled with @kbd{M-x | ||
| 1589 | scheme-mode}. You can initiate a Scheme session by typing @kbd{M-x | ||
| 1590 | run-scheme} (the buffer for interacting with Scheme is named | ||
| 1591 | @samp{*scheme*}), and send expressions to it by typing @kbd{C-M-x}. | ||
diff --git a/doc/emacs/cal-xtra.texi b/doc/emacs/cal-xtra.texi index 6d20c92a6d9..2d2b32943f5 100644 --- a/doc/emacs/cal-xtra.texi +++ b/doc/emacs/cal-xtra.texi | |||
| @@ -41,12 +41,12 @@ customize the variables @code{calendar-intermonth-header} and | |||
| 41 | 41 | ||
| 42 | @vindex calendar-holiday-marker | 42 | @vindex calendar-holiday-marker |
| 43 | @vindex diary-entry-marker | 43 | @vindex diary-entry-marker |
| 44 | @vindex calenday-today-marker | 44 | @vindex calendar-today-marker |
| 45 | The variable @code{calendar-holiday-marker} specifies how to mark a | 45 | The variable @code{calendar-holiday-marker} specifies how to mark a |
| 46 | date as being a holiday. Its value may be a single-character string to | 46 | date as being a holiday. Its value may be a single-character string to |
| 47 | insert next to the date, or a face name to use for displaying the date. | 47 | insert next to the date, or a face name to use for displaying the date. |
| 48 | Likewise, the variable @code{diary-entry-marker} specifies how to mark a | 48 | Likewise, the variable @code{diary-entry-marker} specifies how to mark a |
| 49 | date that has diary entries, and @code{calenday-today-marker} is used by | 49 | date that has diary entries, and @code{calendar-today-marker} is used by |
| 50 | the function @code{calendar-mark-today} to mark today's date. By | 50 | the function @code{calendar-mark-today} to mark today's date. By |
| 51 | default, the calendar uses faces named @code{holiday}, @code{diary}, and | 51 | default, the calendar uses faces named @code{holiday}, @code{diary}, and |
| 52 | @code{calendar-today} for these purposes. | 52 | @code{calendar-today} for these purposes. |
diff --git a/doc/emacs/dired-xtra.texi b/doc/emacs/dired-xtra.texi index efb05226ba8..52ccccce58c 100644 --- a/doc/emacs/dired-xtra.texi +++ b/doc/emacs/dired-xtra.texi | |||
| @@ -7,24 +7,24 @@ | |||
| 7 | @node Subdir Switches | 7 | @node Subdir Switches |
| 8 | @section Subdirectory Switches in Dired | 8 | @section Subdirectory Switches in Dired |
| 9 | 9 | ||
| 10 | You can insert subdirectories with specified @code{ls} switches in | 10 | You can insert subdirectories with specified @command{ls} switches in |
| 11 | Dired buffers using @kbd{C-u i}. You can change the @code{ls} | 11 | Dired buffers using @kbd{C-u i}. You can change the @command{ls} |
| 12 | switches of an already inserted subdirectory using @kbd{C-u l}. | 12 | switches of an already inserted subdirectory using @kbd{C-u l}. |
| 13 | 13 | ||
| 14 | Dired preserves the switches if you revert the buffer. Deleting a | 14 | Dired preserves the switches if you revert the buffer. Deleting a |
| 15 | subdirectory forgets about its switches. | 15 | subdirectory forgets about its switches. |
| 16 | 16 | ||
| 17 | Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u}) | 17 | Using @code{dired-undo} (@pxref{Marks vs Flags}) to reinsert or delete |
| 18 | to reinsert or delete subdirectories that were inserted with explicit | 18 | subdirectories that were inserted with explicit switches can bypass |
| 19 | switches can bypass Dired's machinery for remembering (or forgetting) | 19 | Dired's machinery for remembering (or forgetting) switches. Deleting |
| 20 | switches. Deleting a subdirectory using @code{dired-undo} does not | 20 | a subdirectory using @code{dired-undo} does not forget its switches. |
| 21 | forget its switches. When later reinserted using @kbd{i}, it will be | 21 | When later reinserted using @kbd{i}, it will be reinserted using its |
| 22 | reinserted using its old switches. Using @code{dired-undo} to | 22 | old switches. Using @code{dired-undo} to reinsert a subdirectory that |
| 23 | reinsert a subdirectory that was deleted using the regular | 23 | was deleted using the regular Dired commands (not @code{dired-undo}) |
| 24 | Dired commands (not @code{dired-undo}) will originally insert it with | 24 | will originally insert it with its old switches. Reverting the |
| 25 | its old switches. Reverting the buffer, however, will relist it using | 25 | buffer, however, will relist it using the buffer's default switches. |
| 26 | the buffer's default switches. If any of this yields problems, you | 26 | If any of this yields problems, you can easily correct the situation |
| 27 | can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}. | 27 | using @kbd{C-u i} or @kbd{C-u l}. |
| 28 | 28 | ||
| 29 | Dired does not remember the @code{R} switch. Inserting a subdirectory | 29 | Dired does not remember the @code{R} switch. Inserting a subdirectory |
| 30 | with switches that include the @code{R} switch is equivalent to | 30 | with switches that include the @code{R} switch is equivalent to |
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index b6ed47fdb3f..5097565830e 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi | |||
| @@ -73,32 +73,45 @@ completion commands can be used in the minibuffer; in particular, | |||
| 73 | a directory name. | 73 | a directory name. |
| 74 | 74 | ||
| 75 | The variable @code{dired-listing-switches} specifies the options to | 75 | The variable @code{dired-listing-switches} specifies the options to |
| 76 | give to @code{ls} for listing the directory; this string @emph{must} | 76 | give to @command{ls} for listing the directory; this string |
| 77 | contain @samp{-l}. If you use a prefix argument with the @code{dired} | 77 | @emph{must} contain @samp{-l}. If you use a prefix argument with the |
| 78 | command, you can specify the @code{ls} switches with the minibuffer | 78 | @code{dired} command, you can specify the @command{ls} switches with the |
| 79 | before you enter the directory specification. No matter how they are | 79 | minibuffer before you enter the directory specification. No matter |
| 80 | specified, the @code{ls} switches can include short options (that is, | 80 | how they are specified, the @command{ls} switches can include short |
| 81 | single characters) requiring no arguments, and long options (starting | 81 | options (that is, single characters) requiring no arguments, and long |
| 82 | with @samp{--}) whose arguments are specified with @samp{=}. | 82 | options (starting with @samp{--}) whose arguments are specified with |
| 83 | @samp{=}. | ||
| 83 | 84 | ||
| 84 | @vindex dired-use-ls-dired | 85 | @vindex dired-use-ls-dired |
| 85 | Note that Dired automatically adds the option @samp{--dired}, if | 86 | If your @command{ls} program supports the @samp{--dired} option, |
| 86 | your @code{ls} program supports it, unless you explicitly set | 87 | Dired automatically passes it that option; this causes @command{ls} to |
| 87 | the variable @code{dired-use-ls-dired} to @code{nil}. Without this | 88 | emit special escape sequences for certain unusual file names, without |
| 88 | option, Dired will have trouble parsing some @samp{unusual} file-names. | 89 | which Dired will not be able to parse those names. The first time you |
| 89 | See the documentation of @code{dired-use-ls-dired} for more details. | 90 | run Dired in an Emacs session, it checks whether @command{ls} supports |
| 90 | 91 | the @samp{--dired} option by calling it once with that option. If the | |
| 91 | On MS-Windows and MS-DOS systems, Emacs @emph{emulates} @code{ls}; | 92 | exit code is 0, Dired will subsequently use the @samp{--dired} option; |
| 92 | see @ref{ls in Lisp}, for options and peculiarities of that emulation. | 93 | otherwise it will not. You can inhibit this check by customizing the |
| 94 | variable @code{dired-use-ls-dired}. The value @code{unspecified} (the | ||
| 95 | default) means to perform the check; any other non-@code{nil} value | ||
| 96 | means to use the @samp{--dired} option; and @code{nil} means not to | ||
| 97 | use the @samp{--dired} option. | ||
| 98 | |||
| 99 | On MS-Windows and MS-DOS systems, Emacs emulates @command{ls}. | ||
| 100 | @xref{ls in Lisp}, for options and peculiarities of this emulation. | ||
| 93 | 101 | ||
| 94 | @findex dired-other-window | 102 | @findex dired-other-window |
| 95 | @kindex C-x 4 d | 103 | @kindex C-x 4 d |
| 96 | @findex dired-other-frame | 104 | @findex dired-other-frame |
| 97 | @kindex C-x 5 d | 105 | @kindex C-x 5 d |
| 98 | To display the Dired buffer in another window rather than in the | 106 | To display the Dired buffer in another window, use @kbd{C-x 4 d} |
| 99 | selected window, use @kbd{C-x 4 d} (@code{dired-other-window}) instead | 107 | (@code{dired-other-window}) instead of @kbd{C-x d}. @kbd{C-x 5 d} |
| 100 | of @kbd{C-x d}. @kbd{C-x 5 d} (@code{dired-other-frame}) uses a | 108 | (@code{dired-other-frame}) displays the Dired buffer in a separate |
| 101 | separate frame to display the Dired buffer. | 109 | frame. |
| 110 | |||
| 111 | @kindex q @r{(Dired)} | ||
| 112 | @findex quit-window | ||
| 113 | Typing @kbd{q} (@code{quit-window}) buries the Dired buffer, and | ||
| 114 | deletes its window if the window was created just for that buffer. | ||
| 102 | 115 | ||
| 103 | @node Dired Navigation | 116 | @node Dired Navigation |
| 104 | @section Navigation in the Dired Buffer | 117 | @section Navigation in the Dired Buffer |
| @@ -124,7 +137,11 @@ minibuffer, and moves point to the line in the Dired buffer describing | |||
| 124 | that file. | 137 | that file. |
| 125 | 138 | ||
| 126 | @cindex searching Dired buffers | 139 | @cindex searching Dired buffers |
| 140 | @findex dired-isearch-filenames | ||
| 127 | @vindex dired-isearch-filenames | 141 | @vindex dired-isearch-filenames |
| 142 | @findex dired-isearch-filenames-regexp | ||
| 143 | @kindex M-s f C-s @r{(Dired)} | ||
| 144 | @kindex M-s f M-C-s @r{(Dired)} | ||
| 128 | @kbd{M-s f C-s} (@code{dired-isearch-filenames}) performs a forward | 145 | @kbd{M-s f C-s} (@code{dired-isearch-filenames}) performs a forward |
| 129 | incremental search in the Dired buffer, looking for matches only | 146 | incremental search in the Dired buffer, looking for matches only |
| 130 | amongst the file names and ignoring the rest of the text in the | 147 | amongst the file names and ignoring the rest of the text in the |
| @@ -331,18 +348,16 @@ another window, but do not select that window (@code{dired-display-file}). | |||
| 331 | @item Mouse-1 | 348 | @item Mouse-1 |
| 332 | @itemx Mouse-2 | 349 | @itemx Mouse-2 |
| 333 | @findex dired-mouse-find-file-other-window | 350 | @findex dired-mouse-find-file-other-window |
| 334 | Visit the file named by the line you click on | 351 | Visit the file whose name you clicked on |
| 335 | (@code{dired-mouse-find-file-other-window}). This uses another window | 352 | (@code{dired-mouse-find-file-other-window}). This uses another window |
| 336 | to display the file, like the @kbd{o} command. | 353 | to display the file, like the @kbd{o} command. |
| 337 | 354 | ||
| 338 | @item v | 355 | @item v |
| 339 | @kindex v @r{(Dired)} | 356 | @kindex v @r{(Dired)} |
| 340 | @findex dired-view-file | 357 | @findex dired-view-file |
| 341 | View the file described on the current line, using @kbd{M-x view-file} | 358 | View the file described on the current line, with View mode |
| 342 | (@code{dired-view-file}). Viewing a file with @code{view-file} is | 359 | (@code{dired-view-file}). View mode provides convenient commands to |
| 343 | like visiting it, but is slanted toward moving around in the file | 360 | navigate the buffer but forbids changing it; @xref{View Mode}. |
| 344 | conveniently and does not allow changing the file. @xref{Misc File | ||
| 345 | Ops, View File, Miscellaneous File Operations}. | ||
| 346 | 361 | ||
| 347 | @item ^ | 362 | @item ^ |
| 348 | @kindex ^ @r{(Dired)} | 363 | @kindex ^ @r{(Dired)} |
| @@ -520,9 +535,9 @@ the regular expression @var{regexp} | |||
| 520 | @kbd{% m}, except that it searches the file contents instead of the file | 535 | @kbd{% m}, except that it searches the file contents instead of the file |
| 521 | name. | 536 | name. |
| 522 | 537 | ||
| 523 | @item C-x u | 538 | @item C-/ |
| 539 | @itemx C-x u | ||
| 524 | @itemx C-_ | 540 | @itemx C-_ |
| 525 | @itemx C-/ | ||
| 526 | @kindex C-_ @r{(Dired)} | 541 | @kindex C-_ @r{(Dired)} |
| 527 | @findex dired-undo | 542 | @findex dired-undo |
| 528 | Undo changes in the Dired buffer, such as adding or removing | 543 | Undo changes in the Dired buffer, such as adding or removing |
| @@ -615,7 +630,7 @@ Like the other commands in this section, this command operates on the | |||
| 615 | Rename the specified files (@code{dired-do-rename}). If you rename a | 630 | Rename the specified files (@code{dired-do-rename}). If you rename a |
| 616 | single file, the argument @var{new} is the new name of the file. If | 631 | single file, the argument @var{new} is the new name of the file. If |
| 617 | you rename several files, the argument @var{new} is the directory into | 632 | you rename several files, the argument @var{new} is the directory into |
| 618 | which to move the files (this is like the shell command @code{mv}). | 633 | which to move the files (this is like the shell command @command{mv}). |
| 619 | 634 | ||
| 620 | Dired automatically changes the visited file name of buffers associated | 635 | Dired automatically changes the visited file name of buffers associated |
| 621 | with renamed files so that they refer to the new names. | 636 | with renamed files so that they refer to the new names. |
| @@ -625,7 +640,7 @@ with renamed files so that they refer to the new names. | |||
| 625 | @cindex hard links (in Dired) | 640 | @cindex hard links (in Dired) |
| 626 | @item H @var{new} @key{RET} | 641 | @item H @var{new} @key{RET} |
| 627 | Make hard links to the specified files (@code{dired-do-hardlink}). | 642 | Make hard links to the specified files (@code{dired-do-hardlink}). |
| 628 | This is like the shell command @code{ln}. The argument @var{new} is | 643 | This is like the shell command @command{ln}. The argument @var{new} is |
| 629 | the directory to make the links in, or (if making just one link) the | 644 | the directory to make the links in, or (if making just one link) the |
| 630 | name to give the link. | 645 | name to give the link. |
| 631 | 646 | ||
| @@ -642,9 +657,10 @@ link. | |||
| 642 | @kindex M @r{(Dired)} | 657 | @kindex M @r{(Dired)} |
| 643 | @cindex changing file permissions (in Dired) | 658 | @cindex changing file permissions (in Dired) |
| 644 | @item M @var{modespec} @key{RET} | 659 | @item M @var{modespec} @key{RET} |
| 645 | Change the mode (also called ``permission bits'') of the specified files | 660 | Change the mode (also called @dfn{permission bits}) of the specified |
| 646 | (@code{dired-do-chmod}). @var{modespec} can be in octal or symbolic | 661 | files (@code{dired-do-chmod}). @var{modespec} can be in octal or |
| 647 | notation like arguments handled by the @code{chmod} program. | 662 | symbolic notation, like arguments handled by the @command{chmod} |
| 663 | program. | ||
| 648 | 664 | ||
| 649 | @findex dired-do-chgrp | 665 | @findex dired-do-chgrp |
| 650 | @kindex G @r{(Dired)} | 666 | @kindex G @r{(Dired)} |
| @@ -663,8 +679,8 @@ this.) | |||
| 663 | 679 | ||
| 664 | @vindex dired-chown-program | 680 | @vindex dired-chown-program |
| 665 | The variable @code{dired-chown-program} specifies the name of the | 681 | The variable @code{dired-chown-program} specifies the name of the |
| 666 | program to use to do the work (different systems put @code{chown} in | 682 | program to use to do the work (different systems put @command{chown} |
| 667 | different places). | 683 | in different places). |
| 668 | 684 | ||
| 669 | @findex dired-do-touch | 685 | @findex dired-do-touch |
| 670 | @kindex T @r{(Dired)} | 686 | @kindex T @r{(Dired)} |
| @@ -952,17 +968,17 @@ The backup file is the first file given to @code{diff}. | |||
| 952 | @cindex subdirectories in Dired | 968 | @cindex subdirectories in Dired |
| 953 | @cindex expanding subdirectories in Dired | 969 | @cindex expanding subdirectories in Dired |
| 954 | 970 | ||
| 955 | A Dired buffer displays just one directory in the normal case; | 971 | A Dired buffer usually displays just one directory, but you can |
| 956 | but you can optionally include its subdirectories as well. | 972 | optionally include its subdirectories as well. |
| 957 | 973 | ||
| 958 | The simplest way to include multiple directories in one Dired buffer is | 974 | The simplest way to include multiple directories in one Dired buffer is |
| 959 | to specify the options @samp{-lR} for running @code{ls}. (If you give a | 975 | to specify the options @samp{-lR} for running @command{ls}. (If you give a |
| 960 | numeric argument when you run Dired, then you can specify these options | 976 | numeric argument when you run Dired, then you can specify these options |
| 961 | in the minibuffer.) That produces a recursive directory listing showing | 977 | in the minibuffer.) That produces a recursive directory listing showing |
| 962 | all subdirectories at all levels. | 978 | all subdirectories at all levels. |
| 963 | 979 | ||
| 964 | More often, you will want to show only specific subdirectories. You | 980 | More often, you will want to show only specific subdirectories. You |
| 965 | can do this with the @kbd{i} command: | 981 | can do this with @kbd{i} (@code{dired-maybe-insert-subdir}): |
| 966 | 982 | ||
| 967 | @table @kbd | 983 | @table @kbd |
| 968 | @findex dired-maybe-insert-subdir | 984 | @findex dired-maybe-insert-subdir |
| @@ -973,25 +989,27 @@ can do this with the @kbd{i} command: | |||
| 973 | Insert the contents of a subdirectory later in the buffer. | 989 | Insert the contents of a subdirectory later in the buffer. |
| 974 | @end table | 990 | @end table |
| 975 | 991 | ||
| 976 | Use the @kbd{i} (@code{dired-maybe-insert-subdir}) command on a line | 992 | @noindent |
| 977 | that describes a file which is a directory. It inserts the contents of | 993 | If you use this command on a line that describes a file which is a |
| 978 | that directory into the same Dired buffer, and moves there. Inserted | 994 | directory, it inserts the contents of that directory into the same |
| 979 | subdirectory contents follow the top-level directory of the Dired | 995 | Dired buffer, and moves there. Inserted subdirectory contents follow |
| 980 | buffer, just as they do in @samp{ls -lR} output. | 996 | the top-level directory of the Dired buffer, just as they do in |
| 981 | 997 | @samp{ls -lR} output. | |
| 982 | If the subdirectory's contents are already present in the buffer, the | 998 | |
| 983 | @kbd{i} command just moves to it. | 999 | If the subdirectory's contents are already present in the buffer, |
| 984 | 1000 | the @kbd{i} command just moves to it. | |
| 985 | In either case, @kbd{i} sets the Emacs mark before moving, so @kbd{C-u | 1001 | |
| 986 | C-@key{SPC}} takes you back to the old position in the buffer (the line | 1002 | In either case, @kbd{i} sets the Emacs mark before moving, so |
| 987 | describing that subdirectory). You can also use @samp{^} to return | 1003 | @kbd{C-u C-@key{SPC}} returns to your previous position in the Dired |
| 988 | to the parent directory in the same Dired buffer. | 1004 | buffer (@pxref{Setting Mark}). You can also use @samp{^} to return to |
| 989 | 1005 | the parent directory in the same Dired buffer (@pxref{Dired | |
| 990 | Use the @kbd{l} command (@code{dired-do-redisplay}) to update the | 1006 | Visiting}). |
| 991 | subdirectory's contents. Use @kbd{C-u k} on the subdirectory header | 1007 | |
| 992 | line to remove the subdirectory listing (@pxref{Dired Updating}). You | 1008 | Use the @kbd{l} command (@code{dired-do-redisplay}) to update the |
| 993 | can also hide and show inserted subdirectories (@pxref{Hiding | 1009 | subdirectory's contents, and use @kbd{C-u k} on the subdirectory |
| 994 | Subdirectories}). | 1010 | header line to remove the subdirectory listing (@pxref{Dired |
| 1011 | Updating}). You can also hide and show inserted subdirectories | ||
| 1012 | (@pxref{Hiding Subdirectories}). | ||
| 995 | 1013 | ||
| 996 | @ifnottex | 1014 | @ifnottex |
| 997 | @include dired-xtra.texi | 1015 | @include dired-xtra.texi |
| @@ -1209,10 +1227,10 @@ tell @command{find} what condition to test. To use this command, you | |||
| 1209 | need to know how to use @command{find}. | 1227 | need to know how to use @command{find}. |
| 1210 | 1228 | ||
| 1211 | @vindex find-ls-option | 1229 | @vindex find-ls-option |
| 1212 | The format of listing produced by these commands is controlled by the | 1230 | The format of listing produced by these commands is controlled by |
| 1213 | variable @code{find-ls-option}, whose default value specifies using | 1231 | the variable @code{find-ls-option}, whose default value specifies |
| 1214 | options @samp{-ld} for @code{ls}. If your listings are corrupted, you | 1232 | using options @samp{-ld} for @command{ls}. If your listings are |
| 1215 | may need to change the value of this variable. | 1233 | corrupted, you may need to change the value of this variable. |
| 1216 | 1234 | ||
| 1217 | @findex locate | 1235 | @findex locate |
| 1218 | @findex locate-with-filter | 1236 | @findex locate-with-filter |
| @@ -1338,10 +1356,14 @@ rotation is lossless, and uses an external utility called JpegTRAN. | |||
| 1338 | @kindex + @r{(Dired)} | 1356 | @kindex + @r{(Dired)} |
| 1339 | @findex dired-create-directory | 1357 | @findex dired-create-directory |
| 1340 | The command @kbd{+} (@code{dired-create-directory}) reads a | 1358 | The command @kbd{+} (@code{dired-create-directory}) reads a |
| 1341 | directory name, and creates the directory if it does not already | 1359 | directory name, and creates that directory. It signals an error if |
| 1342 | exist. | 1360 | the directory already exists. |
| 1343 | 1361 | ||
| 1344 | @cindex searching multiple files via Dired | 1362 | @cindex searching multiple files via Dired |
| 1363 | @kindex M-s a C-s @r{(Dired)} | ||
| 1364 | @kindex M-s a M-C-s @r{(Dired)} | ||
| 1365 | @findex dired-do-isearch | ||
| 1366 | @findex dired-do-isearch-regexp | ||
| 1345 | The command @kbd{M-s a C-s} (@code{dired-do-isearch}) begins a | 1367 | The command @kbd{M-s a C-s} (@code{dired-do-isearch}) begins a |
| 1346 | ``multi-file'' incremental search on the marked files. If a search | 1368 | ``multi-file'' incremental search on the marked files. If a search |
| 1347 | fails at the end of a file, typing @kbd{C-s} advances to the next | 1369 | fails at the end of a file, typing @kbd{C-s} advances to the next |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index aca3735ff03..7f703fbaad0 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -602,11 +602,8 @@ Editing Text-based Tables | |||
| 602 | * Table Recognition:: How to activate and deactivate tables. | 602 | * Table Recognition:: How to activate and deactivate tables. |
| 603 | * Cell Commands:: Cell-oriented commands in a table. | 603 | * Cell Commands:: Cell-oriented commands in a table. |
| 604 | * Cell Justification:: Justifying cell contents. | 604 | * Cell Justification:: Justifying cell contents. |
| 605 | * Row Commands:: Manipulating rows of table cell. | 605 | * Table Rows and Columns:: Inserting and deleting rows and columns. |
| 606 | * Column Commands:: Manipulating columns of table cell. | ||
| 607 | * Fixed Width Mode:: Fixing cell width. | ||
| 608 | * Table Conversion:: Converting between plain text and tables. | 606 | * Table Conversion:: Converting between plain text and tables. |
| 609 | * Measuring Tables:: Analyzing table dimension. | ||
| 610 | * Table Misc:: Table miscellany. | 607 | * Table Misc:: Table miscellany. |
| 611 | 608 | ||
| 612 | Editing Programs | 609 | Editing Programs |
| @@ -702,7 +699,7 @@ Compiling and Testing Programs | |||
| 702 | * Executing Lisp:: Various modes for editing Lisp programs, | 699 | * Executing Lisp:: Various modes for editing Lisp programs, |
| 703 | with different facilities for running | 700 | with different facilities for running |
| 704 | the Lisp programs. | 701 | the Lisp programs. |
| 705 | * Lisp Libraries:: Creating Lisp programs to run in Emacs. | 702 | * Lisp Libraries:: How Lisp programs are loaded into Emacs. |
| 706 | * Lisp Eval:: Executing a single Lisp expression in Emacs. | 703 | * Lisp Eval:: Executing a single Lisp expression in Emacs. |
| 707 | * Lisp Interaction:: Executing Lisp in an Emacs buffer. | 704 | * Lisp Interaction:: Executing Lisp in an Emacs buffer. |
| 708 | * External Lisp:: Communicating through Emacs with a separate Lisp. | 705 | * External Lisp:: Communicating through Emacs with a separate Lisp. |
| @@ -725,8 +722,7 @@ GDB Graphical Interface | |||
| 725 | * Breakpoints Buffer:: A breakpoint control panel. | 722 | * Breakpoints Buffer:: A breakpoint control panel. |
| 726 | * Threads Buffer:: Displays your threads. | 723 | * Threads Buffer:: Displays your threads. |
| 727 | * Stack Buffer:: Select a frame from the call stack. | 724 | * Stack Buffer:: Select a frame from the call stack. |
| 728 | * Other GDB Buffers:: Input/output, locals, registers, | 725 | * Other GDB Buffers:: Other buffers for controlling the GDB state. |
| 729 | assembler, threads and memory buffers. | ||
| 730 | * Watch Expressions:: Monitor variable values in the speedbar. | 726 | * Watch Expressions:: Monitor variable values in the speedbar. |
| 731 | * Multithreaded Debugging:: Debugging programs with several threads. | 727 | * Multithreaded Debugging:: Debugging programs with several threads. |
| 732 | 728 | ||
| @@ -745,15 +741,16 @@ Version Control | |||
| 745 | * VC Mode Line:: How the mode line shows version control status. | 741 | * VC Mode Line:: How the mode line shows version control status. |
| 746 | * Basic VC Editing:: How to edit a file under version control. | 742 | * Basic VC Editing:: How to edit a file under version control. |
| 747 | * Log Buffer:: Features available in log entry buffers. | 743 | * Log Buffer:: Features available in log entry buffers. |
| 744 | * Registering:: Putting a file under version control. | ||
| 748 | * Old Revisions:: Examining and comparing old versions. | 745 | * Old Revisions:: Examining and comparing old versions. |
| 749 | * Secondary VC Commands:: The commands used a little less frequently. | 746 | * VC Change Log:: Viewing the VC Change Log. |
| 747 | * VC Undo:: Canceling changes before or after committing. | ||
| 750 | * VC Directory Mode:: Listing files managed by version control. | 748 | * VC Directory Mode:: Listing files managed by version control. |
| 751 | * Branches:: Multiple lines of development. | 749 | * Branches:: Multiple lines of development. |
| 752 | * Remote Repositories:: Efficient access to remote CVS servers. | ||
| 753 | * Revision Tags:: Symbolic names for revisions. | 750 | * Revision Tags:: Symbolic names for revisions. |
| 754 | * Miscellaneous VC:: Various other commands and features of VC. | 751 | * Miscellaneous VC:: Various other commands and features of VC. |
| 755 | * Customizing VC:: Variables that change VC's behavior. | 752 | * Customizing VC:: Variables that change VC's behavior. |
| 756 | 753 | ||
| 757 | Introduction to Version Control | 754 | Introduction to Version Control |
| 758 | 755 | ||
| 759 | * Why Version Control?:: Understanding the problems it addresses. | 756 | * Why Version Control?:: Understanding the problems it addresses. |
| @@ -770,12 +767,6 @@ Basic Editing under Version Control | |||
| 770 | * VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. | 767 | * VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. |
| 771 | * Advanced C-x v v:: Advanced features available with a prefix argument. | 768 | * Advanced C-x v v:: Advanced features available with a prefix argument. |
| 772 | 769 | ||
| 773 | The Secondary Commands of VC | ||
| 774 | |||
| 775 | * Registering:: Putting a file under version control. | ||
| 776 | * VC Change Log:: Viewing the VC Change Log. | ||
| 777 | * VC Undo:: Canceling changes before or after check-in. | ||
| 778 | |||
| 779 | VC Directory Mode | 770 | VC Directory Mode |
| 780 | 771 | ||
| 781 | * VC Directory Buffer:: What the buffer looks like and means. | 772 | * VC Directory Buffer:: What the buffer looks like and means. |
| @@ -784,26 +775,15 @@ VC Directory Mode | |||
| 784 | Multiple Branches of a File | 775 | Multiple Branches of a File |
| 785 | 776 | ||
| 786 | * Switching Branches:: How to get to another existing branch. | 777 | * Switching Branches:: How to get to another existing branch. |
| 787 | * Creating Branches:: How to start a new branch. | 778 | * VC Pull:: Updating a branch from another branch. |
| 788 | * Merging:: Transferring changes between branches. | 779 | * Merging:: Transferring changes between branches. |
| 789 | * Multi-User Branching:: Multiple users working at multiple branches | 780 | * Creating Branches:: How to start a new branch. |
| 790 | in parallel. | ||
| 791 | |||
| 792 | Remote Repositories | ||
| 793 | |||
| 794 | * Version Backups:: Keeping local copies of repository versions. | ||
| 795 | * Local Version Control:: Using another version system for local editing. | ||
| 796 | |||
| 797 | Revision Tags | ||
| 798 | |||
| 799 | * Making Revision Tags:: The tag facilities. | ||
| 800 | * Revision Tag Caveats:: Things to be careful of when using tags. | ||
| 801 | 781 | ||
| 802 | Miscellaneous Commands and Features of VC | 782 | Miscellaneous Commands and Features of VC |
| 803 | 783 | ||
| 804 | * Change Logs and VC:: Generating a change log file from log entries. | 784 | * Change Logs and VC:: Generating a change log file from log entries. |
| 805 | * Renaming and VC:: A command to rename both the source and master | 785 | * VC Delete/Rename:: Deleting and renaming version-controlled files. |
| 806 | file correctly. | 786 | * Revision Tags:: Symbolic names for revisions. |
| 807 | * Version Headers:: Inserting version control headers into working files. | 787 | * Version Headers:: Inserting version control headers into working files. |
| 808 | 788 | ||
| 809 | Customizing VC | 789 | Customizing VC |
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index e3da0ca44e6..9b2322e1850 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1485,6 +1485,12 @@ argument to @kbd{M-x delete-file} or @kbd{M-x delete-directory} makes | |||
| 1485 | them delete outright, instead of using the Trash, regardless of | 1485 | them delete outright, instead of using the Trash, regardless of |
| 1486 | @code{delete-by-moving-to-trash}. | 1486 | @code{delete-by-moving-to-trash}. |
| 1487 | 1487 | ||
| 1488 | @ifnottex | ||
| 1489 | If a file is under version control (@pxref{Version Control}), you | ||
| 1490 | should delete it using @kbd{M-x vc-delete-file} instead of @kbd{M-x | ||
| 1491 | delete-file}. @xref{VC Delete/Rename}. | ||
| 1492 | @end ifnottex | ||
| 1493 | |||
| 1488 | @findex copy-file | 1494 | @findex copy-file |
| 1489 | @cindex copying files | 1495 | @cindex copying files |
| 1490 | @kbd{M-x copy-file} reads the file @var{old} and writes a new file | 1496 | @kbd{M-x copy-file} reads the file @var{old} and writes a new file |
| @@ -1498,6 +1504,7 @@ it creates a copy of the @var{old} directory and puts it in @var{new}. | |||
| 1498 | If @var{new} is not an existing directory, it copies all the contents | 1504 | If @var{new} is not an existing directory, it copies all the contents |
| 1499 | of @var{old} into a new directory named @var{new}. | 1505 | of @var{old} into a new directory named @var{new}. |
| 1500 | 1506 | ||
| 1507 | @cindex renaming files | ||
| 1501 | @findex rename-file | 1508 | @findex rename-file |
| 1502 | @kbd{M-x rename-file} reads two file names @var{old} and @var{new} | 1509 | @kbd{M-x rename-file} reads two file names @var{old} and @var{new} |
| 1503 | using the minibuffer, then renames file @var{old} as @var{new}. If | 1510 | using the minibuffer, then renames file @var{old} as @var{new}. If |
| @@ -1512,6 +1519,12 @@ RET /tmp RET} renames @file{~/foo} to @file{/tmp/foo}. The same rule | |||
| 1512 | applies to all the remaining commands in this section. All of them | 1519 | applies to all the remaining commands in this section. All of them |
| 1513 | ask for confirmation when the new file name already exists, too. | 1520 | ask for confirmation when the new file name already exists, too. |
| 1514 | 1521 | ||
| 1522 | @ifnottex | ||
| 1523 | If a file is under version control (@pxref{Version Control}), you | ||
| 1524 | should rename it using @kbd{M-x vc-rename-file} instead of @kbd{M-x | ||
| 1525 | rename-file}. @xref{VC Delete/Rename}. | ||
| 1526 | @end ifnottex | ||
| 1527 | |||
| 1515 | @findex add-name-to-file | 1528 | @findex add-name-to-file |
| 1516 | @cindex hard links (creation) | 1529 | @cindex hard links (creation) |
| 1517 | @kbd{M-x add-name-to-file} adds an additional name to an existing | 1530 | @kbd{M-x add-name-to-file} adds an additional name to an existing |
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 1445d25be15..dec5aa771ea 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi | |||
| @@ -32,7 +32,7 @@ unavailable. However, it is still possible to create multiple | |||
| 32 | ``frames'' on text-only terminals; such frames are displayed one at a | 32 | ``frames'' on text-only terminals; such frames are displayed one at a |
| 33 | time, filling the entire terminal screen (@pxref{Non-Window | 33 | time, filling the entire terminal screen (@pxref{Non-Window |
| 34 | Terminals}). It is also possible to use the mouse on some text-only | 34 | Terminals}). It is also possible to use the mouse on some text-only |
| 35 | terminals (@pxref{Text-Only Mouse}, for doing so on GNU and UNIX | 35 | terminals (@pxref{Text-Only Mouse}, for doing so on GNU and Unix |
| 36 | systems; and | 36 | systems; and |
| 37 | @iftex | 37 | @iftex |
| 38 | @pxref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}, | 38 | @pxref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}, |
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 354812edc1f..6ce298c1795 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -49,13 +49,13 @@ variable @code{vc-handled-backends} to @code{nil} | |||
| 49 | * VC Mode Line:: How the mode line shows version control status. | 49 | * VC Mode Line:: How the mode line shows version control status. |
| 50 | * Basic VC Editing:: How to edit a file under version control. | 50 | * Basic VC Editing:: How to edit a file under version control. |
| 51 | * Log Buffer:: Features available in log entry buffers. | 51 | * Log Buffer:: Features available in log entry buffers. |
| 52 | * Registering:: Putting a file under version control. | ||
| 52 | * Old Revisions:: Examining and comparing old versions. | 53 | * Old Revisions:: Examining and comparing old versions. |
| 53 | * Secondary VC Commands:: The commands used a little less frequently. | 54 | * VC Change Log:: Viewing the VC Change Log. |
| 55 | * VC Undo:: Canceling changes before or after committing. | ||
| 54 | * VC Directory Mode:: Listing files managed by version control. | 56 | * VC Directory Mode:: Listing files managed by version control. |
| 55 | * Branches:: Multiple lines of development. | 57 | * Branches:: Multiple lines of development. |
| 56 | @ifnottex | 58 | @ifnottex |
| 57 | * Remote Repositories:: Efficient access to remote CVS servers. | ||
| 58 | * Revision Tags:: Symbolic names for revisions. | ||
| 59 | * Miscellaneous VC:: Various other commands and features of VC. | 59 | * Miscellaneous VC:: Various other commands and features of VC. |
| 60 | * Customizing VC:: Variables that change VC's behavior. | 60 | * Customizing VC:: Variables that change VC's behavior. |
| 61 | @end ifnottex | 61 | @end ifnottex |
| @@ -71,7 +71,7 @@ control operations. | |||
| 71 | 71 | ||
| 72 | Some uncommon or intricate version control operations, such as | 72 | Some uncommon or intricate version control operations, such as |
| 73 | altering repository settings, are not supported in VC. You should | 73 | altering repository settings, are not supported in VC. You should |
| 74 | perform such tasks outside Emacs, e.g. via the command line. | 74 | perform such tasks outside Emacs, e.g.@: via the command line. |
| 75 | 75 | ||
| 76 | This section provides a general overview of version control, and | 76 | This section provides a general overview of version control, and |
| 77 | describes the version control systems that VC supports. You can skip | 77 | describes the version control systems that VC supports. You can skip |
| @@ -125,7 +125,7 @@ which it refers to as @dfn{back ends}: | |||
| 125 | @item | 125 | @item |
| 126 | SCCS was the first version control system ever built, and was long ago | 126 | SCCS was the first version control system ever built, and was long ago |
| 127 | superseded by more advanced ones. VC compensates for certain features | 127 | superseded by more advanced ones. VC compensates for certain features |
| 128 | missing in SCCS (e.g., tag names for releases) by implementing them | 128 | missing in SCCS (e.g.@: tag names for releases) by implementing them |
| 129 | itself. Other VC features, such as multiple branches, are simply | 129 | itself. Other VC features, such as multiple branches, are simply |
| 130 | unavailable. Since SCCS is non-free, we recommend avoiding it. | 130 | unavailable. Since SCCS is non-free, we recommend avoiding it. |
| 131 | 131 | ||
| @@ -154,7 +154,7 @@ moving/renaming. VC supports all basic editing operations under CVS. | |||
| 154 | @cindex SVN | 154 | @cindex SVN |
| 155 | @cindex Subversion | 155 | @cindex Subversion |
| 156 | @item | 156 | @item |
| 157 | Subversion (SVN) is a free version control system designed to be | 157 | Subversion (svn) is a free version control system designed to be |
| 158 | similar to CVS but without its problems (e.g., it supports atomic | 158 | similar to CVS but without its problems (e.g., it supports atomic |
| 159 | commits of filesets, and versioning of directories, symbolic links, | 159 | commits of filesets, and versioning of directories, symbolic links, |
| 160 | meta-data, renames, copies, and deletes). | 160 | meta-data, renames, copies, and deletes). |
| @@ -162,37 +162,33 @@ meta-data, renames, copies, and deletes). | |||
| 162 | @cindex GNU Arch | 162 | @cindex GNU Arch |
| 163 | @cindex Arch | 163 | @cindex Arch |
| 164 | @item | 164 | @item |
| 165 | GNU Arch is one of the earliest @dfn{distributed} version control | 165 | GNU Arch is one of the earliest @dfn{decentralized} version control |
| 166 | systems (the other being Monotone). @xref{VCS Concepts}, for a | 166 | systems (the other being Monotone). @xref{VCS Concepts}, for a |
| 167 | description of distributed version control systems. It is no longer | 167 | description of decentralized version control systems. It is no longer |
| 168 | under active development, and has been deprecated in favor of Bazaar. | 168 | under active development, and has been deprecated in favor of Bazaar. |
| 169 | 169 | ||
| 170 | @cindex git | 170 | @cindex git |
| 171 | @item | 171 | @item |
| 172 | Git is a distributed version control system originally invented by | 172 | Git is a decentralized version control system originally invented by |
| 173 | Linus Torvalds to support development of Linux (his kernel). VC | 173 | Linus Torvalds to support development of Linux (his kernel). VC |
| 174 | supports many common git operations, but others, such as repository | 174 | supports many common Git operations, but others, such as repository |
| 175 | syncing, must be done from the command line. | 175 | syncing, must be done from the command line. |
| 176 | 176 | ||
| 177 | @cindex hg | 177 | @cindex hg |
| 178 | @cindex Mercurial | 178 | @cindex Mercurial |
| 179 | @item | 179 | @item |
| 180 | Mercurial (hg) is a distributed version control system broadly | 180 | Mercurial (hg) is a decentralized version control system broadly |
| 181 | resembling git. VC supports most Mercurial commands, with the | 181 | resembling Git. VC supports most Mercurial commands, with the |
| 182 | exception of repository sync operations. | 182 | exception of repository sync operations. |
| 183 | 183 | ||
| 184 | @cindex bzr | 184 | @cindex bzr |
| 185 | @cindex Bazaar | 185 | @cindex Bazaar |
| 186 | @item | 186 | @item |
| 187 | Bazaar (bzr) is a distributed version control system that supports | 187 | Bazaar (bzr) is a decentralized version control system that supports |
| 188 | both repository-based and distributed versioning. VC supports most | 188 | both repository-based and decentralized versioning. VC supports most |
| 189 | basic editing operations under Bazaar. | 189 | basic editing operations under Bazaar. |
| 190 | @end itemize | 190 | @end itemize |
| 191 | 191 | ||
| 192 | Previous versions of VC supported a version control system known as | ||
| 193 | Meta-CVS. This support was dropped due to limited interest from users | ||
| 194 | and developers. | ||
| 195 | |||
| 196 | @node VCS Concepts | 192 | @node VCS Concepts |
| 197 | @subsubsection Concepts of Version Control | 193 | @subsubsection Concepts of Version Control |
| 198 | 194 | ||
| @@ -210,16 +206,19 @@ as @dfn{log entries} that describe the changes made to each file. | |||
| 210 | The copy of a version-controlled file that you actually edit is | 206 | The copy of a version-controlled file that you actually edit is |
| 211 | called the @dfn{work file}. You can change each work file as you | 207 | called the @dfn{work file}. You can change each work file as you |
| 212 | would an ordinary file. After you are done with a set of changes, you | 208 | would an ordinary file. After you are done with a set of changes, you |
| 213 | @dfn{commit} (or @dfn{check in}) the changes; this records the changes | 209 | may @dfn{commit} (or @dfn{check in}) the changes; this records the |
| 214 | in the repository, along with a descriptive log entry. | 210 | changes in the repository, along with a descriptive log entry. |
| 211 | |||
| 212 | @cindex working tree | ||
| 213 | A directory tree of work files is called a @dfn{working tree}. | ||
| 215 | 214 | ||
| 216 | @cindex revision | 215 | @cindex revision |
| 217 | @cindex revision ID | 216 | @cindex revision ID |
| 218 | A copy of a file stored in a repository is called a @dfn{revision}. | 217 | Each commit creates a new @dfn{revision} in the repository. The |
| 219 | The history of a file is a sequence of revisions. Each revision is | 218 | version control system keeps track of all past revisions and the |
| 220 | named by a @dfn{revision ID}. The format of the revision ID depends | 219 | changes that were made in each revision. Each revision is named by a |
| 221 | on the version control system; in the simplest case, it is just an | 220 | @dfn{revision ID}, whose format depends on the version control system; |
| 222 | integer. | 221 | in the simplest case, it is just an integer. |
| 223 | 222 | ||
| 224 | To go beyond these basic concepts, you will need to understand three | 223 | To go beyond these basic concepts, you will need to understand three |
| 225 | aspects in which version control systems differ. As explained in the | 224 | aspects in which version control systems differ. As explained in the |
| @@ -229,17 +228,18 @@ these modes of operation, but it cannot hide the differences. | |||
| 229 | 228 | ||
| 230 | @node VCS Merging | 229 | @node VCS Merging |
| 231 | @subsubsection Merge-based vs lock-based Version Control | 230 | @subsubsection Merge-based vs lock-based Version Control |
| 232 | @cindex locking versus merging | ||
| 233 | 231 | ||
| 234 | A version control system typically has some mechanism to coordinate | 232 | A version control system typically has some mechanism to coordinate |
| 235 | between users who want to change the same file. There are two ways to | 233 | between users who want to change the same file. There are two ways to |
| 236 | do this: merging and locking. | 234 | do this: merging and locking. |
| 237 | 235 | ||
| 238 | In a version control system that uses merging, each user may check | 236 | @cindex merging-based version |
| 239 | out and modify a work file at any time. The system lets you | 237 | In a version control system that uses merging, each user may modify |
| 240 | @dfn{merge} your work file, which may contain changes that have not | 238 | a work file at any time. The system lets you @dfn{merge} your work |
| 241 | been committed, with the latest changes that others have committed. | 239 | file, which may contain changes that have not been committed, with the |
| 240 | latest changes that others have committed. | ||
| 242 | 241 | ||
| 242 | @cindex locking-based version | ||
| 243 | Older version control systems use a @dfn{locking} scheme instead. | 243 | Older version control systems use a @dfn{locking} scheme instead. |
| 244 | Here, work files are normally read-only. To edit a file, you ask the | 244 | Here, work files are normally read-only. To edit a file, you ask the |
| 245 | version control system to make it writable for you by @dfn{locking} | 245 | version control system to make it writable for you by @dfn{locking} |
| @@ -264,7 +264,7 @@ number and severity of conflicts that actually occur. | |||
| 264 | SCCS always uses locking. RCS is lock-based by default but can be | 264 | SCCS always uses locking. RCS is lock-based by default but can be |
| 265 | told to operate in a merging style. CVS and Subversion are | 265 | told to operate in a merging style. CVS and Subversion are |
| 266 | merge-based by default but can be told to operate in a locking mode. | 266 | merge-based by default but can be told to operate in a locking mode. |
| 267 | Distributed version control systems, such as GNU Arch, git, and | 267 | Decentralized version control systems, such as GNU Arch, Git, and |
| 268 | Mercurial, are exclusively merging-based. | 268 | Mercurial, are exclusively merging-based. |
| 269 | 269 | ||
| 270 | VC mode supports both locking and merging version control. The | 270 | VC mode supports both locking and merging version control. The |
| @@ -276,15 +276,16 @@ possible. | |||
| 276 | @node VCS Changesets | 276 | @node VCS Changesets |
| 277 | @subsubsection Changeset-based vs File-based Version Control | 277 | @subsubsection Changeset-based vs File-based Version Control |
| 278 | 278 | ||
| 279 | @cindex changesets | 279 | @cindex file-based version control |
| 280 | On SCCS, RCS, CVS, and other early version control systems, version | 280 | On SCCS, RCS, CVS, and other early version control systems, version |
| 281 | control operations are @dfn{file-based}: each file has its own comment | 281 | control operations are @dfn{file-based}: each file has its own comment |
| 282 | and revision history separate from that of all other files. Newer | 282 | and revision history separate from that of all other files. Newer |
| 283 | systems, beginning with Subversion, are @dfn{changeset-based}: a | 283 | systems, beginning with Subversion, are @dfn{changeset-based}: a |
| 284 | checkin may include changes to several files, and the entire set of | 284 | commit may include changes to several files, and the entire set of |
| 285 | changes is handled as a unit. Any comment associated with the change | 285 | changes is handled as a unit. Any comment associated with the change |
| 286 | does not belong to a single file, but to the changeset itself. | 286 | does not belong to a single file, but to the changeset itself. |
| 287 | 287 | ||
| 288 | @cindex changeset-based version control | ||
| 288 | Changeset-based version control is more flexible and powerful than | 289 | Changeset-based version control is more flexible and powerful than |
| 289 | file-based version control; usually, when a change to multiple files | 290 | file-based version control; usually, when a change to multiple files |
| 290 | has to be reversed, it's good to be able to easily identify and remove | 291 | has to be reversed, it's good to be able to easily identify and remove |
| @@ -295,18 +296,20 @@ all of it. | |||
| 295 | 296 | ||
| 296 | @cindex centralized version control | 297 | @cindex centralized version control |
| 297 | @cindex decentralized version control | 298 | @cindex decentralized version control |
| 299 | @cindex distributed version control | ||
| 298 | Early version control systems were designed around a | 300 | Early version control systems were designed around a |
| 299 | @dfn{centralized} model in which each project has only one repository | 301 | @dfn{centralized} model in which each project has only one repository |
| 300 | used by all developers. SCCS, RCS, CVS, and Subversion share this | 302 | used by all developers. SCCS, RCS, CVS, and Subversion share this |
| 301 | kind of model. One of its drawbacks is that the repository is a choke | 303 | kind of model. One of its drawbacks is that the repository is a choke |
| 302 | point for reliability and efficiency. | 304 | point for reliability and efficiency. |
| 303 | 305 | ||
| 304 | GNU Arch pioneered the concept of @dfn{decentralized} version | 306 | GNU Arch pioneered the concept of @dfn{distributed} or |
| 305 | control, later implemented in git, Mercurial, and Bazaar. A project | 307 | @dfn{decentralized} version control, later implemented in Git, |
| 306 | may have several different repositories, and these systems support a | 308 | Mercurial, and Bazaar. A project may have several different |
| 307 | sort of super-merge between repositories that tries to reconcile their | 309 | repositories, and these systems support a sort of super-merge between |
| 308 | change histories. In effect, there is one repository for each | 310 | repositories that tries to reconcile their change histories. In |
| 309 | developer, and repository merges take the place of commit operations. | 311 | effect, there is one repository for each developer, and repository |
| 312 | merges take the place of commit operations. | ||
| 310 | 313 | ||
| 311 | VC helps you manage the traffic between your personal workfiles and | 314 | VC helps you manage the traffic between your personal workfiles and |
| 312 | a repository. Whether the repository is a single master, or one of a | 315 | a repository. Whether the repository is a single master, or one of a |
| @@ -346,10 +349,9 @@ policy, which you should follow. | |||
| 346 | When the policy is to use both, you typically want to write an entry | 349 | When the policy is to use both, you typically want to write an entry |
| 347 | for each change just once, then put it into both logs. You can write | 350 | for each change just once, then put it into both logs. You can write |
| 348 | the entry in @file{ChangeLog}, then copy it to the log buffer with | 351 | the entry in @file{ChangeLog}, then copy it to the log buffer with |
| 349 | @kbd{C-c C-a} when checking in the change (@pxref{Log Buffer}). Or | 352 | @kbd{C-c C-a} when committing the change (@pxref{Log Buffer}). Or you |
| 350 | you can write the entry in the log buffer while checking in the | 353 | can write the entry in the log buffer while committing the change, and |
| 351 | change, and later use the @kbd{C-x v a} command to copy it to | 354 | later use the @kbd{C-x v a} command to copy it to @file{ChangeLog} |
| 352 | @file{ChangeLog} | ||
| 353 | @iftex | 355 | @iftex |
| 354 | (@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}). | 356 | (@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}). |
| 355 | @end iftex | 357 | @end iftex |
| @@ -359,20 +361,22 @@ change, and later use the @kbd{C-x v a} command to copy it to | |||
| 359 | 361 | ||
| 360 | @node VC Mode Line | 362 | @node VC Mode Line |
| 361 | @subsection Version Control and the Mode Line | 363 | @subsection Version Control and the Mode Line |
| 362 | @cindex VC, mode line indicator | 364 | @cindex VC mode line indicator |
| 363 | 365 | ||
| 364 | When you visit a file that is under version control, Emacs indicates | 366 | When you visit a file that is under version control, Emacs indicates |
| 365 | this on the mode line. For example, @samp{Bzr-1223} says that Bazaar | 367 | this on the mode line. For example, @samp{Bzr-1223} says that Bazaar |
| 366 | is used for that file, and the current revision ID is 1223. | 368 | is used for that file, and the current revision ID is 1223. |
| 367 | 369 | ||
| 370 | @cindex version control status | ||
| 368 | The character between the back-end name and the revision ID | 371 | The character between the back-end name and the revision ID |
| 369 | indicates the status of the work file. In a merge-based version | 372 | indicates the @dfn{version control status} of the work file. In a |
| 370 | control system, a @samp{-} character indicates that the work file is | 373 | merge-based version control system, a @samp{-} character indicates |
| 371 | unmodified, and @samp{:} indicates that it has been modified. | 374 | that the work file is unmodified, and @samp{:} indicates that it has |
| 372 | @samp{!} indicates that the file contains conflicts as result of a | 375 | been modified. @samp{!} indicates that the file contains conflicts as |
| 373 | recent merge operation (@pxref{Merging}), or that the file was removed | 376 | result of a recent merge operation (@pxref{Merging}), or that the file |
| 374 | from the version control. Finally, @samp{?} means that the file is | 377 | was removed from the version control. Finally, @samp{?} means that |
| 375 | under version control, but is missing from the working tree. | 378 | the file is under version control, but is missing from the working |
| 379 | tree. | ||
| 376 | 380 | ||
| 377 | In a lock-based system, @samp{-} indicates an unlocked file, and | 381 | In a lock-based system, @samp{-} indicates an unlocked file, and |
| 378 | @samp{:} a locked file; if the file is locked by another user (for | 382 | @samp{:} a locked file; if the file is locked by another user (for |
| @@ -402,6 +406,7 @@ system, but is usually not excessive. | |||
| 402 | @subsection Basic Editing under Version Control | 406 | @subsection Basic Editing under Version Control |
| 403 | 407 | ||
| 404 | @cindex filesets, VC | 408 | @cindex filesets, VC |
| 409 | @cindex VC filesets | ||
| 405 | Most VC commands operate on @dfn{VC filesets}. A VC fileset is a | 410 | Most VC commands operate on @dfn{VC filesets}. A VC fileset is a |
| 406 | collection of one or more files that a VC operation acts on. When you | 411 | collection of one or more files that a VC operation acts on. When you |
| 407 | type VC commands in a buffer visiting a version-controlled file, the | 412 | type VC commands in a buffer visiting a version-controlled file, the |
| @@ -409,37 +414,34 @@ VC fileset is simply that one file. When you type them in a VC | |||
| 409 | Directory buffer, and some files in it are marked, the VC fileset | 414 | Directory buffer, and some files in it are marked, the VC fileset |
| 410 | consists of the marked files (@pxref{VC Directory Mode}). | 415 | consists of the marked files (@pxref{VC Directory Mode}). |
| 411 | 416 | ||
| 412 | The principal VC command is an all-purpose command, @kbd{C-x v v} | 417 | On modern changeset-based version control systems (@pxref{VCS |
| 413 | (@code{vc-next-action}), that performs either registration, locking, | 418 | Changesets}), VC commands handle multi-file VC filesets as a group. |
| 414 | merging or a check-in (depending on the situation) on the current VC | 419 | For example, committing a multi-file VC fileset generates a single |
| 415 | fileset. You can use @kbd{C-x v v} in a file-visiting buffer or in a | 420 | revision, containing the changes to all those files. On older |
| 416 | VC Directory buffer. | 421 | file-based version control systems like CVS, each file in a multi-file |
| 422 | VC fileset is handled individually; for example, a commit generates | ||
| 423 | one revision for each changed file. | ||
| 417 | 424 | ||
| 418 | @table @kbd | 425 | @table @kbd |
| 419 | @itemx C-x v v | 426 | @itemx C-x v v |
| 420 | Perform the appropriate next version control operation on the VC fileset. | 427 | Perform the next appropriate version control operation on the current |
| 428 | VC fileset. | ||
| 421 | @end table | 429 | @end table |
| 422 | 430 | ||
| 423 | @findex vc-next-action | 431 | @findex vc-next-action |
| 424 | @kindex C-x v v | 432 | @kindex C-x v v |
| 425 | The precise action of @kbd{C-x v v} depends on the state of the VC | 433 | The principal VC command is a multi-purpose command, @kbd{C-x v v} |
| 426 | fileset, and whether the version control system uses locking or | 434 | (@code{vc-next-action}), which performs the ``most appropriate'' |
| 427 | merging. This is described in detail in the subsequent sections. | 435 | action on the current VC fileset: either registering it with a version |
| 428 | 436 | control system, or committing it, or unlocking it, or merging changes | |
| 429 | VC filesets are the way that VC mode bridges the gap between | 437 | into it. The precise actions are described in detail in the following |
| 430 | file-based and changeset-based version control systems. They are, | 438 | subsections. You can use @kbd{C-x v v} either in a file-visiting |
| 431 | essentially, a way to pass multiple file arguments as a group to | 439 | buffer or in a VC Directory buffer. |
| 432 | version control commands. For example, on Subversion, a checkin with | 440 | |
| 433 | a multi-file VC fileset becomes a joint commit, as though you had | 441 | Note that VC filesets are distinct from the ``named filesets'' used |
| 434 | typed @command{svn commit} with those file arguments at the shell | 442 | for viewing and visiting files in functional groups |
| 435 | command line. All files in a VC fileset must be under the same | 443 | (@pxref{Filesets}). Unlike named filesets, VC filesets are not named |
| 436 | version control system; if they are not, Emacs signals an error when | 444 | and don't persist across sessions. |
| 437 | you attempt to execute a command on the fileset. | ||
| 438 | |||
| 439 | VC filesets are distinct from the ``named filesets'' used for | ||
| 440 | viewing and visiting files in functional groups (@pxref{Filesets}). | ||
| 441 | Unlike named filesets, VC filesets are not named and don't persist | ||
| 442 | across sessions. | ||
| 443 | 445 | ||
| 444 | @menu | 446 | @menu |
| 445 | * VC With A Merging VCS:: Without locking: default mode for CVS. | 447 | * VC With A Merging VCS:: Without locking: default mode for CVS. |
| @@ -450,46 +452,44 @@ across sessions. | |||
| 450 | @node VC With A Merging VCS | 452 | @node VC With A Merging VCS |
| 451 | @subsubsection Basic Version Control with Merging | 453 | @subsubsection Basic Version Control with Merging |
| 452 | 454 | ||
| 453 | When your version control system is merging-based (the default for | 455 | On a merging-based version control system (i.e.@: most modern ones; |
| 454 | CVS and all newer version control systems), work files are always | 456 | @pxref{VCS Merging}), @kbd{C-x v v} does the following: |
| 455 | writable; you need not do anything special to begin editing a file. | ||
| 456 | The status indicator on the mode line is @samp{-} if the file is | ||
| 457 | unmodified; it flips to @samp{:} as soon as you save any changes | ||
| 458 | (@pxref{VC Mode Line}). | ||
| 459 | |||
| 460 | Here is what @kbd{C-x v v} does when using a merging-based system: | ||
| 461 | 457 | ||
| 462 | @itemize @bullet | 458 | @itemize @bullet |
| 463 | @item | 459 | @item |
| 464 | If the work file is in a directory that is not controlled by any | 460 | If there is more than one file in the VC fileset and the files have |
| 465 | version control system, prompt for a repository type. Then, create a | 461 | inconsistent version control statuses, signal an error. (Note, |
| 466 | version control repository of that type and register the file with it. | 462 | however, that a fileset is allowed to include both ``newly-added'' |
| 463 | files and ``modified'' files; @pxref{Registering}.) | ||
| 467 | 464 | ||
| 468 | @item | 465 | @item |
| 469 | If the work file is in a directory that is controlled by a version | 466 | If none of the files in the VC fileset are registered with a version |
| 470 | control system but not registered with it, register the file. | 467 | control system, register the VC fileset, i.e.@: place it under version |
| 468 | control. @xref{Registering}. If Emacs cannot find a system to | ||
| 469 | register under, it prompts for a repository type, creates a new | ||
| 470 | repository, and registers the VC fileset with it. | ||
| 471 | 471 | ||
| 472 | @item | 472 | @item |
| 473 | If the work file is the same as in the repository, do nothing. | 473 | If every work file in the VC fileset is unchanged, do nothing. |
| 474 | 474 | ||
| 475 | @item | 475 | @item |
| 476 | If you have not changed the work file, but some other user has checked | 476 | If every work file in the VC fileset has been modified, commit the |
| 477 | in changes to the repository, merge those changes into the work file. | 477 | changes. To do this, Emacs pops up a @samp{*vc-log*} buffer; type the |
| 478 | desired log entry for the new revision, followed by @kbd{C-c C-c} to | ||
| 479 | commit. @xref{Log Buffer}. | ||
| 480 | |||
| 481 | If committing to a shared repository, the commit may fail if the | ||
| 482 | repository that has been changed since your last update. In that | ||
| 483 | case, you must perform an update before trying again. On a | ||
| 484 | decentralized version control system, use @kbd{C-x v +} (@pxref{VC | ||
| 485 | Pull}) or @kbd{C-x v m} (@pxref{Merging}). On a centralized version | ||
| 486 | control system, type @kbd{C-x v v} again to merge in the repository | ||
| 487 | changes. | ||
| 478 | 488 | ||
| 479 | @item | 489 | @item |
| 480 | If you have made modifications to the work file, attempt to commit | 490 | Finally, if you are using a centralized version control system, check |
| 481 | the changes. To do this, Emacs first reads the log entry for the new | 491 | if each work file in the VC fileset is up-to-date. If any file has |
| 482 | revision (@pxref{Log Buffer}). If some other user has committed | 492 | been changed in the repository, offer to update it. |
| 483 | changes to the repository since you last checked it out, the checkin | ||
| 484 | fails. In that case, type @kbd{C-x v v} again to merge those changes | ||
| 485 | into your own work file; this puts the work file into a ``conflicted'' | ||
| 486 | state. Type @kbd{C-x v v} to clear the ``conflicted'' state; VC then | ||
| 487 | regards the file as up-to-date and modified, and you can try to check | ||
| 488 | it in again. | ||
| 489 | |||
| 490 | To pick up any recent changes from the repository @emph{without} | ||
| 491 | trying to commit your own changes, type @kbd{C-x v m @key{RET}}. | ||
| 492 | @xref{Merging}. | ||
| 493 | @end itemize | 493 | @end itemize |
| 494 | 494 | ||
| 495 | These rules also apply when you use RCS in its ``non-locking'' mode, | 495 | These rules also apply when you use RCS in its ``non-locking'' mode, |
| @@ -498,7 +498,7 @@ Nothing informs you if another user has committed changes in the same | |||
| 498 | file since you began editing it; when you commit your revision, his | 498 | file since you began editing it; when you commit your revision, his |
| 499 | changes are removed (however, they remain in the repository and are | 499 | changes are removed (however, they remain in the repository and are |
| 500 | thus not irrevocably lost). Therefore, you must verify that the | 500 | thus not irrevocably lost). Therefore, you must verify that the |
| 501 | current revision is unchanged before checking in your changes. In | 501 | current revision is unchanged before committing your changes. In |
| 502 | addition, locking is possible with RCS even in this mode: @kbd{C-x v | 502 | addition, locking is possible with RCS even in this mode: @kbd{C-x v |
| 503 | v} with an unmodified file locks the file, just as it does with RCS in | 503 | v} with an unmodified file locks the file, just as it does with RCS in |
| 504 | its normal locking mode (@pxref{VC With A Locking VCS}). | 504 | its normal locking mode (@pxref{VC With A Locking VCS}). |
| @@ -506,32 +506,44 @@ its normal locking mode (@pxref{VC With A Locking VCS}). | |||
| 506 | @node VC With A Locking VCS | 506 | @node VC With A Locking VCS |
| 507 | @subsubsection Basic Version Control with Locking | 507 | @subsubsection Basic Version Control with Locking |
| 508 | 508 | ||
| 509 | Under a locking-based version control system (such as SCCS, and RCS | 509 | On a locking-based version control system (such as SCCS, and RCS in |
| 510 | in its default mode), @kbd{C-x v v} does the following: | 510 | its default mode), @kbd{C-x v v} does the following: |
| 511 | 511 | ||
| 512 | @itemize @bullet | 512 | @itemize @bullet |
| 513 | @item | 513 | @item |
| 514 | If the file is not locked, lock it and make it writable, so that you | 514 | If there is more than one file in the VC fileset and the files have |
| 515 | can change it. | 515 | inconsistent version control statuses, signal an error. |
| 516 | |||
| 517 | @item | ||
| 518 | If each file in the VC fileset is not registered with a version | ||
| 519 | control system, register the VC fileset. @xref{Registering}. If | ||
| 520 | Emacs cannot find a system to register under, it prompts for a | ||
| 521 | repository type, creates a new repository, and registers the VC | ||
| 522 | fileset with it. | ||
| 523 | |||
| 524 | @item | ||
| 525 | If each file is registered and unlocked, lock it and make it writable, | ||
| 526 | so that you can begin to edit it. | ||
| 516 | 527 | ||
| 517 | @item | 528 | @item |
| 518 | If the file is locked by you, and contains changes, commit the | 529 | If each file is locked by you and contains changes, commit the |
| 519 | changes. In order to do this, Emacs first reads the log entry for the | 530 | changes. To do this, Emacs pops up a @samp{*vc-log*} buffer; type the |
| 520 | new revision. @xref{Log Buffer}. | 531 | desired log entry for the new revision, followed by @kbd{C-c C-c} to |
| 532 | commit (@pxref{Log Buffer}). | ||
| 521 | 533 | ||
| 522 | @item | 534 | @item |
| 523 | If the file is locked by you, but you have not changed it since you | 535 | If each file is locked by you, but you have not changed it, release |
| 524 | locked it, release the lock and makes the file read-only again. | 536 | the lock and make the file read-only again. |
| 525 | 537 | ||
| 526 | @item | 538 | @item |
| 527 | If the file is locked by some other user, ask whether you want to | 539 | If each file is locked by another user, ask whether you want to |
| 528 | ``steal the lock'' from that user. If you say yes, the file becomes | 540 | ``steal the lock''. If you say yes, the file becomes locked by you, |
| 529 | locked by you, but a message is sent to the person who had formerly | 541 | and a warning message is sent to the user who had formerly locked the |
| 530 | locked the file, to inform him of what has happened. | 542 | file. |
| 531 | @end itemize | 543 | @end itemize |
| 532 | 544 | ||
| 533 | These rules also apply when you use CVS in locking mode, except | 545 | These rules also apply when you use CVS in locking mode, except |
| 534 | that CVS does not support stealing a lock. | 546 | that CVS does not support stealing locks. |
| 535 | 547 | ||
| 536 | @node Advanced C-x v v | 548 | @node Advanced C-x v v |
| 537 | @subsubsection Advanced Control in @kbd{C-x v v} | 549 | @subsubsection Advanced Control in @kbd{C-x v v} |
| @@ -544,49 +556,55 @@ to do the operation. | |||
| 544 | 556 | ||
| 545 | @itemize @bullet | 557 | @itemize @bullet |
| 546 | @item | 558 | @item |
| 547 | If the file is modified (or locked), you can specify the revision ID | 559 | @cindex specific version control system |
| 548 | to use for the new version that you commit. This is one way to create | 560 | You can specify the name of a version control system. This is useful |
| 549 | a new branch (@pxref{Branches}). | 561 | if the fileset can be managed by more than one version control system, |
| 562 | and Emacs fails to detect the correct one. | ||
| 550 | 563 | ||
| 551 | @item | 564 | @item |
| 552 | If the file is not modified (and unlocked), you can specify the | 565 | Otherwise, if using CVS or RCS, you can specify a revision ID. |
| 553 | revision to select; this lets you start working from an older | ||
| 554 | revision, or on another branch. If you do not enter any revision, | ||
| 555 | that takes you to the highest (``head'') revision on the current | ||
| 556 | branch; therefore @kbd{C-u C-x v v @key{RET}} is a convenient way to | ||
| 557 | get the latest version of a file from the repository. | ||
| 558 | 566 | ||
| 559 | @item | 567 | If the fileset is modified (or locked), this makes Emacs commit with |
| 560 | @cindex specific version control system | 568 | that revision ID. You can create a new branch by supplying an |
| 561 | Instead of the revision ID, you can also specify the name of a | 569 | appropriate revision ID (@pxref{Branches}). |
| 562 | version control system. This is useful when one file is being managed | 570 | |
| 563 | with two version control systems at the same time | 571 | If the fileset is unmodified (and unlocked), this checks the specified |
| 564 | @iftex | 572 | revision into the working tree. You can also specify a revision on |
| 565 | (@pxref{Local Version Control,,,emacs-xtra, Specialized Emacs | 573 | another branch by giving its revision or branch ID (@pxref{Switching |
| 566 | Features}). | 574 | Branches}). An empty argument (i.e.@: @kbd{C-u C-x v v @key{RET}}) |
| 567 | @end iftex | 575 | checks out the latest (``head'') revision on the current branch. |
| 568 | @ifnottex | ||
| 569 | (@pxref{Local Version Control}). | ||
| 570 | @end ifnottex | ||
| 571 | 576 | ||
| 577 | This signals an error on a decentralized version control system. | ||
| 578 | Those systems do not let you specify your own revision IDs, nor do | ||
| 579 | they use the concept of ``checking out'' individual files. | ||
| 572 | @end itemize | 580 | @end itemize |
| 573 | 581 | ||
| 574 | @node Log Buffer | 582 | @node Log Buffer |
| 575 | @subsection Features of the Log Entry Buffer | 583 | @subsection Features of the Log Entry Buffer |
| 576 | 584 | ||
| 577 | When you tell VC to commit a change, it pops up a buffer called | 585 | @cindex C-c C-c @r{(Log Edit mode)} |
| 578 | @samp{*VC-Log*}. In this buffer, you should write a @dfn{log entry} | 586 | @findex log-edit-done |
| 587 | When you tell VC to commit a change, it pops up a buffer named | ||
| 588 | @samp{*vc-log*}. In this buffer, you should write a @dfn{log entry} | ||
| 579 | describing the changes you have made (@pxref{Why Version Control?}). | 589 | describing the changes you have made (@pxref{Why Version Control?}). |
| 580 | After you are done, type @kbd{C-c C-c}; this exits the buffer and | 590 | After you are done, type @kbd{C-c C-c} (@code{log-edit-done}) to exit |
| 581 | commits the change, together with your log entry. | 591 | the buffer and commit the change, together with your log entry. |
| 582 | 592 | ||
| 583 | While in the @samp{*VC-Log*} buffer, you can write one or more | 593 | @cindex Log Edit mode |
| 584 | @dfn{header lines}, specifying additional information to be supplied | 594 | @cindex mode, Log Edit |
| 585 | to the version control system. Each header line must occupy a single | 595 | @vindex vc-log-mode-hook |
| 586 | line at the top of the buffer; the first line that is not a header | 596 | The major mode for the @samp{*vc-log*} buffer is Log Edit mode, a |
| 587 | line is treated as the start of the log entry. For example, the | 597 | variant of Text mode (@pxref{Text Mode}). On entering Log Edit mode, |
| 588 | following header line states that the present change was not written | 598 | Emacs runs the hooks @code{text-mode-hook} and @code{vc-log-mode-hook} |
| 589 | by you, but by another developer: | 599 | (@pxref{Hooks}). |
| 600 | |||
| 601 | In the @samp{*vc-log*} buffer, you can write one or more @dfn{header | ||
| 602 | lines}, specifying additional information to be supplied to the | ||
| 603 | version control system. Each header line must occupy a single line at | ||
| 604 | the top of the buffer; the first line that is not a header line is | ||
| 605 | treated as the start of the log entry. For example, the following | ||
| 606 | header line states that the present change was not written by you, but | ||
| 607 | by another developer: | ||
| 590 | 608 | ||
| 591 | @smallexample | 609 | @smallexample |
| 592 | Author: J. R. Hacker <jrh@@example.com> | 610 | Author: J. R. Hacker <jrh@@example.com> |
| @@ -597,196 +615,215 @@ Apart from the @samp{Author} header, Emacs recognizes the headers | |||
| 597 | @samp{Date} (a manually-specified commit time) and @samp{Fixes} (a | 615 | @samp{Date} (a manually-specified commit time) and @samp{Fixes} (a |
| 598 | reference to a bug fixed by the change). Not all version control | 616 | reference to a bug fixed by the change). Not all version control |
| 599 | systems recognize all headers: Bazaar recognizes all three headers, | 617 | systems recognize all headers: Bazaar recognizes all three headers, |
| 600 | while git, Mercurial, and Monotone recognizes only @samp{Author} and | 618 | while Git, Mercurial, and Monotone recognize only @samp{Author} and |
| 601 | @samp{Summary}. If you specify a header for a version control that | 619 | @samp{Date}. If you specify a header for a system that does not |
| 602 | does not support it, the header is treated as part of the log entry. | 620 | support it, the header is treated as part of the log entry. |
| 603 | 621 | ||
| 622 | @kindex C-c C-f @r{(Log Edit mode)} | ||
| 604 | @findex log-edit-show-files | 623 | @findex log-edit-show-files |
| 624 | @kindex C-c C-d @r{(Log Edit mode)} | ||
| 605 | @findex log-edit-show-diff | 625 | @findex log-edit-show-diff |
| 606 | Type @kbd{C-c C-f} (@code{log-edit-show-files}) to display a list of | 626 | While in the @samp{*vc-log*} buffer, the ``current VC fileset'' is |
| 607 | files in the current VC fileset. If you called @kbd{C-x v v} directly | 627 | considered to be the fileset that will be committed if you type |
| 608 | from a work file, the fileset consists of that single file; if you | 628 | @w{@kbd{C-c C-c}}. To view a list of the files in the VC fileset, |
| 609 | called @kbd{C-x v v} from a VC directory buffer (@pxref{VC Directory | 629 | type @w{@kbd{C-c C-f}} (@code{log-edit-show-files}). To view a diff |
| 610 | Mode}), the fileset may consist of multiple files. | 630 | of changes between the VC fileset and the version from which you |
| 611 | 631 | started editing (@pxref{Old Revisions}), type @kbd{C-c C-d} | |
| 632 | (@code{log-edit-show-diff}). | ||
| 633 | |||
| 634 | @kindex C-c C-a @r{(Log Edit mode)} | ||
| 612 | @findex log-edit-insert-changelog | 635 | @findex log-edit-insert-changelog |
| 613 | Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a @dfn{diff} | 636 | If the VC fileset includes one or more @file{ChangeLog} files |
| 614 | of the changes you have made (i.e., the differences between the work | 637 | (@pxref{Change Log}), type @kbd{C-c C-a} |
| 615 | file and the repository revision from which you started editing). | ||
| 616 | @xref{Old Revisions}. | ||
| 617 | |||
| 618 | If the current VC fileset includes one or more @file{ChangeLog} | ||
| 619 | files (@pxref{Change Log}), type @kbd{C-c C-a} | ||
| 620 | (@code{log-edit-insert-changelog}) to pull the relevant entries into | 638 | (@code{log-edit-insert-changelog}) to pull the relevant entries into |
| 621 | the @samp{*VC-Log*} buffer. If the topmost item in each | 639 | the @samp{*vc-log*} buffer. If the topmost item in each |
| 622 | @file{ChangeLog} was made under your user name on the current date, | 640 | @file{ChangeLog} was made under your user name on the current date, |
| 623 | this command searches that item for entries that match the file(s) to | 641 | this command searches that item for entries matching the file(s) to be |
| 624 | be committed; if found, these entries are inserted. | 642 | committed, and inserts them. |
| 625 | @iftex | ||
| 626 | @xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}, | ||
| 627 | @end iftex | ||
| 628 | @ifnottex | 643 | @ifnottex |
| 629 | @xref{Change Logs and VC}, | 644 | If you are using CVS or RCS, see @ref{Change Logs and VC}, for the |
| 645 | opposite way of working---generating ChangeLog entries from the Log | ||
| 646 | Edit buffer. | ||
| 630 | @end ifnottex | 647 | @end ifnottex |
| 631 | for the opposite way of working---generating ChangeLog entries from | ||
| 632 | the revision control log. | ||
| 633 | 648 | ||
| 634 | To abort a check-in, just @strong{don't} type @kbd{C-c C-c} in that | 649 | To abort a commit, just @strong{don't} type @kbd{C-c C-c} in that |
| 635 | buffer. You can switch buffers and do other editing. As long as you | 650 | buffer. You can switch buffers and do other editing. As long as you |
| 636 | don't try to commit another file, the entry you were editing remains | 651 | don't try to make another commit, the entry you were editing remains |
| 637 | in the @samp{*VC-Log*} buffer, and you can go back to that buffer at | 652 | in the @samp{*vc-log*} buffer, and you can go back to that buffer at |
| 638 | any time to complete the check-in. | 653 | any time to complete the commit. |
| 639 | 654 | ||
| 640 | If you change several source files for the same reason, it is often | 655 | @kindex M-n @r{(Log Edit mode)} |
| 641 | convenient to specify the same log entry for many of the files. (This | 656 | @kindex M-p @r{(Log Edit mode)} |
| 642 | is the normal way to do things on a changeset-oriented system, where | 657 | @kindex M-s @r{(Log Edit mode)} |
| 643 | comments are attached to changesets rather than the history of | 658 | @kindex M-r @r{(Log Edit mode)} |
| 644 | individual files.) The most convenient way to do this is to mark all | ||
| 645 | the files in VC Directory Mode and commit from there; the log buffer | ||
| 646 | will carry the fileset information with it and do a group commit when | ||
| 647 | you type @kbd{C-c C-c}. | ||
| 648 | |||
| 649 | You can also browse the history of previous log entries to duplicate | 659 | You can also browse the history of previous log entries to duplicate |
| 650 | a checkin comment. This can be useful when you want several files to | 660 | a commit comment. This can be useful when you want to make several |
| 651 | have checkin comments that vary only slightly from each other. The | 661 | commits with similar comments. The commands @kbd{M-n}, @kbd{M-p}, |
| 652 | commands @kbd{M-n}, @kbd{M-p}, @kbd{M-s} and @kbd{M-r} for doing this | 662 | @kbd{M-s} and @kbd{M-r} for doing this work just like the minibuffer |
| 653 | work just like the minibuffer history commands (except that these | 663 | history commands (@pxref{Minibuffer History}), except that they are |
| 654 | versions are used outside the minibuffer). | 664 | used outside the minibuffer. |
| 655 | 665 | ||
| 656 | @vindex vc-log-mode-hook | 666 | @node Registering |
| 657 | Each time you commit a change, the log entry buffer is put into VC | 667 | @subsection Registering a File for Version Control |
| 658 | Log Edit mode, which involves running two hooks: @code{text-mode-hook} | 668 | |
| 659 | and @code{vc-log-mode-hook}. @xref{Hooks}. | 669 | @table @kbd |
| 670 | @item C-x v i | ||
| 671 | Register the visited file for version control. | ||
| 672 | @end table | ||
| 673 | |||
| 674 | @kindex C-x v i | ||
| 675 | @findex vc-register | ||
| 676 | The command @kbd{C-x v i} (@code{vc-register}) @dfn{registers} each | ||
| 677 | file in the current VC fileset, placing it under version control. | ||
| 678 | This is essentially equivalent to the action of @kbd{C-x v v} on an | ||
| 679 | unregistered VC fileset (@pxref{Basic VC Editing}), except that if the | ||
| 680 | VC fileset is already registered, @kbd{C-x v i} signals an error | ||
| 681 | whereas @kbd{C-x v v} performs some other action. | ||
| 682 | |||
| 683 | To register a file, Emacs must choose a version control system. For | ||
| 684 | a multi-file VC fileset, the VC Directory buffer specifies the system | ||
| 685 | to use (@pxref{VC Directory Mode}). For a single-file VC fileset, if | ||
| 686 | the file's directory already contains files registered in a version | ||
| 687 | control system, or if the directory is part of a directory tree | ||
| 688 | controlled by a version control system, Emacs chooses that system. In | ||
| 689 | the event that more than one version control system is applicable, | ||
| 690 | Emacs uses the one that appears first in the variable | ||
| 691 | @iftex | ||
| 692 | @code{vc-handled-backends}. | ||
| 693 | @end iftex | ||
| 694 | @ifnottex | ||
| 695 | @code{vc-handled-backends} (@pxref{Customizing VC}). | ||
| 696 | @end ifnottex | ||
| 697 | If Emacs cannot find a version control system to register the file | ||
| 698 | under, it prompts for a repository type, creates a new repository, and | ||
| 699 | registers the file into that repository. | ||
| 700 | |||
| 701 | On most version control systems, registering a file with @kbd{C-x v | ||
| 702 | i} or @kbd{C-x v v} adds it to the ``working tree'' but not to the | ||
| 703 | repository. Such files are labeled as @samp{added} in the VC | ||
| 704 | Directory buffer, and show a revision ID of @samp{@@@@} in the mode | ||
| 705 | line. To make the registration take effect in the repository, you | ||
| 706 | must perform a commit (@pxref{Basic VC Editing}). Note that a single | ||
| 707 | commit can include both file additions and edits to existing files. | ||
| 708 | |||
| 709 | On a locking-based version control system (@pxref{VCS Merging}), | ||
| 710 | registering a file leaves it unlocked and read-only. Type @kbd{C-x v | ||
| 711 | v} if you wish to start editing it. | ||
| 660 | 712 | ||
| 661 | @node Old Revisions | 713 | @node Old Revisions |
| 662 | @subsection Examining And Comparing Old Revisions | 714 | @subsection Examining And Comparing Old Revisions |
| 663 | 715 | ||
| 664 | One of the convenient features of version control is the ability | ||
| 665 | to examine any revision of a file, or compare two revisions. | ||
| 666 | |||
| 667 | @table @kbd | 716 | @table @kbd |
| 668 | @item C-x v ~ | ||
| 669 | Prompt for a revision of the current file, and visit it in a buffer of | ||
| 670 | its own (@code{vc-revision-other-window}). | ||
| 671 | |||
| 672 | @item C-x v = | 717 | @item C-x v = |
| 673 | Compare the files in the current fileset with the working revision(s) | 718 | Compare the work files in the current VC fileset with the versions you |
| 674 | you started from (@code{vc-diff}). With a prefix argument, prompt for | 719 | started from (@code{vc-diff}). With a prefix argument, prompt for two |
| 675 | two revisions of the current fileset and compare them. You can call | 720 | revisions of the current VC fileset and compare them. You can also |
| 676 | this command from a Dired buffer (@pxref{Dired}). | 721 | call this command from a Dired buffer (@pxref{Dired}). |
| 722 | |||
| 723 | @ifnottex | ||
| 724 | @item M-x vc-ediff | ||
| 725 | Like @kbd{C-x v =}, but using Ediff. @xref{Top, Ediff, ediff, The | ||
| 726 | Ediff Manual}. | ||
| 727 | @end ifnottex | ||
| 677 | 728 | ||
| 678 | @item C-x v D | 729 | @item C-x v D |
| 679 | Compare the entire tree corresponding to the current fileset with the | 730 | Compare the entire working tree to the revision you started from |
| 680 | tree you started from (@code{vc-root-diff}). With a prefix argument, | 731 | (@code{vc-root-diff}). With a prefix argument, prompt for two |
| 681 | prompt for two revisions and compare their trees. | 732 | revisions and compare their trees. |
| 733 | |||
| 734 | @item C-x v ~ | ||
| 735 | Prompt for a revision of the current file, and visit it in a separate | ||
| 736 | buffer (@code{vc-revision-other-window}). | ||
| 682 | 737 | ||
| 683 | @item C-x v g | 738 | @item C-x v g |
| 684 | Display an annotated version of the file: for each line, show the | 739 | Display an annotated version of the current file: for each line, show |
| 685 | latest revision in which it was modified (@code{vc-annotate}). | 740 | the latest revision in which it was modified (@code{vc-annotate}). |
| 686 | @end table | 741 | @end table |
| 687 | 742 | ||
| 688 | @findex vc-revision-other-window | ||
| 689 | @kindex C-x v ~ | ||
| 690 | To examine an old revision, visit the work file and type @kbd{C-x v | ||
| 691 | ~ @var{revision} @key{RET}} (@code{vc-revision-other-window}). Here, | ||
| 692 | @var{revision} is either the desired revision ID (@pxref{VCS | ||
| 693 | Concepts}), or the name of a tag or branch | ||
| 694 | @iftex | ||
| 695 | (@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}). | ||
| 696 | @end iftex | ||
| 697 | @ifnottex | ||
| 698 | (@pxref{Tags}). | ||
| 699 | @end ifnottex | ||
| 700 | This command puts the text of the old revision in a file named | ||
| 701 | @file{@var{filename}.~@var{revision}~}, and visits it in its own | ||
| 702 | buffer in a separate window. | ||
| 703 | |||
| 704 | @findex vc-diff | 743 | @findex vc-diff |
| 705 | @kindex C-x v = | 744 | @kindex C-x v = |
| 706 | @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC | 745 | @kbd{C-x v =} (@code{vc-diff}) displays a @dfn{diff} which compares |
| 707 | fileset (saving them if necessary) with the repository revision(s) | 746 | each work file in the current VC fileset to the version(s) from which |
| 708 | from which you started editing. Note that the latter may or may not | 747 | you started editing. The diff is displayed in another window, in a |
| 709 | be the latest revision of the file(s). | 748 | Diff mode buffer (@pxref{Diff Mode}) named @file{*vc-diff*}. The |
| 710 | 749 | usual Diff mode commands are available in this buffer. In particular, | |
| 711 | The diff is displayed in another window, in a Diff mode buffer | 750 | the @kbd{g} (@code{revert-buffer}) command performs the file |
| 712 | (@pxref{Diff Mode}) named @file{*vc-diff*}. In this buffer, the | 751 | comparison again, generating a new diff. |
| 713 | @kbd{g} (@code{revert-buffer}) command performs the file comparison | ||
| 714 | again, generating a new diff. | ||
| 715 | 752 | ||
| 716 | @findex vc-diff | ||
| 717 | @kindex C-u C-x v = | 753 | @kindex C-u C-x v = |
| 718 | To compare two arbitrary revisions of the current VC fileset, call | 754 | To compare two arbitrary revisions of the current VC fileset, call |
| 719 | @code{vc-diff} with a prefix argument: @kbd{C-u C-x v =}. This | 755 | @code{vc-diff} with a prefix argument: @kbd{C-u C-x v =}. This |
| 720 | prompts for two revision IDs, using the minibuffer, and displays the | 756 | prompts for two revision IDs (@pxref{VCS Concepts}), and displays a |
| 721 | diff in a special buffer in another window. Instead of providing a | 757 | diff between those versions of the fileset. This will not work |
| 722 | revision ID, you can give an empty input, which specifies the current | 758 | reliably for multi-file VC filesets, if the version control system is |
| 723 | contents of the work file; or a tag or branch name | 759 | file-based rather than changeset-based (e.g.@: CVS), since then |
| 724 | @iftex | 760 | revision IDs for different files would not be related in any |
| 725 | (@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}). | 761 | meaningful way. |
| 726 | @end iftex | 762 | |
| 763 | Instead of the revision ID, some version control systems let you | ||
| 764 | specify revisions in other formats. For instance, under Bazaar you | ||
| 765 | can enter @samp{date:yesterday} for the argument to @kbd{C-u C-x v =} | ||
| 766 | (and related commands) to specify the first revision committed after | ||
| 767 | yesterday. See the documentation of the version control system for | ||
| 768 | details. | ||
| 769 | |||
| 770 | If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a Dired buffer | ||
| 771 | (@pxref{Dired}), the file listed on the current line is treated as the | ||
| 772 | current VC fileset. | ||
| 773 | |||
| 727 | @ifnottex | 774 | @ifnottex |
| 728 | (@pxref{Tags}). | 775 | @findex vc-ediff |
| 776 | @kbd{M-x vc-ediff} works like @kbd{C-x v =}, except that it uses an | ||
| 777 | Ediff session. @xref{Top, Ediff, ediff, The Ediff Manual}. | ||
| 729 | @end ifnottex | 778 | @end ifnottex |
| 730 | If your version control system is file-based (e.g. CVS) rather than | ||
| 731 | changeset-based (Subversion, GNU Arch, git, Mercurial), supplying a | ||
| 732 | revision ID for a multi-file fileset (as opposed to a symbolic tag | ||
| 733 | name) is unlikely to return diffs that are connected in any meaningful | ||
| 734 | way. | ||
| 735 | |||
| 736 | The command @kbd{C-x v D} (@code{vc-root-diff}) is similar to | ||
| 737 | @kbd{C-x v =}, but it compares the entire tree associated with the | ||
| 738 | current VC fileset with the tree you started with. This means all the | ||
| 739 | files controlled by the current version control repository, even those | ||
| 740 | that are not part of the current VC fileset. | ||
| 741 | |||
| 742 | If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a buffer that | ||
| 743 | is neither visiting a version-controlled file nor a VC directory | ||
| 744 | buffer, these commands generate a diff of all registered files in the | ||
| 745 | current directory and its subdirectories. | ||
| 746 | 779 | ||
| 747 | @findex vc-ediff | 780 | @findex vc-root-diff |
| 748 | The function @code{vc-ediff} works like @code{vc-diff} and provides a way to | 781 | @kindex C-x v D |
| 749 | visually compare two revisions of a file in an Ediff session, @pxref{Top, | 782 | @kbd{C-x v D} (@code{vc-root-diff}) is similar to @kbd{C-x v =}, but |
| 750 | Ediff, ediff, The Ediff Manual}. It compares the file associated with the | 783 | it displays the changes in the entire current working tree (i.e.@: the |
| 751 | current buffer with the last repository revision. To compare two arbitrary | 784 | working tree containing the current VC fileset). If you invoke this |
| 752 | revisions of the current file, call @code{vc-ediff} with a prefix argument. | 785 | command from a Dired buffer, it applies to the working tree containing |
| 786 | the directory. | ||
| 753 | 787 | ||
| 754 | @vindex vc-diff-switches | 788 | @vindex vc-diff-switches |
| 755 | @vindex vc-rcs-diff-switches | 789 | You can customize the @command{diff} options that @kbd{C-x v =} and |
| 756 | @kbd{C-x v =} works by running a variant of the @code{diff} utility | 790 | @kbd{C-x v D} use for generating diffs. The options used are taken |
| 757 | designed to work with the version control system in use. The options | 791 | from the first non-@code{nil} value amongst the variables |
| 758 | to pass to the @code{diff} command are taken from the first non-@code{nil} | 792 | @code{vc-@var{backend}-diff-switches}, @code{vc-diff-switches}, and |
| 759 | value of @code{vc-@var{backend}-diff-switches}, @code{vc-diff-switches}, | 793 | @code{diff-switches} (@pxref{Comparing Files}), in that order. Here, |
| 760 | and @code{diff-switches} (@pxref{Comparing Files}), in that order. | 794 | @var{backend} stands for the relevant version control system, |
| 761 | Since @code{nil} means to check the next variable in the sequence, | 795 | e.g.@: @code{bzr} for Bazaar. Since @code{nil} means to check the |
| 762 | either of the first two may use the value @code{t} to mean no switches at all. | 796 | next variable in the sequence, either of the first two may use the |
| 763 | Most of the @samp{vc@dots{}diff-switches} variables default to | 797 | value @code{t} to mean no switches at all. Most of the |
| 764 | @code{nil}, but some default to @code{t}. These are for those version | 798 | @code{vc-@var{backend}-diff-switches} variables default to @code{nil}, |
| 765 | control systems (e.g. SVN) whose @code{diff} implementations do not | 799 | but some default to @code{t}; these are for version control systems |
| 766 | accept common options (e.g. @samp{-c}) likely to be in | 800 | whose @code{diff} implementations do not accept common diff options, |
| 767 | @code{diff-switches}. | 801 | such as Subversion. |
| 768 | 802 | ||
| 769 | The buffer produced by @kbd{C-x v =} supports the commands of | 803 | @findex vc-revision-other-window |
| 770 | Compilation mode (@pxref{Compilation Mode}), such as @kbd{C-x `} and | 804 | @kindex C-x v ~ |
| 771 | @kbd{C-c C-c}, in both the ``old'' and ``new'' text, and they always | 805 | To directly examine an older version of a file, visit the work file |
| 772 | find the corresponding locations in the current work file. (Older | 806 | and type @kbd{C-x v ~ @var{revision} @key{RET}} |
| 773 | revisions are not, in general, present as files on your disk.) | 807 | (@code{vc-revision-other-window}). This retrieves the file version |
| 808 | corresponding to @var{revision}, saves it to | ||
| 809 | @file{@var{filename}.~@var{revision}~}, and visits it in a separate | ||
| 810 | window. | ||
| 774 | 811 | ||
| 775 | @findex vc-annotate | 812 | @findex vc-annotate |
| 776 | @kindex C-x v g | 813 | @kindex C-x v g |
| 777 | For some back ends, you can display the file @dfn{annotated} with | 814 | Many version control systems allow you to view files @dfn{annotated} |
| 778 | per-line revision information, by typing @kbd{C-x v g} | 815 | with per-line revision information, by typing @kbd{C-x v g} |
| 779 | (@code{vc-annotate}). This creates a new buffer (the ``annotate | 816 | (@code{vc-annotate}). This creates a new buffer (the ``annotate |
| 780 | buffer'') displaying the file's text, with each part colored to show | 817 | buffer'') displaying the file's text, with each line colored to show |
| 781 | how old it is. Text colored red is new, blue means old, and | 818 | how old it is. Red text is new, blue is old, and intermediate colors |
| 782 | intermediate colors indicate intermediate ages. By default, the color | 819 | indicate intermediate ages. By default, the color is scaled over the |
| 783 | is scaled over the full range of ages, such that the oldest changes | 820 | full range of ages, such that the oldest changes are blue, and the |
| 784 | are blue, and the newest changes are red. | 821 | newest changes are red. |
| 785 | 822 | ||
| 786 | When you give a prefix argument to this command, Emacs reads two | 823 | When you give a prefix argument to this command, Emacs reads two |
| 787 | arguments using the minibuffer: the ID of which revision to display and | 824 | arguments using the minibuffer: the revision to display and annotate |
| 788 | annotate (instead of the current file contents), and the time span in | 825 | (instead of the current file contents), and the time span in days the |
| 789 | days the color range should cover. | 826 | color range should cover. |
| 790 | 827 | ||
| 791 | From the annotate buffer, these and other color scaling options are | 828 | From the annotate buffer, these and other color scaling options are |
| 792 | available from the @samp{VC-Annotate} menu. In this buffer, you can | 829 | available from the @samp{VC-Annotate} menu. In this buffer, you can |
| @@ -795,13 +832,13 @@ view diffs, or view log entries: | |||
| 795 | 832 | ||
| 796 | @table @kbd | 833 | @table @kbd |
| 797 | @item p | 834 | @item p |
| 798 | Annotate the previous revision, that is to say, the revision before | 835 | Annotate the previous revision, i.e.@: the revision before the one |
| 799 | the one currently annotated. A numeric prefix argument is a repeat | 836 | currently annotated. A numeric prefix argument is a repeat count, so |
| 800 | count, so @kbd{C-u 10 p} would take you back 10 revisions. | 837 | @kbd{C-u 10 p} would take you back 10 revisions. |
| 801 | 838 | ||
| 802 | @item n | 839 | @item n |
| 803 | Annotate the next revision---the one after the revision currently | 840 | Annotate the next revision, i.e.@: the revision after the one |
| 804 | annotated. A numeric prefix argument is a repeat count. | 841 | currently annotated. A numeric prefix argument is a repeat count. |
| 805 | 842 | ||
| 806 | @item j | 843 | @item j |
| 807 | Annotate the revision indicated by the current line. | 844 | Annotate the revision indicated by the current line. |
| @@ -840,76 +877,12 @@ Toggle the annotation visibility. This is useful for looking just at | |||
| 840 | the file contents without distraction from the annotations. | 877 | the file contents without distraction from the annotations. |
| 841 | @end table | 878 | @end table |
| 842 | 879 | ||
| 843 | @node Secondary VC Commands | ||
| 844 | @subsection The Secondary Commands of VC | ||
| 845 | |||
| 846 | This section explains the secondary commands of VC. | ||
| 847 | |||
| 848 | @menu | ||
| 849 | * Registering:: Putting a file under version control. | ||
| 850 | * VC Change Log:: Viewing the VC Change Log. | ||
| 851 | * VC Undo:: Canceling changes before or after check-in. | ||
| 852 | @end menu | ||
| 853 | |||
| 854 | @node Registering | ||
| 855 | @subsubsection Registering a File for Version Control | ||
| 856 | |||
| 857 | @kindex C-x v i | ||
| 858 | @findex vc-register | ||
| 859 | You can put any file under version control by simply visiting it, and | ||
| 860 | then typing @w{@kbd{C-x v i}} (@code{vc-register}). | ||
| 861 | |||
| 862 | @table @kbd | ||
| 863 | @item C-x v i | ||
| 864 | Register the visited file for version control. | ||
| 865 | @end table | ||
| 866 | |||
| 867 | To register the file, Emacs must choose which version control system | ||
| 868 | to use for it. If the file's directory already contains files | ||
| 869 | registered in a version control system, Emacs uses that system. If | ||
| 870 | there is more than one system in use for a directory, Emacs uses the | ||
| 871 | one that appears first in @code{vc-handled-backends} | ||
| 872 | @iftex | ||
| 873 | (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). | ||
| 874 | @end iftex | ||
| 875 | @ifnottex | ||
| 876 | (@pxref{Customizing VC}). | ||
| 877 | @end ifnottex | ||
| 878 | On the other hand, if there are no files already registered, Emacs uses | ||
| 879 | the first system from @code{vc-handled-backends} that could register | ||
| 880 | the file (for example, you cannot register a file under CVS if its | ||
| 881 | directory is not already part of a CVS tree); with the default value | ||
| 882 | of @code{vc-handled-backends}, this means that Emacs uses RCS in this | ||
| 883 | situation. | ||
| 884 | |||
| 885 | If locking is in use, @kbd{C-x v i} leaves the file unlocked and | ||
| 886 | read-only. Type @kbd{C-x v v} if you wish to start editing it. After | ||
| 887 | registering a file with CVS, you must subsequently commit the initial | ||
| 888 | revision by typing @kbd{C-x v v}. Until you do that, the revision ID | ||
| 889 | appears as @samp{@@@@} in the mode line. | ||
| 890 | |||
| 891 | @vindex vc-default-init-revision | ||
| 892 | @cindex initial revision ID to register | ||
| 893 | The default initial revision ID for a newly registered file | ||
| 894 | varies by what VCS you are using; normally it will be 1.1 on VCSes | ||
| 895 | that use dot-pair revision IDs and 1 on VCSes that use monotonic IDs. | ||
| 896 | You can specify a different default by setting the variable | ||
| 897 | @code{vc-default-init-revision}, or you can give @kbd{C-x v i} a | ||
| 898 | numeric argument; then it reads the initial revision ID for this | ||
| 899 | particular file using the minibuffer. | ||
| 900 | |||
| 901 | @c See http://debbugs.gnu.org/9745 | ||
| 902 | @c @vindex vc-initial-comment | ||
| 903 | @c If @code{vc-initial-comment} is non-@code{nil}, @kbd{C-x v i} reads an | ||
| 904 | @c initial comment to describe the purpose of this source file. Reading | ||
| 905 | @c the initial comment works like reading a log entry (@pxref{Log Buffer}). | ||
| 906 | |||
| 907 | @node VC Change Log | 880 | @node VC Change Log |
| 908 | @subsubsection VC Change Log | 881 | @subsection VC Change Log |
| 909 | 882 | ||
| 910 | @table @kbd | 883 | @table @kbd |
| 911 | @item C-x v l | 884 | @item C-x v l |
| 912 | Display revision control state and change history | 885 | Display the change history for the current fileset |
| 913 | (@code{vc-print-log}). | 886 | (@code{vc-print-log}). |
| 914 | 887 | ||
| 915 | @item C-x v L | 888 | @item C-x v L |
| @@ -928,85 +901,91 @@ Display the changes that will be sent by the next push operation | |||
| 928 | @kindex C-x v l | 901 | @kindex C-x v l |
| 929 | @findex vc-print-log | 902 | @findex vc-print-log |
| 930 | The command @kbd{C-x v l} (@code{vc-print-log}) displays a buffer | 903 | The command @kbd{C-x v l} (@code{vc-print-log}) displays a buffer |
| 931 | named @samp{*vc-change-log*} in a new window. This buffer lists the | 904 | named @samp{*vc-change-log*}, showing the history of changes made to |
| 932 | changes to the current file, including the associated log entries. | 905 | the current file, including who made the changes, the dates, and the |
| 933 | (These are the log entries associated with the version control system, | 906 | log entry for each change (these are the same log entries you would |
| 934 | i.e. the ones you enter via the @samp{*VC-Log*} buffer. @xref{Log | 907 | enter via the @samp{*vc-log*} buffer; @pxref{Log Buffer}). Point is |
| 935 | Buffer}.) Point is centered at the revision of the file currently | 908 | centered at the revision of the file currently being visited. With a |
| 936 | being visited. With a prefix argument, the command prompts for the | 909 | prefix argument, the command prompts for the revision to center on, |
| 937 | revision to center on, and the maximum number of revisions to display. | 910 | and the maximum number of revisions to display. |
| 938 | You can call this command from a Dired buffer (@pxref{Dired}). | 911 | |
| 912 | If you call @kbd{C-x v l} from a VC Directory buffer (@pxref{VC | ||
| 913 | Directory Mode}) or a Dired buffer (@pxref{Dired}), it applies to the | ||
| 914 | file listed on the current line. | ||
| 939 | 915 | ||
| 940 | @findex vc-print-root-log | 916 | @findex vc-print-root-log |
| 941 | Type @kbd{C-x v L} (@code{vc-print-root-log}) to display a | 917 | @findex log-view-toggle-entry-display |
| 942 | @samp{*vc-change-log*} buffer showing the history of the | 918 | @kbd{C-x v L} (@code{vc-print-root-log}) displays a |
| 943 | version-controlled directory tree as a whole. With a prefix argument, | 919 | @samp{*vc-change-log*} buffer showing the history of the entire |
| 944 | the command prompts for the maximum number of revisions to display. | 920 | version-controlled directory tree (RCS, SCCS, and CVS do not support |
| 945 | RCS, SCCS, and CVS do not support this feature. | 921 | this feature). With a prefix argument, the command prompts for the |
| 946 | 922 | maximum number of revisions to display. | |
| 947 | On a distributed version control system, the @kbd{C-x v I} | 923 | |
| 924 | The @kbd{C-x v L} history is shown in a compact form, usually | ||
| 925 | showing only the first line of each log entry. However, you can type | ||
| 926 | @key{RET} (@code{log-view-toggle-entry-display}) in the | ||
| 927 | @samp{*vc-change-log*} buffer to reveal the entire log entry for the | ||
| 928 | revision at point. A second @key{RET} hides it again. | ||
| 929 | |||
| 930 | On a decentralized version control system, the @kbd{C-x v I} | ||
| 948 | (@code{vc-log-incoming}) command displays a log buffer showing the | 931 | (@code{vc-log-incoming}) command displays a log buffer showing the |
| 949 | changes that will be applied, the next time you run the version | 932 | changes that will be applied, the next time you run the version |
| 950 | control system's ``pull'' command to get new revisions from another | 933 | control system's ``pull'' command to get new revisions from another |
| 951 | repository. This other repository is the default one from which | 934 | repository (@pxref{VC Pull}). This other repository is the default |
| 952 | changes are pulled, as defined by the version control system; with a | 935 | one from which changes are pulled, as defined by the version control |
| 953 | prefix argument, @code{vc-log-incoming} prompts for a specific | 936 | system; with a prefix argument, @code{vc-log-incoming} prompts for a |
| 954 | repository from which changes would be pulled, and lists the changes | 937 | specific repository. Similarly, @kbd{C-x v O} |
| 955 | accordingly. Similarly, @kbd{C-x v O} (@code{vc-log-outgoing}) shows | 938 | (@code{vc-log-outgoing}) shows the changes that will be sent to |
| 956 | the changes that will be sent to another repository, the next time you | 939 | another repository, the next time you run the ``push'' command; with a |
| 957 | run the ``push'' command; with a prefix argument, it prompts for a | 940 | prefix argument, it prompts for a specific destination repository. |
| 958 | specific repository to which changes would be pushed. | ||
| 959 | 941 | ||
| 960 | In the @samp{*vc-change-log*} buffer, you can use the following keys | 942 | In the @samp{*vc-change-log*} buffer, you can use the following keys |
| 961 | to move between the logs of revisions and of files, to view past | 943 | to move between the logs of revisions and of files, and to examine and |
| 962 | revisions, to modify change comments, to view annotations and to view | 944 | compare past revisions (@pxref{Old Revisions}): |
| 963 | diffs: | ||
| 964 | 945 | ||
| 965 | @table @kbd | 946 | @table @kbd |
| 966 | @item p | 947 | @item p |
| 967 | Move to the previous revision-item in the buffer. (Revision entries in the log | 948 | Move to the previous revision entry. (Revision entries in the log |
| 968 | buffer are usually in reverse-chronological order, so the previous | 949 | buffer are usually in reverse-chronological order, so the previous |
| 969 | revision-item usually corresponds to a newer revision.) A numeric | 950 | revision-item usually corresponds to a newer revision.) A numeric |
| 970 | prefix argument is a repeat count. | 951 | prefix argument is a repeat count. |
| 971 | 952 | ||
| 972 | @item n | 953 | @item n |
| 973 | Move to the next revision-item (which most often corresponds to the | 954 | Move to the next revision entry. A numeric prefix argument is a |
| 974 | previous revision of the file). A numeric prefix argument is a repeat | 955 | repeat count. |
| 975 | count. | ||
| 976 | 956 | ||
| 977 | @item P | 957 | @item P |
| 978 | Move to the log of the previous file, when the logs of multiple files | 958 | Move to the log of the previous file, if showing logs for a multi-file |
| 979 | are in the log buffer (@pxref{VC Directory Mode}). Otherwise, just | 959 | VC fileset. Otherwise, just move to the beginning of the log. A |
| 980 | move to the beginning of the log. A numeric prefix argument is a | 960 | numeric prefix argument is a repeat count. |
| 981 | repeat count, so @kbd{C-u 10 P} would move backward 10 files. | ||
| 982 | 961 | ||
| 983 | @item N | 962 | @item N |
| 984 | Move to the log of the next file, when the logs of multiple files are | 963 | Move to the log of the next file, if showing logs for a multi-file VC |
| 985 | in the log buffer (@pxref{VC Directory Mode}). It also takes a | 964 | fileset. A numeric prefix argument is a repeat count. |
| 986 | numeric prefix argument as a repeat count. | ||
| 987 | 965 | ||
| 988 | @item a | 966 | @item a |
| 989 | Annotate the revision indicated by the current line. | 967 | Annotate the revision on the current line (@pxref{Old Revisions}). |
| 990 | 968 | ||
| 991 | @item e | 969 | @item e |
| 992 | Modify the change comment displayed at point. Note that not all VC | 970 | Modify the change comment displayed at point. Note that not all VC |
| 993 | systems support modifying change comments. | 971 | systems support modifying change comments. |
| 994 | 972 | ||
| 995 | @item f | 973 | @item f |
| 996 | Visit the revision indicated at the current line, like typing @kbd{C-x | 974 | Visit the revision indicated at the current line. |
| 997 | v ~} and specifying this revision's ID (@pxref{Old Revisions}). | ||
| 998 | 975 | ||
| 999 | @item d | 976 | @item d |
| 1000 | Display the diff (@pxref{Comparing Files}) between the revision | 977 | Display a diff between the revision at point and the next earlier |
| 1001 | indicated at the current line and the next earlier revision. This is | 978 | revision, for the specific file. |
| 1002 | useful to see what actually changed in the file when the revision | ||
| 1003 | indicated on the current line was committed. | ||
| 1004 | 979 | ||
| 1005 | @item D | 980 | @item D |
| 1006 | Display the changeset diff (@pxref{Comparing Files}) between the | 981 | Display the changeset diff between the revision at point and the next |
| 1007 | revision indicated at the current line and the next earlier revision. | 982 | earlier revision. This shows the changes to all files made in that |
| 1008 | This is useful to see all the changes to all files that the revision | 983 | revision. |
| 1009 | indicated on the current line did when it was committed. | 984 | |
| 985 | @item @key{RET} | ||
| 986 | In a compact-style log buffer (e.g.@: the one created by @kbd{C-x v | ||
| 987 | L}), toggle between showing and hiding the full log entry for the | ||
| 988 | revision at point. | ||
| 1010 | @end table | 989 | @end table |
| 1011 | 990 | ||
| 1012 | @vindex vc-log-show-limit | 991 | @vindex vc-log-show-limit |
| @@ -1020,62 +999,71 @@ entries} or @samp{Show unlimited entries} buttons at the end of the | |||
| 1020 | buffer. However, RCS, SCCS, and CVS do not support this feature. | 999 | buffer. However, RCS, SCCS, and CVS do not support this feature. |
| 1021 | 1000 | ||
| 1022 | @node VC Undo | 1001 | @node VC Undo |
| 1023 | @subsubsection Undoing Version Control Actions | 1002 | @subsection Undoing Version Control Actions |
| 1024 | 1003 | ||
| 1025 | @table @kbd | 1004 | @table @kbd |
| 1026 | @item C-x v u | 1005 | @item C-x v u |
| 1027 | Revert the buffer and the file to the working revision from which you started | 1006 | Revert the work file(s) in the current VC fileset to the last revision |
| 1028 | editing the file. | 1007 | (@code{vc-revert}). |
| 1029 | |||
| 1030 | @item C-x v c | ||
| 1031 | Remove the last-entered change from the master for the visited file. | ||
| 1032 | This undoes your last check-in. | ||
| 1033 | @end table | 1008 | @end table |
| 1034 | 1009 | ||
| 1010 | @c `C-x v c' (vc-rollback) was removed, since it's RCS/SCCS specific. | ||
| 1011 | |||
| 1035 | @kindex C-x v u | 1012 | @kindex C-x v u |
| 1036 | @findex vc-revert-buffer | 1013 | @findex vc-revert |
| 1037 | If you want to discard your current set of changes and revert to the | 1014 | @vindex vc-revert-show-diff |
| 1038 | working revision from which you started editing the file, use @kbd{C-x | 1015 | If you want to discard all the changes you have made to the current |
| 1039 | v u} (@code{vc-revert-buffer}). If the version control system is | 1016 | VC fileset, type @kbd{C-x v u} (@code{vc-revert-buffer}). This shows |
| 1040 | locking-based, this leaves the file unlocked, and you must lock it | 1017 | you a diff between the work file(s) and the revision from which you |
| 1041 | again before making new changes. @kbd{C-x v u} requires confirmation, | 1018 | started editing, and asks for confirmation for discarding the changes. |
| 1042 | unless it sees that you haven't made any changes with respect to the | 1019 | If you agree, the fileset is reverted. If you don't want @kbd{C-x v |
| 1043 | master copy of the working revision. | 1020 | u} to show a diff, set the variable @code{vc-revert-show-diff} to |
| 1044 | 1021 | @code{nil} (you can still view the diff directly with @kbd{C-x v =}; | |
| 1045 | @kbd{C-x v u} is also the command to unlock a file if you lock it and | 1022 | @pxref{Old Revisions}). Note that @kbd{C-x v u} cannot be reversed |
| 1046 | then decide not to change it. | 1023 | with the usual undo commands (@pxref{Undo}), so use it with care. |
| 1047 | 1024 | ||
| 1048 | @kindex C-x v c | 1025 | On locking-based version control systems, @kbd{C-x v u} leaves files |
| 1049 | @findex vc-rollback | 1026 | unlocked; you must lock again to resume editing. You can also use |
| 1050 | To cancel a change that you already committed, use @kbd{C-x v c} | 1027 | @kbd{C-x v u} to unlock a file if you lock it and then decide not to |
| 1051 | (@code{vc-rollback}). This command discards all record of the most | 1028 | change it. |
| 1052 | recent checked-in revision, but only if your work file corresponds to | ||
| 1053 | that revision---you cannot use @kbd{C-x v c} to cancel a revision that | ||
| 1054 | is not the latest on its branch. Note that many version control | ||
| 1055 | systems do not support rollback at all; this command is something of a | ||
| 1056 | historical relic. | ||
| 1057 | 1029 | ||
| 1058 | @node VC Directory Mode | 1030 | @node VC Directory Mode |
| 1059 | @subsection VC Directory Mode | 1031 | @subsection VC Directory Mode |
| 1060 | 1032 | ||
| 1033 | @cindex VC Directory buffer | ||
| 1034 | The @dfn{VC Directory buffer} is a specialized buffer for viewing | ||
| 1035 | the version control statuses of the files in a directory tree, and | ||
| 1036 | performing version control operations on those files. In particular, | ||
| 1037 | it is used to specify multi-file VC filesets for commands like | ||
| 1038 | @w{@kbd{C-x v v}} to act on (@pxref{VC Directory Commands}). | ||
| 1039 | |||
| 1061 | @kindex C-x v d | 1040 | @kindex C-x v d |
| 1062 | @findex vc-dir | 1041 | @findex vc-dir |
| 1063 | When you are working on a large program, it is often useful to find | 1042 | To use the VC Directory buffer, type @kbd{C-x v d} (@code{vc-dir}). |
| 1064 | out which files have changed within an entire directory tree, or to | 1043 | This reads a directory name using the minibuffer, and switches to a VC |
| 1065 | view the status of all files under version control at once, and to | 1044 | Directory buffer for that directory. By default, the buffer is named |
| 1066 | perform version control operations on collections of files. You can | 1045 | @samp{*vc-dir*}. Its contents are described |
| 1067 | use the command @kbd{C-x v d} (@code{vc-dir}) to make a directory | 1046 | @iftex |
| 1068 | listing that includes only files relevant for version control. This | 1047 | below. |
| 1069 | creates a @dfn{VC Directory buffer} and displays it in a separate | 1048 | @end iftex |
| 1070 | window. | 1049 | @ifnottex |
| 1050 | in @ref{VC Directory Buffer}. | ||
| 1051 | @end ifnottex | ||
| 1052 | |||
| 1053 | The @code{vc-dir} command automatically detects the version control | ||
| 1054 | system to be used in the specified directory. In the event that more | ||
| 1055 | than one system is being used in the directory, you should invoke the | ||
| 1056 | command with a prefix argument, @kbd{C-u C-x v d}; this prompts for | ||
| 1057 | the version control system which the VC Directory buffer should use. | ||
| 1071 | 1058 | ||
| 1059 | @ifnottex | ||
| 1072 | @cindex PCL-CVS | 1060 | @cindex PCL-CVS |
| 1073 | @pindex cvs | 1061 | @pindex cvs |
| 1074 | @cindex CVS directory mode | 1062 | @cindex CVS directory mode |
| 1075 | The VC Directory buffer works with all the version control systems | 1063 | In addition to the VC Directory buffer, Emacs has a similar facility |
| 1076 | that VC supports. For CVS, Emacs also offers a more powerful facility | 1064 | called PCL-CVS which is specialized for CVS. @xref{Top, , About |
| 1077 | called PCL-CVS. @xref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The | 1065 | PCL-CVS, pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}. |
| 1078 | Emacs Front-End to CVS}. | 1066 | @end ifnottex |
| 1079 | 1067 | ||
| 1080 | @menu | 1068 | @menu |
| 1081 | * Buffer: VC Directory Buffer. What the buffer looks like and means. | 1069 | * Buffer: VC Directory Buffer. What the buffer looks like and means. |
| @@ -1086,369 +1074,367 @@ Emacs Front-End to CVS}. | |||
| 1086 | @subsubsection The VC Directory Buffer | 1074 | @subsubsection The VC Directory Buffer |
| 1087 | 1075 | ||
| 1088 | The VC Directory buffer contains a list of version-controlled files | 1076 | The VC Directory buffer contains a list of version-controlled files |
| 1089 | in the current directory and its subdirectories. Files which are | 1077 | and their version control statuses. It lists files in the current |
| 1090 | up-to-date (have no local differences from the repository copy) are | 1078 | directory (the one specified when you called @kbd{C-x v d}) and its |
| 1091 | usually hidden; if all files in a subdirectory are up-to-date, the | 1079 | subdirectories, but only those with a ``noteworthy'' status. Files |
| 1092 | subdirectory is hidden as well. There is an exception to this rule: | 1080 | that are up-to-date (i.e.@: the same as in the repository) are |
| 1093 | if VC mode detects that a file has changed to an up-to-date state | 1081 | omitted. If all the files in a subdirectory are up-to-date, the |
| 1094 | since you last looked at it, that file and its state are shown. | 1082 | subdirectory is not listed either. As an exception, if a file has |
| 1095 | 1083 | become up-to-date as a direct result of a VC command, it is listed. | |
| 1096 | If a directory uses more that one version control system, you can | 1084 | |
| 1097 | select which system to use for the @code{vc-dir} command by invoking | 1085 | Here is an example of a VC Directory buffer listing: |
| 1098 | @code{vc-dir} with a prefix argument: @kbd{C-u C-x v d}. | ||
| 1099 | |||
| 1100 | The line for an individual file shows the version control state of | ||
| 1101 | the file. Under RCS and SCCS, the name of the user locking the file | ||
| 1102 | is shown; under CVS, an abbreviated version of the @samp{cvs status} | ||
| 1103 | output is used. Here is an example using CVS: | ||
| 1104 | 1086 | ||
| 1105 | @smallexample | 1087 | @smallexample |
| 1106 | @group | 1088 | @group |
| 1107 | ./ | 1089 | ./ |
| 1108 | modified file1.c | 1090 | edited configure.ac |
| 1109 | needs-update file2.c | 1091 | * added README |
| 1110 | needs-merge file3.c | 1092 | unregistered temp.txt |
| 1093 | src/ | ||
| 1094 | * edited src/main.c | ||
| 1111 | @end group | 1095 | @end group |
| 1112 | @end smallexample | 1096 | @end smallexample |
| 1113 | 1097 | ||
| 1114 | @noindent | 1098 | @noindent |
| 1115 | In this example, @samp{file1.c} is modified with respect to the | 1099 | Two work files have been modified but not committed: |
| 1116 | repository, and @samp{file2.c} is not. @samp{file3.c} is modified, | 1100 | @file{configure.ac} in the current directory, and @file{foo.c} in the |
| 1117 | but other changes have also been committed---you need to merge them | 1101 | @file{src/} subdirectory. The file named @file{README} has been added |
| 1118 | with the work file before you can check it in. | 1102 | but is not yet committed, while @file{temp.txt} is not under version |
| 1119 | 1103 | control (@pxref{Registering}). | |
| 1120 | @vindex vc-stay-local | 1104 | |
| 1121 | @vindex vc-cvs-stay-local | 1105 | The @samp{*} characters next to the entries for @file{README} and |
| 1122 | In the above, if the repository were on a remote machine, VC only | 1106 | @file{src/main.c} indicate that the user has marked out these files as |
| 1123 | contacts it when the variable @code{vc-stay-local} (or | 1107 | the current VC fileset |
| 1124 | @code{vc-cvs-stay-local}) is @code{nil} | ||
| 1125 | @iftex | 1108 | @iftex |
| 1126 | (@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}). | 1109 | (see below). |
| 1127 | @end iftex | 1110 | @end iftex |
| 1128 | @ifnottex | 1111 | @ifnottex |
| 1129 | (@pxref{CVS Options}). | 1112 | (@pxref{VC Directory Commands}). |
| 1113 | @end ifnottex | ||
| 1114 | |||
| 1115 | The above example is typical for a decentralized version control | ||
| 1116 | system like Bazaar, Git, or Mercurial. Other systems can show other | ||
| 1117 | statuses. For instance, CVS shows the @samp{needs-update} status if | ||
| 1118 | the repository has changes that have not been applied to the work | ||
| 1119 | file. RCS and SCCS show the name of the user locking a file as its | ||
| 1120 | status. | ||
| 1121 | |||
| 1122 | @ifnottex | ||
| 1123 | @vindex vc-stay-local | ||
| 1124 | @vindex vc-cvs-stay-local | ||
| 1125 | On CVS and Subversion, the @code{vc-dir} command normally contacts | ||
| 1126 | the repository, which may be on a remote machine, to check for | ||
| 1127 | updates. If you change the variable @code{vc-stay-local} or | ||
| 1128 | @code{vc-cvs-stay-local} (for CVS) to @code{nil} (@pxref{CVS | ||
| 1129 | Options}), then Emacs avoids contacting a remote repository when | ||
| 1130 | generating the VC Directory buffer (it will still contact it when | ||
| 1131 | necessary, e.g.@: when doing a commit). This may be desirable if you | ||
| 1132 | are working offline or the network is slow. | ||
| 1130 | @end ifnottex | 1133 | @end ifnottex |
| 1131 | This is because access to the repository may be slow, or you may be | ||
| 1132 | working offline and not have access to the repository at all. As a | ||
| 1133 | consequence, VC would not be able to tell you that @samp{file3.c} is | ||
| 1134 | in the ``merge'' state; you would learn that only when you try to | ||
| 1135 | check-in your modified copy of the file, or use a command such as | ||
| 1136 | @kbd{C-x v m}. | ||
| 1137 | |||
| 1138 | In practice, this is not a problem because CVS handles this case | ||
| 1139 | consistently whenever it arises. In VC, you'll simply get prompted to | ||
| 1140 | merge the remote changes into your work file first. The benefits of | ||
| 1141 | less network communication usually outweigh the disadvantage of not | ||
| 1142 | seeing remote changes immediately. | ||
| 1143 | 1134 | ||
| 1144 | @vindex vc-directory-exclusion-list | 1135 | @vindex vc-directory-exclusion-list |
| 1145 | When a VC directory displays subdirectories it omits some that | 1136 | The VC Directory buffer omits subdirectories listed in the variable |
| 1146 | should never contain any files under version control. By default, | 1137 | @code{vc-directory-exclusion-list}. Its default value contains |
| 1147 | this includes Version Control subdirectories such as @samp{RCS} and | 1138 | directories that are used internally by version control systems. |
| 1148 | @samp{CVS}; you can customize this by setting the variable | ||
| 1149 | @code{vc-directory-exclusion-list}. | ||
| 1150 | 1139 | ||
| 1151 | @node VC Directory Commands | 1140 | @node VC Directory Commands |
| 1152 | @subsubsection VC Directory Commands | 1141 | @subsubsection VC Directory Commands |
| 1153 | 1142 | ||
| 1154 | VC Directory mode has a full set of navigation and marking commands | 1143 | Emacs provides several commands for navigating the VC Directory |
| 1155 | for picking out filesets. Some of these are also available in a | 1144 | buffer, and for ``marking'' files as belonging to the current VC |
| 1156 | context menu invoked by @kbd{mouse-2}. | 1145 | fileset. |
| 1157 | 1146 | ||
| 1158 | Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p} also | 1147 | @table @kbd |
| 1159 | move vertically as in other list-browsing modes. @key{SPC} and | 1148 | @item n |
| 1160 | @key{TAB} behave like down-arrow, and @key{BackTab} behaves like | 1149 | @itemx @key{SPC} |
| 1161 | up-arrow. | 1150 | Move point to the next entry (@code{vc-dir-next-line}). |
| 1162 | 1151 | ||
| 1163 | Both @kbd{C-m} and @kbd{f} visit the file on the current | 1152 | @item p |
| 1164 | line. @kbd{o} visits that file in another window. @kbd{q} dismisses | 1153 | Move point to the previous entry (@code{vc-dir-previous-line}). |
| 1165 | the directory buffer. | ||
| 1166 | 1154 | ||
| 1167 | @kbd{x} hides up-to-date files. | 1155 | @item @key{TAB} |
| 1156 | Move to the next directory entry (@code{vc-dir-next-directory}). | ||
| 1168 | 1157 | ||
| 1169 | @kbd{m} marks the file or directory on the current line. If the | 1158 | @item S-@key{TAB} |
| 1170 | region is active, @kbd{m} marks all the files in the region. There | 1159 | Move to the previous directory entry |
| 1171 | are some restrictions when marking: a file cannot be marked if any of | 1160 | (@code{vc-dir-previous-directory}). |
| 1172 | its parent directories are marked, and a directory cannot be marked if | ||
| 1173 | any files in it or in its child directories are marked. | ||
| 1174 | 1161 | ||
| 1175 | @kbd{M} marks all the files with the same VC state as the current | 1162 | @item @key{RET} |
| 1176 | file if the cursor is on a file. If the cursor is on a directory, it | 1163 | @itemx f |
| 1177 | marks all child files. With a prefix argument: marks all files and | 1164 | Visit the file or directory listed on the current line |
| 1178 | directories. | 1165 | (@code{vc-dir-find-file}). |
| 1179 | 1166 | ||
| 1180 | @kbd{u} unmarks the file or directory on the current line. If the | 1167 | @item o |
| 1181 | region is active, it unmarks all the files in the region. | 1168 | Visit the file or directory on the current line, in a separate window |
| 1169 | (@code{vc-dir-find-file-other-window}). | ||
| 1182 | 1170 | ||
| 1183 | @kbd{U} marks all the files with the same VC state as the current file | 1171 | @item m |
| 1184 | if the cursor is on a file. If the cursor is on a directory, it | 1172 | Mark the file or directory on the current line (@code{vc-dir-mark}), |
| 1185 | unmarks all child files. With a prefix argument: unmarks all marked | 1173 | putting it in the current VC fileset. If the region is active, mark |
| 1174 | all files in the region. | ||
| 1175 | |||
| 1176 | A file cannot be marked with this command if it is already in a marked | ||
| 1177 | directory, or one of its subdirectories. Similarly, a directory | ||
| 1178 | cannot be marked with this command if any file in its tree is marked. | ||
| 1179 | |||
| 1180 | @item M | ||
| 1181 | If point is on a file entry, mark all files with the same status; if | ||
| 1182 | point is on a directory entry, mark all files in that directory tree | ||
| 1183 | (@code{vc-dir-mark-all-files}). With a prefix argument, mark all | ||
| 1184 | listed files and directories. | ||
| 1185 | |||
| 1186 | @kindex q @r{(VC Directory)} | ||
| 1187 | @findex quit-window | ||
| 1188 | @item q | ||
| 1189 | Bury the VC Directory buffer, and delete its window if the window was | ||
| 1190 | created just for that buffer. | ||
| 1191 | |||
| 1192 | @item u | ||
| 1193 | Unmark the file or directory on the current line. If the region is | ||
| 1194 | active, unmark all the files in the region (@code{vc-dir-unmark}). | ||
| 1195 | |||
| 1196 | @item U | ||
| 1197 | If point is on a file entry, unmark all files with the same status; if | ||
| 1198 | point is on a directory entry, unmark all files in that directory tree | ||
| 1199 | (@code{vc-dir-unmark-all-files}). With a prefix argument, unmark all | ||
| 1186 | files and directories. | 1200 | files and directories. |
| 1187 | 1201 | ||
| 1188 | It is possible to do search, search and replace, incremental search, | 1202 | @item x |
| 1189 | and incremental regexp search on multiple files. These commands will | 1203 | Hide files with @samp{up-to-date} status |
| 1190 | work on all the marked files or the current file if nothing is marked. | 1204 | (@code{vc-dir-hide-up-to-date}). |
| 1191 | If a directory is marked, the files in that directory shown in the VC | ||
| 1192 | directory buffer will be used. | ||
| 1193 | 1205 | ||
| 1194 | @kbd{S} searches the marked files. | 1206 | @item q |
| 1207 | Quit the VC Directory buffer, and bury it (@code{quit-window}). | ||
| 1208 | @end table | ||
| 1195 | 1209 | ||
| 1196 | @kbd{Q} does a query replace on the marked files. | 1210 | @findex vc-dir-mark |
| 1211 | @findex vc-dir-mark-all-files | ||
| 1212 | While in the VC Directory buffer, all the files that you mark with | ||
| 1213 | @kbd{m} (@code{vc-dir-mark}) or @kbd{M} (@code{vc-dir-mark}) are in | ||
| 1214 | the current VC fileset. If you mark a directory entry with @kbd{m}, | ||
| 1215 | all the listed files in that directory tree are in the current VC | ||
| 1216 | fileset. The files and directories that belong to the current VC | ||
| 1217 | fileset are indicated with a @samp{*} character in the VC Directory | ||
| 1218 | buffer, next to their VC status. In this way, you can set up a | ||
| 1219 | multi-file VC fileset to be acted on by VC commands like @w{@kbd{C-x v | ||
| 1220 | v}} (@pxref{Basic VC Editing}), @w{@kbd{C-x v =}} (@pxref{Old | ||
| 1221 | Revisions}), and @w{@kbd{C-x v u}} (@pxref{VC Undo}). | ||
| 1222 | |||
| 1223 | The VC Directory buffer also defines some single-key shortcuts for | ||
| 1224 | VC commands with the @kbd{C-x v} prefix: @kbd{=}, @kbd{+}, @kbd{l}, | ||
| 1225 | @kbd{i}, and @kbd{v}. | ||
| 1226 | |||
| 1227 | For example, you can commit a set of edited files by opening a VC | ||
| 1228 | Directory buffer, where the files are listed with the @samp{edited} | ||
| 1229 | status; marking the files; and typing @kbd{v} or @kbd{C-x v v} | ||
| 1230 | (@code{vc-next-action}). If the version control system is | ||
| 1231 | changeset-based, Emacs will commit the files in a single revision. | ||
| 1232 | |||
| 1233 | While in the VC Directory buffer, you can also perform search and | ||
| 1234 | replace on the current VC fileset, with the following commands: | ||
| 1197 | 1235 | ||
| 1198 | @kbd{M-s a C-s} does an incremental search on the marked files. | 1236 | @table @kbd |
| 1237 | @item S | ||
| 1238 | Search the fileset (@code{vc-dir-search}). | ||
| 1199 | 1239 | ||
| 1200 | @kbd{M-s a C-M-s} does an incremental regular expression search | 1240 | @item Q |
| 1201 | on the marked files. | 1241 | Do a regular expression query replace on the fileset |
| 1242 | (@code{vc-dir-query-replace-regexp}). | ||
| 1243 | |||
| 1244 | @item M-s a C-s | ||
| 1245 | Do an incremental search on the fileset (@code{vc-dir-isearch}). | ||
| 1246 | |||
| 1247 | @item M-s a C-M-s | ||
| 1248 | Do an incremental regular expression search on the fileset | ||
| 1249 | (@code{vc-dir-isearch-regexp}). | ||
| 1250 | @end table | ||
| 1251 | |||
| 1252 | @noindent | ||
| 1253 | Apart from acting on multiple files, these commands behave much like | ||
| 1254 | their single-buffer counterparts (@pxref{Search}). | ||
| 1202 | 1255 | ||
| 1203 | @cindex stashes in version control | 1256 | @cindex stashes in version control |
| 1204 | @cindex shelves in version control | 1257 | @cindex shelves in version control |
| 1205 | Commands are also accessible from the VC-dir menu. Note that some | 1258 | The above commands are also available via the menu bar, and via a |
| 1206 | VC backends use the VC-dir menu to make available extra, | 1259 | context menu invoked by @kbd{Mouse-2}. Furthermore, some VC backends |
| 1207 | backend-specific, commands. For example, Git and Bazaar allow you to | 1260 | use the menu to provide extra backend-specific commands. For example, |
| 1208 | manipulate @dfn{stashes} and @dfn{shelves}. (These provide a | 1261 | Git and Bazaar allow you to manipulate @dfn{stashes} and @dfn{shelves} |
| 1209 | mechanism to temporarily store uncommitted changes somewhere out of | 1262 | (where are a way to temporarily put aside uncommitted changes, and |
| 1210 | the way, and bring them back at a later time.) | 1263 | bring them back at a later time). |
| 1211 | |||
| 1212 | Normal VC commands with the @kbd{C-x v} prefix work in VC directory | ||
| 1213 | buffers. Some single-key shortcuts are available as well; @kbd{=}, | ||
| 1214 | @kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with | ||
| 1215 | @kbd{C-x v}. | ||
| 1216 | |||
| 1217 | The command @kbd{C-x v v} (@code{vc-next-action}) operates on all | ||
| 1218 | the marked files, so that you can commit several files at once. If | ||
| 1219 | the underlying VC supports atomic commits of multiple-file changesets, | ||
| 1220 | @kbd{C-x v v} with a selected set of modified but not committed files | ||
| 1221 | will commit all of them at once as a single changeset. | ||
| 1222 | |||
| 1223 | When @kbd{C-x v v} (@code{vc-next-action}) operates on multiple | ||
| 1224 | files, all of those files must be either in the same state or in | ||
| 1225 | compatible states (added, modified and removed states are considered | ||
| 1226 | compatible). Otherwise it signals an error. This differs from the | ||
| 1227 | behavior of older versions of VC, which did not have fileset | ||
| 1228 | operations and simply did @code{vc-next-action} on each file | ||
| 1229 | individually. | ||
| 1230 | |||
| 1231 | If any files are in a state that calls for commit, @kbd{C-x v v} reads a | ||
| 1232 | single log entry and uses it for the changeset as a whole. If the | ||
| 1233 | underling VCS is file- rather than changeset-oriented, the log entry | ||
| 1234 | will be replicated into the history of each file. | ||
| 1235 | 1264 | ||
| 1236 | @node Branches | 1265 | @node Branches |
| 1237 | @subsection Multiple Branches of a File | 1266 | @subsection Version Control Branches |
| 1238 | @cindex branch (version control) | 1267 | @cindex branch (version control) |
| 1239 | @cindex trunk (version control) | 1268 | |
| 1240 | 1269 | One use of version control is to support multiple independent lines | |
| 1241 | One use of version control is to maintain multiple ``current'' | 1270 | of development, which are called @dfn{branches}. Branches are used |
| 1242 | revisions of a file. For example, you might have different revisions of a | 1271 | for maintaining separate ``stable'' and ``development'' versions of a |
| 1243 | program in which you are gradually adding various unfinished new | 1272 | program, and for developing unrelated features in isolation from one |
| 1244 | features. Each such independent line of development is called a | 1273 | another. |
| 1245 | @dfn{branch}. VC allows you to create branches, switch between | 1274 | |
| 1246 | different branches, and merge changes from one branch to another. | 1275 | VC's support for branch operations is currently fairly limited. For |
| 1247 | Please note, however, that branches are not supported for SCCS. | 1276 | decentralized version control systems, it provides commands for |
| 1248 | 1277 | @dfn{updating} one branch with the contents of another, and for | |
| 1249 | A file's main line of development is usually called the @dfn{trunk}. | 1278 | @dfn{merging} the changes made to two different branches |
| 1250 | You can create multiple branches from the trunk. How the difference | 1279 | (@pxref{Merging}). For centralized version control systems, it |
| 1251 | between trunk and branch is made visible is dependent on whether the | 1280 | supports checking out different branches and committing into new or |
| 1252 | VCS uses dot-pair or monotonic version IDs. | 1281 | different branches. |
| 1253 | |||
| 1254 | In VCSes with dot-pair revision IDs, the revisions on the trunk are | ||
| 1255 | normally IDed 1.1, 1.2, 1.3, etc. At any such revision, you can | ||
| 1256 | start an independent branch. A branch starting at revision 1.2 would | ||
| 1257 | have revision ID 1.2.1.1, and consecutive revisions on this branch | ||
| 1258 | would have IDs 1.2.1.2, 1.2.1.3, 1.2.1.4, and so on. If there is | ||
| 1259 | a second branch also starting at revision 1.2, it would consist of | ||
| 1260 | revisions 1.2.2.1, 1.2.2.2, 1.2.2.3, etc. | ||
| 1261 | |||
| 1262 | In VCSes with monotonic revision IDs, trunk revisions are IDed as | ||
| 1263 | 1, 2, 3, etc. A branch from (say) revision 2 might start with 2.1 and | ||
| 1264 | continue through 2.2, 2.3, etc. But naming conventions for branches | ||
| 1265 | and subbranches vary widely on these systems, and some (like | ||
| 1266 | Mercurial) never depart from the monotonic integer sequence at all. | ||
| 1267 | Consult the documentation of the VCS you are using. | ||
| 1268 | |||
| 1269 | @cindex head revision | ||
| 1270 | If you omit the final component of a dot-pair revision ID, that is called a | ||
| 1271 | @dfn{branch ID}. It refers to the highest existing revision on that | ||
| 1272 | branch---the @dfn{head revision} of that branch. The branches in the | ||
| 1273 | dot-pair example above have branch IDs 1.2.1 and 1.2.2. | ||
| 1274 | 1282 | ||
| 1275 | @menu | 1283 | @menu |
| 1276 | * Switching Branches:: How to get to another existing branch. | 1284 | * Switching Branches:: How to get to another existing branch. |
| 1277 | * Creating Branches:: How to start a new branch. | 1285 | * VC Pull:: Updating the contents of a branch. |
| 1278 | * Merging:: Transferring changes between branches. | 1286 | * Merging:: Transferring changes between branches. |
| 1279 | * Multi-User Branching:: Multiple users working at multiple branches | 1287 | * Creating Branches:: How to start a new branch. |
| 1280 | in parallel. | ||
| 1281 | @end menu | 1288 | @end menu |
| 1282 | 1289 | ||
| 1283 | @node Switching Branches | 1290 | @node Switching Branches |
| 1284 | @subsubsection Switching between Branches | 1291 | @subsubsection Switching between Branches |
| 1285 | 1292 | ||
| 1286 | To switch between branches, type @kbd{C-u C-x v v} and specify the | 1293 | The various version control systems differ in how branches are |
| 1287 | revision ID you want to select. On a locking-based system, this | 1294 | implemented, and these differences cannot be entirely concealed by VC. |
| 1288 | version is then visited @emph{unlocked} (write-protected), so you can | 1295 | |
| 1289 | examine it before locking it. Switching branches in this way is allowed | 1296 | On some decentralized version control systems, including Bazaar and |
| 1290 | only when the file is not locked. | 1297 | Mercurial in its normal mode of operation, each branch has its own |
| 1291 | 1298 | working directory tree, so switching between branches just involves | |
| 1292 | On a VCS with dot-pair IDs, you can omit the minor part, thus giving | 1299 | switching directories. On Git, switching between branches is done |
| 1293 | only the branch ID; this takes you to the head version on the | 1300 | using the @command{git branch} command, which changes the contents of |
| 1294 | chosen branch. If you only type @key{RET}, Emacs goes to the highest | 1301 | the working tree itself. |
| 1295 | version on the trunk. | 1302 | |
| 1303 | On centralized version control systems, you can switch between | ||
| 1304 | branches by typing @kbd{C-u C-x v v} in an up-to-date work file | ||
| 1305 | (@pxref{Advanced C-x v v}), and entering the revision ID for a | ||
| 1306 | revision on another branch. On CVS, for instance, revisions on the | ||
| 1307 | @dfn{trunk} (the main line of development) normally have IDs of the | ||
| 1308 | form 1.1, 1.2, 1.3, @dots{}, while the first branch created from (say) | ||
| 1309 | revision 1.2 has revision IDs 1.2.1.1, 1.2.1.2, @dots{}, the second | ||
| 1310 | branch created from revision 1.2 has revision IDs 1.2.2.1, 1.2.2.2, | ||
| 1311 | @dots{}, and so forth. You can also specify the @dfn{branch ID}, | ||
| 1312 | which is a branch revision ID omitting its final component | ||
| 1313 | (e.g.@: 1.2.1), to switch to the latest revision on that branch. | ||
| 1314 | |||
| 1315 | On a locking-based system, switching to a different branch also | ||
| 1316 | unlocks (write-protects) the working tree. | ||
| 1317 | |||
| 1318 | Once you have switched to a branch, VC commands will apply to that | ||
| 1319 | branch until you switch away; for instance, any VC filesets that you | ||
| 1320 | commit will be committed to that specific branch. | ||
| 1321 | |||
| 1322 | @node VC Pull | ||
| 1323 | @subsubsection Pulling Changes into a Branch | ||
| 1296 | 1324 | ||
| 1297 | After you have switched to any branch (including the main branch), you | 1325 | @table @kbd |
| 1298 | stay on it for subsequent VC commands, until you explicitly select some | 1326 | @itemx C-x v + |
| 1299 | other branch. | 1327 | On a decentralized version control system, update the current branch |
| 1328 | by ``pulling in'' changes from another location. | ||
| 1300 | 1329 | ||
| 1301 | @node Creating Branches | 1330 | On a centralized version control system, update the current VC |
| 1302 | @subsubsection Creating New Branches | 1331 | fileset. |
| 1332 | @end table | ||
| 1303 | 1333 | ||
| 1304 | To create a new branch from a head revision (one that is the latest | 1334 | @kindex C-x v + |
| 1305 | in the branch that contains it), first select that revision if | 1335 | @findex vc-pull |
| 1306 | necessary, lock it with @kbd{C-x v v}, and make whatever changes you | 1336 | On a decentralized version control system, the command @kbd{C-x v +} |
| 1307 | want. Then, when you commit the changes, use @kbd{C-u C-x v v}. This | 1337 | (@code{vc-pull}) updates the current branch and working tree. It is |
| 1308 | lets you specify the revision ID for the new revision. You should | 1338 | typically used to update a copy of a remote branch. If you supply a |
| 1309 | specify a suitable branch ID for a branch starting at the current | 1339 | prefix argument, the command prompts for the exact version control |
| 1310 | revision. For example, if the current revision is 2.5, the branch ID | 1340 | command to use, which lets you specify where to pull changes from. |
| 1311 | should be 2.5.1, 2.5.2, and so on, depending on the number of existing | 1341 | Otherwise, it pulls from a default location determined by the version |
| 1312 | branches at that point. | 1342 | control system. |
| 1313 | |||
| 1314 | To create a new branch at an older revision (one that is no longer the | ||
| 1315 | head of a branch), first select that revision (@pxref{Switching | ||
| 1316 | Branches}). Your procedure will then differ depending on whether you | ||
| 1317 | are using a locking or merging-based VCS. | ||
| 1318 | 1343 | ||
| 1319 | On a locking VCS, you will need to lock the old revision branch with | 1344 | Amongst decentralized version control systems, @kbd{C-x v +} is |
| 1320 | @kbd{C-x v v}. You'll be asked to confirm, when you lock the old | 1345 | currently supported only by Bazaar, Git, and Mercurial. On Bazaar, it |
| 1321 | revision, that you really mean to create a new branch---if you say no, | 1346 | calls @command{bzr pull} for ordinary branches (to pull from a master |
| 1322 | you'll be offered a chance to lock the latest revision instead. On | 1347 | branch into a mirroring branch), and @command{bzr update} for a bound |
| 1323 | a merging-based VCS you will skip this step. | 1348 | branch (to pull from a central repository). On Git, it calls |
| 1349 | @command{git pull} to fetch changes from a remote repository and merge | ||
| 1350 | it into the current branch. On Mercurial, it calls @command{hg pull | ||
| 1351 | -u} to fetch changesets from the default remote repository and update | ||
| 1352 | the working directory. | ||
| 1324 | 1353 | ||
| 1325 | Then make your changes and type @kbd{C-x v v} again to commit a new | 1354 | Prior to pulling, you can use @kbd{C-x v I} (@code{vc-log-incoming}) |
| 1326 | revision. This automatically creates a new branch starting from the | 1355 | to view a log buffer of the changes to be applied. @xref{VC Change |
| 1327 | selected revision. You need not specially request a new branch, | 1356 | Log}. |
| 1328 | because that's the only way to add a new revision at a point that is | ||
| 1329 | not the head of a branch. | ||
| 1330 | 1357 | ||
| 1331 | After the branch is created, you ``stay'' on it. That means that | 1358 | On a centralized version control system like CVS, @kbd{C-x v +} |
| 1332 | subsequent check-ins create new revisions on that branch. To leave the | 1359 | updates the current VC fileset from the repository. |
| 1333 | branch, you must explicitly select a different revision with @kbd{C-u C-x | ||
| 1334 | v v}. To transfer changes from one branch to another, use the merge | ||
| 1335 | command, described in the next section. | ||
| 1336 | 1360 | ||
| 1337 | @node Merging | 1361 | @node Merging |
| 1338 | @subsubsection Merging Branches | 1362 | @subsubsection Merging Branches |
| 1339 | |||
| 1340 | @cindex merging changes | 1363 | @cindex merging changes |
| 1341 | When you have finished the changes on a certain branch, you will | ||
| 1342 | often want to incorporate them into the file's main line of development | ||
| 1343 | (the trunk). This is not a trivial operation, because development might | ||
| 1344 | also have proceeded on the trunk, so that you must @dfn{merge} the | ||
| 1345 | changes into a file that has already been changed otherwise. VC allows | ||
| 1346 | you to do this (and other things) with the @code{vc-merge} command. | ||
| 1347 | 1364 | ||
| 1348 | @table @kbd | 1365 | @table @kbd |
| 1349 | @item C-x v m (vc-merge) | 1366 | @itemx C-x v m |
| 1350 | Merge changes into the work file. | 1367 | On a decentralized version control system, merge changes from another |
| 1368 | branch into the current one. | ||
| 1369 | |||
| 1370 | On a centralized version control system, merge changes from another | ||
| 1371 | branch into the current VC fileset. | ||
| 1351 | @end table | 1372 | @end table |
| 1352 | 1373 | ||
| 1353 | @kindex C-x v m | 1374 | While developing a branch, you may sometimes need to @dfn{merge} in |
| 1354 | @findex vc-merge | 1375 | changes that have already been made in another branch. This is not a |
| 1355 | @kbd{C-x v m} (@code{vc-merge}) takes a set of changes and merges it | 1376 | trivial operation, as overlapping changes may have been made to the |
| 1356 | into the current version of the work file. It firsts asks you in the | 1377 | two branches. |
| 1357 | minibuffer where the changes should come from. If you just type | 1378 | |
| 1358 | @key{RET}, Emacs merges any changes that were made on the same branch | 1379 | On a decentralized version control system, merging is done with the |
| 1359 | since you checked the file out (we call this @dfn{merging the news}). | 1380 | command @kbd{C-x v m} (@code{vc-merge}). On Bazaar, this prompts for |
| 1360 | This is the common way to pick up recent changes from the repository, | 1381 | the exact arguments to pass to @command{bzr merge}, offering a |
| 1361 | regardless of whether you have already changed the file yourself. | 1382 | sensible default if possible. On Git, this prompts for the name of a |
| 1362 | 1383 | branch to merge from, with completion (based on the branch names known | |
| 1363 | You can also enter a branch ID or a pair of revision IDs in | 1384 | to the current repository). The output from running the merge command |
| 1364 | the minibuffer. Then @kbd{C-x v m} finds the changes from that | 1385 | is shown in a separate buffer. |
| 1365 | branch, or the differences between the two revisions you specified, and | 1386 | |
| 1366 | merges them into the current revision of the current file. | 1387 | On a centralized version control system like CVS, @kbd{C-x v m} |
| 1367 | 1388 | prompts for a branch ID, or a pair of revision IDs (@pxref{Switching | |
| 1368 | As an example, suppose that you have finished a certain feature on | 1389 | Branches}); then it finds the changes from that branch, or the changes |
| 1369 | branch 1.3.1. In the meantime, development on the trunk has proceeded | 1390 | between the two revisions you specified, and merges those changes into |
| 1370 | to revision 1.5. To merge the changes from the branch to the trunk, | 1391 | the current VC fileset. If you just type @key{RET}, Emacs simply |
| 1371 | first go to the head revision of the trunk, by typing @kbd{C-u C-x v v | 1392 | merges any changes that were made on the same branch since you checked |
| 1372 | @key{RET}}. Revision 1.5 is now current. If locking is used for the file, | 1393 | the file out. |
| 1373 | type @kbd{C-x v v} to lock revision 1.5 so that you can change it. Next, | ||
| 1374 | type @kbd{C-x v m 1.3.1 @key{RET}}. This takes the entire set of changes on | ||
| 1375 | branch 1.3.1 (relative to revision 1.3, where the branch started, up to | ||
| 1376 | the last revision on the branch) and merges it into the current revision | ||
| 1377 | of the work file. You can now commit the changed file, thus creating | ||
| 1378 | revision 1.6 containing the changes from the branch. | ||
| 1379 | |||
| 1380 | It is possible to do further editing after merging the branch, before | ||
| 1381 | the next check-in. But it is usually wiser to commit the merged | ||
| 1382 | revision, then lock it and make the further changes. This will keep | ||
| 1383 | a better record of the history of changes. | ||
| 1384 | 1394 | ||
| 1385 | @cindex conflicts | 1395 | @cindex conflicts |
| 1386 | @cindex resolving conflicts | 1396 | @cindex resolving conflicts |
| 1387 | When you merge changes into a file that has itself been modified, the | 1397 | Immediately after performing a merge, only the working tree is |
| 1388 | changes might overlap. We call this situation a @dfn{conflict}, and | 1398 | modified, and you can review the changes produced by the merge with |
| 1389 | reconciling the conflicting changes is called @dfn{resolving a | 1399 | @kbd{C-x v D} and related commands (@pxref{Old Revisions}). If the |
| 1390 | conflict}. | 1400 | two branches contained overlapping changes, merging produces a |
| 1391 | 1401 | @dfn{conflict}; a warning appears in the output of the merge command, | |
| 1392 | Whenever conflicts occur during merging, VC detects them, tells you | 1402 | and @dfn{conflict markers} are inserted into each affected work file, |
| 1393 | about them in the echo area, and asks whether you want help in merging. | 1403 | surrounding the two sets of conflicting changes. You must then |
| 1394 | If you say yes, it starts an Ediff session (@pxref{Top, | 1404 | resolve the conflict by editing the conflicted files. Once you are |
| 1395 | Ediff, Ediff, ediff, The Ediff Manual}). | 1405 | done, the modified files must be committed in the usual way for the |
| 1396 | 1406 | merge to take effect (@pxref{Basic VC Editing}). | |
| 1397 | If you say no, the conflicting changes are both inserted into the | ||
| 1398 | file, surrounded by @dfn{conflict markers}. The example below shows how | ||
| 1399 | a conflict region looks; the file is called @samp{name} and the current | ||
| 1400 | master file revision with user B's changes in it is 1.11. | ||
| 1401 | |||
| 1402 | @c @w here is so CVS won't think this is a conflict. | ||
| 1403 | @smallexample | ||
| 1404 | @group | ||
| 1405 | @w{<}<<<<<< name | ||
| 1406 | @var{User A's version} | ||
| 1407 | ======= | ||
| 1408 | @var{User B's version} | ||
| 1409 | @w{>}>>>>>> 1.11 | ||
| 1410 | @end group | ||
| 1411 | @end smallexample | ||
| 1412 | 1407 | ||
| 1413 | @findex vc-resolve-conflicts | 1408 | @node Creating Branches |
| 1414 | Then you can resolve the conflicts by editing the file manually. Or | 1409 | @subsubsection Creating New Branches |
| 1415 | you can type @code{M-x vc-resolve-conflicts} after visiting the file. | 1410 | |
| 1416 | This starts an Ediff session, as described above. Don't forget to | 1411 | On centralized version control systems like CVS, Emacs supports |
| 1417 | commit the merged version afterwards. | 1412 | creating new branches as part of a commit operation. When committing |
| 1418 | 1413 | a modified VC fileset, type @kbd{C-u C-x v v} (@code{vc-next-action} | |
| 1419 | @findex vc-find-conflicted-file | 1414 | with a prefix argument; @pxref{Advanced C-x v v}). Then Emacs prompts |
| 1420 | If there is more than one conflicted file in a merge, type @kbd{M-x | 1415 | for a revision ID for the new revision. You should specify a suitable |
| 1421 | vc-find-conflicted-file} after resolving the conflicts in each file. | 1416 | branch ID for a branch starting at the current revision. For example, |
| 1422 | This command visits the next conflicted file, and moves point to the | 1417 | if the current revision is 2.5, the branch ID should be 2.5.1, 2.5.2, |
| 1423 | first conflict marker in that file. | 1418 | and so on, depending on the number of existing branches at that point. |
| 1424 | 1419 | ||
| 1425 | @node Multi-User Branching | 1420 | To create a new branch at an older revision (one that is no longer |
| 1426 | @subsubsection Multi-User Branching | 1421 | the head of a branch), first select that revision (@pxref{Switching |
| 1427 | 1422 | Branches}). Your procedure will then differ depending on whether you | |
| 1428 | It is often useful for multiple developers to work simultaneously on | 1423 | are using a locking or merging-based VCS. |
| 1429 | different branches of a file. CVS and later systems allow this by | 1424 | |
| 1430 | default; for RCS, it is possible if you create multiple source | 1425 | On a locking VCS, you will need to lock the old revision branch with |
| 1431 | directories. Each source directory should have a link named | 1426 | @kbd{C-x v v}. You'll be asked to confirm, when you lock the old |
| 1432 | @file{RCS} which points to a common directory of RCS master files. | 1427 | revision, that you really mean to create a new branch---if you say no, |
| 1433 | Then each source directory can have its own choice of selected | 1428 | you'll be offered a chance to lock the latest revision instead. On a |
| 1434 | revisions, but all share the same common RCS records. | 1429 | merging-based VCS you will skip this step. |
| 1435 | 1430 | ||
| 1436 | This technique works reliably and automatically, provided that the | 1431 | Then make your changes and type @kbd{C-x v v} again to commit a new |
| 1437 | source files contain RCS version headers | 1432 | revision. This creates a new branch starting from the selected |
| 1438 | @iftex | 1433 | revision. |
| 1439 | (@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}). | ||
| 1440 | @end iftex | ||
| 1441 | @ifnottex | ||
| 1442 | (@pxref{Version Headers}). | ||
| 1443 | @end ifnottex | ||
| 1444 | The headers enable Emacs to be sure, at all times, which revision | ||
| 1445 | ID is present in the work file. | ||
| 1446 | 1434 | ||
| 1447 | If the files do not have version headers, you must instead tell Emacs | 1435 | After the branch is created, subsequent commits create new revisions |
| 1448 | explicitly in each session which branch you are working on. To do this, | 1436 | on that branch. To leave the branch, you must explicitly select a |
| 1449 | first find the file, then type @kbd{C-u C-x v v} and specify the correct | 1437 | different revision with @kbd{C-u C-x v v}. |
| 1450 | branch ID. This ensures that Emacs knows which branch it is using | ||
| 1451 | during this particular editing session. | ||
| 1452 | 1438 | ||
| 1453 | @ifnottex | 1439 | @ifnottex |
| 1454 | @include vc1-xtra.texi | 1440 | @include vc1-xtra.texi |
| @@ -1458,13 +1444,11 @@ during this particular editing session. | |||
| 1458 | @section Change Logs | 1444 | @section Change Logs |
| 1459 | 1445 | ||
| 1460 | @cindex change log | 1446 | @cindex change log |
| 1461 | A change log file contains a chronological record of when and why you | 1447 | Many software projects keep a @dfn{change log}. This is a file, |
| 1462 | have changed a program, consisting of a sequence of entries describing | 1448 | normally named @file{ChangeLog}, containing a chronological record of |
| 1463 | individual changes. Normally it is kept in a file called | 1449 | when and how the program was changed. Sometimes, there are several |
| 1464 | @file{ChangeLog} in the same directory as the file you are editing, or | 1450 | change log files, each recording the changes in one directory or |
| 1465 | one of its parent directories. A single @file{ChangeLog} file can | 1451 | directory tree. |
| 1466 | record changes for all the files in its directory and all its | ||
| 1467 | subdirectories. | ||
| 1468 | 1452 | ||
| 1469 | @menu | 1453 | @menu |
| 1470 | * Change Log Commands:: Commands for editing change log files. | 1454 | * Change Log Commands:: Commands for editing change log files. |
| @@ -1496,7 +1480,7 @@ rather than starting a new item. | |||
| 1496 | 1480 | ||
| 1497 | You can combine multiple changes of the same nature. If you don't | 1481 | You can combine multiple changes of the same nature. If you don't |
| 1498 | enter any text after the initial @kbd{C-x 4 a}, any subsequent | 1482 | enter any text after the initial @kbd{C-x 4 a}, any subsequent |
| 1499 | @kbd{C-x 4 a} adds another symbol to the change. | 1483 | @kbd{C-x 4 a} adds another symbol to the change log entry. |
| 1500 | 1484 | ||
| 1501 | @vindex add-log-always-start-new-record | 1485 | @vindex add-log-always-start-new-record |
| 1502 | If @code{add-log-always-start-new-record} is non-@code{nil}, | 1486 | If @code{add-log-always-start-new-record} is non-@code{nil}, |
| @@ -1534,15 +1518,7 @@ ordering of entries. | |||
| 1534 | Version control systems are another way to keep track of changes in | 1518 | Version control systems are another way to keep track of changes in |
| 1535 | your program and keep a change log. In the VC log buffer, typing | 1519 | your program and keep a change log. In the VC log buffer, typing |
| 1536 | @kbd{C-c C-a} (@code{log-edit-insert-changelog}) inserts the relevant | 1520 | @kbd{C-c C-a} (@code{log-edit-insert-changelog}) inserts the relevant |
| 1537 | Change Log entry, if one exists (@pxref{Log Buffer}). You can also | 1521 | Change Log entry, if one exists. @xref{Log Buffer}. |
| 1538 | insert a VC log entry into a Change Log buffer by typing @kbd{C-x v a} | ||
| 1539 | (@code{vc-update-change-log}) in the Change Log buffer | ||
| 1540 | @iftex | ||
| 1541 | (@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}). | ||
| 1542 | @end iftex | ||
| 1543 | @ifnottex | ||
| 1544 | (@pxref{Change Logs and VC}). | ||
| 1545 | @end ifnottex | ||
| 1546 | 1522 | ||
| 1547 | @node Format of ChangeLog | 1523 | @node Format of ChangeLog |
| 1548 | @subsection Format of ChangeLog | 1524 | @subsection Format of ChangeLog |
| @@ -1597,8 +1573,8 @@ Of course, you should substitute the proper years and copyright holder. | |||
| 1597 | @cindex tags and tag tables | 1573 | @cindex tags and tag tables |
| 1598 | 1574 | ||
| 1599 | A @dfn{tag} is a reference to a subunit in a program or in a | 1575 | A @dfn{tag} is a reference to a subunit in a program or in a |
| 1600 | document. In program source code, tags reference syntactic elements | 1576 | document. In source code, tags reference syntactic elements of the |
| 1601 | of the program: functions, subroutines, data types, macros, etc. In a | 1577 | program: functions, subroutines, data types, macros, etc. In a |
| 1602 | document, tags reference chapters, sections, appendices, etc. Each | 1578 | document, tags reference chapters, sections, appendices, etc. Each |
| 1603 | tag specifies the name of the file where the corresponding subunit is | 1579 | tag specifies the name of the file where the corresponding subunit is |
| 1604 | defined, and the position of the subunit's definition in that file. | 1580 | defined, and the position of the subunit's definition in that file. |
| @@ -1612,34 +1588,36 @@ a Yacc parser, or from Lex scanner definitions; @file{.i} preprocessed | |||
| 1612 | C files; and Fortran files produced by preprocessing @file{.fpp} | 1588 | C files; and Fortran files produced by preprocessing @file{.fpp} |
| 1613 | source files. | 1589 | source files. |
| 1614 | 1590 | ||
| 1615 | To produce a tags table, you use the @samp{etags} command, | 1591 | @cindex etags |
| 1616 | submitting it a document or the source code of a program. | 1592 | To produce a tags table, you run the @command{etags} shell command |
| 1617 | @samp{etags} writes the tags to a @dfn{tags table file}, or @dfn{tags | 1593 | on a document or the source code file. The @samp{etags} program |
| 1618 | file} in short. The conventional name for a tags file is @file{TAGS}. | 1594 | writes the tags to a @dfn{tags table file}, or @dfn{tags file} in |
| 1595 | short. The conventional name for a tags file is @file{TAGS}. | ||
| 1596 | @xref{Create Tags Table}. | ||
| 1619 | 1597 | ||
| 1620 | Emacs uses the information recorded in tags tables in commands that | 1598 | Emacs provides many commands for searching and replacing using the |
| 1621 | search or replace through multiple source files: these commands use | 1599 | information recorded in tags tables. For instance, the @kbd{M-.} |
| 1622 | the names of the source files recorded in the tags table to know which | 1600 | (@code{find-tag}) jumps to the location of a specified function |
| 1623 | files to search. Other commands, such as @kbd{M-.}, which finds the | 1601 | definition in its source file. @xref{Find Tag}. |
| 1624 | definition of a function, use the recorded information about the | ||
| 1625 | function names and positions to find the source file and the position | ||
| 1626 | within that file where the function is defined. | ||
| 1627 | 1602 | ||
| 1628 | @cindex C++ class browser, tags | 1603 | @cindex C++ class browser, tags |
| 1629 | @cindex tags, C++ | 1604 | @cindex tags, C++ |
| 1630 | @cindex class browser, C++ | 1605 | @cindex class browser, C++ |
| 1631 | @cindex Ebrowse | 1606 | @cindex Ebrowse |
| 1632 | See also the Ebrowse facility, which is tailored for C++. | 1607 | The Ebrowse facility is similar to @command{etags} but specifically |
| 1633 | @xref{Top,, Ebrowse, ebrowse, Ebrowse User's Manual}. | 1608 | tailored for C++. @xref{Top,, Ebrowse, ebrowse, Ebrowse User's |
| 1609 | Manual}. The Semantic package provides another way to generate and | ||
| 1610 | use tags, separate from the @command{etags} facility. | ||
| 1611 | @xref{Semantic}. | ||
| 1634 | 1612 | ||
| 1635 | @menu | 1613 | @menu |
| 1636 | * Tag Syntax:: Tag syntax for various types of code and text files. | 1614 | * Tag Syntax:: Tag syntax for various types of code and text files. |
| 1637 | * Create Tags Table:: Creating a tags table with @code{etags}. | 1615 | * Create Tags Table:: Creating a tags table with @command{etags}. |
| 1638 | * Etags Regexps:: Create arbitrary tags using regular expressions. | 1616 | * Etags Regexps:: Create arbitrary tags using regular expressions. |
| 1639 | * Select Tags Table:: How to visit a tags table. | 1617 | * Select Tags Table:: How to visit a tags table. |
| 1640 | * Find Tag:: Commands to find the definition of a specific tag. | 1618 | * Find Tag:: Commands to find the definition of a specific tag. |
| 1641 | * Tags Search:: Using a tags table for searching and replacing. | 1619 | * Tags Search:: Using a tags table for searching and replacing. |
| 1642 | * List Tags:: Listing and finding tags defined in a file. | 1620 | * List Tags:: Using tags for completion, and listing them. |
| 1643 | @end menu | 1621 | @end menu |
| 1644 | 1622 | ||
| 1645 | @node Tag Syntax | 1623 | @node Tag Syntax |
| @@ -1661,7 +1639,7 @@ and @samp{--no-members} can make the tags table file much smaller. | |||
| 1661 | 1639 | ||
| 1662 | You can tag function declarations and external variables in addition | 1640 | You can tag function declarations and external variables in addition |
| 1663 | to function definitions by giving the @samp{--declarations} option to | 1641 | to function definitions by giving the @samp{--declarations} option to |
| 1664 | @code{etags}. | 1642 | @command{etags}. |
| 1665 | 1643 | ||
| 1666 | @item | 1644 | @item |
| 1667 | In C++ code, in addition to all the tag constructs of C code, member | 1645 | In C++ code, in addition to all the tag constructs of C code, member |
| @@ -1678,15 +1656,15 @@ Tags for variables and functions in classes are named | |||
| 1678 | @samp{@var{class}.@var{variable}} and @samp{@var{class}.@var{function}}. | 1656 | @samp{@var{class}.@var{variable}} and @samp{@var{class}.@var{function}}. |
| 1679 | 1657 | ||
| 1680 | @item | 1658 | @item |
| 1681 | In La@TeX{} text, the argument of any of the commands @code{\chapter}, | 1659 | In La@TeX{} documents, the arguments for @code{\chapter}, |
| 1682 | @code{\section}, @code{\subsection}, @code{\subsubsection}, | 1660 | @code{\section}, @code{\subsection}, @code{\subsubsection}, |
| 1683 | @code{\eqno}, @code{\label}, @code{\ref}, @code{\cite}, | 1661 | @code{\eqno}, @code{\label}, @code{\ref}, @code{\cite}, |
| 1684 | @code{\bibitem}, @code{\part}, @code{\appendix}, @code{\entry}, | 1662 | @code{\bibitem}, @code{\part}, @code{\appendix}, @code{\entry}, |
| 1685 | @code{\index}, @code{\def}, @code{\newcommand}, @code{\renewcommand}, | 1663 | @code{\index}, @code{\def}, @code{\newcommand}, @code{\renewcommand}, |
| 1686 | @code{\newenvironment} or @code{\renewenvironment} is a tag.@refill | 1664 | @code{\newenvironment} and @code{\renewenvironment} are tags. |
| 1687 | 1665 | ||
| 1688 | Other commands can make tags as well, if you specify them in the | 1666 | Other commands can make tags as well, if you specify them in the |
| 1689 | environment variable @env{TEXTAGS} before invoking @code{etags}. The | 1667 | environment variable @env{TEXTAGS} before invoking @command{etags}. The |
| 1690 | value of this environment variable should be a colon-separated list of | 1668 | value of this environment variable should be a colon-separated list of |
| 1691 | command names. For example, | 1669 | command names. For example, |
| 1692 | 1670 | ||
| @@ -1818,9 +1796,9 @@ Regexps}) to handle other formats and languages. | |||
| 1818 | 1796 | ||
| 1819 | @node Create Tags Table | 1797 | @node Create Tags Table |
| 1820 | @subsection Creating Tags Tables | 1798 | @subsection Creating Tags Tables |
| 1821 | @cindex @code{etags} program | 1799 | @cindex @command{etags} program |
| 1822 | 1800 | ||
| 1823 | The @code{etags} program is used to create a tags table file. It knows | 1801 | The @command{etags} program is used to create a tags table file. It knows |
| 1824 | the syntax of several languages, as described in | 1802 | the syntax of several languages, as described in |
| 1825 | @iftex | 1803 | @iftex |
| 1826 | the previous section. | 1804 | the previous section. |
| @@ -1828,58 +1806,51 @@ the previous section. | |||
| 1828 | @ifnottex | 1806 | @ifnottex |
| 1829 | @ref{Tag Syntax}. | 1807 | @ref{Tag Syntax}. |
| 1830 | @end ifnottex | 1808 | @end ifnottex |
| 1831 | Here is how to run @code{etags}: | 1809 | Here is how to run @command{etags}: |
| 1832 | 1810 | ||
| 1833 | @example | 1811 | @example |
| 1834 | etags @var{inputfiles}@dots{} | 1812 | etags @var{inputfiles}@dots{} |
| 1835 | @end example | 1813 | @end example |
| 1836 | 1814 | ||
| 1837 | @noindent | 1815 | @noindent |
| 1838 | The @code{etags} program reads the specified files, and writes a tags | 1816 | The @command{etags} program reads the specified files, and writes a tags |
| 1839 | table named @file{TAGS} in the current working directory. You can | 1817 | table named @file{TAGS} in the current working directory. You can |
| 1840 | optionally specify a different file name for the tags table by using the | 1818 | optionally specify a different file name for the tags table by using the |
| 1841 | @samp{--output=@var{file}} option; specifying @file{-} as a file name | 1819 | @samp{--output=@var{file}} option; specifying @file{-} as a file name |
| 1842 | prints the tags table to standard output. | 1820 | prints the tags table to standard output. |
| 1843 | 1821 | ||
| 1844 | If the specified files don't exist, @code{etags} looks for | 1822 | If the specified files don't exist, @command{etags} looks for |
| 1845 | compressed versions of them and uncompresses them to read them. Under | 1823 | compressed versions of them and uncompresses them to read them. Under |
| 1846 | MS-DOS, @code{etags} also looks for file names like @file{mycode.cgz} | 1824 | MS-DOS, @command{etags} also looks for file names like @file{mycode.cgz} |
| 1847 | if it is given @samp{mycode.c} on the command line and @file{mycode.c} | 1825 | if it is given @samp{mycode.c} on the command line and @file{mycode.c} |
| 1848 | does not exist. | 1826 | does not exist. |
| 1849 | 1827 | ||
| 1850 | @code{etags} recognizes the language used in an input file based on | 1828 | If the tags table becomes outdated due to changes in the files |
| 1851 | its file name and contents. You can specify the language with the | 1829 | described in it, you can update it by running the @command{etags} |
| 1852 | @samp{--language=@var{name}} option, described below. | 1830 | program again. If the tags table does not record a tag, or records it |
| 1853 | 1831 | for the wrong file, then Emacs will not be able to find that | |
| 1854 | If the tags table data become outdated due to changes in the files | 1832 | definition until you update the tags table. But if the position |
| 1855 | described in the table, the way to update the tags table is the same | 1833 | recorded in the tags table becomes a little bit wrong (due to other |
| 1856 | way it was made in the first place. If the tags table fails to record | 1834 | editing), Emacs will still be able to find the right position, with a |
| 1857 | a tag, or records it for the wrong file, then Emacs cannot possibly | 1835 | slight delay. |
| 1858 | find its definition until you update the tags table. However, if the | ||
| 1859 | position recorded in the tags table becomes a little bit wrong (due to | ||
| 1860 | other editing), the worst consequence is a slight delay in finding the | ||
| 1861 | tag. Even if the stored position is very far wrong, Emacs will still | ||
| 1862 | find the tag, after searching most of the file for it. That delay is | ||
| 1863 | hardly noticeable with today's computers. | ||
| 1864 | 1836 | ||
| 1865 | Thus, there is no need to update the tags table after each edit. | 1837 | Thus, there is no need to update the tags table after each edit. |
| 1866 | You should update a tags table when you define new tags that you want | 1838 | You should update a tags table when you define new tags that you want |
| 1867 | to have listed, or when you move tag definitions from one file to | 1839 | to have listed, or when you move tag definitions from one file to |
| 1868 | another, or when changes become substantial. | 1840 | another, or when changes become substantial. |
| 1869 | 1841 | ||
| 1870 | One tags table can virtually include another. Specify the included | 1842 | You can make a tags table @dfn{include} another tags table, by |
| 1871 | tags file name with the @samp{--include=@var{file}} option when | 1843 | passing the @samp{--include=@var{file}} option to @command{etags}. It |
| 1872 | creating the file that is to include it. The latter file then acts as | 1844 | then covers all the files covered by the included tags file, as well |
| 1873 | if it covered all the source files specified in the included file, as | 1845 | as its own. |
| 1874 | well as the files it directly contains. | ||
| 1875 | 1846 | ||
| 1876 | If you specify the source files with relative file names when you run | 1847 | If you specify the source files with relative file names when you run |
| 1877 | @code{etags}, the tags file will contain file names relative to the | 1848 | @command{etags}, the tags file will contain file names relative to the |
| 1878 | directory where the tags file was initially written. This way, you can | 1849 | directory where the tags file was initially written. This way, you can |
| 1879 | move an entire directory tree containing both the tags file and the | 1850 | move an entire directory tree containing both the tags file and the |
| 1880 | source files, and the tags file will still refer correctly to the source | 1851 | source files, and the tags file will still refer correctly to the source |
| 1881 | files. If the tags file is @file{-} or is in the @file{/dev} directory, | 1852 | files. If the tags file is @file{-} or is in the @file{/dev} directory, |
| 1882 | however, the file names are | 1853 | however, the file names are |
| 1883 | made relative to the current working directory. This is useful, for | 1854 | made relative to the current working directory. This is useful, for |
| 1884 | example, when writing the tags to @file{/dev/stdout}. | 1855 | example, when writing the tags to @file{/dev/stdout}. |
| 1885 | 1856 | ||
| @@ -1887,40 +1858,41 @@ example, when writing the tags to @file{/dev/stdout}. | |||
| 1887 | pointing to a tags file in a different directory, because this would | 1858 | pointing to a tags file in a different directory, because this would |
| 1888 | generally render the file names invalid. | 1859 | generally render the file names invalid. |
| 1889 | 1860 | ||
| 1890 | If you specify absolute file names as arguments to @code{etags}, then | 1861 | If you specify absolute file names as arguments to @command{etags}, then |
| 1891 | the tags file will contain absolute file names. This way, the tags file | 1862 | the tags file will contain absolute file names. This way, the tags file |
| 1892 | will still refer to the same files even if you move it, as long as the | 1863 | will still refer to the same files even if you move it, as long as the |
| 1893 | source files remain in the same place. Absolute file names start with | 1864 | source files remain in the same place. Absolute file names start with |
| 1894 | @samp{/}, or with @samp{@var{device}:/} on MS-DOS and MS-Windows. | 1865 | @samp{/}, or with @samp{@var{device}:/} on MS-DOS and MS-Windows. |
| 1895 | 1866 | ||
| 1896 | When you want to make a tags table from a great number of files, you | 1867 | When you want to make a tags table from a great number of files, |
| 1897 | may have problems listing them on the command line, because some systems | 1868 | you may have problems listing them on the command line, because some |
| 1898 | have a limit on its length. The simplest way to circumvent this limit | 1869 | systems have a limit on its length. You can circumvent this limit by |
| 1899 | is to tell @code{etags} to read the file names from its standard input, | 1870 | telling @command{etags} to read the file names from its standard |
| 1900 | by typing a dash in place of the file names, like this: | 1871 | input, by typing a dash in place of the file names, like this: |
| 1901 | 1872 | ||
| 1902 | @smallexample | 1873 | @smallexample |
| 1903 | find . -name "*.[chCH]" -print | etags - | 1874 | find . -name "*.[chCH]" -print | etags - |
| 1904 | @end smallexample | 1875 | @end smallexample |
| 1905 | 1876 | ||
| 1906 | Use the option @samp{--language=@var{name}} to specify the language | 1877 | @command{etags} recognizes the language used in an input file based |
| 1907 | explicitly. You can intermix these options with file names; each one | 1878 | on its file name and contents. You can specify the language |
| 1908 | applies to the file names that follow it. Specify | 1879 | explicitly with the @samp{--language=@var{name}} option. You can |
| 1909 | @samp{--language=auto} to tell @code{etags} to resume guessing the | 1880 | intermix these options with file names; each one applies to the file |
| 1910 | language from the file names and file contents. Specify | 1881 | names that follow it. Specify @samp{--language=auto} to tell |
| 1911 | @samp{--language=none} to turn off language-specific processing | 1882 | @command{etags} to resume guessing the language from the file names |
| 1912 | entirely; then @code{etags} recognizes tags by regexp matching alone | 1883 | and file contents. Specify @samp{--language=none} to turn off |
| 1913 | (@pxref{Etags Regexps}). | 1884 | language-specific processing entirely; then @command{etags} recognizes |
| 1885 | tags by regexp matching alone (@pxref{Etags Regexps}). | ||
| 1914 | 1886 | ||
| 1915 | The option @samp{--parse-stdin=@var{file}} is mostly useful when | 1887 | The option @samp{--parse-stdin=@var{file}} is mostly useful when |
| 1916 | calling @code{etags} from programs. It can be used (only once) in | 1888 | calling @command{etags} from programs. It can be used (only once) in |
| 1917 | place of a file name on the command line. @code{Etags} will read from | 1889 | place of a file name on the command line. @command{etags} will read from |
| 1918 | standard input and mark the produced tags as belonging to the file | 1890 | standard input and mark the produced tags as belonging to the file |
| 1919 | @var{file}. | 1891 | @var{file}. |
| 1920 | 1892 | ||
| 1921 | @samp{etags --help} outputs the list of the languages @code{etags} | 1893 | @samp{etags --help} outputs the list of the languages @command{etags} |
| 1922 | knows, and the file name rules for guessing the language. It also prints | 1894 | knows, and the file name rules for guessing the language. It also prints |
| 1923 | a list of all the available @code{etags} options, together with a short | 1895 | a list of all the available @command{etags} options, together with a short |
| 1924 | explanation. If followed by one or more @samp{--language=@var{lang}} | 1896 | explanation. If followed by one or more @samp{--language=@var{lang}} |
| 1925 | options, it outputs detailed information about how tags are generated for | 1897 | options, it outputs detailed information about how tags are generated for |
| 1926 | @var{lang}. | 1898 | @var{lang}. |
| @@ -1928,21 +1900,22 @@ options, it outputs detailed information about how tags are generated for | |||
| 1928 | @node Etags Regexps | 1900 | @node Etags Regexps |
| 1929 | @subsection Etags Regexps | 1901 | @subsection Etags Regexps |
| 1930 | 1902 | ||
| 1931 | The @samp{--regex} option provides a general way of recognizing tags | 1903 | The @samp{--regex} option to @command{etags} allows tags to be |
| 1932 | based on regexp matching. You can freely intermix this option with | 1904 | recognized by regular expression matching. You can intermix this |
| 1933 | file names, and each one applies to the source files that follow it. | 1905 | option with file names; each one applies to the source files that |
| 1934 | If you specify multiple @samp{--regex} options, all of them are used | 1906 | follow it. If you specify multiple @samp{--regex} options, all of |
| 1935 | in parallel. The syntax is: | 1907 | them are used in parallel. The syntax is: |
| 1936 | 1908 | ||
| 1937 | @smallexample | 1909 | @smallexample |
| 1938 | --regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers} | 1910 | --regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers} |
| 1939 | @end smallexample | 1911 | @end smallexample |
| 1940 | 1912 | ||
| 1941 | The essential part of the option value is @var{tagregexp}, the | 1913 | @noindent |
| 1942 | regexp for matching tags. It is always used anchored, that is, it | 1914 | The essential part of the option value is @var{tagregexp}, the regexp |
| 1943 | only matches at the beginning of a line. If you want to allow | 1915 | for matching tags. It is always used anchored, that is, it only |
| 1944 | indented tags, use a regexp that matches initial whitespace; start it | 1916 | matches at the beginning of a line. If you want to allow indented |
| 1945 | with @samp{[ \t]*}. | 1917 | tags, use a regexp that matches initial whitespace; start it with |
| 1918 | @samp{[ \t]*}. | ||
| 1946 | 1919 | ||
| 1947 | In these regular expressions, @samp{\} quotes the next character, and | 1920 | In these regular expressions, @samp{\} quotes the next character, and |
| 1948 | all the GCC character escape sequences are supported (@samp{\a} for | 1921 | all the GCC character escape sequences are supported (@samp{\a} for |
| @@ -1959,7 +1932,7 @@ completion on tag names more reliably. You can find some examples | |||
| 1959 | below. | 1932 | below. |
| 1960 | 1933 | ||
| 1961 | The @var{modifiers} are a sequence of zero or more characters that | 1934 | The @var{modifiers} are a sequence of zero or more characters that |
| 1962 | modify the way @code{etags} does the matching. A regexp with no | 1935 | modify the way @command{etags} does the matching. A regexp with no |
| 1963 | modifiers is applied sequentially to each line of the input file, in a | 1936 | modifiers is applied sequentially to each line of the input file, in a |
| 1964 | case-sensitive way. The modifiers and their meanings are: | 1937 | case-sensitive way. The modifiers and their meanings are: |
| 1965 | 1938 | ||
| @@ -1984,22 +1957,22 @@ etags --regex=/@var{reg1}/i voo.doo --regex=/@var{reg2}/m \ | |||
| 1984 | @end smallexample | 1957 | @end smallexample |
| 1985 | 1958 | ||
| 1986 | @noindent | 1959 | @noindent |
| 1987 | Here @code{etags} chooses the parsing language for @file{voo.doo} and | 1960 | Here @command{etags} chooses the parsing language for @file{voo.doo} and |
| 1988 | @file{bar.ber} according to their contents. @code{etags} also uses | 1961 | @file{bar.ber} according to their contents. @command{etags} also uses |
| 1989 | @var{reg1} to recognize additional tags in @file{voo.doo}, and both | 1962 | @var{reg1} to recognize additional tags in @file{voo.doo}, and both |
| 1990 | @var{reg1} and @var{reg2} to recognize additional tags in | 1963 | @var{reg1} and @var{reg2} to recognize additional tags in |
| 1991 | @file{bar.ber}. @var{reg1} is checked against each line of | 1964 | @file{bar.ber}. @var{reg1} is checked against each line of |
| 1992 | @file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while | 1965 | @file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while |
| 1993 | @var{reg2} is checked against the whole @file{bar.ber} file, | 1966 | @var{reg2} is checked against the whole @file{bar.ber} file, |
| 1994 | permitting multi-line matches, in a case-sensitive way. @code{etags} | 1967 | permitting multi-line matches, in a case-sensitive way. @command{etags} |
| 1995 | uses only the Lisp tags rules, with no user-specified regexp matching, | 1968 | uses only the Lisp tags rules, with no user-specified regexp matching, |
| 1996 | to recognize tags in @file{los.er}. | 1969 | to recognize tags in @file{los.er}. |
| 1997 | 1970 | ||
| 1998 | You can restrict a @samp{--regex} option to match only files of a | 1971 | You can restrict a @samp{--regex} option to match only files of a |
| 1999 | given language by using the optional prefix @var{@{language@}}. | 1972 | given language by using the optional prefix @var{@{language@}}. |
| 2000 | (@samp{etags --help} prints the list of languages recognized by | 1973 | (@samp{etags --help} prints the list of languages recognized by |
| 2001 | @code{etags}.) This is particularly useful when storing many | 1974 | @command{etags}.) This is particularly useful when storing many |
| 2002 | predefined regular expressions for @code{etags} in a file. The | 1975 | predefined regular expressions for @command{etags} in a file. The |
| 2003 | following example tags the @code{DEFVAR} macros in the Emacs source | 1976 | following example tags the @code{DEFVAR} macros in the Emacs source |
| 2004 | files, for the C language only: | 1977 | files, for the C language only: |
| 2005 | 1978 | ||
| @@ -2009,7 +1982,7 @@ files, for the C language only: | |||
| 2009 | 1982 | ||
| 2010 | @noindent | 1983 | @noindent |
| 2011 | When you have complex regular expressions, you can store the list of | 1984 | When you have complex regular expressions, you can store the list of |
| 2012 | them in a file. The following option syntax instructs @code{etags} to | 1985 | them in a file. The following option syntax instructs @command{etags} to |
| 2013 | read two files of regular expressions. The regular expressions | 1986 | read two files of regular expressions. The regular expressions |
| 2014 | contained in the second file are matched without regard to case. | 1987 | contained in the second file are matched without regard to case. |
| 2015 | 1988 | ||
| @@ -2018,9 +1991,9 @@ contained in the second file are matched without regard to case. | |||
| 2018 | @end smallexample | 1991 | @end smallexample |
| 2019 | 1992 | ||
| 2020 | @noindent | 1993 | @noindent |
| 2021 | A regex file for @code{etags} contains one regular expression per | 1994 | A regex file for @command{etags} contains one regular expression per |
| 2022 | line. Empty lines, and lines beginning with space or tab are ignored. | 1995 | line. Empty lines, and lines beginning with space or tab are ignored. |
| 2023 | When the first character in a line is @samp{@@}, @code{etags} assumes | 1996 | When the first character in a line is @samp{@@}, @command{etags} assumes |
| 2024 | that the rest of the line is the name of another file of regular | 1997 | that the rest of the line is the name of another file of regular |
| 2025 | expressions; thus, one such file can include another file. All the | 1998 | expressions; thus, one such file can include another file. All the |
| 2026 | other lines are taken to be regular expressions. If the first | 1999 | other lines are taken to be regular expressions. If the first |
| @@ -2083,14 +2056,14 @@ etags --language=none \ | |||
| 2083 | @node Select Tags Table | 2056 | @node Select Tags Table |
| 2084 | @subsection Selecting a Tags Table | 2057 | @subsection Selecting a Tags Table |
| 2085 | 2058 | ||
| 2086 | @vindex tags-file-name | ||
| 2087 | @findex visit-tags-table | 2059 | @findex visit-tags-table |
| 2088 | Emacs has at any time one @dfn{selected} tags table, and all the | 2060 | Emacs has at any time one @dfn{selected} tags table. All the |
| 2089 | commands for working with tags tables use the selected one. To select | 2061 | commands for working with tags tables use the selected one. To select |
| 2090 | a tags table, type @kbd{M-x visit-tags-table}, which reads the tags | 2062 | a tags table, type @kbd{M-x visit-tags-table}, which reads the tags |
| 2091 | table file name as an argument, with @file{TAGS} in the default | 2063 | table file name as an argument, with @file{TAGS} in the default |
| 2092 | directory as the default. | 2064 | directory as the default. |
| 2093 | 2065 | ||
| 2066 | @vindex tags-file-name | ||
| 2094 | Emacs does not actually read in the tags table contents until you | 2067 | Emacs does not actually read in the tags table contents until you |
| 2095 | try to use them; all @code{visit-tags-table} does is store the file | 2068 | try to use them; all @code{visit-tags-table} does is store the file |
| 2096 | name in the variable @code{tags-file-name}, and setting the variable | 2069 | name in the variable @code{tags-file-name}, and setting the variable |
| @@ -2154,27 +2127,25 @@ Pop back to where you previously invoked @kbd{M-.} and friends. | |||
| 2154 | 2127 | ||
| 2155 | @kindex M-. | 2128 | @kindex M-. |
| 2156 | @findex find-tag | 2129 | @findex find-tag |
| 2157 | @kbd{M-.}@: (@code{find-tag}) is the command to find the definition of | 2130 | @kbd{M-.}@: (@code{find-tag}) prompts for a tag name and jumps to |
| 2158 | a specified tag. It searches through the tags table for that tag, as a | 2131 | its source definition. It works by searching through the tags table |
| 2159 | string, and then uses the tags table info to determine the file that the | 2132 | for that tag's file and approximate character position, visiting that |
| 2160 | definition is in and the approximate character position in the file of | 2133 | file, and searching for the tag definition at ever-increasing |
| 2161 | the definition. Then @code{find-tag} visits that file, moves point to | 2134 | distances away from the recorded approximate position. |
| 2162 | the approximate character position, and searches ever-increasing | 2135 | |
| 2163 | distances away to find the tag definition. | 2136 | When entering the tag argument to @kbd{M-.}, the usual minibuffer |
| 2164 | 2137 | completion commands can be used (@pxref{Completion}), with the tag | |
| 2165 | If an empty argument is given (just type @key{RET}), the balanced | 2138 | names in the selected tags table as completion candidates. If you |
| 2166 | expression in the buffer before or around point is used as the | 2139 | specify an empty argument, the balanced expression in the buffer |
| 2167 | @var{tag} argument. @xref{Expressions}. | 2140 | before or around point is the default argument. @xref{Expressions}. |
| 2168 | 2141 | ||
| 2169 | You don't need to give @kbd{M-.} the full name of the tag; a part | 2142 | You don't need to give @kbd{M-.} the full name of the tag; a part |
| 2170 | will do. This is because @kbd{M-.} finds tags in the table which | 2143 | will do. @kbd{M-.} finds tags which contain that argument as a |
| 2171 | contain @var{tag} as a substring. However, it prefers an exact match | 2144 | substring. However, it prefers an exact match to a substring match. |
| 2172 | to a substring match. To find other tags that match the same | 2145 | To find other tags that match the same substring, give @code{find-tag} |
| 2173 | substring, give @code{find-tag} a numeric argument, as in @kbd{C-u | 2146 | a numeric argument, as in @kbd{C-u M-.} or @kbd{M-0 M-.}; this does |
| 2174 | M-.}; this does not read a tag name, but continues searching the tags | 2147 | not read a tag name, but continues searching the tags table's text for |
| 2175 | table's text for another tag containing the same substring last used. | 2148 | another tag containing the same substring last used. |
| 2176 | If you have a real @key{META} key, @kbd{M-0 M-.}@: is an easier | ||
| 2177 | alternative to @kbd{C-u M-.}. | ||
| 2178 | 2149 | ||
| 2179 | @kindex C-x 4 . | 2150 | @kindex C-x 4 . |
| 2180 | @findex find-tag-other-window | 2151 | @findex find-tag-other-window |
| @@ -2182,23 +2153,23 @@ alternative to @kbd{C-u M-.}. | |||
| 2182 | @findex find-tag-other-frame | 2153 | @findex find-tag-other-frame |
| 2183 | Like most commands that can switch buffers, @code{find-tag} has a | 2154 | Like most commands that can switch buffers, @code{find-tag} has a |
| 2184 | variant that displays the new buffer in another window, and one that | 2155 | variant that displays the new buffer in another window, and one that |
| 2185 | makes a new frame for it. The former is @w{@kbd{C-x 4 .}}, which invokes | 2156 | makes a new frame for it. The former is @w{@kbd{C-x 4 .}} |
| 2186 | the command @code{find-tag-other-window}. The latter is @w{@kbd{C-x 5 .}}, | 2157 | (@code{find-tag-other-window}), and the latter is @w{@kbd{C-x 5 .}} |
| 2187 | which invokes @code{find-tag-other-frame}. | 2158 | (@code{find-tag-other-frame}). |
| 2188 | 2159 | ||
| 2189 | To move back to places you've found tags recently, use @kbd{C-u - | 2160 | To move back to previous tag definitions, use @kbd{C-u - M-.}; more |
| 2190 | M-.}; more generally, @kbd{M-.} with a negative numeric argument. This | 2161 | generally, @kbd{M-.} with a negative numeric argument. Similarly, |
| 2191 | command can take you to another buffer. @w{@kbd{C-x 4 .}} with a negative | 2162 | @w{@kbd{C-x 4 .}} with a negative argument finds the previous tag |
| 2192 | argument finds the previous tag location in another window. | 2163 | location in another window. |
| 2193 | 2164 | ||
| 2194 | @kindex M-* | 2165 | @kindex M-* |
| 2195 | @findex pop-tag-mark | 2166 | @findex pop-tag-mark |
| 2196 | @vindex find-tag-marker-ring-length | 2167 | @vindex find-tag-marker-ring-length |
| 2197 | As well as going back to places you've found tags recently, you can go | 2168 | As well as going back to places you've found tags recently, you can |
| 2198 | back to places @emph{from where} you found them. Use @kbd{M-*}, which | 2169 | go back to places @emph{from where} you found them, using @kbd{M-*} |
| 2199 | invokes the command @code{pop-tag-mark}, for this. Typically you would | 2170 | (@code{pop-tag-mark}). Thus you can find and examine the definition |
| 2200 | find and study the definition of something with @kbd{M-.} and then | 2171 | of something with @kbd{M-.} and then return to where you were with |
| 2201 | return to where you were with @kbd{M-*}. | 2172 | @kbd{M-*}. |
| 2202 | 2173 | ||
| 2203 | Both @kbd{C-u - M-.} and @kbd{M-*} allow you to retrace your steps to | 2174 | Both @kbd{C-u - M-.} and @kbd{M-*} allow you to retrace your steps to |
| 2204 | a depth determined by the variable @code{find-tag-marker-ring-length}. | 2175 | a depth determined by the variable @code{find-tag-marker-ring-length}. |
| @@ -2242,10 +2213,10 @@ can follow its progress. As soon as it finds an occurrence, | |||
| 2242 | 2213 | ||
| 2243 | @kindex M-, | 2214 | @kindex M-, |
| 2244 | @findex tags-loop-continue | 2215 | @findex tags-loop-continue |
| 2245 | Having found one match, you probably want to find all the rest. To find | 2216 | Having found one match, you probably want to find all the rest. |
| 2246 | one more match, type @kbd{M-,} (@code{tags-loop-continue}) to resume the | 2217 | Type @kbd{M-,} (@code{tags-loop-continue}) to resume the |
| 2247 | @code{tags-search}. This searches the rest of the current buffer, followed | 2218 | @code{tags-search}, finding one more match. This searches the rest of |
| 2248 | by the remaining files of the tags table.@refill | 2219 | the current buffer, followed by the remaining files of the tags table. |
| 2249 | 2220 | ||
| 2250 | @findex tags-query-replace | 2221 | @findex tags-query-replace |
| 2251 | @kbd{M-x tags-query-replace} performs a single | 2222 | @kbd{M-x tags-query-replace} performs a single |
| @@ -2282,56 +2253,56 @@ have to search (those which are not already visited in Emacs buffers). | |||
| 2282 | Buffers in which no match is found are quickly killed; the others | 2253 | Buffers in which no match is found are quickly killed; the others |
| 2283 | continue to exist. | 2254 | continue to exist. |
| 2284 | 2255 | ||
| 2285 | It may have struck you that @code{tags-search} is a lot like | 2256 | As an alternative to @code{tags-search}, you can run @command{grep} |
| 2286 | @code{grep}. You can also run @code{grep} itself as an inferior of | 2257 | as a subprocess and have Emacs show you the matching lines one by one. |
| 2287 | Emacs and have Emacs show you the matching lines one by one. | ||
| 2288 | @xref{Grep Searching}. | 2258 | @xref{Grep Searching}. |
| 2289 | 2259 | ||
| 2290 | @node List Tags | 2260 | @node List Tags |
| 2291 | @subsection Tags Table Inquiries | 2261 | @subsection Tags Table Inquiries |
| 2292 | 2262 | ||
| 2293 | @table @kbd | 2263 | @table @kbd |
| 2264 | @item C-M-i | ||
| 2265 | @itemx M-@key{TAB} | ||
| 2266 | Perform completion on the text around point, using the selected tags | ||
| 2267 | table if one is loaded (@code{completion-at-point}). | ||
| 2294 | @item M-x list-tags @key{RET} @var{file} @key{RET} | 2268 | @item M-x list-tags @key{RET} @var{file} @key{RET} |
| 2295 | Display a list of the tags defined in the program file @var{file}. | 2269 | Display a list of the tags defined in the program file @var{file}. |
| 2296 | @item M-x tags-apropos @key{RET} @var{regexp} @key{RET} | 2270 | @item M-x tags-apropos @key{RET} @var{regexp} @key{RET} |
| 2297 | Display a list of all tags matching @var{regexp}. | 2271 | Display a list of all tags matching @var{regexp}. |
| 2298 | @end table | 2272 | @end table |
| 2299 | 2273 | ||
| 2274 | @cindex completion (symbol names) | ||
| 2275 | In most programming language modes, you can type @kbd{C-M-i} or | ||
| 2276 | @kbd{M-@key{TAB}} (@code{completion-at-point}) to complete the symbol | ||
| 2277 | at point. If there is a selected tags table, this command can use it | ||
| 2278 | to generate completion candidates. @xref{Symbol Completion}. | ||
| 2279 | |||
| 2300 | @findex list-tags | 2280 | @findex list-tags |
| 2301 | @kbd{M-x list-tags} reads the name of one of the files described by | 2281 | @kbd{M-x list-tags} reads the name of one of the files covered by |
| 2302 | the selected tags table, and displays a list of all the tags defined in | 2282 | the selected tags table, and displays a list of tags defined in that |
| 2303 | that file. The ``file name'' argument is really just a string to | 2283 | file. Do not include a directory as part of the file name unless the |
| 2304 | compare against the file names recorded in the tags table; it is read as | 2284 | file name recorded in the tags table includes a directory. |
| 2305 | a string rather than as a file name. Therefore, completion and | ||
| 2306 | defaulting are not available, and you must enter the file name the same | ||
| 2307 | way it appears in the tags table. Do not include a directory as part of | ||
| 2308 | the file name unless the file name recorded in the tags table includes a | ||
| 2309 | directory. | ||
| 2310 | 2285 | ||
| 2311 | @findex tags-apropos | 2286 | @findex tags-apropos |
| 2312 | @vindex tags-apropos-verbose | 2287 | @vindex tags-apropos-verbose |
| 2313 | @kbd{M-x tags-apropos} is like @code{apropos} for tags | ||
| 2314 | (@pxref{Apropos}). It finds all the tags in the selected tags table | ||
| 2315 | whose entries match @var{regexp}, and displays them. If the variable | ||
| 2316 | @code{tags-apropos-verbose} is non-@code{nil}, it displays the names | ||
| 2317 | of the tags files together with the tag names. | ||
| 2318 | |||
| 2319 | @vindex tags-tag-face | 2288 | @vindex tags-tag-face |
| 2320 | @vindex tags-apropos-additional-actions | 2289 | @vindex tags-apropos-additional-actions |
| 2321 | You can customize the appearance of the output by setting the | 2290 | @kbd{M-x tags-apropos} is like @code{apropos} for tags |
| 2322 | variable @code{tags-tag-face} to a face. You can display additional | 2291 | (@pxref{Apropos}). It displays a list of tags in the selected tags |
| 2323 | output with @kbd{M-x tags-apropos} by customizing the variable | 2292 | table whose entries match @var{regexp}. If the variable |
| 2324 | @code{tags-apropos-additional-actions}---see its documentation for | 2293 | @code{tags-apropos-verbose} is non-@code{nil}, it displays the names |
| 2325 | details. | 2294 | of the tags files together with the tag names. You can customize the |
| 2326 | 2295 | appearance of the output by setting the variable @code{tags-tag-face} | |
| 2327 | You can also use the collection of tag names to complete a symbol | 2296 | to a face. You can display additional output by customizing the |
| 2328 | name in the buffer. @xref{Symbol Completion}. | 2297 | variable @code{tags-apropos-additional-actions}; see its documentation |
| 2329 | 2298 | for details. | |
| 2330 | You can use @kbd{M-x next-file} to visit the files in the selected | 2299 | |
| 2331 | tags table. The first time this command is called, it visits the | 2300 | @findex next-file |
| 2332 | first file in the tags table. Each subsequent call visits the next | 2301 | @kbd{M-x next-file} visits files covered by the selected tags table. |
| 2333 | file in the table, unless a prefix argument is supplied, in which case | 2302 | The first time it is called, it visits the first file covered by the |
| 2334 | it returns to the first file. | 2303 | table. Each subsequent call visits the next covered file, unless a |
| 2304 | prefix argument is supplied, in which case it returns to the first | ||
| 2305 | file. | ||
| 2335 | 2306 | ||
| 2336 | @node EDE | 2307 | @node EDE |
| 2337 | @section Emacs Development Environment | 2308 | @section Emacs Development Environment |
diff --git a/doc/emacs/msdog.texi b/doc/emacs/msdog.texi index e3c9b8d4fc2..547d8cbadd9 100644 --- a/doc/emacs/msdog.texi +++ b/doc/emacs/msdog.texi | |||
| @@ -863,15 +863,22 @@ fontconfig library used in modern Free desktops: | |||
| 863 | 863 | ||
| 864 | The old XLFD based format is also supported for backwards compatibility. | 864 | The old XLFD based format is also supported for backwards compatibility. |
| 865 | 865 | ||
| 866 | Emacs 23 supports a number of backends. Currently, the @code{gdi} | 866 | @cindex font backend selection (MS-Windows) |
| 867 | and @code{uniscribe} font backends are supported on Windows. The | 867 | Emacs 23 and later supports a number of font backends. Currently, |
| 868 | @code{gdi} font backend is available on all versions of Windows, and | 868 | the @code{gdi} and @code{uniscribe} backends are supported on Windows. |
| 869 | supports all fonts that are natively supported by Windows. The | 869 | The @code{gdi} font backend is available on all versions of Windows, |
| 870 | and supports all fonts that are natively supported by Windows. The | ||
| 870 | @code{uniscribe} font backend is available on Windows 2000 and later, | 871 | @code{uniscribe} font backend is available on Windows 2000 and later, |
| 871 | and supports TrueType and OpenType fonts. Some languages requiring | 872 | and supports TrueType and OpenType fonts. Some languages requiring |
| 872 | complex layout can only be properly supported by the uniscribe | 873 | complex layout can only be properly supported by the Uniscribe |
| 873 | backend. By default, both backends are enabled if supported, with | 874 | backend. By default, both backends are enabled if supported, with |
| 874 | @code{uniscribe} taking priority over @code{gdi}. | 875 | @code{uniscribe} taking priority over @code{gdi}. To override that |
| 876 | and use the GDI backend even if Uniscribe is available, invoke Emacs | ||
| 877 | with the @kbd{-xrm Emacs.fontBackend:gdi} command-line argument, or | ||
| 878 | add a @code{Emacs.fontBackend} resource with the value @code{gdi} in | ||
| 879 | the Registry under either the | ||
| 880 | @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} or the | ||
| 881 | @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs} key (@pxref{Resources}). | ||
| 875 | 882 | ||
| 876 | @cindex font properties (MS Windows) | 883 | @cindex font properties (MS Windows) |
| 877 | @noindent | 884 | @noindent |
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 675977c2c35..7301ecfea8a 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -8,8 +8,8 @@ | |||
| 8 | @cindex C editing | 8 | @cindex C editing |
| 9 | @cindex program editing | 9 | @cindex program editing |
| 10 | 10 | ||
| 11 | Emacs provides many features to facilitate editing programs. Some | 11 | This chapter describes Emacs features for facilitating editing |
| 12 | of these features can | 12 | programs. Some of these features can: |
| 13 | 13 | ||
| 14 | @itemize @bullet | 14 | @itemize @bullet |
| 15 | @item | 15 | @item |
| @@ -25,8 +25,6 @@ Insert, kill or align comments (@pxref{Comments}). | |||
| 25 | Highlight program syntax (@pxref{Font Lock}). | 25 | Highlight program syntax (@pxref{Font Lock}). |
| 26 | @end itemize | 26 | @end itemize |
| 27 | 27 | ||
| 28 | This chapter describes these features and many more. | ||
| 29 | |||
| 30 | @menu | 28 | @menu |
| 31 | * Program Modes:: Major modes for editing programs. | 29 | * Program Modes:: Major modes for editing programs. |
| 32 | * Defuns:: Commands to operate on major top-level parts | 30 | * Defuns:: Commands to operate on major top-level parts |
| @@ -40,8 +38,8 @@ Highlight program syntax (@pxref{Font Lock}). | |||
| 40 | * Glasses:: Making identifiersLikeThis more readable. | 38 | * Glasses:: Making identifiersLikeThis more readable. |
| 41 | * Semantic:: Suite of editing tools based on source code parsing. | 39 | * Semantic:: Suite of editing tools based on source code parsing. |
| 42 | * Misc for Programs:: Other Emacs features useful for editing programs. | 40 | * Misc for Programs:: Other Emacs features useful for editing programs. |
| 43 | * C Modes:: Special commands of C, C++, Objective-C, | 41 | * C Modes:: Special commands of C, C++, Objective-C, Java, |
| 44 | Java, and Pike modes. | 42 | IDL, Pike and AWK modes. |
| 45 | * Asm Mode:: Asm mode and its special features. | 43 | * Asm Mode:: Asm mode and its special features. |
| 46 | @ifnottex | 44 | @ifnottex |
| 47 | * Fortran:: Fortran mode and its special features. | 45 | * Fortran:: Fortran mode and its special features. |
| @@ -52,21 +50,14 @@ Highlight program syntax (@pxref{Font Lock}). | |||
| 52 | @section Major Modes for Programming Languages | 50 | @section Major Modes for Programming Languages |
| 53 | @cindex modes for programming languages | 51 | @cindex modes for programming languages |
| 54 | 52 | ||
| 55 | Emacs has specialized major modes for various programming languages. | 53 | Emacs has specialized major modes (@pxref{Major Modes}) for many |
| 56 | @xref{Major Modes}. A programming language major mode typically | 54 | programming languages. A programming language mode typically |
| 57 | specifies the syntax of expressions, the customary rules for | 55 | specifies the syntax of expressions, the customary rules for |
| 58 | indentation, how to do syntax highlighting for the language, and how | 56 | indentation, how to do syntax highlighting for the language, and how |
| 59 | to find the beginning or end of a function definition. It often | 57 | to find the beginning or end of a function definition. It often has |
| 60 | customizes or provides facilities for compiling and debugging programs | 58 | features for compiling and debugging programs as well. The major mode |
| 61 | as well. | 59 | for each language is named after the language; for instance, the major |
| 62 | 60 | mode for the C programming language is @code{c-mode}. | |
| 63 | Ideally, Emacs should provide a major mode for each programming | ||
| 64 | language that you might want to edit; if it doesn't have a mode for | ||
| 65 | your favorite language, you can contribute one. But often the mode | ||
| 66 | for one language can serve for other syntactically similar languages. | ||
| 67 | The major mode for language @var{l} is called @code{@var{l}-mode}, | ||
| 68 | and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}. | ||
| 69 | @xref{Choosing Modes}. | ||
| 70 | 61 | ||
| 71 | @cindex Perl mode | 62 | @cindex Perl mode |
| 72 | @cindex Icon mode | 63 | @cindex Icon mode |
| @@ -89,40 +80,32 @@ and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}. | |||
| 89 | @cindex Conf mode | 80 | @cindex Conf mode |
| 90 | @cindex DNS mode | 81 | @cindex DNS mode |
| 91 | @cindex Javascript mode | 82 | @cindex Javascript mode |
| 92 | The existing programming language major modes include Lisp, Scheme | 83 | Emacs has programming language modes for Lisp, Scheme, the |
| 93 | (a variant of Lisp) and the Scheme-based DSSSL expression language, | 84 | Scheme-based DSSSL expression language, Ada, ASM, AWK, C, C++, Delphi, |
| 94 | Ada, ASM, AWK, C, C++, Delphi (Object Pascal), Fortran, Icon, IDL | 85 | Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, Metafont |
| 95 | (CORBA), IDLWAVE, Java, Javascript, Metafont (@TeX{}'s companion for | 86 | (@TeX{}'s companion for font creation), Modula2, Objective-C, Octave, |
| 96 | font creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike, | 87 | Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, Tcl, and |
| 97 | PostScript, Prolog, Python, Ruby, Simula, Tcl, and VHDL. An | 88 | VHDL. An alternative mode for Perl is called CPerl mode. Modes are |
| 98 | alternative mode for Perl is called CPerl mode. Modes are available | 89 | also available for the scripting languages of the common GNU and Unix |
| 99 | for the scripting languages of the common GNU and Unix shells, VMS | 90 | shells, VMS DCL, and MS-DOS/MS-Windows @samp{BAT} files, and for |
| 100 | DCL, and MS-DOS/MS-Windows @samp{BAT} files. There are also major | 91 | makefiles, DNS master files, and various sorts of configuration files. |
| 101 | modes for editing makefiles, DNS master files, and various sorts of | 92 | |
| 102 | configuration files. | 93 | Ideally, Emacs should have a major mode for each programming |
| 94 | language that you might want to edit. If it doesn't have a mode for | ||
| 95 | your favorite language, the mode might be implemented in a package not | ||
| 96 | distributed with Emacs (@pxref{Packages}); or you can contribute one. | ||
| 103 | 97 | ||
| 104 | @kindex DEL @r{(programming modes)} | 98 | @kindex DEL @r{(programming modes)} |
| 105 | @findex c-electric-backspace | 99 | @findex c-electric-backspace |
| 100 | @findex backward-delete-char-untabify | ||
| 106 | In most programming languages, indentation should vary from line to | 101 | In most programming languages, indentation should vary from line to |
| 107 | line to illustrate the structure of the program. So the major modes | 102 | line to illustrate the structure of the program. Therefore, in most |
| 108 | for programming languages arrange for @key{TAB} to update the | 103 | programming language modes, typing @key{TAB} updates the indentation |
| 109 | indentation of the current line (@pxref{Program Indent}). They also | 104 | of the current line (@pxref{Program Indent}). Furthermore, @key{DEL} |
| 110 | rebind @key{DEL} to treat a tab as if it were the equivalent number of | 105 | is usually bound to @code{backward-delete-char-untabify}, which |
| 111 | spaces; this lets you delete one column of indentation without | 106 | deletes backward treating each tab as if it were the equivalent number |
| 112 | worrying whether the whitespace consists of spaces or tabs. Use | 107 | of spaces, so that you can delete one column of indentation without |
| 113 | @kbd{C-b C-d} to delete a tab character before point, in these modes. | 108 | worrying whether the whitespace consists of spaces or tabs. |
| 114 | |||
| 115 | Separate manuals are available for the modes for Ada (@pxref{Top, , Ada | ||
| 116 | Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK | ||
| 117 | (@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes | ||
| 118 | (@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}). For Fortran | ||
| 119 | mode, see | ||
| 120 | @iftex | ||
| 121 | @ref{Fortran,,, emacs-xtra, Specialized Emacs Features}. | ||
| 122 | @end iftex | ||
| 123 | @ifnottex | ||
| 124 | @ref{Fortran}. | ||
| 125 | @end ifnottex | ||
| 126 | 109 | ||
| 127 | @cindex mode hook | 110 | @cindex mode hook |
| 128 | @vindex c-mode-hook | 111 | @vindex c-mode-hook |
| @@ -130,13 +113,24 @@ mode, see | |||
| 130 | @vindex emacs-lisp-mode-hook | 113 | @vindex emacs-lisp-mode-hook |
| 131 | @vindex lisp-interaction-mode-hook | 114 | @vindex lisp-interaction-mode-hook |
| 132 | @vindex scheme-mode-hook | 115 | @vindex scheme-mode-hook |
| 133 | Turning on a major mode runs a normal hook called the @dfn{mode | 116 | Entering a programming language mode runs the custom Lisp functions |
| 134 | hook}, which is the value of a Lisp variable. Each major mode has a | 117 | specified in the hook variable @code{prog-mode-hook}, followed by |
| 135 | mode hook, and the hook's name is always made from the mode command's | 118 | those specified in the mode's own mode hook (@pxref{Major Modes}). |
| 136 | name by adding @samp{-hook}. For example, turning on C mode runs the | 119 | For instance, entering C mode runs the hooks @code{prog-mode-hook} and |
| 137 | hook @code{c-mode-hook}, while turning on Lisp mode runs the hook | 120 | @code{c-mode-hook}. @xref{Hooks}, for information about hooks. |
| 138 | @code{lisp-mode-hook}. The purpose of the mode hook is to give you a | 121 | |
| 139 | place to set up customizations for that major mode. @xref{Hooks}. | 122 | @ifinfo |
| 123 | Separate manuals are available for the modes for Ada (@pxref{Top,, | ||
| 124 | Ada Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba | ||
| 125 | IDL/Pike/AWK (@pxref{Top, , CC Mode, ccmode, CC Mode}), and IDLWAVE | ||
| 126 | (@pxref{Top,, IDLWAVE, idlwave, IDLWAVE User Manual}). | ||
| 127 | @end ifinfo | ||
| 128 | @ifnotinfo | ||
| 129 | The Emacs distribution contains Info manuals for the major modes for | ||
| 130 | Ada, C/C++/Objective C/Java/Corba IDL/Pike/AWK, and IDLWAVE. For | ||
| 131 | Fortran mode, see the ``Fortran'' section in the Info version of the | ||
| 132 | Emacs manual, which is not included in this printed version. | ||
| 133 | @end ifnotinfo | ||
| 140 | 134 | ||
| 141 | @node Defuns | 135 | @node Defuns |
| 142 | @section Top-Level Definitions, or Defuns | 136 | @section Top-Level Definitions, or Defuns |
| @@ -328,20 +322,19 @@ The Speedbar can also use it (@pxref{Speedbar}). | |||
| 328 | @subsection Which Function Mode | 322 | @subsection Which Function Mode |
| 329 | @cindex current function name in mode line | 323 | @cindex current function name in mode line |
| 330 | 324 | ||
| 331 | Which Function mode is a minor mode that displays the current | 325 | Which Function mode is a global minor mode (@pxref{Minor Modes}) |
| 332 | function name in the mode line, updating it as you move around in a | 326 | which displays the current function name in the mode line, updating it |
| 333 | buffer. | 327 | as you move around in a buffer. |
| 334 | 328 | ||
| 335 | @findex which-function-mode | 329 | @findex which-function-mode |
| 336 | @vindex which-func-modes | 330 | @vindex which-func-modes |
| 337 | To either enable or disable Which Function mode, use the command | 331 | To either enable or disable Which Function mode, use the command |
| 338 | @kbd{M-x which-function-mode}. This command applies to all buffers, | 332 | @kbd{M-x which-function-mode}. Although Which Function mode is a |
| 339 | both existing ones and those yet to be created. However, it takes | 333 | global minor mode, it takes effect only in certain major modes: those |
| 340 | effect only in certain major modes, those listed in the value of | 334 | listed in the variable @code{which-func-modes}. If the value of |
| 341 | @code{which-func-modes}. If the value of @code{which-func-modes} is | 335 | @code{which-func-modes} is @code{t} rather than a list of modes, then |
| 342 | @code{t} rather than a list of modes, then Which Function mode applies | 336 | Which Function mode applies to all major modes that know how to |
| 343 | to all major modes that know how to support it---in other words, all | 337 | support it---in other words, all the major modes that support Imenu. |
| 344 | the major modes that support Imenu. | ||
| 345 | 338 | ||
| 346 | @node Program Indent | 339 | @node Program Indent |
| 347 | @section Indentation for Programs | 340 | @section Indentation for Programs |
| @@ -352,6 +345,10 @@ reindent it as you change it. Emacs has commands to indent either a | |||
| 352 | single line, a specified number of lines, or all of the lines inside a | 345 | single line, a specified number of lines, or all of the lines inside a |
| 353 | single parenthetical grouping. | 346 | single parenthetical grouping. |
| 354 | 347 | ||
| 348 | @xref{Indentation}, for general information about indentation. This | ||
| 349 | section describes indentation features specific to programming | ||
| 350 | language modes. | ||
| 351 | |||
| 355 | @menu | 352 | @menu |
| 356 | * Basic Indent:: Indenting a single line. | 353 | * Basic Indent:: Indenting a single line. |
| 357 | * Multi-line Indent:: Commands to reindent many lines at once. | 354 | * Multi-line Indent:: Commands to reindent many lines at once. |
| @@ -361,18 +358,15 @@ single parenthetical grouping. | |||
| 361 | @end menu | 358 | @end menu |
| 362 | 359 | ||
| 363 | @cindex pretty-printer | 360 | @cindex pretty-printer |
| 364 | Emacs also provides a Lisp pretty-printer in the library @code{pp}. | 361 | Emacs also provides a Lisp pretty-printer in the @code{pp} package, |
| 365 | This program reformats a Lisp object with indentation chosen to look nice. | 362 | which reformats Lisp objects with nice-looking indentation. |
| 366 | 363 | ||
| 367 | @node Basic Indent | 364 | @node Basic Indent |
| 368 | @subsection Basic Program Indentation Commands | 365 | @subsection Basic Program Indentation Commands |
| 369 | 366 | ||
| 370 | The basic indentation commands indent a single line according to the | ||
| 371 | usual conventions of the language you are editing. | ||
| 372 | |||
| 373 | @table @kbd | 367 | @table @kbd |
| 374 | @item @key{TAB} | 368 | @item @key{TAB} |
| 375 | Adjust indentation of current line. | 369 | Adjust indentation of current line (@code{indent-for-tab-command}). |
| 376 | @item C-j | 370 | @item C-j |
| 377 | Insert a newline, then adjust indentation of following line | 371 | Insert a newline, then adjust indentation of following line |
| 378 | (@code{newline-and-indent}). | 372 | (@code{newline-and-indent}). |
| @@ -382,65 +376,50 @@ Insert a newline, then adjust indentation of following line | |||
| 382 | @findex c-indent-command | 376 | @findex c-indent-command |
| 383 | @findex indent-line-function | 377 | @findex indent-line-function |
| 384 | @findex indent-for-tab-command | 378 | @findex indent-for-tab-command |
| 385 | The basic indentation command is @key{TAB}. In any | 379 | The basic indentation command is @key{TAB} |
| 386 | programming-language major mode, @key{TAB} gives the current line the | 380 | (@code{indent-for-tab-command}), which was documented in |
| 387 | correct indentation as determined from the previous lines. It does | 381 | @ref{Indentation}. In programming language modes, @key{TAB} indents |
| 388 | this by inserting or deleting whitespace at the beginning of the | 382 | the current line, based on the indentation and syntactic content of |
| 389 | current line. If point was inside the whitespace at the beginning of | 383 | the preceding lines; if the region is active, @key{TAB} indents each |
| 390 | the line, @key{TAB} puts it at the end of that whitespace; otherwise, | 384 | line within the region, not just the current line. |
| 391 | @key{TAB} keeps point fixed with respect to the characters around it. | ||
| 392 | If the region is active (@pxref{Mark}), @key{TAB} indents every line | ||
| 393 | within the region instead of just the current line. The function that | ||
| 394 | @key{TAB} runs depends on the major mode; for instance, it is | ||
| 395 | @code{c-indent-line-or-region} in C mode. Each function is aware of | ||
| 396 | the syntax and conventions for its particular language. | ||
| 397 | |||
| 398 | Use @kbd{C-q @key{TAB}} to insert a tab character at point. | ||
| 399 | 385 | ||
| 400 | @kindex C-j @r{(indenting source code)} | 386 | @kindex C-j @r{(indenting source code)} |
| 401 | @findex newline-and-indent | 387 | @findex newline-and-indent |
| 402 | When entering lines of new code, use @kbd{C-j} | 388 | The command @kbd{C-j} (@code{newline-and-indent}), which was |
| 403 | (@code{newline-and-indent}), which inserts a newline and then adjusts | 389 | documented in @ref{Indentation Commands}, does the same as @key{RET} |
| 404 | indentation after it. (It also deletes any trailing whitespace which | 390 | followed by @key{TAB}: it inserts a new line, then adjusts the line's |
| 405 | remains before the new newline.) For instance, @kbd{C-j} at the end | 391 | indentation. |
| 406 | of a line creates a blank line with appropriate indentation. In | 392 | |
| 407 | programming language modes, it is equivalent to @key{RET} @key{TAB}. | 393 | When indenting a line that starts within a parenthetical grouping, |
| 408 | 394 | Emacs usually places the start of the line under the preceding line | |
| 409 | When Emacs indents a line that starts within a parenthetical | 395 | within the group, or under the text after the parenthesis. If you |
| 410 | grouping, it usually places the start of the line under the preceding | 396 | manually give one of these lines a nonstandard indentation (e.g.@: for |
| 411 | line within the group, or under the text after the parenthesis. If | 397 | aesthetic purposes), the lines below will follow it. |
| 412 | you manually give one of these lines a nonstandard indentation, the | 398 | |
| 413 | lines below will tend to follow it. This behavior is convenient in | 399 | The indentation commands for most programming language modes assume |
| 414 | cases where you have overridden the standard result of @key{TAB} | 400 | that a open-parenthesis, open-brace or other opening delimiter at the |
| 415 | indentation (e.g., for aesthetic purposes). | 401 | left margin is the start of a function. If the code you are editing |
| 416 | 402 | violates this assumption---even if the delimiters occur in strings or | |
| 417 | Many programming-language modes assume that an open-parenthesis, | 403 | comments---you must set @code{open-paren-in-column-0-is-defun-start} |
| 418 | open-brace or other opening delimiter at the left margin is the start | 404 | to @code{nil} for indentation to work properly. @xref{Left Margin |
| 419 | of a function. This assumption speeds up indentation commands. If | ||
| 420 | the text you are editing contains opening delimiters in column zero | ||
| 421 | that aren't the beginning of a functions---even if these delimiters | ||
| 422 | occur inside strings or comments---then you must set | ||
| 423 | @code{open-paren-in-column-0-is-defun-start}. @xref{Left Margin | ||
| 424 | Paren}. | 405 | Paren}. |
| 425 | 406 | ||
| 426 | Normally, Emacs indents lines using an ``optimal'' mix of tab and | ||
| 427 | space characters. If you want Emacs to use spaces only, set | ||
| 428 | @code{indent-tabs-mode} (@pxref{Just Spaces}). | ||
| 429 | |||
| 430 | @node Multi-line Indent | 407 | @node Multi-line Indent |
| 431 | @subsection Indenting Several Lines | 408 | @subsection Indenting Several Lines |
| 432 | 409 | ||
| 433 | Sometimes, you may want to reindent several lines of code at a time. | 410 | Sometimes, you may want to reindent several lines of code at a time. |
| 434 | One way to do this is to use the mark; when the mark is active and the | 411 | One way to do this is to use the mark; when the mark is active and the |
| 435 | region is non-empty, @key{TAB} indents every line within the region. | 412 | region is non-empty, @key{TAB} indents every line in the region. |
| 436 | In addition, Emacs provides several other commands for indenting large | 413 | Alternatively, the command @kbd{C-M-\} (@code{indent-region}) indents |
| 437 | chunks of code: | 414 | every line in the region, whether or not the mark is active |
| 415 | (@pxref{Indentation Commands}). | ||
| 416 | |||
| 417 | In addition, Emacs provides the following commands for indenting | ||
| 418 | large chunks of code: | ||
| 438 | 419 | ||
| 439 | @table @kbd | 420 | @table @kbd |
| 440 | @item C-M-q | 421 | @item C-M-q |
| 441 | Reindent all the lines within one parenthetical grouping. | 422 | Reindent all the lines within one parenthetical grouping. |
| 442 | @item C-M-\ | ||
| 443 | Reindent all lines in the region (@code{indent-region}). | ||
| 444 | @item C-u @key{TAB} | 423 | @item C-u @key{TAB} |
| 445 | Shift an entire parenthetical grouping rigidly sideways so that its | 424 | Shift an entire parenthetical grouping rigidly sideways so that its |
| 446 | first line is properly indented. | 425 | first line is properly indented. |
| @@ -454,18 +433,13 @@ lines that start inside comments and strings. | |||
| 454 | To reindent the contents of a single parenthetical grouping, | 433 | To reindent the contents of a single parenthetical grouping, |
| 455 | position point before the beginning of the grouping and type | 434 | position point before the beginning of the grouping and type |
| 456 | @kbd{C-M-q}. This changes the relative indentation within the | 435 | @kbd{C-M-q}. This changes the relative indentation within the |
| 457 | grouping, without affecting its overall indentation (i.e., the | 436 | grouping, without affecting its overall indentation (i.e.@: the |
| 458 | indentation of the line where the grouping starts). The function that | 437 | indentation of the line where the grouping starts). The function that |
| 459 | @kbd{C-M-q} runs depends on the major mode; it is | 438 | @kbd{C-M-q} runs depends on the major mode; it is |
| 460 | @code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode, | 439 | @code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode, |
| 461 | etc. To correct the overall indentation as well, type @key{TAB} | 440 | etc. To correct the overall indentation as well, type @key{TAB} |
| 462 | first. | 441 | first. |
| 463 | 442 | ||
| 464 | @kbd{C-M-\} (@code{indent-region}) applies @key{TAB} to the region. | ||
| 465 | This is useful when Transient Mark mode is disabled (@pxref{Disabled | ||
| 466 | Transient Mark}), because in that case @key{TAB} does not act on the | ||
| 467 | region. | ||
| 468 | |||
| 469 | @kindex C-u TAB | 443 | @kindex C-u TAB |
| 470 | If you like the relative indentation within a grouping but not the | 444 | If you like the relative indentation within a grouping but not the |
| 471 | indentation of its first line, move point to that first line and type | 445 | indentation of its first line, move point to that first line and type |
| @@ -516,9 +490,9 @@ expression. | |||
| 516 | @cindex @code{lisp-indent-function} property | 490 | @cindex @code{lisp-indent-function} property |
| 517 | You can override the standard pattern in various ways for individual | 491 | You can override the standard pattern in various ways for individual |
| 518 | functions, according to the @code{lisp-indent-function} property of | 492 | functions, according to the @code{lisp-indent-function} property of |
| 519 | the function name. Normally you would use this for macro definitions | 493 | the function name. This is normally done for macro definitions, using |
| 520 | and specify it using the @code{declare} construct (@pxref{Defining | 494 | the @code{declare} construct. @xref{Defining Macros,,, elisp, the |
| 521 | Macros,,, elisp, the Emacs Lisp Reference Manual}). | 495 | Emacs Lisp Reference Manual}. |
| 522 | 496 | ||
| 523 | @node C Indent | 497 | @node C Indent |
| 524 | @subsection Commands for C Indentation | 498 | @subsection Commands for C Indentation |
| @@ -632,6 +606,14 @@ information on customizing indentation for C and related modes, | |||
| 632 | including how to override parts of an existing style and how to define | 606 | including how to override parts of an existing style and how to define |
| 633 | your own styles. | 607 | your own styles. |
| 634 | 608 | ||
| 609 | @findex c-guess | ||
| 610 | @findex c-guess-install | ||
| 611 | As an alternative to specifying a style, you can tell Emacs to guess | ||
| 612 | a style by typing @kbd{M-x c-guess} in a sample code buffer. You can | ||
| 613 | then apply the guessed style to other buffers with @kbd{M-x | ||
| 614 | c-guess-install}. @xref{Guessing the Style,,, ccmode, the CC Mode | ||
| 615 | Manual}, for details. | ||
| 616 | |||
| 635 | @node Parentheses | 617 | @node Parentheses |
| 636 | @section Commands for Editing with Parentheses | 618 | @section Commands for Editing with Parentheses |
| 637 | 619 | ||
| @@ -664,9 +646,13 @@ parentheses and unbalanced string quotes in the buffer. | |||
| 664 | @cindex sexp | 646 | @cindex sexp |
| 665 | @cindex expression | 647 | @cindex expression |
| 666 | @cindex balanced expression | 648 | @cindex balanced expression |
| 667 | These commands deal with balanced expressions, also called | 649 | Each programming language mode has its own definition of a |
| 668 | @dfn{sexps}@footnote{The word ``sexp'' is used to refer to an | 650 | @dfn{balanced expression}. Balanced expressions typically include |
| 669 | expression in Lisp.}. | 651 | individual symbols, numbers, and string constants, as well as pieces |
| 652 | of code enclosed in a matching pair of delimiters. The following | ||
| 653 | commands deal with balanced expressions (in Emacs, such expressions | ||
| 654 | are referred to internally as @dfn{sexps}@footnote{The word ``sexp'' | ||
| 655 | is used to refer to an expression in Lisp.}). | ||
| 670 | 656 | ||
| 671 | @table @kbd | 657 | @table @kbd |
| 672 | @item C-M-f | 658 | @item C-M-f |
| @@ -682,90 +668,71 @@ Transpose expressions (@code{transpose-sexps}). | |||
| 682 | Put mark after following expression (@code{mark-sexp}). | 668 | Put mark after following expression (@code{mark-sexp}). |
| 683 | @end table | 669 | @end table |
| 684 | 670 | ||
| 685 | Each programming language major mode customizes the definition of | ||
| 686 | balanced expressions to suit that language. Balanced expressions | ||
| 687 | typically include symbols, numbers, and string constants, as well as | ||
| 688 | any pair of matching delimiters and their contents. Some languages | ||
| 689 | have obscure forms of expression syntax that nobody has bothered to | ||
| 690 | implement in Emacs. | ||
| 691 | |||
| 692 | @cindex Control-Meta | ||
| 693 | By convention, the keys for these commands are all Control-Meta | ||
| 694 | characters. They usually act on expressions just as the corresponding | ||
| 695 | Meta characters act on words. For instance, the command @kbd{C-M-b} | ||
| 696 | moves backward over a balanced expression, just as @kbd{M-b} moves | ||
| 697 | back over a word. | ||
| 698 | |||
| 699 | @kindex C-M-f | 671 | @kindex C-M-f |
| 700 | @kindex C-M-b | 672 | @kindex C-M-b |
| 701 | @findex forward-sexp | 673 | @findex forward-sexp |
| 702 | @findex backward-sexp | 674 | @findex backward-sexp |
| 703 | To move forward over a balanced expression, use @kbd{C-M-f} | 675 | To move forward over a balanced expression, use @kbd{C-M-f} |
| 704 | (@code{forward-sexp}). If the first significant character after point | 676 | (@code{forward-sexp}). If the first significant character after point |
| 705 | is an opening delimiter (@samp{(} in Lisp; @samp{(}, @samp{[} or | 677 | is an opening delimiter (e.g.@: @samp{(}, @samp{[} or @samp{@{} in C), |
| 706 | @samp{@{} in C), @kbd{C-M-f} moves past the matching closing | 678 | this command moves past the matching closing delimiter. If the |
| 707 | delimiter. If the character begins a symbol, string, or number, | 679 | character begins a symbol, string, or number, the command moves over |
| 708 | @kbd{C-M-f} moves over that. | 680 | that. |
| 709 | 681 | ||
| 710 | The command @kbd{C-M-b} (@code{backward-sexp}) moves backward over a | 682 | The command @kbd{C-M-b} (@code{backward-sexp}) moves backward over a |
| 711 | balanced expression. The detailed rules are like those above for | 683 | balanced expression---like @kbd{C-M-f}, but in the reverse direction. |
| 712 | @kbd{C-M-f}, but with directions reversed. If there are prefix | 684 | If the expression is preceded by any prefix characters (single-quote, |
| 713 | characters (single-quote, backquote and comma, in Lisp) preceding the | 685 | backquote and comma, in Lisp), the command moves back over them as |
| 714 | expression, @kbd{C-M-b} moves back over them as well. The balanced | 686 | well. |
| 715 | expression commands move across comments as if they were whitespace, | 687 | |
| 716 | in most modes. | 688 | @kbd{C-M-f} or @kbd{C-M-b} with an argument repeats that operation |
| 717 | 689 | the specified number of times; with a negative argument means to move | |
| 718 | @kbd{C-M-f} or @kbd{C-M-b} with an argument repeats that operation the | 690 | in the opposite direction. In most modes, these two commands move |
| 719 | specified number of times; with a negative argument, it moves in the | 691 | across comments as if they were whitespace. Note that their keys, |
| 720 | opposite direction. | 692 | @kbd{C-M-f} and @kbd{C-M-b}, are analogous to @kbd{C-f} and @kbd{C-b}, |
| 693 | which move by characters (@pxref{Moving Point}), and @kbd{M-f} and | ||
| 694 | @kbd{M-b}, which move by words (@pxref{Words}). | ||
| 721 | 695 | ||
| 722 | @cindex killing expressions | 696 | @cindex killing expressions |
| 723 | @kindex C-M-k | 697 | @kindex C-M-k |
| 724 | @findex kill-sexp | 698 | @findex kill-sexp |
| 725 | Killing a whole balanced expression can be done with @kbd{C-M-k} | 699 | To kill a whole balanced expression, type @kbd{C-M-k} |
| 726 | (@code{kill-sexp}). @kbd{C-M-k} kills the characters that @kbd{C-M-f} | 700 | (@code{kill-sexp}). This kills the text that @kbd{C-M-f} would move |
| 727 | would move over. | 701 | over. |
| 728 | 702 | ||
| 729 | @cindex transposition of expressions | 703 | @cindex transposition of expressions |
| 730 | @kindex C-M-t | 704 | @kindex C-M-t |
| 731 | @findex transpose-sexps | 705 | @findex transpose-sexps |
| 732 | A somewhat random-sounding command which is nevertheless handy is | 706 | @kbd{C-M-t} (@code{transpose-sexps}) switches the positions of the |
| 733 | @kbd{C-M-t} (@code{transpose-sexps}), which drags the previous | 707 | previous balanced expression and the next one. It is analogous to the |
| 734 | balanced expression across the next one. An argument serves as a | 708 | @kbd{C-t} command, which transposes characters (@pxref{Transpose}). |
| 735 | repeat count, moving the previous expression over that many following | 709 | An argument to @kbd{C-M-t} serves as a repeat count, moving the |
| 736 | ones. A negative argument drags the previous balanced expression | 710 | previous expression over that many following ones. A negative |
| 737 | backwards across those before it (thus canceling out the effect of | 711 | argument moves the previous balanced expression backwards across those |
| 738 | @kbd{C-M-t} with a positive argument). An argument of zero, rather | 712 | before it. An argument of zero, rather than doing nothing, transposes |
| 739 | than doing nothing, transposes the balanced expressions ending at or | 713 | the balanced expressions ending at or after point and the mark. |
| 740 | after point and the mark. | ||
| 741 | 714 | ||
| 742 | @kindex C-M-@@ | 715 | @kindex C-M-@@ |
| 743 | @kindex C-M-@key{SPC} | 716 | @kindex C-M-@key{SPC} |
| 744 | @findex mark-sexp | 717 | @findex mark-sexp |
| 745 | To operate on balanced expressions with an operation which acts on | 718 | To operate on balanced expressions with a command which acts on the |
| 746 | the region, use the command @kbd{C-M-@key{SPC}} (@code{mark-sexp}). | 719 | region, type @kbd{C-M-@key{SPC}} (@code{mark-sexp}). This sets the |
| 747 | This sets the mark at the same place that @kbd{C-M-f} would move to. | 720 | mark where @kbd{C-M-f} would move to. While the mark is active, each |
| 748 | @xref{Marking Objects}, for more information about this command. | 721 | successive call to this command extends the region by shifting the |
| 749 | 722 | mark by one expression. Positive or negative numeric arguments move | |
| 750 | @kbd{C-M-@key{SPC}} treats | 723 | the mark forward or backward by the specified number of expressions. |
| 751 | numeric arguments in the same way as @kbd{C-M-f}; in particular, a | 724 | The alias @kbd{C-M-@@} is equivalent to @kbd{C-M-@key{SPC}}. |
| 752 | negative argument puts the mark at the beginning of the previous | 725 | @xref{Marking Objects}, for more information about this and related |
| 753 | balanced expression. The alias @kbd{C-M-@@} is equivalent to | 726 | commands. |
| 754 | @kbd{C-M-@key{SPC}}. While the mark is active, each successive use of | ||
| 755 | @kbd{C-M-@key{SPC}} extends the region by shifting the mark by one | ||
| 756 | sexp. | ||
| 757 | 727 | ||
| 758 | In languages that use infix operators, such as C, it is not possible | 728 | In languages that use infix operators, such as C, it is not possible |
| 759 | to recognize all balanced expressions as such because there can be | 729 | to recognize all balanced expressions because there can be multiple |
| 760 | multiple possibilities at a given position. For example, C mode does | 730 | possibilities at a given position. For example, C mode does not treat |
| 761 | not treat @samp{foo + bar} as a single expression, even though it | 731 | @samp{foo + bar} as a single expression, even though it @emph{is} one |
| 762 | @emph{is} one C expression; instead, it recognizes @samp{foo} as one | 732 | C expression; instead, it recognizes @samp{foo} as one expression and |
| 763 | expression and @samp{bar} as another, with the @samp{+} as punctuation | 733 | @samp{bar} as another, with the @samp{+} as punctuation between them. |
| 764 | between them. Both @samp{foo + bar} and @samp{foo} are legitimate | 734 | However, C mode recognizes @samp{(foo + bar)} as a single expression, |
| 765 | choices for ``the expression following point'' when point is at the | 735 | because of the parentheses. |
| 766 | @samp{f}, so the expression commands must perforce choose one or the | ||
| 767 | other to operate on. Note that @samp{(foo + bar)} is recognized as a | ||
| 768 | single expression in C mode, because of the parentheses. | ||
| 769 | 736 | ||
| 770 | @node Moving by Parens | 737 | @node Moving by Parens |
| 771 | @subsection Moving in the Parenthesis Structure | 738 | @subsection Moving in the Parenthesis Structure |
| @@ -776,19 +743,18 @@ single expression in C mode, because of the parentheses. | |||
| 776 | @cindex braces, moving across | 743 | @cindex braces, moving across |
| 777 | @cindex list commands | 744 | @cindex list commands |
| 778 | 745 | ||
| 779 | The Emacs commands for handling parenthetical groupings see nothing | 746 | The following commands move over groupings delimited by parentheses |
| 780 | except parentheses (or whatever characters must balance in the | 747 | (or whatever else serves as delimiters in the language you are working |
| 781 | language you are working with). They ignore strings and comments | 748 | with). They ignore strings and comments, including any parentheses |
| 782 | (including any parentheses within them) and ignore parentheses quoted | 749 | within them, and also ignore parentheses that are ``quoted'' with an |
| 783 | by an escape character. They are mainly intended for editing | 750 | escape character. These commands are mainly intended for editing |
| 784 | programs, but can be useful for editing any text that has parentheses. | 751 | programs, but can be useful for editing any text containing |
| 785 | They are sometimes called ``list'' commands because in Lisp these | 752 | parentheses. They are referred to internally as ``list'' commands |
| 786 | groupings are lists. | 753 | because in Lisp these groupings are lists. |
| 787 | 754 | ||
| 788 | These commands assume that the starting point is not inside a string | 755 | These commands assume that the starting point is not inside a string |
| 789 | or a comment. Sometimes you can invoke them usefully from one of | 756 | or a comment. If you invoke them from inside a string or comment, the |
| 790 | these places (for example, when you have a parenthesised clause in a | 757 | results are unreliable. |
| 791 | comment) but this is unreliable. | ||
| 792 | 758 | ||
| 793 | @table @kbd | 759 | @table @kbd |
| 794 | @item C-M-n | 760 | @item C-M-n |
| @@ -826,52 +792,62 @@ delimiter, this is nearly the same as searching for a @samp{(}. An | |||
| 826 | argument specifies the number of levels to go down. | 792 | argument specifies the number of levels to go down. |
| 827 | 793 | ||
| 828 | @node Matching | 794 | @node Matching |
| 829 | @subsection Automatic Display Of Matching Parentheses | 795 | @subsection Matching Parentheses |
| 830 | @cindex matching parentheses | 796 | @cindex matching parentheses |
| 831 | @cindex parentheses, displaying matches | 797 | @cindex parentheses, displaying matches |
| 832 | 798 | ||
| 833 | The Emacs parenthesis-matching feature is designed to show | 799 | Emacs has a number of @dfn{parenthesis matching} features, which |
| 834 | automatically how parentheses (and other matching delimiters) match in | 800 | make it easy to see how and whether parentheses (or other delimiters) |
| 835 | the text. Whenever you type a self-inserting character that is a | 801 | match up. |
| 836 | closing delimiter, the cursor moves momentarily to the location of the | 802 | |
| 803 | Whenever you type a self-inserting character that is a closing | ||
| 804 | delimiter, the cursor moves momentarily to the location of the | ||
| 837 | matching opening delimiter, provided that is on the screen. If it is | 805 | matching opening delimiter, provided that is on the screen. If it is |
| 838 | not on the screen, Emacs displays some of the text near it in the echo | 806 | not on the screen, Emacs displays some of the text near it in the echo |
| 839 | area. Either way, you can tell which grouping you are closing off. | 807 | area. Either way, you can tell which grouping you are closing off. |
| 840 | 808 | If the opening delimiter and closing delimiter are mismatched---such | |
| 841 | If the opening delimiter and closing delimiter are mismatched---such | ||
| 842 | as in @samp{[x)}---a warning message is displayed in the echo area. | 809 | as in @samp{[x)}---a warning message is displayed in the echo area. |
| 843 | 810 | ||
| 844 | @vindex blink-matching-paren | 811 | @vindex blink-matching-paren |
| 845 | @vindex blink-matching-paren-distance | 812 | @vindex blink-matching-paren-distance |
| 846 | @vindex blink-matching-delay | 813 | @vindex blink-matching-delay |
| 847 | Three variables control parenthesis match display: | 814 | Three variables control the display of matching parentheses: |
| 848 | 815 | ||
| 849 | @code{blink-matching-paren} turns the feature on or off: @code{nil} | 816 | @itemize @bullet |
| 850 | disables it, but the default is @code{t} to enable match display. | 817 | @item |
| 818 | @code{blink-matching-paren} turns the feature on or off: @code{nil} | ||
| 819 | disables it, but the default is @code{t} to enable it. | ||
| 851 | 820 | ||
| 852 | @code{blink-matching-delay} says how many seconds to leave the | 821 | @item |
| 853 | cursor on the matching opening delimiter, before bringing it back to | 822 | @code{blink-matching-delay} says how many seconds to leave the cursor |
| 854 | the real location of point; the default is 1, but on some systems it | 823 | on the matching opening delimiter, before bringing it back to the real |
| 855 | is useful to specify a fraction of a second. | 824 | location of point. This may be an integer or floating-point number; |
| 825 | the default is 1. | ||
| 856 | 826 | ||
| 857 | @code{blink-matching-paren-distance} specifies how many characters | 827 | @item |
| 828 | @code{blink-matching-paren-distance} specifies how many characters | ||
| 858 | back to search to find the matching opening delimiter. If the match | 829 | back to search to find the matching opening delimiter. If the match |
| 859 | is not found in that distance, scanning stops, and nothing is displayed. | 830 | is not found in that distance, Emacs stops scanning and nothing is |
| 860 | This is to prevent the scan for the matching delimiter from wasting | 831 | displayed. The default is 102400. |
| 861 | lots of time when there is no match. The default is 102400. | 832 | @end itemize |
| 862 | 833 | ||
| 863 | @cindex Show Paren mode | 834 | @cindex Show Paren mode |
| 864 | @cindex highlighting matching parentheses | 835 | @cindex highlighting matching parentheses |
| 865 | @findex show-paren-mode | 836 | @findex show-paren-mode |
| 866 | Show Paren mode provides a more powerful kind of automatic matching. | 837 | Show Paren mode, a global minor mode, provides a more powerful kind |
| 867 | Whenever point is before an opening delimiter or after a closing | 838 | of automatic matching. Whenever point is before an opening delimiter |
| 868 | delimiter, both that delimiter and its opposite delimiter are | 839 | or after a closing delimiter, both that delimiter and its opposite |
| 869 | highlighted. Use the command @kbd{M-x show-paren-mode} to enable or | 840 | delimiter are highlighted. To toggle Show Paren mode, type @kbd{M-x |
| 870 | disable this mode. | 841 | show-paren-mode}. |
| 871 | 842 | ||
| 872 | Show Paren mode uses the faces @code{show-paren-match} and | 843 | @cindex Electric Pair mode |
| 873 | @code{show-paren-mismatch} to highlight parentheses; you can customize | 844 | @cindex inserting matching parentheses |
| 874 | them to control how highlighting looks. @xref{Face Customization}. | 845 | @findex electric-pair-mode |
| 846 | Electric Pair mode, a global minor mode, provides a way to easily | ||
| 847 | insert matching delimiters. Whenever you insert an opening delimiter, | ||
| 848 | the matching closing delimiter is automatically inserted as well, | ||
| 849 | leaving point between the two. To toggle Electric Pair mode, type | ||
| 850 | @kbd{M-x electric-pair-mode}. | ||
| 875 | 851 | ||
| 876 | @node Comments | 852 | @node Comments |
| 877 | @section Manipulating Comments | 853 | @section Manipulating Comments |
| @@ -882,6 +858,23 @@ provides special commands for editing and inserting comments. It can | |||
| 882 | also do spell checking on comments with Flyspell Prog mode | 858 | also do spell checking on comments with Flyspell Prog mode |
| 883 | (@pxref{Spelling}). | 859 | (@pxref{Spelling}). |
| 884 | 860 | ||
| 861 | Some major modes have special rules for indenting different kinds of | ||
| 862 | comments. For example, in Lisp code, comments starting with two | ||
| 863 | semicolons are indented as if they were lines of code, while those | ||
| 864 | starting with three semicolons are supposed to be aligned to the left | ||
| 865 | margin and are often used for sectioning purposes. Emacs understand | ||
| 866 | these conventions; for instance, typing @key{TAB} on a comment line | ||
| 867 | will indent the comment to the appropriate position. | ||
| 868 | |||
| 869 | @example | ||
| 870 | ;; This function is just an example. | ||
| 871 | ;;; Here either two or three semicolons are appropriate. | ||
| 872 | (defun foo (x) | ||
| 873 | ;;; And now, the first part of the function: | ||
| 874 | ;; The following line adds one. | ||
| 875 | (1+ x)) ; This line adds one. | ||
| 876 | @end example | ||
| 877 | |||
| 885 | @menu | 878 | @menu |
| 886 | * Comment Commands:: Inserting, killing, and aligning comments. | 879 | * Comment Commands:: Inserting, killing, and aligning comments. |
| 887 | * Multi-Line Comments:: Commands for adding and editing multi-line comments. | 880 | * Multi-Line Comments:: Commands for adding and editing multi-line comments. |
| @@ -893,12 +886,12 @@ also do spell checking on comments with Flyspell Prog mode | |||
| 893 | @cindex indentation for comments | 886 | @cindex indentation for comments |
| 894 | @cindex alignment for comments | 887 | @cindex alignment for comments |
| 895 | 888 | ||
| 896 | The commands in this table insert, kill and align comments: | 889 | The following commands operate on comments: |
| 897 | 890 | ||
| 898 | @table @asis | 891 | @table @asis |
| 899 | @item @kbd{M-;} | 892 | @item @kbd{M-;} |
| 900 | Insert or realign comment on current line; alternatively, comment or | 893 | Insert or realign comment on current line; if the region is active, |
| 901 | uncomment the region (@code{comment-dwim}). | 894 | comment or uncomment the region instead (@code{comment-dwim}). |
| 902 | @item @kbd{C-u M-;} | 895 | @item @kbd{C-u M-;} |
| 903 | Kill comment on current line (@code{comment-kill}). | 896 | Kill comment on current line (@code{comment-kill}). |
| 904 | @item @kbd{C-x ;} | 897 | @item @kbd{C-x ;} |
| @@ -909,7 +902,7 @@ Like @key{RET} followed by inserting and aligning a comment | |||
| 909 | (@code{comment-indent-new-line}). @xref{Multi-Line Comments}. | 902 | (@code{comment-indent-new-line}). @xref{Multi-Line Comments}. |
| 910 | @item @kbd{M-x comment-region} | 903 | @item @kbd{M-x comment-region} |
| 911 | @itemx @kbd{C-c C-c} (in C-like modes) | 904 | @itemx @kbd{C-c C-c} (in C-like modes) |
| 912 | Add or remove comment delimiters on all the lines in the region. | 905 | Add comment delimiters to all the lines in the region. |
| 913 | @end table | 906 | @end table |
| 914 | 907 | ||
| 915 | @kindex M-; | 908 | @kindex M-; |
| @@ -920,65 +913,61 @@ I Mean''; it indicates that this command can be used for many | |||
| 920 | different jobs relating to comments, depending on the situation where | 913 | different jobs relating to comments, depending on the situation where |
| 921 | you use it. | 914 | you use it. |
| 922 | 915 | ||
| 923 | When a region is active, @kbd{M-;} either adds or removes comment | 916 | When a region is active (@pxref{Mark}), @kbd{M-;} either adds |
| 924 | delimiters on each line of the region. @xref{Mark}. If every line in | 917 | comment delimiters to the region, or removes them. If every line in |
| 925 | the region is a comment, it removes comment delimiters from each; | 918 | the region is already a comment, it ``uncomments'' each of those lines |
| 926 | otherwise, it adds comment delimiters to each. You can also use the | 919 | by removing their comment delimiters. Otherwise, it adds comment |
| 927 | commands @code{comment-region} and @code{uncomment-region} to | 920 | delimiters to enclose the text in the region. |
| 928 | explicitly comment or uncomment the text in the region | 921 | |
| 929 | (@pxref{Multi-Line Comments}). If you supply a prefix argument to | 922 | If you supply a prefix argument to @kbd{M-;} when a region is |
| 930 | @kbd{M-;} when a region is active, that specifies how many comment | 923 | active, that specifies the number of comment delimiters to add or |
| 931 | delimiters to add or how many to delete. | 924 | delete. A positive argument @var{n} adds @var{n} delimiters, while a |
| 932 | 925 | negative argument @var{-n} removes @var{n} delimiters. | |
| 933 | If the region is not active, @kbd{M-;} inserts a new comment if | 926 | |
| 934 | there is no comment already on the line. The new comment is normally | 927 | If the region is not active, and there is no existing comment on the |
| 935 | aligned at a specific column called the @dfn{comment column}; if the | 928 | current line, @kbd{M-;} adds a new comment to the current line. If |
| 936 | text of the line extends past the comment column, @kbd{M-;} aligns the | 929 | the line is blank (i.e.@: empty or containing only whitespace |
| 937 | comment start string to a suitable boundary (usually, at least one | 930 | characters), the comment is indented to the same position where |
| 938 | space is inserted). The comment begins with the string Emacs thinks | 931 | @key{TAB} would indent to (@pxref{Basic Indent}). If the line is |
| 939 | comments should start with (the value of @code{comment-start}; see | 932 | non-blank, the comment is placed after the last non-whitespace |
| 940 | below). Emacs places point after that string, so you can insert the | 933 | character on the line; normally, Emacs tries putting it at the column |
| 941 | text of the comment right away. If the major mode has specified a | 934 | specified by the variable @code{comment-column} (@pxref{Options for |
| 942 | string to terminate comments, @kbd{M-;} inserts that string after | 935 | Comments}), but if the line already extends past that column, it puts |
| 943 | point, to keep the syntax valid. | 936 | the comment at some suitable position, usually separated from the |
| 937 | non-comment text by at least one space. In each case, Emacs places | ||
| 938 | point after the comment's starting delimiter, so that you can start | ||
| 939 | typing the comment text right away. | ||
| 944 | 940 | ||
| 945 | You can also use @kbd{M-;} to align an existing comment. If a line | 941 | You can also use @kbd{M-;} to align an existing comment. If a line |
| 946 | already contains the comment-start string, @kbd{M-;} realigns it to | 942 | already contains the comment-start string, @kbd{M-;} realigns it to |
| 947 | the conventional alignment and moves point after it. (Exception: | 943 | the conventional alignment and moves point after the comment's |
| 948 | comments starting in column 0 are not moved.) Even when an existing | 944 | starting delimiter. As an exception, comments starting in column 0 |
| 949 | comment is properly aligned, @kbd{M-;} is still useful for moving | 945 | are not moved. Even when an existing comment is properly aligned, |
| 950 | directly to the start of the text inside the comment. | 946 | @kbd{M-;} is still useful for moving directly to the start of the |
| 947 | comment text. | ||
| 951 | 948 | ||
| 952 | @findex comment-kill | 949 | @findex comment-kill |
| 953 | @kindex C-u M-; | 950 | @kindex C-u M-; |
| 954 | @kbd{C-u M-;} kills any comment on the current line, along with the | 951 | @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) kills any |
| 955 | whitespace before it. To reinsert the comment on another line, move | 952 | comment on the current line, along with the whitespace before it. |
| 956 | to the end of that line, do @kbd{C-y}, and then do @kbd{M-;} to | 953 | Since the comment is saved to the kill ring, you can reinsert it on |
| 957 | realign it. | 954 | another line by moving to the end of that line, doing @kbd{C-y}, and |
| 958 | 955 | then @kbd{M-;} to realign the command. You can achieve the same | |
| 959 | Note that @kbd{C-u M-;} is not a distinct key; it is @kbd{M-;} | 956 | effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill} |
| 960 | (@code{comment-dwim}) with a prefix argument. That command is | 957 | (@code{comment-dwim} actually calls @code{comment-kill} as a |
| 961 | programmed so that when it receives a prefix argument it calls | 958 | subroutine when it is given a prefix argument). |
| 962 | @code{comment-kill}. However, @code{comment-kill} is a valid command | ||
| 963 | in its own right, and you can bind it directly to a key if you wish. | ||
| 964 | |||
| 965 | Some major modes have special rules for aligning certain kinds of | ||
| 966 | comments in certain contexts. For example, in Lisp code, comments which | ||
| 967 | start with two semicolons are indented as if they were lines of code, | ||
| 968 | instead of at the comment column. Comments which start with three | ||
| 969 | semicolons are supposed to start at the left margin and are often used | ||
| 970 | for sectioning purposes. Emacs understands | ||
| 971 | these conventions by indenting a double-semicolon comment using @key{TAB}, | ||
| 972 | and by not changing the indentation of a triple-semicolon comment at all. | ||
| 973 | 959 | ||
| 974 | @example | 960 | @kindex C-c C-c (C mode) |
| 975 | ;; This function is just an example. | 961 | @findex comment-region |
| 976 | ;;; Here either two or three semicolons are appropriate. | 962 | @findex uncomment-region |
| 977 | (defun foo (x) | 963 | The command @kbd{M-x comment-region} is equivalent to calling |
| 978 | ;;; And now, the first part of the function: | 964 | @kbd{M-;} on an active region, except that it always acts on the |
| 979 | ;; The following line adds one. | 965 | region, even if the mark is inactive. In C mode and related modes, |
| 980 | (1+ x)) ; This line adds one. | 966 | this command is bound to @kbd{C-c C-c}. The command @kbd{M-x |
| 981 | @end example | 967 | uncomment-region} uncomments each line in the region; a numeric prefix |
| 968 | argument specifies the number of comment delimiters to remove | ||
| 969 | (negative arguments specify the number of comment to delimiters to | ||
| 970 | add). | ||
| 982 | 971 | ||
| 983 | For C-like modes, you can configure the exact effect of @kbd{M-;} by | 972 | For C-like modes, you can configure the exact effect of @kbd{M-;} by |
| 984 | setting the variables @code{c-indent-comment-alist} and | 973 | setting the variables @code{c-indent-comment-alist} and |
| @@ -994,32 +983,31 @@ the brace rather than at @code{comment-column}. For full details see | |||
| 994 | @kindex M-j | 983 | @kindex M-j |
| 995 | @cindex blank lines in programs | 984 | @cindex blank lines in programs |
| 996 | @findex comment-indent-new-line | 985 | @findex comment-indent-new-line |
| 997 | 986 | @vindex comment-multi-line | |
| 998 | If you are typing a comment and wish to continue it on another line, | 987 | If you are typing a comment and wish to continue it to another line, |
| 999 | you can use the command @kbd{C-M-j} or @kbd{M-j} | 988 | type @kbd{M-j} or @kbd{C-M-j} (@code{comment-indent-new-line}). This |
| 1000 | (@code{comment-indent-new-line}). If @code{comment-multi-line} | 989 | breaks the current line, and inserts the necessary comment delimiters |
| 1001 | (@pxref{Options for Comments}) is non-@code{nil}, it moves to a new | 990 | and indentation to continue the comment. |
| 1002 | line within the comment. Otherwise it closes the comment and starts a | 991 | |
| 1003 | new comment on a new line. When Auto Fill mode is on, going past the | 992 | For languages with closing comment delimiters (e.g.@: @samp{*/} in |
| 1004 | fill column while typing a comment causes the comment to be continued | 993 | C), the exact behavior of @kbd{M-j} depends on the value of the |
| 1005 | in just this fashion. | 994 | variable @code{comment-multi-line}. If the value is @code{nil}, the |
| 1006 | 995 | command closes the comment on the old line and starts a new comment on | |
| 1007 | @kindex C-c C-c (C mode) | 996 | the new line. Otherwise, it opens a new line within the current |
| 1008 | @findex comment-region | 997 | comment delimiters. |
| 1009 | To turn existing lines into comment lines, use the @kbd{M-x | 998 | |
| 1010 | comment-region} command (or type @kbd{C-c C-c} in C-like modes). It | 999 | When Auto Fill mode is on, going past the fill column while typing a |
| 1011 | adds comment delimiters to the lines that start in the region, thus | 1000 | comment also continues the comment, in the same way as an explicit |
| 1012 | commenting them out. With a negative argument, it does the | 1001 | invocation of @kbd{M-j}. |
| 1013 | opposite---it deletes comment delimiters from the lines in the region. | 1002 | |
| 1014 | 1003 | To turn existing lines into comment lines, use @kbd{M-;} with the | |
| 1015 | With a positive argument, @code{comment-region} duplicates the last | 1004 | region active, or use @kbd{M-x comment-region} |
| 1016 | character of the comment start sequence it adds; the argument | 1005 | @ifinfo |
| 1017 | specifies how many copies of the character to insert. Thus, in Lisp | 1006 | (@pxref{Comment Commands}). |
| 1018 | mode, @kbd{C-u 2 M-x comment-region} adds @samp{;;} to each line. | 1007 | @end ifinfo |
| 1019 | Duplicating the comment delimiter is a way of calling attention to the | 1008 | @ifnotinfo |
| 1020 | comment. It can also affect how the comment is aligned or indented. | 1009 | as described in the preceding section. |
| 1021 | In Lisp, for proper indentation, you should use an argument of two or | 1010 | @end ifnotinfo |
| 1022 | three, if between defuns; if within a defun, it must be three. | ||
| 1023 | 1011 | ||
| 1024 | You can configure C Mode such that when you type a @samp{/} at the | 1012 | You can configure C Mode such that when you type a @samp{/} at the |
| 1025 | start of a line in a multi-line block comment, this closes the | 1013 | start of a line in a multi-line block comment, this closes the |
| @@ -1032,19 +1020,16 @@ comment. Enable the @code{comment-close-slash} clean-up for this. | |||
| 1032 | @vindex comment-column | 1020 | @vindex comment-column |
| 1033 | @kindex C-x ; | 1021 | @kindex C-x ; |
| 1034 | @findex comment-set-column | 1022 | @findex comment-set-column |
| 1035 | The @dfn{comment column}, the column at which Emacs tries to place | 1023 | As mentioned in @ref{Comment Commands}, when the @kbd{M-j} command |
| 1036 | comments, is stored in the variable @code{comment-column}. You can | 1024 | adds a comment to a line, it tries to place the comment at the column |
| 1037 | set it to a number explicitly. Alternatively, the command @kbd{C-x ;} | 1025 | specified by the buffer-local variable @code{comment-column}. You can |
| 1038 | (@code{comment-set-column}) sets the comment column to the column | 1026 | set either the local value or the default value of this buffer-local |
| 1039 | point is at. @kbd{C-u C-x ;} sets the comment column to match the | 1027 | variable in the usual way (@pxref{Locals}). Alternatively, you can |
| 1040 | last comment before point in the buffer, and then does a @kbd{M-;} to | 1028 | type @kbd{C-x ;} (@code{comment-set-column}) to set the value of |
| 1041 | align the current line's comment under the previous one. | 1029 | @code{comment-column} in the current buffer to the column where point |
| 1042 | 1030 | is currently located. @kbd{C-u C-x ;} sets the comment column to | |
| 1043 | The variable @code{comment-column} is per-buffer: setting the variable | 1031 | match the last comment before point in the buffer, and then does a |
| 1044 | in the normal fashion affects only the current buffer, but there is a | 1032 | @kbd{M-;} to align the current line's comment under the previous one. |
| 1045 | default value which you can change with @code{setq-default}. | ||
| 1046 | @xref{Locals}. Many major modes initialize this variable for the | ||
| 1047 | current buffer. | ||
| 1048 | 1033 | ||
| 1049 | @vindex comment-start-skip | 1034 | @vindex comment-start-skip |
| 1050 | The comment commands recognize comments based on the regular | 1035 | The comment commands recognize comments based on the regular |
| @@ -1053,39 +1038,32 @@ Make sure this regexp does not match the null string. It may match more | |||
| 1053 | than the comment starting delimiter in the strictest sense of the word; | 1038 | than the comment starting delimiter in the strictest sense of the word; |
| 1054 | for example, in C mode the value of the variable is | 1039 | for example, in C mode the value of the variable is |
| 1055 | @c This stops M-q from breaking the line inside that @code. | 1040 | @c This stops M-q from breaking the line inside that @code. |
| 1056 | @code{@w{"/\\*+ *\\|//+ *"}}, which matches extra stars and spaces | 1041 | @code{@w{"\\(//+\\|/\\*+\\)\\s *"}}, which matches extra stars and |
| 1057 | after the @samp{/*} itself, and accepts C++ style comments also. | 1042 | spaces after the @samp{/*} itself, and accepts C++ style comments |
| 1058 | (Note that @samp{\\} is needed in Lisp syntax to include a @samp{\} in | 1043 | also. (Note that @samp{\\} is needed in Lisp syntax to include a |
| 1059 | the string, which is needed to deny the first star its special meaning | 1044 | @samp{\} in the string, which is needed to deny the first star its |
| 1060 | in regexp syntax. @xref{Regexp Backslash}.) | 1045 | special meaning in regexp syntax. @xref{Regexp Backslash}.) |
| 1061 | 1046 | ||
| 1062 | @vindex comment-start | 1047 | @vindex comment-start |
| 1063 | @vindex comment-end | 1048 | @vindex comment-end |
| 1064 | When a comment command makes a new comment, it inserts the value of | 1049 | When a comment command makes a new comment, it inserts the value of |
| 1065 | @code{comment-start} to begin it. The value of @code{comment-end} is | 1050 | @code{comment-start} as an opening comment delimiter. It also inserts |
| 1066 | inserted after point, so that it will follow the text that you will | 1051 | the value of @code{comment-end} after point, as a closing comment |
| 1067 | insert into the comment. When @code{comment-end} is non-empty, it | 1052 | delimiter. For example, in Lisp mode, @code{comment-start} is |
| 1068 | should start with a space. For example, in C mode, | 1053 | @samp{";"} and @code{comment-end} is @code{""} (the empty string). In |
| 1069 | @code{comment-start} has the value @w{@code{"/* "}} and | 1054 | C mode, @code{comment-start} is @code{"/* "} and @code{comment-end} is |
| 1070 | @code{comment-end} has the value @w{@code{" */"}}. | 1055 | @code{" */"}. |
| 1071 | 1056 | ||
| 1072 | @vindex comment-padding | 1057 | @vindex comment-padding |
| 1073 | The variable @code{comment-padding} specifies how many spaces | 1058 | The variable @code{comment-padding} specifies a string that the |
| 1074 | @code{comment-region} should insert on each line between the comment | 1059 | commenting commands should insert between the comment delimiter(s) and |
| 1075 | delimiter and the line's original text. The default is 1, to insert | 1060 | the comment text. The default, @samp{" "}, specifies a single space. |
| 1076 | one space. @code{nil} means 0. Alternatively, @code{comment-padding} | 1061 | Alternatively, the value can be a number, which specifies that number |
| 1077 | can hold the actual string to insert. | 1062 | of spaces, or @code{nil}, which means no spaces at all. |
| 1078 | 1063 | ||
| 1079 | @vindex comment-multi-line | 1064 | The variable @code{comment-multi-line} controls how @kbd{M-j} and |
| 1080 | The variable @code{comment-multi-line} controls how @kbd{C-M-j} | 1065 | Auto Fill mode continue comments over multiple lines. |
| 1081 | (@code{indent-new-comment-line}) behaves when used inside a comment. | 1066 | @xref{Multi-Line Comments}. |
| 1082 | Specifically, when @code{comment-multi-line} is @code{nil}, the | ||
| 1083 | command inserts a comment terminator, begins a new line, and finally | ||
| 1084 | inserts a comment starter. Otherwise it does not insert the | ||
| 1085 | terminator and starter, so it effectively continues the current | ||
| 1086 | comment across multiple lines. In languages that allow multi-line | ||
| 1087 | comments, the choice of value for this variable is a matter of taste. | ||
| 1088 | The default for this variable depends on the major mode. | ||
| 1089 | 1067 | ||
| 1090 | @vindex comment-indent-function | 1068 | @vindex comment-indent-function |
| 1091 | The variable @code{comment-indent-function} should contain a function | 1069 | The variable @code{comment-indent-function} should contain a function |
| @@ -1139,7 +1117,7 @@ mode which @kbd{C-h S} does support. | |||
| 1139 | @node Man Page | 1117 | @node Man Page |
| 1140 | @subsection Man Page Lookup | 1118 | @subsection Man Page Lookup |
| 1141 | 1119 | ||
| 1142 | @cindex manual page | 1120 | @cindex man page |
| 1143 | On Unix, the main form of on-line documentation was the @dfn{manual | 1121 | On Unix, the main form of on-line documentation was the @dfn{manual |
| 1144 | page} or @dfn{man page}. In the GNU operating system, we aim to | 1122 | page} or @dfn{man page}. In the GNU operating system, we aim to |
| 1145 | replace man pages with better-organized manuals that you can browse | 1123 | replace man pages with better-organized manuals that you can browse |
| @@ -1148,71 +1126,51 @@ still useful to read manual pages. | |||
| 1148 | 1126 | ||
| 1149 | @findex manual-entry | 1127 | @findex manual-entry |
| 1150 | You can read the man page for an operating system command, library | 1128 | You can read the man page for an operating system command, library |
| 1151 | function, or system call, with the @kbd{M-x man} command. It | 1129 | function, or system call, with the @kbd{M-x man} command. This |
| 1152 | runs the @code{man} program to format the man page; if the system | 1130 | prompts for a topic, with completion (@pxref{Completion}), and runs |
| 1153 | permits, it runs @code{man} asynchronously, so that you can keep on | 1131 | the @command{man} program to format the corresponding man page. If |
| 1154 | editing while the page is being formatted. (On MS-DOS and MS-Windows | 1132 | the system permits, it runs @command{man} asynchronously, so that you |
| 1155 | 3, you cannot edit while Emacs waits for @code{man} to finish.) The | 1133 | can keep on editing while the page is being formatted. The result |
| 1156 | result goes in a buffer named @samp{*Man @var{topic}*}. These buffers | 1134 | goes in a buffer named @samp{*Man @var{topic}*}. These buffers use a |
| 1157 | use a special major mode, Man mode, that facilitates scrolling and | 1135 | special major mode, Man mode, that facilitates scrolling and jumping |
| 1158 | jumping to other manual pages. For details, type @kbd{C-h m} while in | 1136 | to other manual pages. For details, type @kbd{C-h m} while in a Man |
| 1159 | a man page buffer. | 1137 | mode buffer. |
| 1160 | 1138 | ||
| 1161 | @cindex sections of manual pages | 1139 | @cindex sections of manual pages |
| 1162 | Each man page belongs to one of ten or more @dfn{sections}, each | 1140 | Each man page belongs to one of ten or more @dfn{sections}, each |
| 1163 | named by a digit or by a digit and a letter. Sometimes there are | 1141 | named by a digit or by a digit and a letter. Sometimes there are man |
| 1164 | multiple man pages with the same name in different sections. To read | 1142 | pages with the same name in different sections. To read a man page |
| 1165 | a man page from a specific section, type | 1143 | from a specific section, type @samp{@var{topic}(@var{section})} or |
| 1166 | @samp{@var{topic}(@var{section})} or @samp{@var{section} @var{topic}} | 1144 | @samp{@var{section} @var{topic}} when @kbd{M-x manual-entry} prompts |
| 1167 | when @kbd{M-x manual-entry} prompts for the topic. For example, to | 1145 | for the topic. For example, the man page for the C library function |
| 1168 | read the man page for the C library function @code{chmod} (as opposed | 1146 | @code{chmod} is in section 2, but there is a shell command of the same |
| 1169 | to a command of the same name), type @kbd{M-x manual-entry @key{RET} | 1147 | name, whose man page is in section 1; to view the former, type |
| 1170 | chmod(2) @key{RET}}. (@code{chmod} is a system call, so it is in | 1148 | @kbd{M-x manual-entry @key{RET} chmod(2) @key{RET}}. |
| 1171 | section @samp{2}.) | ||
| 1172 | 1149 | ||
| 1173 | @vindex Man-switches | 1150 | @vindex Man-switches |
| 1174 | If you do not specify a section, the results depend on how the | 1151 | @kindex M-n @r{(Man mode)} |
| 1175 | @code{man} program works on your system. Some of them display only | 1152 | @kindex M-p @r{(Man mode)} |
| 1176 | the first man page they find. Others display all man pages that have | 1153 | If you do not specify a section, @kbd{M-x man} normally displays |
| 1177 | the specified name, so you can move between them with the @kbd{M-n} | 1154 | only the first man page found. On some systems, the @code{man} |
| 1178 | and @kbd{M-p} keys@footnote{On some systems, the @code{man} program | 1155 | program accepts a @samp{-a} command-line option, which tells it to |
| 1179 | accepts a @samp{-a} command-line option which tells it to display all | 1156 | display all the man pages for the specified topic. To make use of |
| 1180 | the man pages for the specified topic. If you want this behavior, you | 1157 | this, change the value of the variable @code{Man-switches} to |
| 1181 | can add this option to the value of the variable @code{Man-switches}.}. | 1158 | @samp{"-a"}. Then, in the Man mode buffer, you can type @kbd{M-n} and |
| 1182 | The mode line shows how many manual pages are present in the Man buffer. | 1159 | @kbd{M-p} to switch between man pages in different sections. The mode |
| 1183 | 1160 | line shows how many manual pages are available. | |
| 1184 | @vindex Man-fontify-manpage-flag | ||
| 1185 | By default, Emacs highlights the text in man pages. For a long man | ||
| 1186 | page, highlighting can take substantial time. You can turn off | ||
| 1187 | highlighting of man pages by setting the variable | ||
| 1188 | @code{Man-fontify-manpage-flag} to @code{nil}. | ||
| 1189 | |||
| 1190 | @findex Man-fontify-manpage | ||
| 1191 | If you insert the text of a man page into an Emacs buffer in some | ||
| 1192 | other fashion, you can use the command @kbd{M-x Man-fontify-manpage} to | ||
| 1193 | perform the same conversions that @kbd{M-x manual-entry} does. | ||
| 1194 | 1161 | ||
| 1195 | @findex woman | 1162 | @findex woman |
| 1196 | @cindex manual pages, on MS-DOS/MS-Windows | 1163 | @cindex manual pages, on MS-DOS/MS-Windows |
| 1197 | An alternative way of reading manual pages is the @kbd{M-x woman} | 1164 | An alternative way of reading manual pages is the @kbd{M-x woman} |
| 1198 | command@footnote{The name of the command, @code{woman}, is an acronym | 1165 | command. Unlike @kbd{M-x man}, it does not run any external programs |
| 1199 | for ``w/o (without) man,'' since it doesn't use the @code{man} | 1166 | to format and display the man pages; the formatting is done by Emacs, |
| 1200 | program.}. Unlike @kbd{M-x man}, it does not run any external | 1167 | so it works on systems such as MS-Windows where the @command{man} |
| 1201 | programs to format and display the man pages; instead it does the job | 1168 | program may be unavailable. It prompts for a man page, and displays |
| 1202 | in Emacs Lisp, so it works on systems such as MS-Windows, where the | 1169 | it in a buffer named @samp{*WoMan @var{section} @var{topic}}. |
| 1203 | @code{man} program (and other programs it uses) are not generally | 1170 | |
| 1204 | available. | 1171 | @kbd{M-x woman} computes the completion list for manpages the first |
| 1205 | 1172 | time you invoke the command. With a numeric argument, it recomputes | |
| 1206 | @kbd{M-x woman} prompts for a name of a manual page, and provides | 1173 | this list; this is useful if you add or delete manual pages. |
| 1207 | completion based on the list of manual pages that are installed on | ||
| 1208 | your machine; the list of available manual pages is computed | ||
| 1209 | automatically the first time you invoke @code{woman}. The word at | ||
| 1210 | point in the current buffer is used to suggest the default for the | ||
| 1211 | name of the manual page. | ||
| 1212 | |||
| 1213 | With a numeric argument, @kbd{M-x woman} recomputes the list of the | ||
| 1214 | manual pages used for completion. This is useful if you add or delete | ||
| 1215 | manual pages. | ||
| 1216 | 1174 | ||
| 1217 | If you type a name of a manual page and @kbd{M-x woman} finds that | 1175 | If you type a name of a manual page and @kbd{M-x woman} finds that |
| 1218 | several manual pages by the same name exist in different sections, it | 1176 | several manual pages by the same name exist in different sections, it |
| @@ -1220,48 +1178,51 @@ pops up a window with possible candidates asking you to choose one of | |||
| 1220 | them. | 1178 | them. |
| 1221 | 1179 | ||
| 1222 | For more information about setting up and using @kbd{M-x woman}, see | 1180 | For more information about setting up and using @kbd{M-x woman}, see |
| 1223 | @ref{Top, WoMan, Browse UN*X Manual Pages WithOut Man, woman, The WoMan | 1181 | @ifinfo |
| 1224 | Manual}. | 1182 | @ref{Top, WoMan, Browse UN*X Manual Pages WithOut Man, woman, The |
| 1183 | WoMan Manual}. | ||
| 1184 | @end ifinfo | ||
| 1185 | @ifnotinfo | ||
| 1186 | the WoMan Info manual, which is distributed with Emacs. | ||
| 1187 | @end ifnotinfo | ||
| 1225 | 1188 | ||
| 1226 | @node Lisp Doc | 1189 | @node Lisp Doc |
| 1227 | @subsection Emacs Lisp Documentation Lookup | 1190 | @subsection Emacs Lisp Documentation Lookup |
| 1228 | 1191 | ||
| 1229 | As you edit Lisp code to be run in Emacs, you can use the commands | 1192 | When editing Emacs Lisp code, you can use the commands @kbd{C-h f} |
| 1230 | @kbd{C-h f} (@code{describe-function}) and @kbd{C-h v} | 1193 | (@code{describe-function}) and @kbd{C-h v} (@code{describe-variable}) |
| 1231 | (@code{describe-variable}) to view documentation of functions and | 1194 | to view the built-in documentation for the Lisp functions and |
| 1232 | variables that you want to use. These commands use the minibuffer to | 1195 | variables that you want to use. @xref{Name Help}. |
| 1233 | read the name of a function or variable to document, and display the | ||
| 1234 | documentation in a window. Their default arguments are based on the | ||
| 1235 | code in the neighborhood of point. For @kbd{C-h f}, the default is | ||
| 1236 | the function called in the innermost list containing point. @kbd{C-h | ||
| 1237 | v} uses the symbol name around or adjacent to point as its default. | ||
| 1238 | 1196 | ||
| 1239 | @cindex Eldoc mode | 1197 | @cindex Eldoc mode |
| 1240 | @findex eldoc-mode | 1198 | @findex eldoc-mode |
| 1241 | A more automatic but less powerful method is Eldoc mode. This minor | 1199 | Eldoc is a buffer-local minor mode that helps with looking up Lisp |
| 1242 | mode constantly displays in the echo area the argument list for the | 1200 | documention. When it is enabled, the echo area displays some useful |
| 1243 | function being called at point. (In other words, it finds the | 1201 | information whenever there is a Lisp function or variable at point; |
| 1244 | function call that point is contained in, and displays the argument | 1202 | for a function, it shows the argument list, and for a variable it |
| 1245 | list of that function.) If point is over a documented variable, it | 1203 | shows the first line of the variable's documentation string. To |
| 1246 | shows the first line of the variable's docstring. Eldoc mode applies | 1204 | toggle Eldoc mode, type @kbd{M-x eldoc-mode}. Eldoc mode can be used |
| 1247 | in Emacs Lisp and Lisp Interaction modes, and perhaps a few others | 1205 | with the Emacs Lisp and Lisp Interaction major modes. |
| 1248 | that provide special support for looking up doc strings. Use the | ||
| 1249 | command @kbd{M-x eldoc-mode} to enable or disable this feature. | ||
| 1250 | 1206 | ||
| 1251 | @node Hideshow | 1207 | @node Hideshow |
| 1252 | @section Hideshow minor mode | 1208 | @section Hideshow minor mode |
| 1209 | @cindex Hideshow mode | ||
| 1210 | @cindex mode, Hideshow | ||
| 1253 | 1211 | ||
| 1254 | @findex hs-minor-mode | 1212 | @findex hs-minor-mode |
| 1255 | Hideshow minor mode provides selective display of portions of a | 1213 | Hideshow mode is a buffer-local minor mode that allows you to |
| 1256 | program, known as @dfn{blocks}. You can use @kbd{M-x hs-minor-mode} | 1214 | selectively display portions of a program, which are referred to as |
| 1257 | to enable or disable this mode, or add @code{hs-minor-mode} to the | 1215 | @dfn{blocks}. Type @kbd{M-x hs-minor-mode} to toggle this minor mode |
| 1258 | mode hook for certain major modes in order to enable it automatically | 1216 | (@pxref{Minor Modes}). |
| 1259 | for those modes. | 1217 | |
| 1218 | When you use Hideshow mode to hide a block, the block disappears | ||
| 1219 | from the screen, to be replaced by an ellipsis (three periods in a | ||
| 1220 | row). Just what constitutes a block depends on the major mode. In C | ||
| 1221 | mode and related modes, blocks are delimited by braces, while in Lisp | ||
| 1222 | mode they are delimited by parentheses. Multi-line comments also | ||
| 1223 | count as blocks. | ||
| 1260 | 1224 | ||
| 1261 | Just what constitutes a block depends on the major mode. In C mode | 1225 | Hideshow mode provides the following commands: |
| 1262 | or C++ mode, they are delimited by braces, while in Lisp mode and | ||
| 1263 | similar modes they are delimited by parentheses. Multi-line comments | ||
| 1264 | also count as blocks. | ||
| 1265 | 1226 | ||
| 1266 | @findex hs-hide-all | 1227 | @findex hs-hide-all |
| 1267 | @findex hs-hide-block | 1228 | @findex hs-hide-block |
| @@ -1285,11 +1246,11 @@ Show the current block (@code{hs-show-block}). | |||
| 1285 | @item C-c @@ C-c | 1246 | @item C-c @@ C-c |
| 1286 | Either hide or show the current block (@code{hs-toggle-hiding}). | 1247 | Either hide or show the current block (@code{hs-toggle-hiding}). |
| 1287 | @item S-Mouse-2 | 1248 | @item S-Mouse-2 |
| 1288 | Either hide or show the block you click on (@code{hs-mouse-toggle-hiding}). | 1249 | Toggle hiding for the block you click on (@code{hs-mouse-toggle-hiding}). |
| 1289 | @item C-c @@ C-M-h | 1250 | @item C-c @@ C-M-h |
| 1290 | Hide all top-level blocks (@code{hs-hide-all}). | 1251 | Hide all top-level blocks (@code{hs-hide-all}). |
| 1291 | @item C-c @@ C-M-s | 1252 | @item C-c @@ C-M-s |
| 1292 | Show everything in the buffer (@code{hs-show-all}). | 1253 | Show all blocks in the buffer (@code{hs-show-all}). |
| 1293 | @item C-c @@ C-l | 1254 | @item C-c @@ C-l |
| 1294 | Hide all blocks @var{n} levels below this block | 1255 | Hide all blocks @var{n} levels below this block |
| 1295 | (@code{hs-hide-level}). | 1256 | (@code{hs-hide-level}). |
| @@ -1298,80 +1259,55 @@ Hide all blocks @var{n} levels below this block | |||
| 1298 | @vindex hs-hide-comments-when-hiding-all | 1259 | @vindex hs-hide-comments-when-hiding-all |
| 1299 | @vindex hs-isearch-open | 1260 | @vindex hs-isearch-open |
| 1300 | @vindex hs-special-modes-alist | 1261 | @vindex hs-special-modes-alist |
| 1301 | These variables exist for customizing Hideshow mode. | 1262 | These variables can be used to customize Hideshow mode: |
| 1302 | 1263 | ||
| 1303 | @table @code | 1264 | @table @code |
| 1304 | @item hs-hide-comments-when-hiding-all | 1265 | @item hs-hide-comments-when-hiding-all |
| 1305 | Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too. | 1266 | If non-@code{nil}, @kbd{C-c @@ C-M-h} (@code{hs-hide-all}) hides |
| 1267 | comments too. | ||
| 1306 | 1268 | ||
| 1307 | @item hs-isearch-open | 1269 | @item hs-isearch-open |
| 1308 | Specifies what kind of hidden blocks incremental search should make | 1270 | This variable specifies the conditions under which incremental search |
| 1309 | visible. The value should be one of these four symbols: | 1271 | should unhide a hidden block when matching text occurs within the |
| 1310 | 1272 | block. Its value should be either @code{code} (unhide only code | |
| 1311 | @table @code | 1273 | blocks), @code{comment} (unhide only comments), @code{t} (unhide both |
| 1312 | @item code | 1274 | code blocks and comments), or @code{nil} (unhide neither code blocks |
| 1313 | Open only code blocks. | 1275 | nor comments). The default value is @code{code}. |
| 1314 | @item comment | ||
| 1315 | Open only comments. | ||
| 1316 | @item t | ||
| 1317 | Open both code blocks and comments. | ||
| 1318 | @item nil | ||
| 1319 | Open neither code blocks nor comments. | ||
| 1320 | @end table | ||
| 1321 | |||
| 1322 | @item hs-special-modes-alist | ||
| 1323 | A list of elements, each specifying how to initialize Hideshow | ||
| 1324 | variables for one major mode. See the variable's documentation string | ||
| 1325 | for more information. | ||
| 1326 | @end table | 1276 | @end table |
| 1327 | 1277 | ||
| 1328 | @node Symbol Completion | 1278 | @node Symbol Completion |
| 1329 | @section Completion for Symbol Names | 1279 | @section Completion for Symbol Names |
| 1330 | @cindex completion (symbol names) | 1280 | @cindex completion (symbol names) |
| 1331 | 1281 | ||
| 1332 | In Emacs, completion is something you normally do in the minibuffer | 1282 | Completion is normally done in the minibuffer (@pxref{Completion}), |
| 1333 | (@pxref{Completion}). But one kind of completion is available in all | 1283 | but you can also complete symbol names in ordinary Emacs buffers. |
| 1334 | buffers: completion for symbol names. | ||
| 1335 | 1284 | ||
| 1336 | @kindex M-TAB | 1285 | @kindex M-TAB |
| 1337 | The character @kbd{M-@key{TAB}} runs a command to complete the | 1286 | @kindex C-M-i |
| 1338 | partial symbol before point against the set of meaningful symbol | 1287 | In programming language modes, type @kbd{C-M-i} or @kbd{M-@key{TAB}} |
| 1339 | names. This command inserts at point any additional characters that | 1288 | to complete the partial symbol before point. On graphical displays, |
| 1340 | it can determine from the partial name. | 1289 | the @kbd{M-@key{TAB}} key is usually reserved by the window manager |
| 1341 | 1290 | for switching graphical windows, so you should type @kbd{C-M-i} or | |
| 1342 | If your window manager defines @kbd{M-@key{TAB}} to switch windows, | 1291 | @kbd{@key{ESC} @key{TAB}} instead. |
| 1343 | you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead. | ||
| 1344 | However, most window managers let you customize these shortcuts, so | ||
| 1345 | you can change any that interfere with the way you use Emacs. | ||
| 1346 | |||
| 1347 | If the partial name in the buffer has multiple possible completions | ||
| 1348 | that differ in the very next character, so that it is impossible to | ||
| 1349 | complete even one more character, @kbd{M-@key{TAB}} displays a list of | ||
| 1350 | all possible completions in another window. | ||
| 1351 | 1292 | ||
| 1352 | @cindex tags-based completion | 1293 | @cindex tags-based completion |
| 1353 | @cindex Info index completion | 1294 | @findex completion-at-point |
| 1354 | @findex complete-symbol | ||
| 1355 | In most programming language major modes, @kbd{M-@key{TAB}} runs the | ||
| 1356 | command @code{complete-symbol}, which provides two kinds of completion. | ||
| 1357 | Normally it does completion based on a tags table (@pxref{Tags}); with a | ||
| 1358 | numeric argument (regardless of the value), it does completion based on | ||
| 1359 | the names listed in the Info file indexes for your language. Thus, to | ||
| 1360 | complete the name of a symbol defined in your own program, use | ||
| 1361 | @kbd{M-@key{TAB}} with no argument; to complete the name of a standard | ||
| 1362 | library function, use @kbd{C-u M-@key{TAB}}. Of course, Info-based | ||
| 1363 | completion works only if there is an Info file for the standard library | ||
| 1364 | functions of your language, and only if it is installed at your site. | ||
| 1365 | |||
| 1366 | @cindex Lisp symbol completion | 1295 | @cindex Lisp symbol completion |
| 1367 | @cindex completion (Lisp symbols) | 1296 | @cindex completion (Lisp symbols) |
| 1368 | @findex lisp-complete-symbol | 1297 | In most programming language modes, @kbd{C-M-i} (or |
| 1369 | In Emacs-Lisp mode, the name space for completion normally consists of | 1298 | @kbd{M-@key{TAB}}) invokes the command @code{completion-at-point}, |
| 1370 | nontrivial symbols present in Emacs---those that have function | 1299 | which generates its completion list in a flexible way. If Semantic |
| 1371 | definitions, values or properties. However, if there is an | 1300 | mode is enabled, it tries to use the Semantic parser data for |
| 1372 | open-parenthesis immediately before the beginning of the partial symbol, | 1301 | completion (@pxref{Semantic}). If Semantic mode is not enabled or |
| 1373 | only symbols with function definitions are considered as completions. | 1302 | fails at performing completion, it tries to complete using the |
| 1374 | The command which implements this is @code{lisp-complete-symbol}. | 1303 | selected tags table (@pxref{Tags}). If in Emacs Lisp mode, it |
| 1304 | performs completion using the function, variable, or property names | ||
| 1305 | defined in the current Emacs session. | ||
| 1306 | |||
| 1307 | In all other respects, in-buffer symbol completion behaves like | ||
| 1308 | minibuffer completion. For instance, if Emacs cannot complete to a | ||
| 1309 | unique symbol, it displays a list of completion alternatives in | ||
| 1310 | another window. @xref{Completion}. | ||
| 1375 | 1311 | ||
| 1376 | In Text mode and related modes, @kbd{M-@key{TAB}} completes words | 1312 | In Text mode and related modes, @kbd{M-@key{TAB}} completes words |
| 1377 | based on the spell-checker's dictionary. @xref{Spelling}. | 1313 | based on the spell-checker's dictionary. @xref{Spelling}. |
| @@ -1379,20 +1315,20 @@ based on the spell-checker's dictionary. @xref{Spelling}. | |||
| 1379 | @node Glasses | 1315 | @node Glasses |
| 1380 | @section Glasses minor mode | 1316 | @section Glasses minor mode |
| 1381 | @cindex Glasses mode | 1317 | @cindex Glasses mode |
| 1382 | @cindex identifiers, making long ones readable | 1318 | @cindex camel case |
| 1383 | @cindex StudlyCaps, making them readable | 1319 | @findex mode, Glasses |
| 1384 | @findex glasses-mode | 1320 | |
| 1385 | 1321 | Glasses mode is a buffer-local minor mode that makes it easier to | |
| 1386 | Glasses minor mode makes @samp{unreadableIdentifiersLikeThis} | 1322 | read mixed-case (or ``CamelCase'') symbols like |
| 1387 | readable by altering the way they display. It knows two different | 1323 | @samp{unReadableSymbol}, by altering how they are displayed. By |
| 1388 | ways to do this: by displaying underscores between a lower-case letter | 1324 | default, it displays extra underscores between each lower-case letter |
| 1389 | and the following capital letter, and by emboldening the capital | 1325 | and the following capital letter. This does not alter the buffer |
| 1390 | letters. It does not alter the buffer text, only the way they | 1326 | text, only how it is displayed. |
| 1391 | display, so you can use it even on read-only buffers. You can use the | 1327 | |
| 1392 | command @kbd{M-x glasses-mode} to enable or disable the mode in the | 1328 | To toggle Glasses mode, type @kbd{M-x glasses-mode} (@pxref{Minor |
| 1393 | current buffer; you can also add @code{glasses-mode} to the mode hook | 1329 | Modes}). When Glasses mode is enabled, the minor mode indicator |
| 1394 | of the programming language major modes in which you normally want | 1330 | @samp{o^o} appears in the mode line. For more information about |
| 1395 | to use Glasses mode. | 1331 | Glasses mode, type @kbd{C-h P glasses @key{RET}}. |
| 1396 | 1332 | ||
| 1397 | @node Semantic | 1333 | @node Semantic |
| 1398 | @section Semantic | 1334 | @section Semantic |
| @@ -1400,23 +1336,24 @@ to use Glasses mode. | |||
| 1400 | 1336 | ||
| 1401 | Semantic is a package that provides language-aware editing commands | 1337 | Semantic is a package that provides language-aware editing commands |
| 1402 | based on @code{source code parsers}. This section provides a brief | 1338 | based on @code{source code parsers}. This section provides a brief |
| 1403 | description of Semantic; | 1339 | description of Semantic; for full details, |
| 1404 | @ifnottex | 1340 | @ifnottex |
| 1405 | for full details, see @ref{Top, Semantic,, semantic, Semantic}. | 1341 | see @ref{Top, Semantic,, semantic, Semantic}. |
| 1406 | @end ifnottex | 1342 | @end ifnottex |
| 1407 | @iftex | 1343 | @iftex |
| 1408 | for full details, type @kbd{C-h i} (@code{info}) and then select the | 1344 | see the Semantic Info manual, which is distributed with Emacs. |
| 1409 | Semantic manual. | ||
| 1410 | @end iftex | 1345 | @end iftex |
| 1411 | 1346 | ||
| 1412 | Most of the ``language aware'' features in Emacs, such as font lock | 1347 | Most of the ``language aware'' features in Emacs, such as Font Lock |
| 1413 | (@pxref{Font Lock}), rely on ``rules of thumb''@footnote{Regular | 1348 | mode (@pxref{Font Lock}), rely on ``rules of thumb''@footnote{Regular |
| 1414 | expressions and syntax tables.} that usually give good results but are | 1349 | expressions and syntax tables.} that usually give good results but are |
| 1415 | never completely exact. In contrast, the parsers used by Semantic | 1350 | never completely exact. In contrast, the parsers used by Semantic |
| 1416 | have an exact understanding of programming language syntax. This | 1351 | have an exact understanding of programming language syntax. This |
| 1417 | allows Semantic to provide search, navigation, and completion commands | 1352 | allows Semantic to provide search, navigation, and completion commands |
| 1418 | that are powerful and precise. | 1353 | that are powerful and precise. |
| 1419 | 1354 | ||
| 1355 | @cindex Semantic mode | ||
| 1356 | @cindex mode, Semantic | ||
| 1420 | To begin using Semantic, type @kbd{M-x semantic-mode} or click on | 1357 | To begin using Semantic, type @kbd{M-x semantic-mode} or click on |
| 1421 | the menu item named @samp{Source Code Parsers (Semantic)} in the | 1358 | the menu item named @samp{Source Code Parsers (Semantic)} in the |
| 1422 | @samp{Tools} menu. This enables Semantic mode, a global minor mode. | 1359 | @samp{Tools} menu. This enables Semantic mode, a global minor mode. |
| @@ -1464,30 +1401,30 @@ is idle. | |||
| 1464 | @node Misc for Programs | 1401 | @node Misc for Programs |
| 1465 | @section Other Features Useful for Editing Programs | 1402 | @section Other Features Useful for Editing Programs |
| 1466 | 1403 | ||
| 1467 | A number of Emacs commands that aren't designed specifically for | 1404 | Some Emacs commands that aren't designed specifically for editing |
| 1468 | editing programs are useful for that nonetheless. | 1405 | programs are useful for that nonetheless. |
| 1469 | 1406 | ||
| 1470 | The Emacs commands that operate on words, sentences and paragraphs | 1407 | The Emacs commands that operate on words, sentences and paragraphs |
| 1471 | are useful for editing code. Most symbols names contain words | 1408 | are useful for editing code. Most symbols names contain words |
| 1472 | (@pxref{Words}); sentences can be found in strings and comments | 1409 | (@pxref{Words}), while sentences can be found in strings and comments |
| 1473 | (@pxref{Sentences}). Paragraphs in the strict sense can be found in | 1410 | (@pxref{Sentences}). As for paragraphs, they are defined in most |
| 1474 | program code (in long comments), but the paragraph commands are useful | 1411 | programming language modes to begin and end at blank lines |
| 1475 | in other places too, because programming language major modes define | 1412 | (@pxref{Paragraphs}). Therefore, judicious use of blank lines to make |
| 1476 | paragraphs to begin and end at blank lines (@pxref{Paragraphs}). | 1413 | the program clearer will also provide useful chunks of text for the |
| 1477 | Judicious use of blank lines to make the program clearer will also | 1414 | paragraph commands to work on. Auto Fill mode, if enabled in a |
| 1478 | provide useful chunks of text for the paragraph commands to work on. | 1415 | programming language major mode, indents the new lines which it |
| 1479 | Auto Fill mode, if enabled in a programming language major mode, | 1416 | creates. |
| 1480 | indents the new lines which it creates. | 1417 | |
| 1481 | 1418 | Apart from Hideshow mode (@pxref{Hideshow}), another way to | |
| 1482 | The selective display feature is useful for looking at the overall | 1419 | selectively display parts of a program is to use the selective display |
| 1483 | structure of a function (@pxref{Selective Display}). This feature | 1420 | feature (@pxref{Selective Display}). Programming modes often also |
| 1484 | hides the lines that are indented more than a specified amount. | 1421 | support Outline minor mode (@pxref{Outline Mode}), which can be used |
| 1485 | Programming modes often support Outline minor mode (@pxref{Outline | 1422 | with the Foldout package (@pxref{Foldout}). |
| 1486 | Mode}). The Foldout package provides folding-editor features | 1423 | |
| 1487 | (@pxref{Foldout}). | 1424 | @ifinfo |
| 1488 | |||
| 1489 | The ``automatic typing'' features may be useful for writing programs. | 1425 | The ``automatic typing'' features may be useful for writing programs. |
| 1490 | @xref{Top,,Autotyping, autotype, Autotyping}. | 1426 | @xref{Top,,Autotyping, autotype, Autotyping}. |
| 1427 | @end ifinfo | ||
| 1491 | 1428 | ||
| 1492 | @node C Modes | 1429 | @node C Modes |
| 1493 | @section C and Related Modes | 1430 | @section C and Related Modes |
| @@ -1509,9 +1446,14 @@ Mode}). The Foldout package provides folding-editor features | |||
| 1509 | 1446 | ||
| 1510 | This section gives a brief description of the special features | 1447 | This section gives a brief description of the special features |
| 1511 | available in C, C++, Objective-C, Java, CORBA IDL, Pike and AWK modes. | 1448 | available in C, C++, Objective-C, Java, CORBA IDL, Pike and AWK modes. |
| 1512 | (These are called ``C mode and related modes.'') @xref{Top, , CC Mode, | 1449 | (These are called ``C mode and related modes.'') |
| 1513 | ccmode, CC Mode}, for a more extensive description of these modes | 1450 | @ifinfo |
| 1514 | and their special features. | 1451 | @xref{Top,, CC Mode, ccmode, CC Mode}, for more details. |
| 1452 | @end ifinfo | ||
| 1453 | @ifnotinfo | ||
| 1454 | For more details, see the CC mode Info manual, which is distributed | ||
| 1455 | with Emacs. | ||
| 1456 | @end ifnotinfo | ||
| 1515 | 1457 | ||
| 1516 | @menu | 1458 | @menu |
| 1517 | * Motion in C:: Commands to move by C statements, etc. | 1459 | * Motion in C:: Commands to move by C statements, etc. |
| @@ -1528,17 +1470,17 @@ and their special features. | |||
| 1528 | related modes. | 1470 | related modes. |
| 1529 | 1471 | ||
| 1530 | @table @code | 1472 | @table @code |
| 1531 | @item M-x c-beginning-of-defun | 1473 | @item C-M-a |
| 1532 | @itemx M-x c-end-of-defun | 1474 | @itemx C-M-e |
| 1533 | @findex c-beginning-of-defun | 1475 | @findex c-beginning-of-defun |
| 1534 | @findex c-end-of-defun | 1476 | @findex c-end-of-defun |
| 1535 | Move point to the beginning or end of the current function or | 1477 | Move point to the beginning or end of the current function or |
| 1536 | top-level definition. These are found by searching for the least | 1478 | top-level definition. In languages with enclosing scopes (such as |
| 1479 | C++'s classes) the @dfn{current function} is the immediate one, | ||
| 1480 | possibly inside a scope. Otherwise it is the one defined by the least | ||
| 1537 | enclosing braces. (By contrast, @code{beginning-of-defun} and | 1481 | enclosing braces. (By contrast, @code{beginning-of-defun} and |
| 1538 | @code{end-of-defun} search for braces in column zero.) If you are | 1482 | @code{end-of-defun} search for braces in column zero.) @xref{Moving |
| 1539 | editing code where the opening brace of a function isn't placed in | 1483 | by Defuns}. |
| 1540 | column zero, you may wish to bind @code{C-M-a} and @code{C-M-e} to | ||
| 1541 | these commands. @xref{Moving by Defuns}. | ||
| 1542 | 1484 | ||
| 1543 | @item C-c C-u | 1485 | @item C-c C-u |
| 1544 | @kindex C-c C-u @r{(C mode)} | 1486 | @kindex C-c C-u @r{(C mode)} |
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi index 0df4a3a7bb5..d05af468fa1 100644 --- a/doc/emacs/rmail.texi +++ b/doc/emacs/rmail.texi | |||
| @@ -1340,17 +1340,18 @@ included in GNU mailutils (the ``mailutils version,'' | |||
| 1340 | command line syntax and the same basic subset of options. However, the | 1340 | command line syntax and the same basic subset of options. However, the |
| 1341 | Mailutils version offers additional features. | 1341 | Mailutils version offers additional features. |
| 1342 | 1342 | ||
| 1343 | The Emacs version of @code{movemail} is able to retrieve mail from the | 1343 | The Emacs version of @code{movemail} is able to retrieve mail from |
| 1344 | usual UNIX mailbox formats and from remote mailboxes using the POP3 | 1344 | the usual Unix mailbox formats and from remote mailboxes using the |
| 1345 | protocol. | 1345 | POP3 protocol. |
| 1346 | 1346 | ||
| 1347 | The Mailutils version is able to handle a wide set of mailbox | 1347 | The Mailutils version is able to handle a wide set of mailbox |
| 1348 | formats, such as plain UNIX mailboxes, @code{maildir} and @code{MH} | 1348 | formats, such as plain Unix mailboxes, @code{maildir} and @code{MH} |
| 1349 | mailboxes, etc. It is able to access remote mailboxes using the POP3 or | 1349 | mailboxes, etc. It is able to access remote mailboxes using the POP3 |
| 1350 | IMAP4 protocol, and can retrieve mail from them using a TLS encrypted | 1350 | or IMAP4 protocol, and can retrieve mail from them using a TLS |
| 1351 | channel. It also accepts mailbox arguments in @acronym{URL} form. | 1351 | encrypted channel. It also accepts mailbox arguments in @acronym{URL} |
| 1352 | The detailed description of mailbox @acronym{URL}s can be found in | 1352 | form. The detailed description of mailbox @acronym{URL}s can be found |
| 1353 | @ref{URL,,,mailutils,Mailbox URL Formats}. In short, a @acronym{URL} is: | 1353 | in @ref{URL,,,mailutils,Mailbox URL Formats}. In short, a |
| 1354 | @acronym{URL} is: | ||
| 1354 | 1355 | ||
| 1355 | @smallexample | 1356 | @smallexample |
| 1356 | @var{proto}://[@var{user}[:@var{password}]@@]@var{host-or-file-name} | 1357 | @var{proto}://[@var{user}[:@var{password}]@@]@var{host-or-file-name} |
| @@ -1381,9 +1382,9 @@ local mailbox. | |||
| 1381 | 1382 | ||
| 1382 | @table @code | 1383 | @table @code |
| 1383 | @item mbox | 1384 | @item mbox |
| 1384 | Usual UNIX mailbox format. In this case, neither @var{user} nor | 1385 | Usual Unix mailbox format. In this case, neither @var{user} nor |
| 1385 | @var{pass} are used, and @var{host-or-file-name} denotes the file name of | 1386 | @var{pass} are used, and @var{host-or-file-name} denotes the file name |
| 1386 | the mailbox file, e.g., @code{mbox://var/spool/mail/smith}. | 1387 | of the mailbox file, e.g., @code{mbox://var/spool/mail/smith}. |
| 1387 | 1388 | ||
| 1388 | @item mh | 1389 | @item mh |
| 1389 | A local mailbox in the @acronym{MH} format. @var{User} and | 1390 | A local mailbox in the @acronym{MH} format. @var{User} and |
| @@ -1524,7 +1525,7 @@ use it, add the @samp{--tls} flag to @code{rmail-movemail-flags}. | |||
| 1524 | @section Retrieving Mail from Local Mailboxes in Various Formats | 1525 | @section Retrieving Mail from Local Mailboxes in Various Formats |
| 1525 | 1526 | ||
| 1526 | If your incoming mail is stored on a local machine in a format other | 1527 | If your incoming mail is stored on a local machine in a format other |
| 1527 | than UNIX mailbox, you will need the Mailutils @code{movemail} to | 1528 | than Unix mailbox, you will need the Mailutils @code{movemail} to |
| 1528 | retrieve it. @xref{Movemail}, for the detailed description of | 1529 | retrieve it. @xref{Movemail}, for the detailed description of |
| 1529 | @code{movemail} versions. For example, to access mail from a inbox in | 1530 | @code{movemail} versions. For example, to access mail from a inbox in |
| 1530 | @code{maildir} format located in @file{/var/spool/mail/in}, you would | 1531 | @code{maildir} format located in @file{/var/spool/mail/in}, you would |
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 8f353961afb..37a85a89ea2 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi | |||
| @@ -21,7 +21,10 @@ are also often useful for editing programs. | |||
| 21 | the file contains ordinary text, use Text mode, which customizes Emacs | 21 | the file contains ordinary text, use Text mode, which customizes Emacs |
| 22 | in small ways for the syntactic conventions of text. Outline mode | 22 | in small ways for the syntactic conventions of text. Outline mode |
| 23 | provides special commands for operating on text with an outline | 23 | provides special commands for operating on text with an outline |
| 24 | structure. | 24 | structure. Org mode extends Outline mode and turn Emacs into a |
| 25 | full-fledged organizer: you can manage TODO lists, store notes and | ||
| 26 | publish them in many formats. | ||
| 27 | |||
| 25 | @iftex | 28 | @iftex |
| 26 | @xref{Outline Mode}. | 29 | @xref{Outline Mode}. |
| 27 | @end iftex | 30 | @end iftex |
| @@ -32,9 +35,14 @@ structure. | |||
| 32 | @findex nxml-mode | 35 | @findex nxml-mode |
| 33 | Emacs has other major modes for text which contains ``embedded'' | 36 | Emacs has other major modes for text which contains ``embedded'' |
| 34 | commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML and | 37 | commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML and |
| 35 | SGML (@pxref{HTML Mode}); XML (@pxref{Top,The nXML Mode | 38 | SGML (@pxref{HTML Mode}); XML |
| 36 | Manual,,nxml-mode, nXML Mode}); and Groff and Nroff (@pxref{Nroff | 39 | @ifinfo |
| 37 | Mode}). | 40 | (@pxref{Top,The nXML Mode Manual,,nxml-mode, nXML Mode}); |
| 41 | @end ifinfo | ||
| 42 | @ifnotinfo | ||
| 43 | (see the nXML mode Info manual, which is distributed with Emacs); | ||
| 44 | @end ifnotinfo | ||
| 45 | and Groff and Nroff (@pxref{Nroff Mode}). | ||
| 38 | 46 | ||
| 39 | @cindex ASCII art | 47 | @cindex ASCII art |
| 40 | If you need to edit pictures made out of text characters (commonly | 48 | If you need to edit pictures made out of text characters (commonly |
| @@ -65,6 +73,7 @@ for editing such pictures. | |||
| 65 | * Case:: Changing the case of text. | 73 | * Case:: Changing the case of text. |
| 66 | * Text Mode:: The major modes for editing text files. | 74 | * Text Mode:: The major modes for editing text files. |
| 67 | * Outline Mode:: Editing outlines. | 75 | * Outline Mode:: Editing outlines. |
| 76 | * Org Mode:: The Emacs organizer. | ||
| 68 | * TeX Mode:: Editing input to the formatter TeX. | 77 | * TeX Mode:: Editing input to the formatter TeX. |
| 69 | * HTML Mode:: Editing HTML and SGML files. | 78 | * HTML Mode:: Editing HTML and SGML files. |
| 70 | * Nroff Mode:: Editing input to the formatter nroff. | 79 | * Nroff Mode:: Editing input to the formatter nroff. |
| @@ -1245,6 +1254,143 @@ automatically by putting this in your init file (@pxref{Init File}): | |||
| 1245 | (eval-after-load "outline" '(require 'foldout)) | 1254 | (eval-after-load "outline" '(require 'foldout)) |
| 1246 | @end example | 1255 | @end example |
| 1247 | 1256 | ||
| 1257 | @node Org Mode | ||
| 1258 | @section Org Mode | ||
| 1259 | @kindex TAB @r{(Org Mode)} | ||
| 1260 | @kindex S-TAB @r{(Org Mode)} | ||
| 1261 | @cindex organizer | ||
| 1262 | @cindex planner | ||
| 1263 | @findex org-mode | ||
| 1264 | @cindex fold | ||
| 1265 | @cindex headline | ||
| 1266 | @kindex M-<up> @r{(Org Mode)} | ||
| 1267 | @kindex M-<down> @r{(Org Mode)} | ||
| 1268 | @kindex M-<left> @r{(Org Mode)} | ||
| 1269 | @kindex M-<right> @r{(Org Mode)} | ||
| 1270 | @kindex S-M-<up> @r{(Org Mode)} | ||
| 1271 | @kindex S-M-<down> @r{(Org Mode)} | ||
| 1272 | @kindex S-M-<left> @r{(Org Mode)} | ||
| 1273 | @kindex S-M-<right> @r{(Org Mode)} | ||
| 1274 | |||
| 1275 | Org mode extends Outline mode to turn Emacs into an organizer and an | ||
| 1276 | authoring system. | ||
| 1277 | |||
| 1278 | When editing a file ending with the @file{.org} extension, Emacs | ||
| 1279 | automatically uses @code{org-mode} as the major mode. In this mode, | ||
| 1280 | headlines start with one (or more) leading star(s) and comments start | ||
| 1281 | with the @code{#} character at the beginning of a line. | ||
| 1282 | |||
| 1283 | @example | ||
| 1284 | * This is the first headline | ||
| 1285 | ** This is a first sub-headline | ||
| 1286 | * This is the second headline | ||
| 1287 | |||
| 1288 | Some content here. | ||
| 1289 | |||
| 1290 | # Some comment here. | ||
| 1291 | @end example | ||
| 1292 | |||
| 1293 | From here, you can use Org mode as a simple outliner: @key{TAB} on a | ||
| 1294 | headline will cycle through the various folding states of a subtree, | ||
| 1295 | and @key{S-TAB} anywhere in the buffer will (un)fold the whole | ||
| 1296 | structure. | ||
| 1297 | |||
| 1298 | You can also manipulate the structure of your document by moving a | ||
| 1299 | headline up and down with @key{M-<up>} and @key{M-<down>}, or by | ||
| 1300 | promoting and demoting a headline with @key{M-<left>} and | ||
| 1301 | @key{M-<left>}. If you want to act on the whole subtree (i.e. the | ||
| 1302 | headline and its content, including other headlines), simply add the | ||
| 1303 | @kbd{Shift} key and use @key{S-M-<up>}, @key{S-M-<down>}, | ||
| 1304 | @key{S-M-<left>} and @key{S-M-<right>}. | ||
| 1305 | |||
| 1306 | For further details, see @ref{Document Structure,,,org, The Org Manual}. | ||
| 1307 | |||
| 1308 | @menu | ||
| 1309 | * Org as an organizer:: Manage TODO lists and agendas | ||
| 1310 | * Org as an authoring system:: Export to various formats | ||
| 1311 | @end menu | ||
| 1312 | |||
| 1313 | @node Org as an organizer | ||
| 1314 | @subsection Org as an organizer | ||
| 1315 | |||
| 1316 | @cindex TODO keywords | ||
| 1317 | @kindex C-c C-t @r{(Org Mode)} | ||
| 1318 | @kindex C-c C-s @r{(Org Mode)} | ||
| 1319 | @kindex C-c C-d @r{(Org Mode)} | ||
| 1320 | @vindex org-todo-keywords | ||
| 1321 | @findex org-todo | ||
| 1322 | @findex org-agenda | ||
| 1323 | @cindex scheduled | ||
| 1324 | @cindex deadline | ||
| 1325 | @cindex agenda | ||
| 1326 | |||
| 1327 | Each headline can be turned into a TODO item calling @code{org-todo} | ||
| 1328 | with @key{C-c C-t} anywhere on it. This will add the TODO keyword | ||
| 1329 | @code{TODO}. Hit @key{C-c C-t} to cycle through the list of available | ||
| 1330 | TODO keywords: you can configure the variable @code{org-todo-keywords} | ||
| 1331 | to use your own list of keywords. | ||
| 1332 | |||
| 1333 | Now that you have something to do, let's add a date to it: pressing | ||
| 1334 | @key{C-c C-s} on a headline will add @code{SCHEDULED} below it, and | ||
| 1335 | you will be prompted for a date through the calendar. @key{C-c C-d} | ||
| 1336 | has the same effect, except that the item will have a @code{DEADLINE} | ||
| 1337 | instead. | ||
| 1338 | |||
| 1339 | Now that some TODO items are planned in the current file, add it to | ||
| 1340 | the list of agenda files with @key{C-c [}. Calling the interactive | ||
| 1341 | command @code{org-agenda} will prompt you for what you want to see: a | ||
| 1342 | list of things to do this week, a list of TODO items with specific | ||
| 1343 | keywords, etc. | ||
| 1344 | |||
| 1345 | For further details, see @ref{TODO items,,,org, The Org Manual} and | ||
| 1346 | @ref{Dates and times,,,org, The Org Manual}. | ||
| 1347 | |||
| 1348 | @node Org as an authoring system | ||
| 1349 | @subsection Org as an authoring system | ||
| 1350 | @cindex export | ||
| 1351 | @findex org-export | ||
| 1352 | @cindex publish | ||
| 1353 | @cindex code block | ||
| 1354 | @cindex quote | ||
| 1355 | |||
| 1356 | You may want to format your Org notes nicely and to prepare them for | ||
| 1357 | export and publication. Org supports simple text formatting: | ||
| 1358 | |||
| 1359 | @example | ||
| 1360 | - This text is /emphasized/ | ||
| 1361 | - This item uses *a bold font* | ||
| 1362 | - This text is _underlined_ | ||
| 1363 | - This text uses =a teletype font= | ||
| 1364 | @end example | ||
| 1365 | |||
| 1366 | If a paragraph is a quote or an example, you can use specific | ||
| 1367 | environments: | ||
| 1368 | |||
| 1369 | @example | ||
| 1370 | #+begin_quote | ||
| 1371 | ``This is a quote.'' | ||
| 1372 | #+end_quote | ||
| 1373 | |||
| 1374 | #+begin_example | ||
| 1375 | This is an example. | ||
| 1376 | #+end_example | ||
| 1377 | @end example | ||
| 1378 | |||
| 1379 | These environments will be displayed in a specific way with respect | ||
| 1380 | to the selected export/publish backend. | ||
| 1381 | |||
| 1382 | To export the current buffer, press the @key{C-c C-e} key anywhere in | ||
| 1383 | an Org buffer. Supported export formats include @code{HTML}, La@TeX{} | ||
| 1384 | and @file{.odt} (OpenDocument format.) Depending on your system | ||
| 1385 | installation, you can also directly export to @code{pdf}. | ||
| 1386 | |||
| 1387 | To export several files at once to a specific directory either locally | ||
| 1388 | or on the Internet, you will need to define a list of projects through | ||
| 1389 | the variable @code{org-publish-project-alist}. | ||
| 1390 | |||
| 1391 | For further details, see @ref{Exporting,,,org, The Org Manual} and | ||
| 1392 | @ref{Publishing,,,org, The Org Manual}. | ||
| 1393 | |||
| 1248 | @node TeX Mode | 1394 | @node TeX Mode |
| 1249 | @section @TeX{} Mode | 1395 | @section @TeX{} Mode |
| 1250 | @cindex @TeX{} mode | 1396 | @cindex @TeX{} mode |
| @@ -1298,8 +1444,8 @@ more information, see the documentation string for the command | |||
| 1298 | @code{bibtex-mode}. | 1444 | @code{bibtex-mode}. |
| 1299 | 1445 | ||
| 1300 | @item | 1446 | @item |
| 1301 | The Ref@TeX{} package provides a minor mode which can be used in | 1447 | The Ref@TeX{} package provides a minor mode which can be used with |
| 1302 | conjunction with La@TeX{} mode to manage bibliographic references. | 1448 | La@TeX{} mode to manage bibliographic references. |
| 1303 | @ifinfo | 1449 | @ifinfo |
| 1304 | @xref{Top,The Ref@TeX{} Manual,,reftex}. | 1450 | @xref{Top,The Ref@TeX{} Manual,,reftex}. |
| 1305 | @end ifinfo | 1451 | @end ifinfo |
| @@ -1764,8 +1910,15 @@ xml-mode}. Emacs uses nXML mode for files which have the extension | |||
| 1764 | @file{.xml}. For XHTML files, which have the extension @file{.xhtml}, | 1910 | @file{.xml}. For XHTML files, which have the extension @file{.xhtml}, |
| 1765 | Emacs uses HTML mode by default; you can make it use nXML mode by | 1911 | Emacs uses HTML mode by default; you can make it use nXML mode by |
| 1766 | customizing the variable @code{auto-mode-alist} (@pxref{Choosing | 1912 | customizing the variable @code{auto-mode-alist} (@pxref{Choosing |
| 1767 | Modes}). nXML mode is described in its own manual: @xref{Top, nXML | 1913 | Modes}). |
| 1914 | @ifinfo | ||
| 1915 | nXML mode is described in its own manual: @xref{Top, nXML | ||
| 1768 | Mode,,nxml-mode, nXML Mode}. | 1916 | Mode,,nxml-mode, nXML Mode}. |
| 1917 | @end ifinfo | ||
| 1918 | @ifnotinfo | ||
| 1919 | nXML mode is described in an Info manual, which is distributed with | ||
| 1920 | Emacs. | ||
| 1921 | @end ifnotinfo | ||
| 1769 | 1922 | ||
| 1770 | @vindex sgml-xml-mode | 1923 | @vindex sgml-xml-mode |
| 1771 | You may choose to use the less powerful SGML mode for editing XML, | 1924 | You may choose to use the less powerful SGML mode for editing XML, |
| @@ -1781,13 +1934,16 @@ always insert explicit closing tags as well. | |||
| 1781 | 1934 | ||
| 1782 | @cindex nroff | 1935 | @cindex nroff |
| 1783 | @findex nroff-mode | 1936 | @findex nroff-mode |
| 1784 | Nroff mode is a mode like Text mode but modified to handle nroff commands | 1937 | @vindex nroff-mode-hook |
| 1785 | present in the text. Invoke @kbd{M-x nroff-mode} to enter this mode. It | 1938 | Nroff mode is a major mode derived from Text mode, which is |
| 1786 | differs from Text mode in only a few ways. All nroff command lines are | 1939 | specialized for editing nroff files (e.g.@: Unix man pages). Type |
| 1787 | considered paragraph separators, so that filling will never garble the | 1940 | @kbd{M-x nroff-mode} to enter this mode. Entering Nroff mode runs the |
| 1788 | nroff commands. Pages are separated by @samp{.bp} commands. Comments | 1941 | hook @code{text-mode-hook}, followed by @code{nroff-mode-hook} |
| 1789 | start with backslash-doublequote. Also, three special commands are | 1942 | (@pxref{Hooks}). |
| 1790 | provided that are not in Text mode: | 1943 | |
| 1944 | In Nroff mode, nroff command lines are treated as paragraph | ||
| 1945 | separators, pages are separated by @samp{.bp} commands, and comments | ||
| 1946 | start with backslash-doublequote. It also defines these commands: | ||
| 1791 | 1947 | ||
| 1792 | @findex forward-text-line | 1948 | @findex forward-text-line |
| 1793 | @findex backward-text-line | 1949 | @findex backward-text-line |
| @@ -1807,23 +1963,16 @@ nroff commands) in the region (@code{count-text-lines}). | |||
| 1807 | @end table | 1963 | @end table |
| 1808 | 1964 | ||
| 1809 | @findex electric-nroff-mode | 1965 | @findex electric-nroff-mode |
| 1810 | The other feature of Nroff mode is that you can turn on Electric Nroff | 1966 | Electric Nroff mode is a buffer-local minor mode that can be used |
| 1811 | mode. This is a minor mode that you can turn on or off with @kbd{M-x | 1967 | with Nroff mode. To toggle this minor mode, type @kbd{M-x |
| 1812 | electric-nroff-mode} (@pxref{Minor Modes}). When the mode is on, each | 1968 | electric-nroff-mode} (@pxref{Minor Modes}). When the mode is on, each |
| 1813 | time you use @key{RET} to end a line that contains an nroff command that | 1969 | time you type @key{RET} to end a line containing an nroff command that |
| 1814 | opens a kind of grouping, the matching nroff command to close that | 1970 | opens a kind of grouping, the nroff command to close that grouping is |
| 1815 | grouping is automatically inserted on the following line. For example, | 1971 | automatically inserted on the following line. |
| 1816 | if you are at the beginning of a line and type @kbd{.@: ( b @key{RET}}, | ||
| 1817 | this inserts the matching command @samp{.)b} on a new line following | ||
| 1818 | point. | ||
| 1819 | 1972 | ||
| 1820 | If you use Outline minor mode with Nroff mode (@pxref{Outline Mode}), | 1973 | If you use Outline minor mode with Nroff mode (@pxref{Outline |
| 1821 | heading lines are lines of the form @samp{.H} followed by a number (the | 1974 | Mode}), heading lines are lines of the form @samp{.H} followed by a |
| 1822 | header level). | 1975 | number (the header level). |
| 1823 | |||
| 1824 | @vindex nroff-mode-hook | ||
| 1825 | Entering Nroff mode runs the hook @code{text-mode-hook}, followed by | ||
| 1826 | the hook @code{nroff-mode-hook} (@pxref{Hooks}). | ||
| 1827 | 1976 | ||
| 1828 | @node Enriched Text | 1977 | @node Enriched Text |
| 1829 | @section Enriched Text | 1978 | @section Enriched Text |
| @@ -2149,18 +2298,16 @@ hides text), and @code{intangible} (which disallows moving point | |||
| 2149 | within the text). The @samp{Remove Special} menu item removes all of | 2298 | within the text). The @samp{Remove Special} menu item removes all of |
| 2150 | these special properties from the text in the region. | 2299 | these special properties from the text in the region. |
| 2151 | 2300 | ||
| 2152 | The @code{invisible} and @code{intangible} properties are @emph{not} | 2301 | The @code{invisible} and @code{intangible} properties are not saved |
| 2153 | saved in the text/enriched format. The @code{read-only} property is | 2302 | in the @samp{text/enriched} format. |
| 2154 | saved, but it is not a standard part of the text/enriched format, so | ||
| 2155 | other editors may not respect it. | ||
| 2156 | 2303 | ||
| 2157 | @node Text Based Tables | 2304 | @node Text Based Tables |
| 2158 | @section Editing Text-based Tables | 2305 | @section Editing Text-based Tables |
| 2159 | @cindex table mode | 2306 | @cindex table mode |
| 2160 | @cindex text-based tables | 2307 | @cindex text-based tables |
| 2161 | 2308 | ||
| 2162 | Table mode provides an easy and intuitive way to create and edit | 2309 | The @code{table} package provides commands to easily edit text-based |
| 2163 | text-based tables. Here is an example of such a table: | 2310 | tables. Here is an example of what such a table looks like: |
| 2164 | 2311 | ||
| 2165 | @smallexample | 2312 | @smallexample |
| 2166 | @group | 2313 | @group |
| @@ -2170,27 +2317,23 @@ text-based tables. Here is an example of such a table: | |||
| 2170 | | forward-char |Move point right N characters | C-f | | 2317 | | forward-char |Move point right N characters | C-f | |
| 2171 | | |(left if N is negative). | | | 2318 | | |(left if N is negative). | | |
| 2172 | | | | | | 2319 | | | | | |
| 2173 | | |On reaching end of buffer, stop | | | ||
| 2174 | | |and signal error. | | | ||
| 2175 | +-----------------+--------------------------------+-----------------+ | 2320 | +-----------------+--------------------------------+-----------------+ |
| 2176 | | backward-char |Move point left N characters | C-b | | 2321 | | backward-char |Move point left N characters | C-b | |
| 2177 | | |(right if N is negative). | | | 2322 | | |(right if N is negative). | | |
| 2178 | | | | | | 2323 | | | | | |
| 2179 | | |On attempt to pass beginning or | | | ||
| 2180 | | |end of buffer, stop and signal | | | ||
| 2181 | | |error. | | | ||
| 2182 | +-----------------+--------------------------------+-----------------+ | 2324 | +-----------------+--------------------------------+-----------------+ |
| 2183 | @end group | 2325 | @end group |
| 2184 | @end smallexample | 2326 | @end smallexample |
| 2185 | 2327 | ||
| 2186 | Table mode allows the contents of the table such as this one to be | 2328 | When Emacs recognizes such a stretch of text as a table |
| 2187 | easily manipulated by inserting or deleting characters inside a cell. | 2329 | (@pxref{Table Recognition}), editing the contents of each table cell |
| 2188 | A cell is effectively a localized rectangular edit region and edits to | 2330 | will automatically resize the table, whenever the contents become too |
| 2189 | a cell do not affect the contents of the surrounding cells. If the | 2331 | large to fit in the cell. You can use the commands defined in the |
| 2190 | contents do not fit into a cell, then the cell is automatically | 2332 | following sections for navigating and editing the table layout. |
| 2191 | expanded in the vertical and/or horizontal directions and the rest of | 2333 | |
| 2192 | the table is restructured and reformatted in accordance with the | 2334 | @findex table-fixed-width-mode |
| 2193 | growth of the cell. | 2335 | To toggle the automatic table resizing feature, type @kbd{M-x |
| 2336 | table-fixed-width-mode}. | ||
| 2194 | 2337 | ||
| 2195 | @menu | 2338 | @menu |
| 2196 | * Table Definition:: What is a text based table. | 2339 | * Table Definition:: What is a text based table. |
| @@ -2198,102 +2341,87 @@ growth of the cell. | |||
| 2198 | * Table Recognition:: How to activate and deactivate tables. | 2341 | * Table Recognition:: How to activate and deactivate tables. |
| 2199 | * Cell Commands:: Cell-oriented commands in a table. | 2342 | * Cell Commands:: Cell-oriented commands in a table. |
| 2200 | * Cell Justification:: Justifying cell contents. | 2343 | * Cell Justification:: Justifying cell contents. |
| 2201 | * Row Commands:: Manipulating rows of table cell. | 2344 | * Table Rows and Columns:: Inserting and deleting rows and columns. |
| 2202 | * Column Commands:: Manipulating columns of table cell. | ||
| 2203 | * Fixed Width Mode:: Fixing cell width. | ||
| 2204 | * Table Conversion:: Converting between plain text and tables. | 2345 | * Table Conversion:: Converting between plain text and tables. |
| 2205 | * Measuring Tables:: Analyzing table dimension. | ||
| 2206 | * Table Misc:: Table miscellany. | 2346 | * Table Misc:: Table miscellany. |
| 2207 | @end menu | 2347 | @end menu |
| 2208 | 2348 | ||
| 2209 | @node Table Definition | 2349 | @node Table Definition |
| 2210 | @subsection What is a Text-based Table? | 2350 | @subsection What is a Text-based Table? |
| 2351 | @cindex cells, for text-based tables | ||
| 2211 | 2352 | ||
| 2212 | Keep the following examples of valid tables in mind as a reference | 2353 | A @dfn{table} consists of a rectangular text area which is divided |
| 2213 | while you read this section: | 2354 | into @dfn{cells}. Each cell must be at least one character wide and |
| 2214 | 2355 | one character high, not counting its border lines. A cell can be | |
| 2215 | @example | 2356 | subdivided into more cells, but they cannot overlap. |
| 2216 | +--+----+---+ +-+ +--+-----+ | ||
| 2217 | | | | | | | | | | | ||
| 2218 | +--+----+---+ +-+ | +--+--+ | ||
| 2219 | | | | | | | | | | ||
| 2220 | +--+----+---+ +--+--+ | | ||
| 2221 | | | | | ||
| 2222 | +-----+--+ | ||
| 2223 | @end example | ||
| 2224 | |||
| 2225 | A table consists of a rectangular frame whose inside is divided into | ||
| 2226 | cells. Each cell must be at least one character wide and one | ||
| 2227 | character high, not counting its border lines. A cell can be | ||
| 2228 | subdivided into multiple rectangular cells, but cells cannot overlap. | ||
| 2229 | 2357 | ||
| 2230 | The table frame and cell border lines are made of three special | 2358 | Cell border lines are drawn with three special characters, specified |
| 2231 | characters. These variables specify those characters: | 2359 | by the following variables: |
| 2232 | 2360 | ||
| 2233 | @table @code | 2361 | @table @code |
| 2234 | @vindex table-cell-vertical-char | 2362 | @vindex table-cell-vertical-char |
| 2235 | @item table-cell-vertical-char | 2363 | @item table-cell-vertical-char |
| 2236 | Holds the character used for vertical lines. The default value is | 2364 | The character used for vertical lines. The default is @samp{|}. |
| 2237 | @samp{|}. | ||
| 2238 | 2365 | ||
| 2239 | @vindex table-cell-horizontal-chars | 2366 | @vindex table-cell-horizontal-chars |
| 2240 | @item table-cell-horizontal-chars | 2367 | @item table-cell-horizontal-chars |
| 2241 | Holds the characters used for horizontal lines. The default value is | 2368 | The characters used for horizontal lines. The default is @samp{"-="}. |
| 2242 | @samp{"-="}. | ||
| 2243 | 2369 | ||
| 2244 | @vindex table-cell-intersection-char | 2370 | @vindex table-cell-intersection-char |
| 2245 | @item table-cell-intersection-char | 2371 | @item table-cell-intersection-char |
| 2246 | Holds the character used at where horizontal line and vertical line | 2372 | The character used for the intersection of horizontal and vertical |
| 2247 | meet. The default value is @samp{+}. | 2373 | lines. The default is @samp{+}. |
| 2248 | @end table | 2374 | @end table |
| 2249 | 2375 | ||
| 2250 | @noindent | 2376 | @noindent |
| 2251 | Based on this definition, the following five tables are examples of invalid | 2377 | The following are examples of @emph{invalid} tables: |
| 2252 | tables: | ||
| 2253 | 2378 | ||
| 2254 | @example | 2379 | @example |
| 2255 | +-----+ +-----+ +--+ +-++--+ ++ | 2380 | +-----+ +--+ +-++--+ |
| 2256 | | | | | | | | || | ++ | 2381 | | | | | | || | |
| 2257 | | +-+ | | | | | | || | | 2382 | | | | | | || | |
| 2258 | | | | | +--+ | +--+--+ +-++--+ | 2383 | +--+ | +--+--+ +-++--+ |
| 2259 | | +-+ | | | | | | | +-++--+ | 2384 | | | | | | | +-++--+ |
| 2260 | | | | | | | | | | || | | 2385 | | | | | | | | || | |
| 2261 | +-----+ +--+--+ +--+--+ +-++--+ | 2386 | +--+--+ +--+--+ +-++--+ |
| 2262 | a b c d e | 2387 | a b c |
| 2263 | @end example | 2388 | @end example |
| 2264 | 2389 | ||
| 2390 | @noindent | ||
| 2265 | From left to right: | 2391 | From left to right: |
| 2266 | 2392 | ||
| 2267 | @enumerate a | 2393 | @enumerate a |
| 2268 | @item | 2394 | @item |
| 2269 | Overlapped cells or non-rectangular cells are not allowed. | 2395 | Overlapped cells or non-rectangular cells are not allowed. |
| 2270 | @item | 2396 | @item |
| 2271 | Same as a. | ||
| 2272 | @item | ||
| 2273 | The border must be rectangular. | 2397 | The border must be rectangular. |
| 2274 | @item | 2398 | @item |
| 2275 | Cells must have a minimum width/height of one character. | 2399 | Cells must have a minimum width/height of one character. |
| 2276 | @item | ||
| 2277 | Same as d. | ||
| 2278 | @end enumerate | 2400 | @end enumerate |
| 2279 | 2401 | ||
| 2280 | @node Table Creation | 2402 | @node Table Creation |
| 2281 | @subsection How to Create a Table? | 2403 | @subsection Creating a Table |
| 2282 | @cindex create a text-based table | 2404 | @cindex create a text-based table |
| 2283 | @cindex table creation | 2405 | @cindex table creation |
| 2284 | 2406 | ||
| 2285 | @findex table-insert | 2407 | @findex table-insert |
| 2286 | The command to create a table is @code{table-insert}. When called | 2408 | To create a text-based table from scratch, type @kbd{M-x |
| 2287 | interactively, it asks for the number of columns, number of rows, cell | 2409 | table-insert}. This command prompts for the number of table columns, |
| 2288 | width and cell height. The number of columns is the number of cells | 2410 | the number of table rows, cell width and cell height. The cell width |
| 2289 | horizontally side by side. The number of rows is the number of cells | 2411 | and cell height do not include the cell borders; each can be specified |
| 2290 | vertically within the table's height. The cell width is a number of | 2412 | as a single integer (which means each cell is given the same |
| 2291 | characters that each cell holds, left to right. The cell height is a | 2413 | width/height), or as a sequence of integers separated by spaces or |
| 2292 | number of lines each cell holds. The cell width and the cell height | 2414 | commas (which specify the width/height of the individual table |
| 2293 | can be either an integer (when the value is constant across the table) | 2415 | columns/rows, counting from left to right for table columns and from |
| 2294 | or a series of integer, separated by spaces or commas, where each | 2416 | top to bottom for table rows). The specified table is then inserted |
| 2295 | number corresponds to the next cell within a row from left to right, | 2417 | at point. |
| 2296 | or the next cell within a column from top to bottom. | 2418 | |
| 2419 | The table inserted by @kbd{M-x table-insert} contains special text | ||
| 2420 | properties, which tell Emacs to treat it specially as a text-based | ||
| 2421 | table. If you save the buffer to a file and visit it again later, | ||
| 2422 | those properties are lost, and the table appears to Emacs as an | ||
| 2423 | ordinary piece of text. See the next section, for how to convert it | ||
| 2424 | back into a table. | ||
| 2297 | 2425 | ||
| 2298 | @node Table Recognition | 2426 | @node Table Recognition |
| 2299 | @subsection Table Recognition | 2427 | @subsection Table Recognition |
| @@ -2301,103 +2429,97 @@ or the next cell within a column from top to bottom. | |||
| 2301 | 2429 | ||
| 2302 | @findex table-recognize | 2430 | @findex table-recognize |
| 2303 | @findex table-unrecognize | 2431 | @findex table-unrecognize |
| 2304 | Table mode maintains special text properties in the buffer to allow | 2432 | Existing text-based tables in a buffer, which lack the special text |
| 2305 | editing in a convenient fashion. When a buffer with tables is saved | 2433 | properties applied by @kbd{M-x table-insert}, are not treated |
| 2306 | to its file, these text properties are lost, so when you visit this | 2434 | specially as tables. To apply those text properties, type @kbd{M-x |
| 2307 | file again later, Emacs does not see a table, but just formatted text. | 2435 | table-recognize}. This command scans the current buffer, |
| 2308 | To resurrect the table text properties, issue the @kbd{M-x | 2436 | @dfn{recognizes} valid table cells, and applies the relevant text |
| 2309 | table-recognize} command. It scans the current buffer, recognizes | 2437 | properties. Conversely, type @kbd{M-x table-unrecognize} to |
| 2310 | valid table cells, and attaches appropriate text properties to allow | 2438 | @dfn{unrecognize} all tables in the current buffer, removing the |
| 2311 | for table editing. The converse command, @code{table-unrecognize}, is | 2439 | special text properties and converting tables back to plain text. |
| 2312 | used to remove the special text properties and convert the buffer back | 2440 | |
| 2313 | to plain text. | 2441 | You can also use the following commands to selectively recognize or |
| 2314 | 2442 | unrecognize tables: | |
| 2315 | Special commands exist to enable or disable tables within a region, | ||
| 2316 | enable or disable individual tables, and enable/disable individual | ||
| 2317 | cells. These commands are: | ||
| 2318 | 2443 | ||
| 2319 | @table @kbd | 2444 | @table @kbd |
| 2320 | @findex table-recognize-region | 2445 | @findex table-recognize-region |
| 2321 | @item M-x table-recognize-region | 2446 | @item M-x table-recognize-region |
| 2322 | Recognize tables within the current region and activate them. | 2447 | Recognize tables within the current region. |
| 2448 | |||
| 2323 | @findex table-unrecognize-region | 2449 | @findex table-unrecognize-region |
| 2324 | @item M-x table-unrecognize-region | 2450 | @item M-x table-unrecognize-region |
| 2325 | Deactivate tables within the current region. | 2451 | Unrecognize tables within the current region. |
| 2452 | |||
| 2326 | @findex table-recognize-table | 2453 | @findex table-recognize-table |
| 2327 | @item M-x table-recognize-table | 2454 | @item M-x table-recognize-table |
| 2328 | Recognize the table at point and activate it. | 2455 | Recognize the table at point and activate it. |
| 2456 | |||
| 2329 | @findex table-unrecognize-table | 2457 | @findex table-unrecognize-table |
| 2330 | @item M-x table-unrecognize-table | 2458 | @item M-x table-unrecognize-table |
| 2331 | Deactivate the table at point. | 2459 | Deactivate the table at point. |
| 2460 | |||
| 2332 | @findex table-recognize-cell | 2461 | @findex table-recognize-cell |
| 2333 | @item M-x table-recognize-cell | 2462 | @item M-x table-recognize-cell |
| 2334 | Recognize the cell at point and activate it. | 2463 | Recognize the cell at point and activate it. |
| 2464 | |||
| 2335 | @findex table-unrecognize-cell | 2465 | @findex table-unrecognize-cell |
| 2336 | @item M-x table-unrecognize-cell | 2466 | @item M-x table-unrecognize-cell |
| 2337 | Deactivate the cell at point. | 2467 | Deactivate the cell at point. |
| 2338 | @end table | 2468 | @end table |
| 2339 | 2469 | ||
| 2340 | For another way of converting text into tables, see @ref{Table | 2470 | @xref{Table Conversion}, for another way to recognize a table. |
| 2341 | Conversion}. | ||
| 2342 | 2471 | ||
| 2343 | @node Cell Commands | 2472 | @node Cell Commands |
| 2344 | @subsection Commands for Table Cells | 2473 | @subsection Commands for Table Cells |
| 2345 | 2474 | ||
| 2346 | @findex table-forward-cell | 2475 | @findex table-forward-cell |
| 2347 | @findex table-backward-cell | 2476 | @findex table-backward-cell |
| 2348 | The commands @code{table-forward-cell} and | 2477 | The commands @kbd{M-x table-forward-cell} and @kbd{M-x |
| 2349 | @code{table-backward-cell} move point from the current cell to an | 2478 | table-backward-cell} move point from the current cell to an adjacent |
| 2350 | adjacent cell forward and backward respectively. The order of the | 2479 | cell. The order is cyclic: when point is in the last cell of a table, |
| 2351 | cells is cyclic: when point is in the last cell of a table, typing | 2480 | @kbd{M-x table-forward-cell} moves to the first cell. Likewise, when |
| 2352 | @kbd{M-x table-forward-cell} moves to the first cell in the table. | 2481 | point is on the first cell, @kbd{M-x table-backward-cell} moves to the |
| 2353 | Likewise @kbd{M-x table-backward-cell} from the first cell in a table | 2482 | last cell. |
| 2354 | moves to the last cell. | ||
| 2355 | 2483 | ||
| 2356 | @findex table-span-cell | 2484 | @findex table-span-cell |
| 2357 | The command @code{table-span-cell} merges the current cell with the | 2485 | @kbd{M-x table-span-cell} prompts for a direction---right, left, |
| 2358 | adjacent cell in a specified direction---right, left, above or below. | 2486 | above, or below---and merges the current cell with the adjacent cell |
| 2359 | You specify the direction with the minibuffer. It does not allow | 2487 | in that direction. This command signals an error if the merge would |
| 2360 | merges which don't result in a legitimate cell layout. | 2488 | result in an illegitimate cell layout. |
| 2361 | 2489 | ||
| 2362 | @findex table-split-cell | 2490 | @findex table-split-cell |
| 2363 | @cindex text-based tables, split a cell | ||
| 2364 | @cindex split table cell | ||
| 2365 | The command @code{table-split-cell} splits the current cell | ||
| 2366 | vertically or horizontally. This command is a wrapper to the | ||
| 2367 | direction specific commands @code{table-split-cell-vertically} and | ||
| 2368 | @code{table-split-cell-horizontally}. You specify the direction with | ||
| 2369 | a minibuffer argument. | ||
| 2370 | |||
| 2371 | @findex table-split-cell-vertically | 2491 | @findex table-split-cell-vertically |
| 2372 | The command @code{table-split-cell-vertically} splits the current | ||
| 2373 | cell vertically and creates a pair of cells above and below where | ||
| 2374 | point is located. The content in the original cell is split as well. | ||
| 2375 | |||
| 2376 | @findex table-split-cell-horizontally | 2492 | @findex table-split-cell-horizontally |
| 2377 | The command @code{table-split-cell-horizontally} splits the current | 2493 | @cindex text-based tables, splitting cells |
| 2378 | cell horizontally and creates a pair of cells right and left of where | 2494 | @cindex splitting table cells |
| 2379 | point is located. If the cell being split is not empty, this asks you | 2495 | @kbd{M-x table-split-cell} splits the current cell vertically or |
| 2380 | how to handle the cell contents. The three options are: @code{split}, | 2496 | horizontally, prompting for the direction with the minibuffer. The |
| 2381 | @code{left}, or @code{right}. @code{split} splits the contents at | 2497 | commands @kbd{M-x table-split-cell-vertically} and @kbd{M-x |
| 2382 | point literally, while the @code{left} and @code{right} options move | 2498 | table-split-cell-horizontally} split in a specific direction. When |
| 2383 | the entire contents into the left or right cell respectively. | 2499 | splitting vertically, the old cell contents are automatically split |
| 2384 | 2500 | between the two new cells. When splitting horizontally, you are | |
| 2385 | @cindex enlarge a table cell | 2501 | prompted for how to divide the cell contents, if the cell is |
| 2386 | @cindex shrink a table cell | 2502 | non-empty; the options are @samp{split} (divide the contents at |
| 2387 | The next four commands enlarge or shrink a cell. They use numeric | 2503 | point), @samp{left} (put all the contents in the left cell), and |
| 2388 | arguments (@pxref{Arguments}) to specify how many columns or rows to | 2504 | @samp{right} (put all the contents in the right cell). |
| 2389 | enlarge or shrink a particular table. | 2505 | |
| 2506 | The following commands enlarge or shrink a cell. By default, they | ||
| 2507 | resize by one row or column; if a numeric argument is supplied, that | ||
| 2508 | specifies the number of rows or columns to resize by. | ||
| 2390 | 2509 | ||
| 2391 | @table @kbd | 2510 | @table @kbd |
| 2392 | @findex table-heighten-cell | 2511 | @findex table-heighten-cell |
| 2393 | @item M-x table-heighten-cell | 2512 | @item M-x table-heighten-cell |
| 2394 | Enlarge the current cell vertically. | 2513 | Enlarge the current cell vertically. |
| 2514 | |||
| 2395 | @findex table-shorten-cell | 2515 | @findex table-shorten-cell |
| 2396 | @item M-x table-shorten-cell | 2516 | @item M-x table-shorten-cell |
| 2397 | Shrink the current cell vertically. | 2517 | Shrink the current cell vertically. |
| 2518 | |||
| 2398 | @findex table-widen-cell | 2519 | @findex table-widen-cell |
| 2399 | @item M-x table-widen-cell | 2520 | @item M-x table-widen-cell |
| 2400 | Enlarge the current cell horizontally. | 2521 | Enlarge the current cell horizontally. |
| 2522 | |||
| 2401 | @findex table-narrow-cell | 2523 | @findex table-narrow-cell |
| 2402 | @item M-x table-narrow-cell | 2524 | @item M-x table-narrow-cell |
| 2403 | Shrink the current cell horizontally. | 2525 | Shrink the current cell horizontally. |
| @@ -2405,107 +2527,76 @@ Shrink the current cell horizontally. | |||
| 2405 | 2527 | ||
| 2406 | @node Cell Justification | 2528 | @node Cell Justification |
| 2407 | @subsection Cell Justification | 2529 | @subsection Cell Justification |
| 2408 | @cindex cell text justification | 2530 | @cindex justification in text-based tables |
| 2409 | 2531 | ||
| 2410 | You can specify text justification for each cell. The justification | 2532 | The command @kbd{M-x table-justify} imposes @dfn{justification} on |
| 2411 | is remembered independently for each cell and the subsequent editing | 2533 | one or more cells in a text-based table. Justification determines how |
| 2412 | of cell contents is subject to the specified justification. | 2534 | the text in the cell is aligned, relative to the edges of the cell. |
| 2535 | Each cell in a table can be separately justified. | ||
| 2413 | 2536 | ||
| 2414 | @findex table-justify | 2537 | @findex table-justify |
| 2415 | The command @code{table-justify} ask you to specify what to justify: | 2538 | @kbd{M-x table-justify} first prompts for what to justify; the |
| 2416 | a cell, a column, or a row. If you select cell justification, this | 2539 | options are @samp{cell} (just the current cell), @samp{column} (all |
| 2417 | command sets the justification only for the current cell. Selecting | 2540 | cells in the current table column) and @samp{row} (all cells in the |
| 2418 | column or row justification sets the justification for all the cells | 2541 | current table row). The command then prompts for the justification |
| 2419 | within a column or row respectively. The command then ask you which | 2542 | style; the options are @code{left}, @code{center}, @code{right}, |
| 2420 | kind of justification to apply: @code{left}, @code{center}, | 2543 | @code{top}, @code{middle}, @code{bottom}, or @code{none} (meaning no |
| 2421 | @code{right}, @code{top}, @code{middle}, @code{bottom}, or | 2544 | vertical justification). |
| 2422 | @code{none}. Horizontal justification and vertical justification are | 2545 | |
| 2423 | specified independently. The options @code{left}, @code{center}, and | 2546 | Horizontal and vertical justification styles are specified |
| 2424 | @code{right} specify horizontal justification while the options | 2547 | independently, and both types can be in effect simultaneously; for |
| 2425 | @code{top}, @code{middle}, @code{bottom}, and @code{none} specify | 2548 | instance, you can call @kbd{M-x table-justify} twice, once to specify |
| 2426 | vertical justification. The vertical justification @code{none} | 2549 | @code{right} justification and once to specify @code{bottom} |
| 2427 | effectively removes vertical justification. Horizontal justification | 2550 | justification, to align the contents of a cell to the bottom right. |
| 2428 | must be one of @code{left}, @code{center}, or @code{right}. | ||
| 2429 | 2551 | ||
| 2430 | @vindex table-detect-cell-alignment | 2552 | @vindex table-detect-cell-alignment |
| 2431 | Justification information is stored in the buffer as a part of text | 2553 | The justification style is stored in the buffer as a text property, |
| 2432 | property. Therefore, this information is ephemeral and does not | 2554 | and is lost when you kill the buffer or exit Emacs. However, the |
| 2433 | survive through the loss of the buffer (closing the buffer and | 2555 | table recognition commands, such as @kbd{M-x table-recognize} |
| 2434 | revisiting the buffer erase any previous text properties). To | 2556 | (@pxref{Table Recognition}), attempt to determine and re-apply each |
| 2435 | countermand for this, the command @code{table-recognize} and other | 2557 | cell's justification style, by examining its contents. To disable |
| 2436 | recognition commands (@pxref{Table Recognition}) are equipped with a | 2558 | this feature, change the variable @code{table-detect-cell-alignment} |
| 2437 | convenience feature (turned on by default). During table recognition, | 2559 | to @code{nil}. |
| 2438 | the contents of a cell are examined to determine which justification | 2560 | |
| 2439 | was originally applied to the cell and then applies this justification | 2561 | @node Table Rows and Columns |
| 2440 | to the cell. This is a speculative algorithm and is therefore not | 2562 | @subsection Table Rows and Columns |
| 2441 | perfect, however, the justification is deduced correctly most of the | 2563 | @cindex inserting rows and columns in text-based tables |
| 2442 | time. To disable this feature, customize the variable | 2564 | |
| 2443 | @code{table-detect-cell-alignment} and set it to @code{nil}. | ||
| 2444 | |||
| 2445 | @node Row Commands | ||
| 2446 | @subsection Commands for Table Rows | ||
| 2447 | @cindex table row commands | ||
| 2448 | |||
| 2449 | @cindex insert row in table | ||
| 2450 | @findex table-insert-row | 2565 | @findex table-insert-row |
| 2451 | The command @code{table-insert-row} inserts a row of cells before | 2566 | @kbd{M-x table-insert-row} inserts a row of cells before the current |
| 2452 | the current row in a table. The current row where point is located is | 2567 | table row. The current row, together with point, is pushed down past |
| 2453 | pushed down after the newly inserted row. A numeric prefix argument | 2568 | the new row. To insert rows after the last row at the bottom of a |
| 2454 | specifies the number of rows to insert. Note that in order to insert | 2569 | table, invoke this command with point below the table, just below the |
| 2455 | rows @emph{after} the last row at the bottom of a table, you must | 2570 | bottom edge. A numeric prefix argument specifies the number of rows |
| 2456 | place point below the table---that is, outside the table---prior to | 2571 | to insert. |
| 2457 | invoking this command. | ||
| 2458 | |||
| 2459 | @cindex delete row in table | ||
| 2460 | @findex table-delete-row | ||
| 2461 | The command @code{table-delete-row} deletes a row of cells at point. | ||
| 2462 | A numeric prefix argument specifies the number of rows to delete. | ||
| 2463 | |||
| 2464 | @node Column Commands | ||
| 2465 | @subsection Commands for Table Columns | ||
| 2466 | @cindex table column commands | ||
| 2467 | |||
| 2468 | @cindex insert column in table | ||
| 2469 | @findex table-insert-column | ||
| 2470 | The command @code{table-insert-column} inserts a column of cells to | ||
| 2471 | the left of the current row in a table. This pushes the current | ||
| 2472 | column to the right. To insert a column to the right side of the | ||
| 2473 | rightmost column, place point to the right of the rightmost column, | ||
| 2474 | which is outside of the table, prior to invoking this command. A | ||
| 2475 | numeric prefix argument specifies the number of columns to insert. | ||
| 2476 | |||
| 2477 | @cindex delete column in table | ||
| 2478 | A command @code{table-delete-column} deletes a column of cells at | ||
| 2479 | point. A numeric prefix argument specifies the number of columns to | ||
| 2480 | delete. | ||
| 2481 | |||
| 2482 | @node Fixed Width Mode | ||
| 2483 | @subsection Fix Width of Cells | ||
| 2484 | @cindex fix width of table cells | ||
| 2485 | 2572 | ||
| 2486 | @findex table-fixed-width-mode | 2573 | @findex table-insert-column |
| 2487 | The command @code{table-fixed-width-mode} toggles fixed width mode | 2574 | Similarly, @kbd{M-x table-insert-column} inserts a column of cells |
| 2488 | on and off. When fixed width mode is turned on, editing inside a | 2575 | to the left of the current table column. To insert a column to the |
| 2489 | cell never changes the cell width; when it is off, the cell width | 2576 | right side of the rightmost column, invoke this command with point to |
| 2490 | expands automatically in order to prevent a word from being folded | 2577 | the right of the rightmost column, outside the table. A numeric |
| 2491 | into multiple lines. By default, fixed width mode is disabled. | 2578 | prefix argument specifies the number of columns to insert. |
| 2579 | |||
| 2580 | @cindex deleting rows and column in text-based tables | ||
| 2581 | @kbd{M-x table-delete-column} deletes the column of cells at point. | ||
| 2582 | Similarly, @kbd{M-x table-delete-row} deletes the row of cells at | ||
| 2583 | point. A numeric prefix argument to either command specifies the | ||
| 2584 | number of columns or rows to delete. | ||
| 2492 | 2585 | ||
| 2493 | @node Table Conversion | 2586 | @node Table Conversion |
| 2494 | @subsection Conversion Between Plain Text and Tables | 2587 | @subsection Converting Between Plain Text and Tables |
| 2495 | @cindex text to table | 2588 | @cindex text to table |
| 2496 | @cindex table to text | 2589 | @cindex table to text |
| 2497 | 2590 | ||
| 2498 | @findex table-capture | 2591 | @findex table-capture |
| 2499 | The command @code{table-capture} captures plain text in a region and | 2592 | The command @kbd{M-x table-capture} captures plain text in a region |
| 2500 | turns it into a table. Unlike @code{table-recognize} (@pxref{Table | 2593 | and turns it into a table. Unlike @kbd{M-x table-recognize} |
| 2501 | Recognition}), the original text does not have a table appearance but | 2594 | (@pxref{Table Recognition}), the original text does not need to have a |
| 2502 | may hold a logical table structure. For example, some elements | 2595 | table appearance; it only needs to have a logical table-like |
| 2503 | separated by known patterns form a two dimensional structure which can | 2596 | structure. |
| 2504 | be turned into a table. | ||
| 2505 | 2597 | ||
| 2506 | Here's an example of data that @code{table-capture} can operate on. | 2598 | For example, suppose we have the following numbers, which are |
| 2507 | The numbers are horizontally separated by a comma and vertically | 2599 | divided into three lines and separated horizontally by commas: |
| 2508 | separated by a newline character. | ||
| 2509 | 2600 | ||
| 2510 | @example | 2601 | @example |
| 2511 | 1, 2, 3, 4 | 2602 | 1, 2, 3, 4 |
| @@ -2526,136 +2617,92 @@ Invoking @kbd{M-x table-capture} on that text produces this table: | |||
| 2526 | +-----+-----+-----+-----+ | 2617 | +-----+-----+-----+-----+ |
| 2527 | @end example | 2618 | @end example |
| 2528 | 2619 | ||
| 2529 | @noindent | ||
| 2530 | The conversion uses @samp{,} for the column delimiter and newline for | ||
| 2531 | a row delimiter, cells are left justified, and minimum cell width is | ||
| 2532 | 5. | ||
| 2533 | |||
| 2534 | @findex table-release | 2620 | @findex table-release |
| 2535 | The command @code{table-release} does the opposite of | 2621 | @kbd{M-x table-release} does the opposite: it converts a table back |
| 2536 | @code{table-capture}. It releases a table by removing the table frame | 2622 | to plain text, removing its cell borders. |
| 2537 | and cell borders. This leaves the table contents as plain text. One | 2623 | |
| 2538 | of the useful applications of @code{table-capture} and | 2624 | One application of this pair of commands is to edit a text in |
| 2539 | @code{table-release} is to edit a text in layout. Look at the | 2625 | layout. Look at the following three paragraphs (the latter two are |
| 2540 | following three paragraphs (the latter two are indented with header | 2626 | indented with header lines): |
| 2541 | lines): | ||
| 2542 | 2627 | ||
| 2543 | @example | 2628 | @example |
| 2544 | table-capture is a powerful command. | 2629 | table-capture is a powerful command. |
| 2545 | Here are some things it can do: | 2630 | Here are some things it can do: |
| 2546 | 2631 | ||
| 2547 | Parse Cell Items By using column delimiter regular | 2632 | Parse Cell Items Using row and column delimiter regexps, |
| 2548 | expression and raw delimiter regular | 2633 | it parses the specified text area and |
| 2549 | expression, it parses the specified text | 2634 | extracts cell items into a table. |
| 2550 | area and extracts cell items from | ||
| 2551 | non-table text and then forms a table out | ||
| 2552 | of them. | ||
| 2553 | |||
| 2554 | Capture Text Area When no delimiters are specified it | ||
| 2555 | creates a single cell table. The text in | ||
| 2556 | the specified region is placed in that | ||
| 2557 | cell. | ||
| 2558 | @end example | 2635 | @end example |
| 2559 | 2636 | ||
| 2560 | @noindent | 2637 | @noindent |
| 2561 | Applying @code{table-capture} to a region containing the above three | 2638 | Applying @code{table-capture} to a region containing the above text, |
| 2562 | paragraphs, with empty strings for column delimiter regexp and row | 2639 | with empty strings for the column and row delimiter regexps, creates a |
| 2563 | delimiter regexp, creates a table with a single cell like the | 2640 | table with a single cell like the following one. |
| 2564 | following one. | 2641 | |
| 2565 | |||
| 2566 | @c The first line's right-hand frame in the following two examples | ||
| 2567 | @c sticks out to accommodate for the removal of @samp in the | ||
| 2568 | @c produced output!! | ||
| 2569 | @smallexample | 2642 | @smallexample |
| 2570 | @group | 2643 | @group |
| 2571 | +-------------------------------------------------------------+ | 2644 | +----------------------------------------------------------+ |
| 2572 | |table-capture is a powerful command. | | 2645 | |table-capture is a powerful command. | |
| 2573 | |Here are some things it can do: | | 2646 | |Here are some things it can do: | |
| 2574 | | | | 2647 | | | |
| 2575 | |Parse Cell Items By using column delimiter regular | | 2648 | |Parse Cell Items Using row and column delimiter regexps,| |
| 2576 | | expression and raw delimiter regular | | 2649 | | it parses the specified text area and | |
| 2577 | | expression, it parses the specified text | | 2650 | | extracts cell items into a table. | |
| 2578 | | area and extracts cell items from | | 2651 | +----------------------------------------------------------+ |
| 2579 | | non-table text and then forms a table out | | ||
| 2580 | | of them. | | ||
| 2581 | | | | ||
| 2582 | |Capture Text Area When no delimiters are specified it | | ||
| 2583 | | creates a single cell table. The text in | | ||
| 2584 | | the specified region is placed in that | | ||
| 2585 | | cell. | | ||
| 2586 | +-------------------------------------------------------------+ | ||
| 2587 | @end group | 2652 | @end group |
| 2588 | @end smallexample | 2653 | @end smallexample |
| 2589 | 2654 | ||
| 2590 | @noindent | 2655 | @noindent |
| 2591 | By splitting the cell appropriately we now have a table consisting of | 2656 | We can then use the cell splitting commands (@pxref{Cell Commands}) to |
| 2592 | paragraphs occupying its own cell. Each cell can now be edited | 2657 | subdivide the table so that each paragraph occupies a cell: |
| 2593 | independently without affecting the layout of other cells. | ||
| 2594 | 2658 | ||
| 2595 | @smallexample | 2659 | @smallexample |
| 2596 | +--------------------------------------------------------------+ | 2660 | +----------------------------------------------------------+ |
| 2597 | |table-capture is a powerful command. | | 2661 | |table-capture is a powerful command. | |
| 2598 | |Here are some things it can do: | | 2662 | |Here are some things it can do: | |
| 2599 | +------------------+-------------------------------------------+ | 2663 | +-----------------+----------------------------------------+ |
| 2600 | |Parse Cell Items |By using column delimiter regular | | 2664 | |Parse Cell Items | Using row and column delimiter regexps,| |
| 2601 | | |expression and raw delimiter regular | | 2665 | | | it parses the specified text area and | |
| 2602 | | |expression, it parses the specified text | | 2666 | | | extracts cell items into a table. | |
| 2603 | | |area and extracts cell items from | | 2667 | +-----------------+----------------------------------------+ |
| 2604 | | |non-table text and then forms a table out | | ||
| 2605 | | |of them. | | ||
| 2606 | +------------------+-------------------------------------------+ | ||
| 2607 | |Capture Text Area |When no delimiters are specified it | | ||
| 2608 | | |creates a single cell table. The text in | | ||
| 2609 | | |the specified region is placed in that | | ||
| 2610 | | |cell. | | ||
| 2611 | +------------------+-------------------------------------------+ | ||
| 2612 | @end smallexample | 2668 | @end smallexample |
| 2613 | 2669 | ||
| 2614 | @noindent | 2670 | @noindent |
| 2615 | By applying @code{table-release}, which does the opposite process, the | 2671 | Each cell can now be edited independently without affecting the layout |
| 2616 | contents become once again plain text. @code{table-release} works as | 2672 | of other cells. When finished, we can invoke @kbd{M-x table-release} |
| 2617 | a companion command to @code{table-capture}. | 2673 | to convert the table back to plain text. |
| 2618 | 2674 | ||
| 2619 | @node Measuring Tables | 2675 | @node Table Misc |
| 2620 | @subsection Analyzing Table Dimensions | 2676 | @subsection Table Miscellany |
| 2621 | @cindex table dimensions | ||
| 2622 | 2677 | ||
| 2678 | @cindex table dimensions | ||
| 2623 | @findex table-query-dimension | 2679 | @findex table-query-dimension |
| 2624 | The command @code{table-query-dimension} analyzes a table structure | 2680 | The command @code{table-query-dimension} reports the layout of the |
| 2625 | and reports information regarding its dimensions. In case of the | 2681 | table and table cell at point. Here is an example of its output: |
| 2626 | above example table, the @code{table-query-dimension} command displays | ||
| 2627 | in echo area: | ||
| 2628 | 2682 | ||
| 2629 | @smallexample | 2683 | @smallexample |
| 2630 | Cell: (21w, 6h), Table: (67w, 16h), Dim: (2c, 3r), Total Cells: 5 | 2684 | Cell: (21w, 6h), Table: (67w, 16h), Dim: (2c, 3r), Total Cells: 5 |
| 2631 | @end smallexample | 2685 | @end smallexample |
| 2632 | 2686 | ||
| 2633 | @noindent | 2687 | @noindent |
| 2634 | This indicates that the current cell is 21 character wide and 6 lines | 2688 | This indicates that the current cell is 21 characters wide and 6 lines |
| 2635 | high, the entire table is 67 characters wide and 16 lines high. The | 2689 | high, the table is 67 characters wide and 16 lines high with 2 columns |
| 2636 | table has 2 columns and 3 rows. It has a total of 5 cells, since the | 2690 | and 3 rows, and a total of 5 cells. |
| 2637 | first row has a spanned cell. | ||
| 2638 | 2691 | ||
| 2639 | @node Table Misc | ||
| 2640 | @subsection Table Miscellany | ||
| 2641 | |||
| 2642 | @cindex insert string into table cells | ||
| 2643 | @findex table-insert-sequence | 2692 | @findex table-insert-sequence |
| 2644 | The command @code{table-insert-sequence} inserts a string into each | 2693 | @kbd{M-x table-insert-sequence} inserts a string into each cell. |
| 2645 | cell. Each string is a part of a sequence i.e.@: a series of | 2694 | Each string is a part of a sequence i.e.@: a series of increasing |
| 2646 | increasing integer numbers. | 2695 | integer numbers. |
| 2647 | 2696 | ||
| 2648 | @cindex table in language format | ||
| 2649 | @cindex table for HTML and LaTeX | 2697 | @cindex table for HTML and LaTeX |
| 2650 | @findex table-generate-source | 2698 | @findex table-generate-source |
| 2651 | The command @code{table-generate-source} generates a table formatted | 2699 | @kbd{M-x table-generate-source} generates a table formatted for a |
| 2652 | for a specific markup language. It asks for a language (which must be | 2700 | specific markup language. It asks for a language (which must be one |
| 2653 | one of @code{html}, @code{latex}, or @code{cals}), a destination | 2701 | of @code{html}, @code{latex}, or @code{cals}), a destination buffer in |
| 2654 | buffer where to put the result, and the table caption (a string), and | 2702 | which to put the result, and a table caption, and then inserts the |
| 2655 | then inserts the generated table in the proper syntax into the | 2703 | generated table into the specified buffer. The default destination |
| 2656 | destination buffer. The default destination buffer is | 2704 | buffer is @code{table.@var{lang}}, where @var{lang} is the language |
| 2657 | @code{table.@var{lang}}, where @var{lang} is the language you | 2705 | you specified. |
| 2658 | specified. | ||
| 2659 | 2706 | ||
| 2660 | @node Two-Column | 2707 | @node Two-Column |
| 2661 | @section Two-Column Editing | 2708 | @section Two-Column Editing |
| @@ -2663,11 +2710,9 @@ specified. | |||
| 2663 | @cindex splitting columns | 2710 | @cindex splitting columns |
| 2664 | @cindex columns, splitting | 2711 | @cindex columns, splitting |
| 2665 | 2712 | ||
| 2666 | Two-column mode lets you conveniently edit two side-by-side columns of | 2713 | Two-column mode lets you conveniently edit two side-by-side columns |
| 2667 | text. It uses two side-by-side windows, each showing its own | 2714 | of text. It uses two side-by-side windows, each showing its own |
| 2668 | buffer. | 2715 | buffer. There are three ways to enter two-column mode: |
| 2669 | |||
| 2670 | There are three ways to enter two-column mode: | ||
| 2671 | 2716 | ||
| 2672 | @table @asis | 2717 | @table @asis |
| 2673 | @item @kbd{@key{F2} 2} or @kbd{C-x 6 2} | 2718 | @item @kbd{@key{F2} 2} or @kbd{C-x 6 2} |
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index 05e89e69f0e..b65e6f96a6e 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi | |||
| @@ -5,301 +5,6 @@ | |||
| 5 | @c This file is included either in vc-xtra.texi (when producing the | 5 | @c This file is included either in vc-xtra.texi (when producing the |
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). | 6 | @c printed version) or in the main Emacs manual (for the on-line version). |
| 7 | 7 | ||
| 8 | @node Remote Repositories | ||
| 9 | @subsection Remote Repositories | ||
| 10 | @cindex remote repositories | ||
| 11 | |||
| 12 | A common way of using CVS and other more advanced VCSes is to set up | ||
| 13 | a central repository on some Internet host, then have each | ||
| 14 | developer check out a personal working copy of the files on his local | ||
| 15 | machine. Committing changes to the repository, and picking up changes | ||
| 16 | from other users into one's own working area, then works by direct | ||
| 17 | interactions with the repository server. | ||
| 18 | |||
| 19 | One difficulty is that access to a repository server is often slow, | ||
| 20 | and that developers might need to work off-line as well. While only | ||
| 21 | third-generation decentralized VCses such as GNU Arch or Mercurial | ||
| 22 | really solve this problem, VC is designed to reduce the amount of | ||
| 23 | network interaction necessary. | ||
| 24 | |||
| 25 | If you are using a truly decentralized VCS you can skip the rest of | ||
| 26 | this section. It describes backup and local-repository techniques | ||
| 27 | that are only useful for Subversion and earlier VCSes. | ||
| 28 | |||
| 29 | @menu | ||
| 30 | * Version Backups:: Keeping local copies of repository versions. | ||
| 31 | * Local Version Control:: Using another version system for local editing. | ||
| 32 | @end menu | ||
| 33 | |||
| 34 | @node Version Backups | ||
| 35 | @subsubsection Version Backups | ||
| 36 | @cindex version backups | ||
| 37 | |||
| 38 | @cindex automatic version backups | ||
| 39 | When VC sees that the repository for a file is on a remote | ||
| 40 | machine, it automatically makes local backups of unmodified versions | ||
| 41 | of the file---@dfn{automatic version backups}. This means that you | ||
| 42 | can compare the file to the repository version (@kbd{C-x v =}), or | ||
| 43 | revert to that version (@kbd{C-x v u}), without any network | ||
| 44 | interactions. | ||
| 45 | |||
| 46 | The local copy of the unmodified file is called a @dfn{version | ||
| 47 | backup} to indicate that it corresponds exactly to a version that is | ||
| 48 | stored in the repository. Note that version backups are not the same | ||
| 49 | as ordinary Emacs backup files | ||
| 50 | @iftex | ||
| 51 | (@pxref{Backup,,,emacs, the Emacs Manual}). | ||
| 52 | @end iftex | ||
| 53 | @ifnottex | ||
| 54 | (@pxref{Backup}). | ||
| 55 | @end ifnottex | ||
| 56 | But they follow a similar naming convention. | ||
| 57 | |||
| 58 | For a file that comes from a remote repository, VC makes a | ||
| 59 | version backup whenever you save the first changes to the file, and | ||
| 60 | removes it after you have committed your modified version to the | ||
| 61 | repository. You can disable the making of automatic version backups by | ||
| 62 | setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}). | ||
| 63 | |||
| 64 | @cindex manual version backups | ||
| 65 | The name of the automatic version backup for version @var{version} | ||
| 66 | of file @var{file} is @code{@var{file}.~@var{version}.~}. This is | ||
| 67 | almost the same as the name used by @kbd{C-x v ~} | ||
| 68 | @iftex | ||
| 69 | (@pxref{Old Revisions,,,emacs, the Emacs Manual}), | ||
| 70 | @end iftex | ||
| 71 | @ifnottex | ||
| 72 | (@pxref{Old Revisions}), | ||
| 73 | @end ifnottex | ||
| 74 | the only difference being the additional dot (@samp{.}) after the | ||
| 75 | version number. This similarity is intentional, because both kinds of | ||
| 76 | files store the same kind of information. The file made by @kbd{C-x v | ||
| 77 | ~} acts as a @dfn{manual version backup}. | ||
| 78 | |||
| 79 | All the VC commands that operate on old versions of a file can use | ||
| 80 | both kinds of version backups. For instance, @kbd{C-x v ~} uses | ||
| 81 | either an automatic or a manual version backup, if possible, to get | ||
| 82 | the contents of the version you request. Likewise, @kbd{C-x v =} and | ||
| 83 | @kbd{C-x v u} use either an automatic or a manual version backup, if | ||
| 84 | one of them exists, to get the contents of a version to compare or | ||
| 85 | revert to. If you changed a file outside of Emacs, so that no | ||
| 86 | automatic version backup was created for the previous text, you can | ||
| 87 | create a manual backup of that version using @kbd{C-x v ~}, and thus | ||
| 88 | obtain the benefit of the local copy for Emacs commands. | ||
| 89 | |||
| 90 | The only difference in Emacs's handling of manual and automatic | ||
| 91 | version backups, once they exist, is that Emacs deletes automatic | ||
| 92 | version backups when you commit to the repository. By contrast, | ||
| 93 | manual version backups remain until you delete them. | ||
| 94 | |||
| 95 | @node Local Version Control | ||
| 96 | @subsubsection Local Version Control | ||
| 97 | @cindex local version control | ||
| 98 | @cindex local back end (version control) | ||
| 99 | |||
| 100 | When you make many changes to a file that comes from a remote | ||
| 101 | repository, it can be convenient to have version control on your local | ||
| 102 | machine as well. You can then record intermediate versions, revert to | ||
| 103 | a previous state, etc., before you actually commit your changes to the | ||
| 104 | remote server. | ||
| 105 | |||
| 106 | VC lets you do this by putting a file under a second, local version | ||
| 107 | control system, so that the file is effectively registered in two | ||
| 108 | systems at the same time. For the description here, we will assume | ||
| 109 | that the remote system is CVS, and you use RCS locally, although the | ||
| 110 | mechanism works with any combination of version control systems | ||
| 111 | (@dfn{back ends}). | ||
| 112 | |||
| 113 | To make it work with other back ends, you must make sure that the | ||
| 114 | ``more local'' back end comes before the ``more remote'' back end in | ||
| 115 | the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By | ||
| 116 | default, this variable is set up so that you can use remote CVS and | ||
| 117 | local RCS as described here. | ||
| 118 | |||
| 119 | To start using local RCS for a file that comes from a remote CVS | ||
| 120 | server, you must @emph{register the file in RCS}, by typing @kbd{C-u | ||
| 121 | C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a | ||
| 122 | prefix argument, and specify RCS as the back end.) | ||
| 123 | |||
| 124 | You can do this at any time; it does not matter whether you have | ||
| 125 | already modified the file with respect to the version in the CVS | ||
| 126 | repository. If possible, VC tries to make the RCS master start with | ||
| 127 | the unmodified repository version, then checks in any local changes | ||
| 128 | as a new version. This works if you have not made any changes yet, or | ||
| 129 | if the unmodified repository version exists locally as a version | ||
| 130 | backup (@pxref{Version Backups}). If the unmodified version is not | ||
| 131 | available locally, the RCS master starts with the modified version; | ||
| 132 | the only drawback to this is that you cannot compare your changes | ||
| 133 | locally to what is stored in the repository. | ||
| 134 | |||
| 135 | The version number of the RCS master is derived from the current CVS | ||
| 136 | version, starting a branch from it. For example, if the current CVS | ||
| 137 | version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in | ||
| 138 | the RCS master will be identical to version 1.23 under CVS; your first | ||
| 139 | changes are checked in as 1.23.1.1. (If the unmodified file is not | ||
| 140 | available locally, VC will check in the modified file twice, both as | ||
| 141 | 1.23 and 1.23.1.1, to make the revision numbers consistent.) | ||
| 142 | |||
| 143 | If you do not use locking under CVS (the default), locking is also | ||
| 144 | disabled for RCS, so that editing under RCS works exactly as under | ||
| 145 | CVS. | ||
| 146 | |||
| 147 | When you are done with local editing, you can commit the final version | ||
| 148 | back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}. | ||
| 149 | This initializes the log entry buffer | ||
| 150 | @iftex | ||
| 151 | (@pxref{Log Buffer,,,emacs, the Emacs Manual}) | ||
| 152 | @end iftex | ||
| 153 | @ifnottex | ||
| 154 | (@pxref{Log Buffer}) | ||
| 155 | @end ifnottex | ||
| 156 | to contain all the log entries you have recorded in the RCS master; | ||
| 157 | you can edit them as you wish, and then commit in CVS by typing | ||
| 158 | @kbd{C-c C-c}. If the commit is successful, VC removes the RCS | ||
| 159 | master, so that the file is once again registered under CVS only. | ||
| 160 | (The RCS master is not actually deleted, just renamed by appending | ||
| 161 | @samp{~} to the name, so that you can refer to it later if you wish.) | ||
| 162 | |||
| 163 | While using local RCS, you can pick up recent changes from the CVS | ||
| 164 | repository into your local file, or commit some of your changes back | ||
| 165 | to CVS, without terminating local RCS version control. To do this, | ||
| 166 | switch to the CVS back end temporarily, with the @kbd{C-x v b} command: | ||
| 167 | |||
| 168 | @table @kbd | ||
| 169 | @item C-x v b | ||
| 170 | Switch to another back end that the current file is registered | ||
| 171 | under (@code{vc-switch-backend}). | ||
| 172 | |||
| 173 | @item C-u C-x v b @var{backend} @key{RET} | ||
| 174 | Switch to @var{backend} for the current file. | ||
| 175 | @end table | ||
| 176 | |||
| 177 | @kindex C-x v b | ||
| 178 | @findex vc-switch-backend | ||
| 179 | @kbd{C-x v b} does not change the buffer contents, or any files; it | ||
| 180 | only changes VC's perspective on how to handle the file. Any | ||
| 181 | subsequent VC commands for that file will operate on the back end that | ||
| 182 | is currently selected. | ||
| 183 | |||
| 184 | If the current file is registered in more than one back end, typing | ||
| 185 | @kbd{C-x v b} ``cycles'' through all of these back ends. With a | ||
| 186 | prefix argument, it asks for the back end to use in the minibuffer. | ||
| 187 | |||
| 188 | Thus, if you are using local RCS, and you want to pick up some recent | ||
| 189 | changes in the file from remote CVS, first visit the file, then type | ||
| 190 | @kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m | ||
| 191 | @key{RET}} to merge the news | ||
| 192 | @iftex | ||
| 193 | (@pxref{Merging,,,emacs, the Emacs Manual}). | ||
| 194 | @end iftex | ||
| 195 | @ifnottex | ||
| 196 | (@pxref{Merging}). | ||
| 197 | @end ifnottex | ||
| 198 | You can then switch back to RCS by typing @kbd{C-x v b} again, and | ||
| 199 | continue to edit locally. | ||
| 200 | |||
| 201 | But if you do this, the revision numbers in the RCS master no longer | ||
| 202 | correspond to those of CVS. Technically, this is not a problem, but | ||
| 203 | it can become difficult to keep track of what is in the CVS repository | ||
| 204 | and what is not. So we suggest that you return from time to time to | ||
| 205 | CVS-only operation, by committing your local changes back to the | ||
| 206 | repository using @kbd{C-u C-x v v cvs @key{RET}}. | ||
| 207 | |||
| 208 | @node Revision Tags | ||
| 209 | @subsection Revision Tags | ||
| 210 | @cindex tags and version control | ||
| 211 | |||
| 212 | In a VCS with per-file revision numbers (such as SCCS, RCS, or CVS) | ||
| 213 | @dfn{tag} is a named set of file versions (one for each registered | ||
| 214 | file) that you can treat as a unit. In a VCS with per-repository | ||
| 215 | version numbers (Subversion and most later ones) a tag is simply | ||
| 216 | a symbolic name for a revision. | ||
| 217 | |||
| 218 | One important kind of tag is a @dfn{release}, a (theoretically) | ||
| 219 | stable version of the system that is ready for distribution to users. | ||
| 220 | |||
| 221 | @menu | ||
| 222 | * Making Revision Tags:: The tag facilities. | ||
| 223 | * Revision Tag Caveats:: Things to be careful of when using tags. | ||
| 224 | @end menu | ||
| 225 | |||
| 226 | @node Making Revision Tags | ||
| 227 | @subsubsection Making and Using Revision Tags | ||
| 228 | |||
| 229 | There are two basic commands for tags; one makes a | ||
| 230 | tag with a given name, the other retrieves a named tag. | ||
| 231 | |||
| 232 | @table @code | ||
| 233 | @kindex C-x v s | ||
| 234 | @findex vc-create-tag | ||
| 235 | @item C-x v s @var{name} @key{RET} | ||
| 236 | Define the working revision of every registered file in or under the | ||
| 237 | current directory as a tag named @var{name} | ||
| 238 | (@code{vc-create-tag}). | ||
| 239 | |||
| 240 | @kindex C-x v r | ||
| 241 | @findex vc-retrieve-tag | ||
| 242 | @item C-x v r @var{name} @key{RET} | ||
| 243 | For all registered files at or below the current directory level, | ||
| 244 | retrieve the tagged revision @var{name}. This command will | ||
| 245 | switch to a branch if @var{name} is a branch name and your VCS | ||
| 246 | distinguishes branches from tags. | ||
| 247 | (@code{vc-retrieve-tag}). | ||
| 248 | |||
| 249 | This command reports an error if any files are locked at or below the | ||
| 250 | current directory, without changing anything; this is to avoid | ||
| 251 | overwriting work in progress. | ||
| 252 | @end table | ||
| 253 | |||
| 254 | Tags are inexpensive, so you need not hesitate to create them whenever | ||
| 255 | they are useful. Branches vary in cost depending on your VCS; in | ||
| 256 | older ones they may be expensive. | ||
| 257 | |||
| 258 | You can give a tag or branch name as an argument to @kbd{C-x v =} or | ||
| 259 | @kbd{C-x v ~} | ||
| 260 | @iftex | ||
| 261 | (@pxref{Old Revisions,,,emacs, the Emacs Manual}). | ||
| 262 | @end iftex | ||
| 263 | @ifnottex | ||
| 264 | (@pxref{Old Revisions}). | ||
| 265 | @end ifnottex | ||
| 266 | Thus, you can use it to compare a tagged version against the current files, | ||
| 267 | or two tagged versions against each other. | ||
| 268 | |||
| 269 | @node Revision Tag Caveats | ||
| 270 | @subsubsection Revision Tag Caveats | ||
| 271 | |||
| 272 | For SCCS, VC implements tags itself; these tags are visible only | ||
| 273 | through VC. Most later systems (including CVS, Subversion, bzr, git, | ||
| 274 | and hg) have a native tag facility, and VC uses it where | ||
| 275 | available; those tags will be visible even when you bypass VC. | ||
| 276 | |||
| 277 | There is no support for VC tags using GNU Arch yet. | ||
| 278 | |||
| 279 | Under older VCSes (SCCS, RCS, CVS, early versions of Subversion), | ||
| 280 | renaming and deletion could create some difficulties with tags. This is | ||
| 281 | not a VC-specific problem, but a general design issue in version | ||
| 282 | control systems that was not solved effectively until the earliest | ||
| 283 | third-generation systems. | ||
| 284 | |||
| 285 | In a file-oriented VCS, when you rename a registered file you need | ||
| 286 | to rename its master along with it; the command @code{vc-rename-file} | ||
| 287 | will do this automatically. If you are using SCCS, you must also | ||
| 288 | update the records of the tag, to mention the file by its new name | ||
| 289 | (@code{vc-rename-file} does this, too). An old tag that refers to a | ||
| 290 | master file that no longer exists under the recorded name is invalid; | ||
| 291 | VC can no longer retrieve it. It would be beyond the scope of this | ||
| 292 | manual to explain enough about RCS and SCCS to explain how to update | ||
| 293 | the tags by hand. | ||
| 294 | |||
| 295 | Using @code{vc-rename-file} makes the tag remain valid for | ||
| 296 | retrieval, but it does not solve all problems. For example, some of the | ||
| 297 | files in your program probably refer to others by name. At the very | ||
| 298 | least, the makefile probably mentions the file that you renamed. If you | ||
| 299 | retrieve an old tag, the renamed file is retrieved under its new | ||
| 300 | name, which is not the name that the makefile expects. So the program | ||
| 301 | won't really work as retrieved. | ||
| 302 | |||
| 303 | @node Miscellaneous VC | 8 | @node Miscellaneous VC |
| 304 | @subsection Miscellaneous Commands and Features of VC | 9 | @subsection Miscellaneous Commands and Features of VC |
| 305 | 10 | ||
| @@ -307,52 +12,55 @@ won't really work as retrieved. | |||
| 307 | 12 | ||
| 308 | @menu | 13 | @menu |
| 309 | * Change Logs and VC:: Generating a change log file from log entries. | 14 | * Change Logs and VC:: Generating a change log file from log entries. |
| 310 | * Renaming and VC:: A command to rename both the source and master | 15 | * VC Delete/Rename:: Deleting and renaming version-controlled files. |
| 311 | file correctly. | 16 | * Revision Tags:: Symbolic names for revisions. |
| 312 | * Version Headers:: Inserting version control headers into working files. | 17 | * Version Headers:: Inserting version control headers into working files. |
| 313 | @end menu | 18 | @end menu |
| 314 | 19 | ||
| 315 | @node Change Logs and VC | 20 | @node Change Logs and VC |
| 316 | @subsubsection Change Logs and VC | 21 | @subsubsection Change Logs and VC |
| 317 | 22 | ||
| 318 | If you use RCS or CVS for a program and also maintain a change log | 23 | If you use RCS or CVS for a program with a @file{ChangeLog} file |
| 319 | file for it | ||
| 320 | @iftex | 24 | @iftex |
| 321 | (@pxref{Change Log,,,emacs, the Emacs Manual}), | 25 | (@pxref{Change Log,,,emacs, the Emacs Manual}), |
| 322 | @end iftex | 26 | @end iftex |
| 323 | @ifnottex | 27 | @ifnottex |
| 324 | (@pxref{Change Log}), | 28 | (@pxref{Change Log}), |
| 325 | @end ifnottex | 29 | @end ifnottex |
| 326 | you can generate change log entries automatically from the version | 30 | you can generate change log entries from the version control log |
| 327 | control log entries: | 31 | entries of previous commits. |
| 32 | |||
| 33 | Note that this only works with RCS or CVS. This procedure would be | ||
| 34 | particularly incorrect on a modern changeset-based version control | ||
| 35 | system, where changes to the @file{ChangeLog} file would normally be | ||
| 36 | committed as part of a changeset. In that case, you should write the | ||
| 37 | change log entries first, then pull them into the @samp{*vc-log*} | ||
| 38 | buffer when you commit | ||
| 39 | @iftex | ||
| 40 | (@pxref{Log Buffer,,,emacs, the Emacs Manual}). | ||
| 41 | @end iftex | ||
| 42 | @ifnottex | ||
| 43 | (@pxref{Log Buffer}). | ||
| 44 | @end ifnottex | ||
| 328 | 45 | ||
| 329 | @table @kbd | 46 | @table @kbd |
| 330 | @item C-x v a | 47 | @item C-x v a |
| 331 | @kindex C-x v a | 48 | @kindex C-x v a |
| 332 | @findex vc-update-change-log | 49 | @findex vc-update-change-log |
| 333 | Visit the current directory's change log file and, for registered files | 50 | Visit the current directory's @file{ChangeLog} file and, for |
| 334 | in that directory, create new entries for versions checked in since the | 51 | registered files in that directory, create new entries for versions |
| 335 | most recent entry in the change log file. | 52 | committed since the most recent change log entry |
| 336 | (@code{vc-update-change-log}). | 53 | (@code{vc-update-change-log}). |
| 337 | 54 | ||
| 338 | This command works with RCS or CVS only, not with any of the other | ||
| 339 | back ends. | ||
| 340 | |||
| 341 | @item C-u C-x v a | 55 | @item C-u C-x v a |
| 342 | As above, but only find entries for the current buffer's file. | 56 | As above, but only find entries for the current buffer's file. |
| 343 | |||
| 344 | @item M-1 C-x v a | ||
| 345 | As above, but find entries for all the currently visited files that are | ||
| 346 | maintained with version control. This works only with RCS, and it puts | ||
| 347 | all entries in the log for the default directory, which may not be | ||
| 348 | appropriate. | ||
| 349 | @end table | 57 | @end table |
| 350 | 58 | ||
| 351 | For example, suppose the first line of @file{ChangeLog} is dated | 59 | For example, suppose the first line of @file{ChangeLog} is dated |
| 352 | 1999-04-10, and that the only check-in since then was by Nathaniel | 60 | 1999-04-10, and that the only check-in since then was by Nathaniel |
| 353 | Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log | 61 | Bowditch to @file{rcs2log} on 1999-05-22 with log entry @samp{Ignore |
| 354 | messages that start with `#'.}. Then @kbd{C-x v a} visits | 62 | log messages that start with `#'.}. Then @kbd{C-x v a} inserts this |
| 355 | @file{ChangeLog} and inserts text like this: | 63 | @file{ChangeLog} entry: |
| 356 | 64 | ||
| 357 | @iftex | 65 | @iftex |
| 358 | @medbreak | 66 | @medbreak |
| @@ -369,17 +77,11 @@ messages that start with `#'.}. Then @kbd{C-x v a} visits | |||
| 369 | @end iftex | 77 | @end iftex |
| 370 | 78 | ||
| 371 | @noindent | 79 | @noindent |
| 372 | You can then edit the new change log entry further as you wish. | 80 | If the version control log entry specifies a function name (in |
| 373 | 81 | parenthesis at the beginning of a line), that is reflected in the | |
| 374 | Some of the new change log entries may duplicate what's already in | 82 | @file{ChangeLog} entry. For example, if a log entry for @file{vc.el} |
| 375 | ChangeLog. You will have to remove these duplicates by hand. | 83 | is @samp{(vc-do-command): Check call-process status.}, the |
| 376 | 84 | @file{ChangeLog} entry is: | |
| 377 | Normally, the log entry for file @file{foo} is displayed as @samp{* | ||
| 378 | foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted | ||
| 379 | if the text of the log entry starts with @w{@samp{(@var{functionname}): | ||
| 380 | }}. For example, if the log entry for @file{vc.el} is | ||
| 381 | @samp{(vc-do-command): Check call-process status.}, then the text in | ||
| 382 | @file{ChangeLog} looks like this: | ||
| 383 | 85 | ||
| 384 | @iftex | 86 | @iftex |
| 385 | @medbreak | 87 | @medbreak |
| @@ -395,221 +97,184 @@ if the text of the log entry starts with @w{@samp{(@var{functionname}): | |||
| 395 | @medbreak | 97 | @medbreak |
| 396 | @end iftex | 98 | @end iftex |
| 397 | 99 | ||
| 398 | When @kbd{C-x v a} adds several change log entries at once, it groups | 100 | When @kbd{C-x v a} adds several change log entries at once, it |
| 399 | related log entries together if they all are checked in by the same | 101 | groups related log entries together if they all are checked in by the |
| 400 | author at nearly the same time. If the log entries for several such | 102 | same author at nearly the same time. If the log entries for several |
| 401 | files all have the same text, it coalesces them into a single entry. | 103 | such files all have the same text, it coalesces them into a single |
| 402 | For example, suppose the most recent check-ins have the following log | 104 | entry. |
| 403 | entries: | ||
| 404 | 105 | ||
| 405 | @flushleft | 106 | @node VC Delete/Rename |
| 406 | @bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.} | 107 | @subsubsection Deleting and Renaming Version-Controlled Files |
| 407 | @bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.} | 108 | @cindex renaming version-controlled files |
| 408 | @bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.} | ||
| 409 | @end flushleft | ||
| 410 | 109 | ||
| 411 | @noindent | 110 | @table @kbd |
| 412 | They appear like this in @file{ChangeLog}: | 111 | @item M-x vc-delete-file |
| 413 | 112 | Prompt for a file name, delete the file from the working tree, and | |
| 414 | @iftex | 113 | schedule the deletion for committing. |
| 415 | @medbreak | ||
| 416 | @end iftex | ||
| 417 | @smallexample | ||
| 418 | @group | ||
| 419 | 1999-04-01 Nathaniel Bowditch <nat@@apn.org> | ||
| 420 | 114 | ||
| 421 | * vc.texinfo: Fix expansion typos. | 115 | @item M-x vc-rename-file |
| 116 | Prompt for two file names, @var{VAR} and @var{OLD}, rename them in the | ||
| 117 | working tree, and schedule the renaming for committing. | ||
| 118 | @end table | ||
| 422 | 119 | ||
| 423 | * vc.el, vc-hooks.el: Don't call expand-file-name. | 120 | @findex vc-delete-file |
| 424 | @end group | 121 | If you wish to delete a version-controlled file, use the command |
| 425 | @end smallexample | 122 | @kbd{M-x vc-delete-file}. This prompts for the file name, and deletes |
| 123 | it via the version control system. The file is removed from the | ||
| 124 | working tree, and in the VC Directory buffer | ||
| 426 | @iftex | 125 | @iftex |
| 427 | @medbreak | 126 | (@pxref{VC Directory Mode}), |
| 428 | @end iftex | 127 | @end iftex |
| 128 | @ifnottex | ||
| 129 | (@pxref{VC Directory Mode}), | ||
| 130 | @end ifnottex | ||
| 131 | it is displayed with the @samp{removed} status. When you commit it, | ||
| 132 | the deletion takes effect in the repository. | ||
| 429 | 133 | ||
| 430 | Normally, @kbd{C-x v a} separates log entries by a blank line, but you | 134 | @findex vc-rename-file |
| 431 | can mark several related log entries to be clumped together (without an | 135 | To rename a version-controlled file, type @kbd{M-x vc-rename-file}. |
| 432 | intervening blank line) by starting the text of each related log entry | 136 | This prompts for two arguments: the name of the file you wish to |
| 433 | with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label | 137 | rename, and the new name; then it performs the renaming via the |
| 434 | itself is not copied to @file{ChangeLog}. For example, suppose the log | 138 | version control system. The renaming takes effect immediately in the |
| 435 | entries are: | 139 | working tree, and takes effect in the repository when you commit the |
| 140 | renamed file. | ||
| 141 | |||
| 142 | On modern version control systems that have built-in support for | ||
| 143 | renaming, the renamed file retains the full change history of the | ||
| 144 | original file. On CVS and older version control systems, the | ||
| 145 | @code{vc-rename-file} command actually works by creating a copy of the | ||
| 146 | old file under the new name, registering it, and deleting the old | ||
| 147 | file. In this case, the change history is not preserved. | ||
| 436 | 148 | ||
| 437 | @flushleft | 149 | @node Revision Tags |
| 438 | @bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.} | 150 | @subsubsection Revision Tags |
| 439 | @bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.} | 151 | @cindex revision tag |
| 440 | @bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.} | 152 | @cindex tags for version control |
| 441 | @end flushleft | ||
| 442 | 153 | ||
| 443 | @noindent | 154 | Most version control systems allow you to apply a @dfn{revision tag} |
| 444 | Then the text in @file{ChangeLog} looks like this: | 155 | to a specific version of a version-controlled tree. On modern |
| 156 | changeset-based version control systems, a revision tag is simply a | ||
| 157 | symbolic name for a particular revision. On older file-based systems | ||
| 158 | like CVS, each tag is added to the entire set of version-controlled | ||
| 159 | files, allowing them to be handled as a unit. Revision tags are | ||
| 160 | commonly used to identify releases that are distributed to users. | ||
| 445 | 161 | ||
| 446 | @iftex | 162 | There are two basic commands for tags; one makes a tag with a given |
| 447 | @medbreak | 163 | name, the other retrieves a named tag. |
| 448 | @end iftex | ||
| 449 | @smallexample | ||
| 450 | @group | ||
| 451 | 1999-04-01 Nathaniel Bowditch <nat@@apn.org> | ||
| 452 | 164 | ||
| 453 | * vc.texinfo: Fix expansion typos. | 165 | @table @code |
| 454 | * vc.el, vc-hooks.el: Don't call expand-file-name. | 166 | @kindex C-x v s |
| 455 | @end group | 167 | @findex vc-create-tag |
| 456 | @end smallexample | 168 | @item C-x v s @var{name} @key{RET} |
| 457 | @iftex | 169 | Define the working revision of every registered file in or under the |
| 458 | @medbreak | 170 | current directory as a tag named @var{name} |
| 459 | @end iftex | 171 | (@code{vc-create-tag}). |
| 460 | 172 | ||
| 461 | A log entry whose text begins with @samp{#} is not copied to | 173 | @kindex C-x v r |
| 462 | @file{ChangeLog}. For example, if you merely fix some misspellings in | 174 | @findex vc-retrieve-tag |
| 463 | comments, you can log the change with an entry beginning with @samp{#} | 175 | @item C-x v r @var{name} @key{RET} |
| 464 | to avoid putting such trivia into @file{ChangeLog}. | 176 | For all registered files at or below the current directory level, |
| 177 | retrieve the tagged revision @var{name}. This command will switch to a | ||
| 178 | branch if @var{name} is a branch name and your VCS distinguishes | ||
| 179 | branches from tags. (@code{vc-retrieve-tag}). | ||
| 465 | 180 | ||
| 466 | @node Renaming and VC | 181 | This command reports an error if any files are locked at or below the |
| 467 | @subsubsection Renaming VC Work Files and Master Files | 182 | current directory, without changing anything; this is to avoid |
| 183 | overwriting work in progress. | ||
| 184 | @end table | ||
| 468 | 185 | ||
| 469 | @findex vc-rename-file | 186 | You can give a tag or branch name as an argument to @kbd{C-x v =} or |
| 470 | When you rename a registered file, you must also rename its master | 187 | @kbd{C-x v ~} |
| 471 | file correspondingly to get proper results. Use @code{vc-rename-file} | 188 | @iftex |
| 472 | to rename the source file as you specify, and rename its master file | 189 | (@pxref{Old Revisions,,,emacs, the Emacs Manual}). |
| 473 | accordingly. It also updates any tags (@pxref{Revision Tags}) that | 190 | @end iftex |
| 474 | mention the file, so that they use the new name; despite this, the | 191 | @ifnottex |
| 475 | tag thus modified may not completely work (@pxref{Revision Tag Caveats}). | 192 | (@pxref{Old Revisions}). |
| 193 | @end ifnottex | ||
| 194 | Thus, you can use it to compare a tagged version against the current files, | ||
| 195 | or two tagged versions against each other. | ||
| 476 | 196 | ||
| 477 | Some back ends do not provide an explicit rename operation to their | 197 | On SCCS, VC implements tags itself; these tags are visible only |
| 478 | repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v} | 198 | through VC. Most later systems (including CVS, Subversion, bzr, git, |
| 479 | on the original and renamed buffers and provide the necessary edit | 199 | and hg) have a native tag facility, and VC uses it where available; |
| 480 | log. | 200 | those tags will be visible even when you bypass VC. |
| 481 | 201 | ||
| 482 | You cannot use @code{vc-rename-file} on a file that is locked by | 202 | In a file-oriented VCS, when you rename a registered file you need |
| 483 | someone else. | 203 | to rename its master along with it; the command @code{vc-rename-file} |
| 204 | will do this automatically. If you are using SCCS, you must also | ||
| 205 | update the records of the tag, to mention the file by its new name | ||
| 206 | (@code{vc-rename-file} does this, too). An old tag that refers to a | ||
| 207 | master file that no longer exists under the recorded name is invalid; | ||
| 208 | VC can no longer retrieve it. It would be beyond the scope of this | ||
| 209 | manual to explain enough about RCS and SCCS to explain how to update | ||
| 210 | the tags by hand. Using @code{vc-rename-file} makes the tag remain | ||
| 211 | valid for retrieval, but it does not solve all problems. For example, | ||
| 212 | some of the files in your program probably refer to others by name. | ||
| 213 | At the very least, the makefile probably mentions the file that you | ||
| 214 | renamed. If you retrieve an old tag, the renamed file is retrieved | ||
| 215 | under its new name, which is not the name that the makefile expects. | ||
| 216 | So the program won't really work as retrieved. | ||
| 484 | 217 | ||
| 485 | @node Version Headers | 218 | @node Version Headers |
| 486 | @subsubsection Inserting Version Control Headers | 219 | @subsubsection Inserting Version Control Headers |
| 487 | 220 | ||
| 488 | Sometimes it is convenient to put version identification strings | 221 | On Subversion, CVS, RCS, and SCCS, you can put certain special |
| 489 | directly into working files. Certain special strings called | 222 | strings called @dfn{version headers} into a work file. When the file |
| 490 | @dfn{version headers} are replaced in each successive version by the | 223 | is committed, the version control system automatically puts the |
| 491 | number of that version, the name of the user who created it, and other | 224 | revision number, the name of the user who made the commit, and other |
| 492 | relevant information. All of the back ends that VC supports have such | 225 | relevant information into the version header. |
| 493 | a mechanism, except GNU Arch. | ||
| 494 | |||
| 495 | VC does not normally use the information contained in these headers. | ||
| 496 | The exception is RCS---with RCS, version headers are sometimes more | ||
| 497 | reliable than the master file to determine which version of the file | ||
| 498 | you are editing. Note that in a multi-branch environment, version | ||
| 499 | headers are necessary to make VC behave correctly | ||
| 500 | @iftex | ||
| 501 | (@pxref{Multi-User Branching,,,emacs, the Emacs Manual}). | ||
| 502 | @end iftex | ||
| 503 | @ifnottex | ||
| 504 | (@pxref{Multi-User Branching}). | ||
| 505 | @end ifnottex | ||
| 506 | |||
| 507 | Searching for RCS version headers is controlled by the variable | ||
| 508 | @code{vc-consult-headers}. If it is non-@code{nil} (the default), | ||
| 509 | Emacs searches for headers to determine the version number you are | ||
| 510 | editing. Setting it to @code{nil} disables this feature. | ||
| 511 | 226 | ||
| 512 | Note that although CVS uses the same kind of version headers as RCS | 227 | @vindex vc-consult-headers |
| 513 | does, VC never searches for these headers if you are using CVS, | 228 | VC does not normally use the information in the version headers. As |
| 514 | regardless of the above setting. | 229 | an exception, when using RCS, Emacs uses the version header, if there |
| 230 | is one, to determine the file version, since it is often more reliable | ||
| 231 | than the RCS master file. To inhibit using the version header this | ||
| 232 | way, change the variable @code{vc-consult-headers} to @code{nil}. | ||
| 515 | 233 | ||
| 516 | @kindex C-x v h | 234 | @kindex C-x v h |
| 517 | @findex vc-insert-headers | 235 | @findex vc-insert-headers |
| 518 | You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to | ||
| 519 | insert a suitable header string. | ||
| 520 | |||
| 521 | @table @kbd | ||
| 522 | @item C-x v h | ||
| 523 | Insert headers in a file for use with your version-control system. | ||
| 524 | @end table | ||
| 525 | |||
| 526 | @vindex vc-@var{backend}-header | 236 | @vindex vc-@var{backend}-header |
| 527 | The default header string is @samp{@w{$}Id$} for RCS and | 237 | To insert a suitable header string into the current buffer, type |
| 528 | @samp{@w{%}W%} for SCCS. You can specify other headers to insert by | 238 | @kbd{C-x v h} (@code{vc-insert-headers}). This command works only on |
| 529 | setting the variables @code{vc-@var{backend}-header} where | 239 | Subversion, CVS, RCS, and SCCS. The variable |
| 530 | @var{backend} is @code{rcs} or @code{sccs}. | 240 | @code{vc-@var{backend}-header} contains the list of keywords to insert |
| 531 | 241 | into the version header; for instance, CVS uses @code{vc-cvs-header}, | |
| 532 | Instead of a single string, you can specify a list of strings; then | 242 | whose default value is @code{'("\$Id\$")}. (The extra backslashes |
| 533 | each string in the list is inserted as a separate header on a line of | 243 | prevent the string constant from being interpreted as a header, if the |
| 534 | its own. | 244 | Emacs Lisp file defining it is maintained with version control.) The |
| 535 | 245 | @kbd{C-x v h} command inserts each keyword in the list on a new line | |
| 536 | It may be necessary to use apparently-superfluous backslashes when | 246 | at point, surrounded by tabs, and inside comment delimiters if |
| 537 | writing the strings that you put in this variable. For instance, you | 247 | necessary. |
| 538 | might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra | ||
| 539 | backslash prevents the string constant from being interpreted as a | ||
| 540 | header, if the Emacs Lisp file containing it is maintained with | ||
| 541 | version control. | ||
| 542 | |||
| 543 | @vindex vc-comment-alist | ||
| 544 | Each header is inserted surrounded by tabs, inside comment delimiters, | ||
| 545 | on a new line at point. Normally the ordinary comment | ||
| 546 | start and comment end strings of the current mode are used, but for | ||
| 547 | certain modes, there are special comment delimiters for this purpose; | ||
| 548 | the variable @code{vc-comment-alist} specifies them. Each element of | ||
| 549 | this list has the form @code{(@var{mode} @var{starter} @var{ender})}. | ||
| 550 | 248 | ||
| 551 | @vindex vc-static-header-alist | 249 | @vindex vc-static-header-alist |
| 552 | The variable @code{vc-static-header-alist} specifies further strings | 250 | The variable @code{vc-static-header-alist} specifies further strings |
| 553 | to add based on the name of the buffer. Its value should be a list of | 251 | to add based on the name of the buffer. Its value should be a list of |
| 554 | elements of the form @code{(@var{regexp} . @var{format})}. Whenever | 252 | elements of the form @code{(@var{regexp} . @var{format})}. Whenever |
| 555 | @var{regexp} matches the buffer name, @var{format} is inserted as part | 253 | @var{regexp} matches the buffer name, @var{format} is also inserted as |
| 556 | of the header. A header line is inserted for each element that matches | 254 | part of the version header. A @samp{%s} in @var{format} is replaced |
| 557 | the buffer name, and for each string specified by | 255 | with the file's version control type. |
| 558 | @code{vc-@var{backend}-header}. The header line is made by processing the | ||
| 559 | string from @code{vc-@var{backend}-header} with the format taken from the | ||
| 560 | element. The default value for @code{vc-static-header-alist} is as follows: | ||
| 561 | |||
| 562 | @example | ||
| 563 | @group | ||
| 564 | (("\\.c$" . | ||
| 565 | "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\ | ||
| 566 | #endif /* lint */\n")) | ||
| 567 | @end group | ||
| 568 | @end example | ||
| 569 | |||
| 570 | @noindent | ||
| 571 | It specifies insertion of text of this form: | ||
| 572 | |||
| 573 | @example | ||
| 574 | @group | ||
| 575 | |||
| 576 | #ifndef lint | ||
| 577 | static char vcid[] = "@var{string}"; | ||
| 578 | #endif /* lint */ | ||
| 579 | @end group | ||
| 580 | @end example | ||
| 581 | |||
| 582 | @noindent | ||
| 583 | Note that the text above starts with a blank line. | ||
| 584 | |||
| 585 | If you use more than one version header in a file, put them close | ||
| 586 | together in the file. The mechanism in @code{revert-buffer} that | ||
| 587 | preserves markers may not handle markers positioned between two version | ||
| 588 | headers. | ||
| 589 | 256 | ||
| 590 | @node Customizing VC | 257 | @node Customizing VC |
| 591 | @subsection Customizing VC | 258 | @subsection Customizing VC |
| 592 | 259 | ||
| 593 | @vindex vc-handled-backends | 260 | @vindex vc-handled-backends |
| 594 | The variable @code{vc-handled-backends} determines which version | 261 | The variable @code{vc-handled-backends} determines which version |
| 595 | control systems VC should handle. The default value is @code{(RCS CVS | 262 | control systems VC should handle. The default value is @code{(RCS CVS |
| 596 | SVN SCCS Bzr Git Hg Mtn Arch)}, so it contains all the version systems | 263 | SVN SCCS Bzr Git Hg Mtn Arch)}, so it contains all the version systems |
| 597 | that are currently supported. If you want VC to ignore one or more of | 264 | that are currently supported. If you want VC to ignore one or more of |
| 598 | these systems, exclude its name from the list. To disable VC entirely, | 265 | these systems, exclude its name from the list. To disable VC |
| 599 | set this variable to @code{nil}. | 266 | entirely, set this variable to @code{nil}. |
| 600 | 267 | ||
| 601 | The order of systems in the list is significant: when you visit a file | 268 | The order of systems in the list is significant: when you visit a |
| 602 | registered in more than one system (@pxref{Local Version Control}), VC | 269 | file registered in more than one system, VC uses the system that comes |
| 603 | uses the system that comes first in @code{vc-handled-backends} by | 270 | first in @code{vc-handled-backends} by default. The order is also |
| 604 | default. The order is also significant when you register a file for | 271 | significant when you register a file for the first time |
| 605 | the first time, see | ||
| 606 | @iftex | 272 | @iftex |
| 607 | @ref{Registering,,,emacs, the Emacs Manual}, | 273 | (@pxref{Registering,,,emacs, the Emacs Manual}). |
| 608 | @end iftex | 274 | @end iftex |
| 609 | @ifnottex | 275 | @ifnottex |
| 610 | @ref{Registering}, | 276 | (@pxref{Registering}). |
| 611 | @end ifnottex | 277 | @end ifnottex |
| 612 | for details. | ||
| 613 | 278 | ||
| 614 | @menu | 279 | @menu |
| 615 | * General VC Options:: Options that apply to multiple back ends. | 280 | * General VC Options:: Options that apply to multiple back ends. |
| @@ -626,40 +291,27 @@ maintained with version control. If you want to make backup files even | |||
| 626 | for files that use version control, set the variable | 291 | for files that use version control, set the variable |
| 627 | @code{vc-make-backup-files} to a non-@code{nil} value. | 292 | @code{vc-make-backup-files} to a non-@code{nil} value. |
| 628 | 293 | ||
| 629 | @vindex vc-keep-workfiles | ||
| 630 | Normally the work file exists all the time, whether it is locked or | ||
| 631 | not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking | ||
| 632 | in a new version with @kbd{C-x v v} deletes the work file; but any | ||
| 633 | attempt to visit the file with Emacs creates it again. (With CVS, work | ||
| 634 | files are always kept.) | ||
| 635 | |||
| 636 | @vindex vc-follow-symlinks | 294 | @vindex vc-follow-symlinks |
| 637 | Editing a version-controlled file through a symbolic link can be | 295 | @cindex symbolic links (and version control) |
| 638 | dangerous. It bypasses the version control system---you can edit the | 296 | Editing a version-controlled file through a symbolic link may cause |
| 639 | file without locking it, and fail to check your changes in. Also, | 297 | unexpected results, if you are unaware that the underlying file is |
| 640 | your changes might overwrite those of another user. To protect against | 298 | version-controlled. The variable @code{vc-follow-symlinks} controls |
| 641 | this, VC checks each symbolic link that you visit, to see if it points | 299 | what Emacs does if you try to visit a symbolic link pointing to a |
| 642 | to a file under version control. | 300 | version-controlled file. If the value is @code{ask} (the default), |
| 643 | 301 | Emacs asks for confirmation. If it is @code{nil}, Emacs just displays | |
| 644 | The variable @code{vc-follow-symlinks} controls what to do when a | 302 | a warning message. If it is @code{t}, Emacs automatically follows the |
| 645 | symbolic link points to a version-controlled file. If it is @code{nil}, | 303 | link and visits the real file instead. |
| 646 | VC only displays a warning message. If it is @code{t}, VC automatically | ||
| 647 | follows the link, and visits the real file instead, telling you about | ||
| 648 | this in the echo area. If the value is @code{ask} (the default), VC | ||
| 649 | asks you each time whether to follow the link. | ||
| 650 | 304 | ||
| 651 | @vindex vc-suppress-confirm | 305 | @vindex vc-suppress-confirm |
| 652 | If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v} | 306 | If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v} |
| 653 | and @kbd{C-x v i} can save the current buffer without asking, and | 307 | and @kbd{C-x v i} can save the current buffer without asking, and |
| 654 | @kbd{C-x v u} also operates without asking for confirmation. (This | 308 | @kbd{C-x v u} also operates without asking for confirmation. |
| 655 | variable does not affect @kbd{C-x v c}; that operation is so drastic | ||
| 656 | that it should always ask for confirmation.) | ||
| 657 | 309 | ||
| 658 | @vindex vc-command-messages | 310 | @vindex vc-command-messages |
| 659 | VC mode does much of its work by running the shell commands for the | 311 | VC mode does much of its work by running the shell commands for the |
| 660 | appropriate backend. If @code{vc-command-messages} is non-@code{nil}, VC | 312 | appropriate version control system. If @code{vc-command-messages} is |
| 661 | displays messages to indicate which shell commands it runs, and | 313 | non-@code{nil}, VC displays messages to indicate which shell commands |
| 662 | additional messages when the commands finish. | 314 | it runs, and additional messages when the commands finish. |
| 663 | 315 | ||
| 664 | @vindex vc-path | 316 | @vindex vc-path |
| 665 | You can specify additional directories to search for version control | 317 | You can specify additional directories to search for version control |
| @@ -715,37 +367,16 @@ the variable @code{vc-mistrust-permissions} affects SCCS use, but | |||
| 715 | @node CVS Options | 367 | @node CVS Options |
| 716 | @subsubsection Options specific for CVS | 368 | @subsubsection Options specific for CVS |
| 717 | 369 | ||
| 718 | @cindex locking (CVS) | 370 | @vindex vc-cvs-global-switches |
| 719 | By default, CVS does not use locking to coordinate the activities of | 371 | You can specify additional command line options to pass to all CVS |
| 720 | several users; anyone can change a work file at any time. However, | 372 | operations in the variable @code{vc-cvs-global-switches}. These |
| 721 | there are ways to restrict this, resulting in behavior that resembles | 373 | switches are inserted immediately after the @code{cvs} command, before |
| 722 | locking. | 374 | the name of the operation to invoke. |
| 723 | |||
| 724 | @cindex CVSREAD environment variable (CVS) | ||
| 725 | For one thing, you can set the @env{CVSREAD} environment variable | ||
| 726 | (the value you use makes no difference). If this variable is defined, | ||
| 727 | CVS makes your work files read-only by default. In Emacs, you must | ||
| 728 | type @kbd{C-x v v} to make the file writable, so that editing works | ||
| 729 | in fact similar as if locking was used. Note however, that no actual | ||
| 730 | locking is performed, so several users can make their files writable | ||
| 731 | at the same time. When setting @env{CVSREAD} for the first time, make | ||
| 732 | sure to check out all your modules anew, so that the file protections | ||
| 733 | are set correctly. | ||
| 734 | |||
| 735 | @cindex cvs watch feature | ||
| 736 | @cindex watching files (CVS) | ||
| 737 | Another way to achieve something similar to locking is to use the | ||
| 738 | @dfn{watch} feature of CVS. If a file is being watched, CVS makes it | ||
| 739 | read-only by default, and you must also use @kbd{C-x v v} in Emacs to | ||
| 740 | make it writable. VC calls @code{cvs edit} to make the file writable, | ||
| 741 | and CVS takes care to notify other developers of the fact that you | ||
| 742 | intend to change the file. See the CVS documentation for details on | ||
| 743 | using the watch feature. | ||
| 744 | 375 | ||
| 745 | @vindex vc-stay-local | 376 | @vindex vc-stay-local |
| 746 | @vindex vc-cvs-stay-local | 377 | @vindex vc-cvs-stay-local |
| 747 | @cindex remote repositories (CVS) | 378 | @cindex remote repositories (CVS) |
| 748 | When a file's repository is on a remote machine, VC tries to keep | 379 | When using a CVS repository on a remote machine, VC can try keeping |
| 749 | network interactions to a minimum. This is controlled by the variable | 380 | network interactions to a minimum. This is controlled by the variable |
| 750 | @code{vc-cvs-stay-local}. There is another variable, | 381 | @code{vc-cvs-stay-local}. There is another variable, |
| 751 | @code{vc-stay-local}, which enables the feature also for other back | 382 | @code{vc-stay-local}, which enables the feature also for other back |
| @@ -753,36 +384,58 @@ ends that support it, including CVS. In the following, we will talk | |||
| 753 | only about @code{vc-cvs-stay-local}, but everything applies to | 384 | only about @code{vc-cvs-stay-local}, but everything applies to |
| 754 | @code{vc-stay-local} as well. | 385 | @code{vc-stay-local} as well. |
| 755 | 386 | ||
| 756 | If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses | 387 | If @code{vc-cvs-stay-local} is @code{t} (the default), VC determines |
| 757 | only the entry in the local CVS subdirectory to determine the file's | 388 | the version control status of each file using only the entry in the |
| 758 | state (and possibly information returned by previous CVS commands). | 389 | local CVS subdirectory and the information returned by previous CVS |
| 759 | One consequence of this is that when you have modified a file, and | 390 | commands. As a consequence, if you have modified a file and somebody |
| 760 | somebody else has already checked in other changes to the file, you | 391 | else has checked in other changes, you will not be notified of the |
| 761 | are not notified of it until you actually try to commit. (But you can | 392 | conflict until you try to commit. |
| 762 | try to pick up any recent changes from the repository first, using | 393 | |
| 763 | @kbd{C-x v m @key{RET}}, | 394 | If you change @code{vc-cvs-stay-local} to @code{nil}, VC queries the |
| 395 | remote repository @emph{before} it decides what to do in | ||
| 396 | @code{vc-next-action} (@kbd{C-x v v}), just as it does for local | ||
| 397 | repositories. | ||
| 398 | |||
| 399 | You can also set @code{vc-cvs-stay-local} to a regular expression | ||
| 400 | that is matched against the repository host name; VC then stays local | ||
| 401 | only for repositories from hosts that match the pattern. | ||
| 402 | |||
| 403 | @cindex automatic version backups | ||
| 404 | When using a remote repository, Emacs normally makes @dfn{automatic | ||
| 405 | version backups} of the original versions of each edited file. These | ||
| 406 | local backups are made whenever you save the first changes to a file, | ||
| 407 | and they are removed after you commit your changes to the repository. | ||
| 408 | (Note that these are not the same as ordinary Emacs backup files; | ||
| 764 | @iftex | 409 | @iftex |
| 765 | @pxref{Merging,,,emacs, the Emacs Manual}). | 410 | @pxref{Backup,,,emacs, the Emacs Manual}.) |
| 766 | @end iftex | 411 | @end iftex |
| 767 | @ifnottex | 412 | @ifnottex |
| 768 | @pxref{Merging}). | 413 | @pxref{Backup}.) |
| 769 | @end ifnottex | 414 | @end ifnottex |
| 415 | Commands like @kbd{C-x v =} and @kbd{C-x v u} make use of automatic | ||
| 416 | version backups, if possible, to avoid having to access the network. | ||
| 770 | 417 | ||
| 771 | When @code{vc-cvs-stay-local} is @code{t}, VC also makes local | 418 | Setting @code{vc-cvs-stay-local} to @code{nil} disables the making |
| 772 | version backups, so that simple diff and revert operations are | 419 | of automatic version backups. |
| 773 | completely local (@pxref{Version Backups}). | ||
| 774 | |||
| 775 | On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil}, | ||
| 776 | then VC queries the remote repository @emph{before} it decides what to | ||
| 777 | do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local | ||
| 778 | repositories. It also does not make any version backups. | ||
| 779 | 420 | ||
| 780 | You can also set @code{vc-cvs-stay-local} to a regular expression | 421 | @cindex manual version backups |
| 781 | that is matched against the repository host name; VC then stays local | 422 | Automatic version backups have names of the form |
| 782 | only for repositories from hosts that match the pattern. | 423 | @w{@code{@var{file}.~@var{version}.~}}. This is similar to the name |
| 424 | that @kbd{C-x v ~} saves old versions to | ||
| 425 | @iftex | ||
| 426 | (@pxref{Old Revisions,,,emacs, the Emacs Manual}), | ||
| 427 | @end iftex | ||
| 428 | @ifnottex | ||
| 429 | (@pxref{Old Revisions}), | ||
| 430 | @end ifnottex | ||
| 431 | except for the additional dot (@samp{.}) after the version. The | ||
| 432 | relevant VC commands can use both kinds of version backups. The main | ||
| 433 | difference is that the ``manual'' version backups made by @kbd{C-x v | ||
| 434 | ~} are not deleted automatically when you commit. | ||
| 783 | 435 | ||
| 784 | @vindex vc-cvs-global-switches | 436 | @cindex locking (CVS) |
| 785 | You can specify additional command line options to pass to all CVS | 437 | CVS does not use locking by default, but there are ways to enable |
| 786 | operations in the variable @code{vc-cvs-global-switches}. These | 438 | locking-like behavior using its @env{CVSREAD} or @dfn{watch} feature; |
| 787 | switches are inserted immediately after the @code{cvs} command, before | 439 | see the CVS documentation for details. If that case, you can use |
| 788 | the name of the operation to invoke. | 440 | @kbd{C-x v v} in Emacs to toggle locking, as you would for a |
| 441 | locking-based version control system (@pxref{VC With A Locking VCS}). | ||
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 37de62be976..d4f9ab747ed 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,23 @@ | |||
| 1 | 2011-12-28 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * files.texi (File Attributes, Changing Files): | ||
| 4 | Use a more-natural notation for octal numbers. | ||
| 5 | |||
| 6 | 2011-12-23 Juanma Barranquero <lekktu@gmail.com> | ||
| 7 | |||
| 8 | * variables.texi (Variables with Restricted Values): | ||
| 9 | Change reference to variable (bug#10354). | ||
| 10 | |||
| 11 | 2011-12-13 Martin Rudalics <rudalics@gmx.at> | ||
| 12 | |||
| 13 | * windows.texi (Splitting Windows): Use t instead of non-nil | ||
| 14 | when describing window-combination-resize. | ||
| 15 | |||
| 16 | 2011-12-05 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 17 | |||
| 18 | * text.texi (Special Properties): Warn against `intangible' properties | ||
| 19 | (bug#10222). | ||
| 20 | |||
| 1 | 2011-11-26 Eli Zaretskii <eliz@gnu.org> | 21 | 2011-11-26 Eli Zaretskii <eliz@gnu.org> |
| 2 | 22 | ||
| 3 | * display.texi (Truncation): | 23 | * display.texi (Truncation): |
| @@ -23,8 +43,8 @@ | |||
| 23 | 43 | ||
| 24 | 2011-11-21 Martin Rudalics <rudalics@gmx.at> | 44 | 2011-11-21 Martin Rudalics <rudalics@gmx.at> |
| 25 | 45 | ||
| 26 | * windows.texi (Windows and Frames, Splitting Windows): Fix | 46 | * windows.texi (Windows and Frames, Splitting Windows): |
| 27 | typos. | 47 | Fix typos. |
| 28 | 48 | ||
| 29 | 2011-11-21 Chong Yidong <cyd@gnu.org> | 49 | 2011-11-21 Chong Yidong <cyd@gnu.org> |
| 30 | 50 | ||
| @@ -36,8 +56,8 @@ | |||
| 36 | (Buffers and Windows): Copyedits. | 56 | (Buffers and Windows): Copyedits. |
| 37 | (Choosing Window): Document special handling of special-display-*. | 57 | (Choosing Window): Document special handling of special-display-*. |
| 38 | (Choosing Window Options): Fix display-buffer-reuse-frames doc. | 58 | (Choosing Window Options): Fix display-buffer-reuse-frames doc. |
| 39 | Don't document even-window-heights, which is going away. Clarify | 59 | Don't document even-window-heights, which is going away. |
| 40 | which options are obeyed by which action functions. | 60 | Clarify which options are obeyed by which action functions. |
| 41 | 61 | ||
| 42 | 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca> | 62 | 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| 43 | 63 | ||
| @@ -9749,7 +9769,7 @@ | |||
| 9749 | directory have been changed to reflect this. | 9769 | directory have been changed to reflect this. |
| 9750 | 9770 | ||
| 9751 | * All instances of @indentedresultt{} have been changed to | 9771 | * All instances of @indentedresultt{} have been changed to |
| 9752 | ` @result{}', using 5 spaces at the begining of the line. | 9772 | ` @result{}', using 5 spaces at the beginning of the line. |
| 9753 | 9773 | ||
| 9754 | 1989-04-24 Robert J. Chassell (bob@rice-chex.ai.mit.edu) | 9774 | 1989-04-24 Robert J. Chassell (bob@rice-chex.ai.mit.edu) |
| 9755 | 9775 | ||
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index e76b2bafd79..41392273fbd 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -946,10 +946,9 @@ If the last event came from a keyboard macro, the value is @code{macro}. | |||
| 946 | 946 | ||
| 947 | It is not easy to display a value of point in the middle of a | 947 | It is not easy to display a value of point in the middle of a |
| 948 | sequence of text that has the @code{display}, @code{composition} or | 948 | sequence of text that has the @code{display}, @code{composition} or |
| 949 | @code{intangible} property, or is invisible. Therefore, after a | 949 | is invisible. Therefore, after a command finishes and returns to the |
| 950 | command finishes and returns to the command loop, if point is within | 950 | command loop, if point is within such a sequence, the command loop |
| 951 | such a sequence, the command loop normally moves point to the edge of | 951 | normally moves point to the edge of the sequence. |
| 952 | the sequence. | ||
| 953 | 952 | ||
| 954 | A command can inhibit this feature by setting the variable | 953 | A command can inhibit this feature by setting the variable |
| 955 | @code{disable-point-adjustment}: | 954 | @code{disable-point-adjustment}: |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index cefa917a4e1..98eaf1f8ade 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -1381,7 +1381,7 @@ Operating System Interface | |||
| 1381 | * System Environment:: Distinguish the name and kind of system. | 1381 | * System Environment:: Distinguish the name and kind of system. |
| 1382 | * User Identification:: Finding the name and user id of the user. | 1382 | * User Identification:: Finding the name and user id of the user. |
| 1383 | * Time of Day:: Getting the current time. | 1383 | * Time of Day:: Getting the current time. |
| 1384 | * Time Conversion:: Converting a time from numeric form to | 1384 | * Time Conversion:: Converting a time from numeric form to |
| 1385 | calendrical data and vice versa. | 1385 | calendrical data and vice versa. |
| 1386 | * Time Parsing:: Converting a time from numeric form to text | 1386 | * Time Parsing:: Converting a time from numeric form to text |
| 1387 | and vice versa. | 1387 | and vice versa. |
| @@ -1438,7 +1438,7 @@ Tips and Conventions | |||
| 1438 | GNU Emacs Internals | 1438 | GNU Emacs Internals |
| 1439 | 1439 | ||
| 1440 | * Building Emacs:: How the dumped Emacs is made. | 1440 | * Building Emacs:: How the dumped Emacs is made. |
| 1441 | * Pure Storage:: A kludge to make preloaded Lisp functions sharable. | 1441 | * Pure Storage:: Kludge to make preloaded Lisp functions shareable. |
| 1442 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. | 1442 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. |
| 1443 | * Memory Usage:: Info about total size of Lisp objects made so far. | 1443 | * Memory Usage:: Info about total size of Lisp objects made so far. |
| 1444 | * Writing Emacs Primitives:: Writing C code for Emacs. | 1444 | * Writing Emacs Primitives:: Writing C code for Emacs. |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 86ecfd122ef..b6d0b5c7ed2 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -1115,16 +1115,11 @@ This function recursively follows symbolic links at all levels. | |||
| 1115 | @end group | 1115 | @end group |
| 1116 | 1116 | ||
| 1117 | @group | 1117 | @group |
| 1118 | (set-file-modes "~/junk/diffs" 438) | 1118 | (set-file-modes "~/junk/diffs" #o666) |
| 1119 | @result{} nil | 1119 | @result{} nil |
| 1120 | @end group | 1120 | @end group |
| 1121 | 1121 | ||
| 1122 | @group | 1122 | @group |
| 1123 | (format "%o" 438) | ||
| 1124 | @result{} "666" ; @r{Convert to octal.} | ||
| 1125 | @end group | ||
| 1126 | |||
| 1127 | @group | ||
| 1128 | % ls -l diffs | 1123 | % ls -l diffs |
| 1129 | -rw-rw-rw- 1 lewis 0 3063 Oct 30 16:00 diffs | 1124 | -rw-rw-rw- 1 lewis 0 3063 Oct 30 16:00 diffs |
| 1130 | @end group | 1125 | @end group |
| @@ -1570,10 +1565,10 @@ the bitwise complement of the ``umask'' value. | |||
| 1570 | 1565 | ||
| 1571 | The argument @var{mode} must be an integer. On most systems, only the | 1566 | The argument @var{mode} must be an integer. On most systems, only the |
| 1572 | low 9 bits of @var{mode} are meaningful. You can use the Lisp construct | 1567 | low 9 bits of @var{mode} are meaningful. You can use the Lisp construct |
| 1573 | for octal character codes to enter @var{mode}; for example, | 1568 | for octal numbers to enter @var{mode}; for example, |
| 1574 | 1569 | ||
| 1575 | @example | 1570 | @example |
| 1576 | (set-default-file-modes ?\644) | 1571 | (set-default-file-modes #o644) |
| 1577 | @end example | 1572 | @end example |
| 1578 | 1573 | ||
| 1579 | Saving a modified version of an existing file does not count as creating | 1574 | Saving a modified version of an existing file does not count as creating |
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 0168c564e34..9ef4646b50b 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi | |||
| @@ -13,7 +13,7 @@ internal aspects of GNU Emacs that may be of interest to C programmers. | |||
| 13 | 13 | ||
| 14 | @menu | 14 | @menu |
| 15 | * Building Emacs:: How the dumped Emacs is made. | 15 | * Building Emacs:: How the dumped Emacs is made. |
| 16 | * Pure Storage:: A kludge to make preloaded Lisp functions sharable. | 16 | * Pure Storage:: Kludge to make preloaded Lisp functions shareable. |
| 17 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. | 17 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. |
| 18 | * Memory Usage:: Info about total size of Lisp objects made so far. | 18 | * Memory Usage:: Info about total size of Lisp objects made so far. |
| 19 | * Writing Emacs Primitives:: Writing C code for Emacs. | 19 | * Writing Emacs Primitives:: Writing C code for Emacs. |
| @@ -196,7 +196,7 @@ function definition in pure storage. If it is non-@code{nil}, then the | |||
| 196 | function definition is copied into pure storage. | 196 | function definition is copied into pure storage. |
| 197 | 197 | ||
| 198 | This flag is @code{t} while loading all of the basic functions for | 198 | This flag is @code{t} while loading all of the basic functions for |
| 199 | building Emacs initially (allowing those functions to be sharable and | 199 | building Emacs initially (allowing those functions to be shareable and |
| 200 | non-collectible). Dumping Emacs as an executable always writes | 200 | non-collectible). Dumping Emacs as an executable always writes |
| 201 | @code{nil} in this variable, regardless of the value it actually has | 201 | @code{nil} in this variable, regardless of the value it actually has |
| 202 | before and after dumping. | 202 | before and after dumping. |
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 9d652901e53..fcb7c772936 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -701,7 +701,7 @@ init file.) | |||
| 701 | @cindex help for major mode | 701 | @cindex help for major mode |
| 702 | @cindex documentation for major mode | 702 | @cindex documentation for major mode |
| 703 | 703 | ||
| 704 | The @code{describe-mode} function is provides information about major | 704 | The @code{describe-mode} function provides information about major |
| 705 | modes. It is normally bound to @kbd{C-h m}. It uses the value of the | 705 | modes. It is normally bound to @kbd{C-h m}. It uses the value of the |
| 706 | variable @code{major-mode} (@pxref{Major Modes}), which is why every | 706 | variable @code{major-mode} (@pxref{Major Modes}), which is why every |
| 707 | major mode command needs to set that variable. | 707 | major mode command needs to set that variable. |
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index 298c7c3d1a8..46dbbb08e57 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi | |||
| @@ -1580,7 +1580,7 @@ decoding functions (@pxref{Explicit Encoding}). | |||
| 1580 | Sometimes, you need to prefer several coding systems for some | 1580 | Sometimes, you need to prefer several coding systems for some |
| 1581 | operation, rather than fix a single one. Emacs lets you specify a | 1581 | operation, rather than fix a single one. Emacs lets you specify a |
| 1582 | priority order for using coding systems. This ordering affects the | 1582 | priority order for using coding systems. This ordering affects the |
| 1583 | sorting of lists of coding sysems returned by functions such as | 1583 | sorting of lists of coding systems returned by functions such as |
| 1584 | @code{find-coding-systems-region} (@pxref{Lisp and Coding Systems}). | 1584 | @code{find-coding-systems-region} (@pxref{Lisp and Coding Systems}). |
| 1585 | 1585 | ||
| 1586 | @defun coding-system-priority-list &optional highestp | 1586 | @defun coding-system-priority-list &optional highestp |
diff --git a/doc/lispref/spellfile b/doc/lispref/spellfile index e0d77ee0541..18fb633acfd 100644 --- a/doc/lispref/spellfile +++ b/doc/lispref/spellfile | |||
| @@ -337,7 +337,6 @@ fset | |||
| 337 | fstab | 337 | fstab |
| 338 | ftp | 338 | ftp |
| 339 | fu | 339 | fu |
| 340 | funtions | ||
| 341 | garbles | 340 | garbles |
| 342 | gc | 341 | gc |
| 343 | gcpro | 342 | gcpro |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index fc12939bec5..f7f9c716162 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -3145,6 +3145,12 @@ group is separately treated as described above. | |||
| 3145 | When the variable @code{inhibit-point-motion-hooks} is non-@code{nil}, | 3145 | When the variable @code{inhibit-point-motion-hooks} is non-@code{nil}, |
| 3146 | the @code{intangible} property is ignored. | 3146 | the @code{intangible} property is ignored. |
| 3147 | 3147 | ||
| 3148 | Beware: this property operates at a very low level, and affects a lot of code | ||
| 3149 | in unexpected ways. So use it with extreme caution. A common misuse is to put | ||
| 3150 | an intangible property on invisible text, which is actually unnecessary since | ||
| 3151 | the command loop will move point outside of the invisible text at the end of | ||
| 3152 | each command anyway. @xref{Adjusting Point}. | ||
| 3153 | |||
| 3148 | @item field | 3154 | @item field |
| 3149 | @kindex field @r{(text property)} | 3155 | @kindex field @r{(text property)} |
| 3150 | Consecutive characters with the same @code{field} property constitute a | 3156 | Consecutive characters with the same @code{field} property constitute a |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 091765043e3..62f5092497a 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -1998,6 +1998,6 @@ This variable holds a list of all variables of type @code{DEFVAR_BOOL}. | |||
| 1998 | Attempting to assign them any other value will result in an error: | 1998 | Attempting to assign them any other value will result in an error: |
| 1999 | 1999 | ||
| 2000 | @example | 2000 | @example |
| 2001 | (setq window-min-height 5.0) | 2001 | (setq undo-limit 1000.0) |
| 2002 | @error{} Wrong type argument: integerp, 5.0 | 2002 | @error{} Wrong type argument: integerp, 1000.0 |
| 2003 | @end example | 2003 | @end example |
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi index 914ba5b1fd8..c89447fc139 100644 --- a/doc/lispref/vol1.texi +++ b/doc/lispref/vol1.texi | |||
| @@ -44,7 +44,7 @@ | |||
| 44 | @end ifset | 44 | @end ifset |
| 45 | 45 | ||
| 46 | @c per rms and peterb, use 10pt fonts for the main text, mostly to | 46 | @c per rms and peterb, use 10pt fonts for the main text, mostly to |
| 47 | @c save on paper cost. | 47 | @c save on paper cost. |
| 48 | @c Do this inside @tex for now, so current makeinfo does not complain. | 48 | @c Do this inside @tex for now, so current makeinfo does not complain. |
| 49 | @tex | 49 | @tex |
| 50 | @ifset smallbook | 50 | @ifset smallbook |
| @@ -1402,7 +1402,7 @@ Operating System Interface | |||
| 1402 | * System Environment:: Distinguish the name and kind of system. | 1402 | * System Environment:: Distinguish the name and kind of system. |
| 1403 | * User Identification:: Finding the name and user id of the user. | 1403 | * User Identification:: Finding the name and user id of the user. |
| 1404 | * Time of Day:: Getting the current time. | 1404 | * Time of Day:: Getting the current time. |
| 1405 | * Time Conversion:: Converting a time from numeric form to | 1405 | * Time Conversion:: Converting a time from numeric form to |
| 1406 | calendrical data and vice versa. | 1406 | calendrical data and vice versa. |
| 1407 | * Time Parsing:: Converting a time from numeric form to text | 1407 | * Time Parsing:: Converting a time from numeric form to text |
| 1408 | and vice versa. | 1408 | and vice versa. |
| @@ -1458,7 +1458,7 @@ Tips and Conventions | |||
| 1458 | GNU Emacs Internals | 1458 | GNU Emacs Internals |
| 1459 | 1459 | ||
| 1460 | * Building Emacs:: How the dumped Emacs is made. | 1460 | * Building Emacs:: How the dumped Emacs is made. |
| 1461 | * Pure Storage:: A kludge to make preloaded Lisp functions sharable. | 1461 | * Pure Storage:: Kludge to make preloaded Lisp functions shareable. |
| 1462 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. | 1462 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. |
| 1463 | * Memory Usage:: Info about total size of Lisp objects made so far. | 1463 | * Memory Usage:: Info about total size of Lisp objects made so far. |
| 1464 | * Writing Emacs Primitives:: Writing C code for Emacs. | 1464 | * Writing Emacs Primitives:: Writing C code for Emacs. |
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi index 1f84b267c9b..d45d23da365 100644 --- a/doc/lispref/vol2.texi +++ b/doc/lispref/vol2.texi | |||
| @@ -1401,7 +1401,7 @@ Operating System Interface | |||
| 1401 | * System Environment:: Distinguish the name and kind of system. | 1401 | * System Environment:: Distinguish the name and kind of system. |
| 1402 | * User Identification:: Finding the name and user id of the user. | 1402 | * User Identification:: Finding the name and user id of the user. |
| 1403 | * Time of Day:: Getting the current time. | 1403 | * Time of Day:: Getting the current time. |
| 1404 | * Time Conversion:: Converting a time from numeric form to | 1404 | * Time Conversion:: Converting a time from numeric form to |
| 1405 | calendrical data and vice versa. | 1405 | calendrical data and vice versa. |
| 1406 | * Time Parsing:: Converting a time from numeric form to text | 1406 | * Time Parsing:: Converting a time from numeric form to text |
| 1407 | and vice versa. | 1407 | and vice versa. |
| @@ -1457,7 +1457,7 @@ Tips and Conventions | |||
| 1457 | GNU Emacs Internals | 1457 | GNU Emacs Internals |
| 1458 | 1458 | ||
| 1459 | * Building Emacs:: How the dumped Emacs is made. | 1459 | * Building Emacs:: How the dumped Emacs is made. |
| 1460 | * Pure Storage:: A kludge to make preloaded Lisp functions sharable. | 1460 | * Pure Storage:: Kludge to make preloaded Lisp functions shareable. |
| 1461 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. | 1461 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. |
| 1462 | * Memory Usage:: Info about total size of Lisp objects made so far. | 1462 | * Memory Usage:: Info about total size of Lisp objects made so far. |
| 1463 | * Writing Emacs Primitives:: Writing C code for Emacs. | 1463 | * Writing Emacs Primitives:: Writing C code for Emacs. |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 437b6db8d58..df631158689 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -793,20 +793,20 @@ the new root window. | |||
| 793 | 793 | ||
| 794 | @defopt window-combination-resize | 794 | @defopt window-combination-resize |
| 795 | If this variable is @code{nil}, @code{split-window} can only split a | 795 | If this variable is @code{nil}, @code{split-window} can only split a |
| 796 | window (denoted by @var{window}) if @var{window}'s screen area is | 796 | window (denoted by @var{window}) if @var{window}'s screen area is large |
| 797 | large enough to accommodate both itself and the new window. This is | 797 | enough to accommodate both itself and the new window. |
| 798 | the default. | 798 | |
| 799 | 799 | If this variable is @code{t}, @code{split-window} tries to resize all | |
| 800 | If this variable is non-@code{nil}, @code{split-window} tries to | 800 | windows that are part of the same combination as @var{window}, in order |
| 801 | resize all windows that are part of the same combination as | 801 | to accommodate the new window. In particular, this may allow |
| 802 | @var{window}, in order to accommodate the new window. In particular, | 802 | @code{split-window} to succeed even if @var{window} is a fixed-size |
| 803 | this may allow @code{split-window} to succeed even if @var{window} is | 803 | window or too small to ordinarily split. Furthermore, subsequently |
| 804 | a fixed-size window or too small to ordinarily split. Furthermore, | 804 | resizing or deleting @var{window} may resize all other windows in its |
| 805 | subsequently resizing or deleting @var{window} may resize all other | 805 | combination. |
| 806 | windows in its combination. | 806 | |
| 807 | 807 | The default is @code{nil}. Other values are reserved for future use. | |
| 808 | This variable has no effect if @code{window-combination-limit} is | 808 | The value of this variable is ignored when |
| 809 | non-@code{nil} (see below). | 809 | @code{window-combination-limit} is non-@code{nil} (see below). |
| 810 | @end defopt | 810 | @end defopt |
| 811 | 811 | ||
| 812 | To illustrate the effect of @code{window-combination-resize}, | 812 | To illustrate the effect of @code{window-combination-resize}, |
| @@ -857,9 +857,9 @@ If @code{window-combination-resize} is @code{nil}, splitting window | |||
| 857 | @end smallexample | 857 | @end smallexample |
| 858 | 858 | ||
| 859 | @noindent | 859 | @noindent |
| 860 | If @code{window-combination-resize} is non-@code{nil}, splitting | 860 | If @code{window-combination-resize} is @code{t}, splitting @code{W3} |
| 861 | @code{W3} instead leaves all three live windows with approximately the | 861 | instead leaves all three live windows with approximately the same |
| 862 | same height: | 862 | height: |
| 863 | 863 | ||
| 864 | @smallexample | 864 | @smallexample |
| 865 | @group | 865 | @group |
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index f94153479a8..3b0e5251d5e 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2011-12-28 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * gnus.texi (Mail Source Customization, Mail Back End Variables): | ||
| 4 | Use octal notation for file permissions, which are normally | ||
| 5 | thought of in octal. | ||
| 6 | (Mail Back End Variables): Use more-plausible modes in example. | ||
| 7 | |||
| 8 | 2011-12-20 Alan Mackenzie <acm@muc.de> | ||
| 9 | |||
| 10 | * cc-mode.texi: Update version string 5.31 -> 5.32. | ||
| 11 | |||
| 12 | 2011-12-06 Juanma Barranquero <lekktu@gmail.com> | ||
| 13 | |||
| 14 | * gnus-faq.texi (FAQ 2-1, FAQ 3-8, FAQ 4-14, FAQ 9-1): Fix typos. | ||
| 15 | |||
| 1 | 2011-11-24 Glenn Morris <rgm@gnu.org> | 16 | 2011-11-24 Glenn Morris <rgm@gnu.org> |
| 2 | 17 | ||
| 3 | * gnus.texi, smtpmail.texi: Fix case of "GnuTLS". | 18 | * gnus.texi, smtpmail.texi: Fix case of "GnuTLS". |
diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi index b64562f6875..60bb6e7cdac 100644 --- a/doc/misc/auth.texi +++ b/doc/misc/auth.texi | |||
| @@ -281,7 +281,7 @@ for any of the prompts. | |||
| 281 | Note that the password needs to be evaluated if it's a function. It's | 281 | Note that the password needs to be evaluated if it's a function. It's |
| 282 | wrapped in a function to provide some security. | 282 | wrapped in a function to provide some security. |
| 283 | 283 | ||
| 284 | Later, after a successful login, @code{nnimal.el} calls the | 284 | Later, after a successful login, @code{nnimap.el} calls the |
| 285 | @code{:save-function} like so: | 285 | @code{:save-function} like so: |
| 286 | 286 | ||
| 287 | @example | 287 | @example |
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 32311ff5c3e..d0c15c1940e 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi | |||
| @@ -12878,7 +12878,7 @@ To declare specifically that @code{x} is real and non-zero, | |||
| 12878 | use @samp{[[-inf .. 0), (0 .. inf]]}. (There is no way in the | 12878 | use @samp{[[-inf .. 0), (0 .. inf]]}. (There is no way in the |
| 12879 | current notation to say that @code{x} is nonzero but not necessarily | 12879 | current notation to say that @code{x} is nonzero but not necessarily |
| 12880 | real.) The @kbd{a e} command does ``unsafe'' simplifications, | 12880 | real.) The @kbd{a e} command does ``unsafe'' simplifications, |
| 12881 | including cancelling @samp{x} from the equation when @samp{x} is | 12881 | including canceling @samp{x} from the equation when @samp{x} is |
| 12882 | not known to be nonzero. | 12882 | not known to be nonzero. |
| 12883 | 12883 | ||
| 12884 | Another set of type symbols distinguish between scalars and vectors. | 12884 | Another set of type symbols distinguish between scalars and vectors. |
| @@ -16873,7 +16873,7 @@ The @kbd{t U} (@code{calc-unix-time}) [@code{unixtime}] command | |||
| 16873 | converts a date form into a Unix time value, which is the number of | 16873 | converts a date form into a Unix time value, which is the number of |
| 16874 | seconds since midnight on Jan 1, 1970, or vice-versa. The numeric result | 16874 | seconds since midnight on Jan 1, 1970, or vice-versa. The numeric result |
| 16875 | will be an integer if the current precision is 12 or less; for higher | 16875 | will be an integer if the current precision is 12 or less; for higher |
| 16876 | precisions, the result may be a float with (@var{precision}@minus{}12) | 16876 | precision, the result may be a float with (@var{precision}@minus{}12) |
| 16877 | digits after the decimal. Just as for @kbd{t J}, the numeric time | 16877 | digits after the decimal. Just as for @kbd{t J}, the numeric time |
| 16878 | is interpreted in the GMT time zone and the date form is interpreted | 16878 | is interpreted in the GMT time zone and the date form is interpreted |
| 16879 | in the current or specified zone. Some systems use Unix-like | 16879 | in the current or specified zone. Some systems use Unix-like |
| @@ -16943,7 +16943,7 @@ from a date form as an integer in the range 0 to 59. | |||
| 16943 | The @kbd{M-6 t P} [@code{second}] function extracts the second | 16943 | The @kbd{M-6 t P} [@code{second}] function extracts the second |
| 16944 | from a date form. If the current precision is 12 or less, | 16944 | from a date form. If the current precision is 12 or less, |
| 16945 | the result is an integer in the range 0 to 59. For higher | 16945 | the result is an integer in the range 0 to 59. For higher |
| 16946 | precisions, the result may instead be a floating-point number. | 16946 | precision, the result may instead be a floating-point number. |
| 16947 | 16947 | ||
| 16948 | @tindex weekday | 16948 | @tindex weekday |
| 16949 | The @kbd{M-7 t P} [@code{weekday}] function extracts the weekday | 16949 | The @kbd{M-7 t P} [@code{weekday}] function extracts the weekday |
| @@ -18499,7 +18499,7 @@ counterparts, which are also available separately as @code{calc-sech} | |||
| 18499 | Calc can compute a variety of less common functions that arise in | 18499 | Calc can compute a variety of less common functions that arise in |
| 18500 | various branches of mathematics. All of the functions described in | 18500 | various branches of mathematics. All of the functions described in |
| 18501 | this section allow arbitrary complex arguments and, except as noted, | 18501 | this section allow arbitrary complex arguments and, except as noted, |
| 18502 | will work to arbitrarily large precisions. They can not at present | 18502 | will work to arbitrarily large precision. They can not at present |
| 18503 | handle error forms or intervals as arguments. | 18503 | handle error forms or intervals as arguments. |
| 18504 | 18504 | ||
| 18505 | NOTE: These functions are still experimental. In particular, their | 18505 | NOTE: These functions are still experimental. In particular, their |
| @@ -21903,7 +21903,7 @@ of our sample formula by selecting it and pressing @kbd{n} | |||
| 21903 | @end smallexample | 21903 | @end smallexample |
| 21904 | 21904 | ||
| 21905 | Unselecting the sub-formula reveals that the minus sign, which would | 21905 | Unselecting the sub-formula reveals that the minus sign, which would |
| 21906 | normally have cancelled out with the subtraction automatically, has | 21906 | normally have canceled out with the subtraction automatically, has |
| 21907 | not been able to do so because the subtraction was not part of the | 21907 | not been able to do so because the subtraction was not part of the |
| 21908 | selected portion. Pressing @kbd{=} (@code{calc-evaluate}) or doing | 21908 | selected portion. Pressing @kbd{=} (@code{calc-evaluate}) or doing |
| 21909 | any other mathematical operation on the whole formula will cause it | 21909 | any other mathematical operation on the whole formula will cause it |
| @@ -22590,7 +22590,7 @@ described for multiplication. | |||
| 22590 | 22590 | ||
| 22591 | Quotients of products cancel only in the leading terms of the | 22591 | Quotients of products cancel only in the leading terms of the |
| 22592 | numerator and denominator. In other words, @expr{a x b / a y b} | 22592 | numerator and denominator. In other words, @expr{a x b / a y b} |
| 22593 | is cancelled to @expr{x b / y b} but not to @expr{x / y}. Once | 22593 | is canceled to @expr{x b / y b} but not to @expr{x / y}. Once |
| 22594 | again this is because full cancellation can be slow; use @kbd{a s} | 22594 | again this is because full cancellation can be slow; use @kbd{a s} |
| 22595 | to cancel all terms of the quotient. | 22595 | to cancel all terms of the quotient. |
| 22596 | 22596 | ||
| @@ -22810,7 +22810,7 @@ the distributive law. For example, @expr{a x^2 b / c x^3 d} will | |||
| 22810 | cancel @expr{x^2} from the top and bottom to get @expr{a b / c x d}. | 22810 | cancel @expr{x^2} from the top and bottom to get @expr{a b / c x d}. |
| 22811 | (The terms in the denominator will then be rearranged to @expr{c d x} | 22811 | (The terms in the denominator will then be rearranged to @expr{c d x} |
| 22812 | as described above.) If there is any common integer or fractional | 22812 | as described above.) If there is any common integer or fractional |
| 22813 | factor in the numerator and denominator, it is cancelled out; | 22813 | factor in the numerator and denominator, it is canceled out; |
| 22814 | for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}. | 22814 | for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}. |
| 22815 | 22815 | ||
| 22816 | Non-constant common factors are not found even by @kbd{a s}. To | 22816 | Non-constant common factors are not found even by @kbd{a s}. To |
| @@ -22858,7 +22858,7 @@ example, @samp{(x - 23) % 10} is simplified to @samp{(x + 7) % 10}. | |||
| 22858 | 22858 | ||
| 22859 | If the argument is multiplied by a constant, and this constant | 22859 | If the argument is multiplied by a constant, and this constant |
| 22860 | has a common integer divisor with the modulus, then this factor is | 22860 | has a common integer divisor with the modulus, then this factor is |
| 22861 | cancelled out. For example, @samp{12 x % 15} is changed to | 22861 | canceled out. For example, @samp{12 x % 15} is changed to |
| 22862 | @samp{3 (4 x % 5)} by factoring out 3. Also, @samp{(12 x + 1) % 15} | 22862 | @samp{3 (4 x % 5)} by factoring out 3. Also, @samp{(12 x + 1) % 15} |
| 22863 | is changed to @samp{3 ((4 x + 1:3) % 5)}. While these forms may | 22863 | is changed to @samp{3 ((4 x + 1:3) % 5)}. While these forms may |
| 22864 | not seem ``simpler,'' they allow Calc to discover useful information | 22864 | not seem ``simpler,'' they allow Calc to discover useful information |
| @@ -22938,13 +22938,13 @@ function. | |||
| 22938 | \bigskip | 22938 | \bigskip |
| 22939 | @end tex | 22939 | @end tex |
| 22940 | 22940 | ||
| 22941 | Equations and inequalities are simplified by cancelling factors | 22941 | Equations and inequalities are simplified by canceling factors |
| 22942 | of products, quotients, or sums on both sides. Inequalities | 22942 | of products, quotients, or sums on both sides. Inequalities |
| 22943 | change sign if a negative multiplicative factor is cancelled. | 22943 | change sign if a negative multiplicative factor is canceled. |
| 22944 | Non-constant multiplicative factors as in @expr{a b = a c} are | 22944 | Non-constant multiplicative factors as in @expr{a b = a c} are |
| 22945 | cancelled from equations only if they are provably nonzero (generally | 22945 | canceled from equations only if they are provably nonzero (generally |
| 22946 | because they were declared so; @pxref{Declarations}). Factors | 22946 | because they were declared so; @pxref{Declarations}). Factors |
| 22947 | are cancelled from inequalities only if they are nonzero and their | 22947 | are canceled from inequalities only if they are nonzero and their |
| 22948 | sign is known. | 22948 | sign is known. |
| 22949 | 22949 | ||
| 22950 | Simplification also replaces an equation or inequality with | 22950 | Simplification also replaces an equation or inequality with |
| @@ -23035,9 +23035,9 @@ The simplifications of @expr{@tfn{ln}(@tfn{exp}(x))}, | |||
| 23035 | unsafe because of problems with principal values (although these | 23035 | unsafe because of problems with principal values (although these |
| 23036 | simplifications are safe if @expr{x} is known to be real). | 23036 | simplifications are safe if @expr{x} is known to be real). |
| 23037 | 23037 | ||
| 23038 | Common factors are cancelled from products on both sides of an | 23038 | Common factors are canceled from products on both sides of an |
| 23039 | equation, even if those factors may be zero: @expr{a x / b x} | 23039 | equation, even if those factors may be zero: @expr{a x / b x} |
| 23040 | to @expr{a / b}. Such factors are never cancelled from | 23040 | to @expr{a / b}. Such factors are never canceled from |
| 23041 | inequalities: Even @kbd{a e} is not bold enough to reduce | 23041 | inequalities: Even @kbd{a e} is not bold enough to reduce |
| 23042 | @expr{a x < b x} to @expr{a < b} (or @expr{a > b}, depending | 23042 | @expr{a x < b x} to @expr{a < b} (or @expr{a > b}, depending |
| 23043 | on whether you believe @expr{x} is positive or negative). | 23043 | on whether you believe @expr{x} is positive or negative). |
| @@ -23071,7 +23071,7 @@ If units auto-ranging mode is enabled, products or quotients in | |||
| 23071 | which the first argument is a number which is out of range for the | 23071 | which the first argument is a number which is out of range for the |
| 23072 | leading unit are modified accordingly. | 23072 | leading unit are modified accordingly. |
| 23073 | 23073 | ||
| 23074 | When cancelling and combining units in products and quotients, | 23074 | When canceling and combining units in products and quotients, |
| 23075 | Calc accounts for unit names that differ only in the prefix letter. | 23075 | Calc accounts for unit names that differ only in the prefix letter. |
| 23076 | For example, @samp{2 km m} is simplified to @samp{2000 m^2}. | 23076 | For example, @samp{2 km m} is simplified to @samp{2000 m^2}. |
| 23077 | However, compatible but different units like @code{ft} and @code{in} | 23077 | However, compatible but different units like @code{ft} and @code{in} |
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index d5f403e5cdb..8b589259a48 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi | |||
| @@ -190,7 +190,7 @@ developing GNU and promoting software freedom.'' | |||
| 190 | @titlepage | 190 | @titlepage |
| 191 | @sp 10 | 191 | @sp 10 |
| 192 | 192 | ||
| 193 | @center @titlefont{CC Mode 5.31} | 193 | @center @titlefont{CC Mode 5.32} |
| 194 | @sp 2 | 194 | @sp 2 |
| 195 | @center @subtitlefont{A GNU Emacs mode for editing C and C-like languages} | 195 | @center @subtitlefont{A GNU Emacs mode for editing C and C-like languages} |
| 196 | @sp 2 | 196 | @sp 2 |
| @@ -378,7 +378,7 @@ was added in version 5.30. | |||
| 378 | 378 | ||
| 379 | This manual describes @ccmode{} | 379 | This manual describes @ccmode{} |
| 380 | @comment The following line must appear on its own, so that the | 380 | @comment The following line must appear on its own, so that the |
| 381 | version 5.31. | 381 | version 5.32. |
| 382 | @comment Release.py script can update the version number automatically | 382 | @comment Release.py script can update the version number automatically |
| 383 | 383 | ||
| 384 | @ccmode{} supports the editing of K&R and ANSI C, C++, Objective-C, | 384 | @ccmode{} supports the editing of K&R and ANSI C, C++, Objective-C, |
| @@ -2160,7 +2160,7 @@ A space between the function name and opening parenthesis when calling | |||
| 2160 | a user function. The last character of the function name and the | 2160 | a user function. The last character of the function name and the |
| 2161 | opening parenthesis are highlighted. This font-locking rule will | 2161 | opening parenthesis are highlighted. This font-locking rule will |
| 2162 | spuriously highlight a valid concatenation expression where an | 2162 | spuriously highlight a valid concatenation expression where an |
| 2163 | identifier precedes a parenthesised expression. Unfortunately. | 2163 | identifier precedes a parenthesized expression. Unfortunately. |
| 2164 | 2164 | ||
| 2165 | @item | 2165 | @item |
| 2166 | Whitespace following the @samp{\} in what otherwise looks like an | 2166 | Whitespace following the @samp{\} in what otherwise looks like an |
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi index 88b068ccd5b..f515109bf76 100644 --- a/doc/misc/dbus.texi +++ b/doc/misc/dbus.texi | |||
| @@ -1677,7 +1677,7 @@ Establish the connection to D-Bus @var{bus}. | |||
| 1677 | 1677 | ||
| 1678 | @var{bus} can be either the symbol @code{:system} or the symbol | 1678 | @var{bus} can be either the symbol @code{:system} or the symbol |
| 1679 | @code{:session}, or it can be a string denoting the address of the | 1679 | @code{:session}, or it can be a string denoting the address of the |
| 1680 | corresponding bus. For the system and session busses, this function | 1680 | corresponding bus. For the system and session buses, this function |
| 1681 | is called when loading @file{dbus.el}, there is no need to call it | 1681 | is called when loading @file{dbus.el}, there is no need to call it |
| 1682 | again. | 1682 | again. |
| 1683 | 1683 | ||
| @@ -1816,7 +1816,7 @@ handled by a hook function. | |||
| 1816 | @defvar dbus-event-error-hooks | 1816 | @defvar dbus-event-error-hooks |
| 1817 | This hook variable keeps a list of functions, which are called when a | 1817 | This hook variable keeps a list of functions, which are called when a |
| 1818 | D-Bus error happens in the event handler. Every function must accept | 1818 | D-Bus error happens in the event handler. Every function must accept |
| 1819 | two arguments, the event and the error variable catched in | 1819 | two arguments, the event and the error variable caught in |
| 1820 | @code{condition-case} by @code{dbus-error}. | 1820 | @code{condition-case} by @code{dbus-error}. |
| 1821 | 1821 | ||
| 1822 | Such functions can be used the adapt the error signal to be raised. | 1822 | Such functions can be used the adapt the error signal to be raised. |
diff --git a/doc/misc/ebrowse.texi b/doc/misc/ebrowse.texi index 19ee9705484..a2a4017eb64 100644 --- a/doc/misc/ebrowse.texi +++ b/doc/misc/ebrowse.texi | |||
| @@ -482,7 +482,7 @@ name. | |||
| 482 | @table @kbd | 482 | @table @kbd |
| 483 | @item SPC | 483 | @item SPC |
| 484 | This command views the class declaration if the database | 484 | This command views the class declaration if the database |
| 485 | contains informations about it. If you don't parse the entire source | 485 | contains information about it. If you don't parse the entire source |
| 486 | you are working on, some classes will only be known to exist but the | 486 | you are working on, some classes will only be known to exist but the |
| 487 | location of their declarations and definitions will not be known.@refill | 487 | location of their declarations and definitions will not be known.@refill |
| 488 | 488 | ||
diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi index cc566086f44..2b2a6a21b7f 100644 --- a/doc/misc/ede.texi +++ b/doc/misc/ede.texi | |||
| @@ -705,11 +705,11 @@ A brief description of the project or target. This is currently used | |||
| 705 | by the @samp{ede-speedbar} interface. | 705 | by the @samp{ede-speedbar} interface. |
| 706 | @item ede-want-file-p | 706 | @item ede-want-file-p |
| 707 | Return non-nil if a target will accept a given file. | 707 | Return non-nil if a target will accept a given file. |
| 708 | It is generally unecessary to override this. See the section on source | 708 | It is generally unnecessary to override this. See the section on source |
| 709 | code. | 709 | code. |
| 710 | @item ede-buffer-mine | 710 | @item ede-buffer-mine |
| 711 | Return non-nil if a buffer belongs to this target. Used during | 711 | Return non-nil if a buffer belongs to this target. Used during |
| 712 | association when a file is loaded. It is generally unecessary to | 712 | association when a file is loaded. It is generally unnecessary to |
| 713 | override this unless you keep auxiliary files. | 713 | override this unless you keep auxiliary files. |
| 714 | @end table | 714 | @end table |
| 715 | 715 | ||
| @@ -2483,7 +2483,7 @@ Create the make rule needed to create an archive for @var{THIS}. | |||
| 2483 | 2483 | ||
| 2484 | @deffn Method ede-proj-makefile-insert-source-variables :PRIMARY this | 2484 | @deffn Method ede-proj-makefile-insert-source-variables :PRIMARY this |
| 2485 | Insert bin_PROGRAMS variables needed by target @var{THIS}. | 2485 | Insert bin_PROGRAMS variables needed by target @var{THIS}. |
| 2486 | We aren't acutally inserting SOURCE details, but this is used by the | 2486 | We aren't actually inserting SOURCE details, but this is used by the |
| 2487 | Makefile.am generator, so use it to add this important bin program. | 2487 | Makefile.am generator, so use it to add this important bin program. |
| 2488 | @end deffn | 2488 | @end deffn |
| 2489 | 2489 | ||
| @@ -2624,7 +2624,7 @@ Return the name of the main target for @var{THIS} target. | |||
| 2624 | 2624 | ||
| 2625 | @deffn Method ede-proj-makefile-insert-automake-pre-variables :AFTER this | 2625 | @deffn Method ede-proj-makefile-insert-automake-pre-variables :AFTER this |
| 2626 | Insert bin_PROGRAMS variables needed by target @var{THIS}. | 2626 | Insert bin_PROGRAMS variables needed by target @var{THIS}. |
| 2627 | We aren't acutally inserting SOURCE details, but this is used by the | 2627 | We aren't actually inserting SOURCE details, but this is used by the |
| 2628 | Makefile.am generator, so use it to add this important bin program. | 2628 | Makefile.am generator, so use it to add this important bin program. |
| 2629 | @end deffn | 2629 | @end deffn |
| 2630 | 2630 | ||
diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index c44cc1c9b09..91440dcfe8f 100644 --- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi | |||
| @@ -417,7 +417,7 @@ called with a @acronym{MIME} handle as the argument. | |||
| 417 | @vindex mm-inline-text-html-with-images | 417 | @vindex mm-inline-text-html-with-images |
| 418 | Some @acronym{HTML} mails might have the trick of spammers using | 418 | Some @acronym{HTML} mails might have the trick of spammers using |
| 419 | @samp{<img>} tags. It is likely to be intended to verify whether you | 419 | @samp{<img>} tags. It is likely to be intended to verify whether you |
| 420 | have read the mail. You can prevent your personal informations from | 420 | have read the mail. You can prevent your personal information from |
| 421 | leaking by setting this option to @code{nil} (which is the default). | 421 | leaking by setting this option to @code{nil} (which is the default). |
| 422 | It is currently ignored by Emacs/w3. For emacs-w3m, you may use the | 422 | It is currently ignored by Emacs/w3. For emacs-w3m, you may use the |
| 423 | command @kbd{t} on the image anchor to show an image even if it is | 423 | command @kbd{t} on the image anchor to show an image even if it is |
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index b0090f0fb84..7c178757927 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi | |||
| @@ -608,7 +608,7 @@ scrolls back. | |||
| 608 | 608 | ||
| 609 | @item Using C-p and C-n with rebind gets into a locked state | 609 | @item Using C-p and C-n with rebind gets into a locked state |
| 610 | 610 | ||
| 611 | This happened a few times in Emacs 21, but has been unreproducible | 611 | This happened a few times in Emacs 21, but has been irreproducible |
| 612 | since. | 612 | since. |
| 613 | 613 | ||
| 614 | @item If an interactive process is currently running, @kbd{M-!} doesn't work | 614 | @item If an interactive process is currently running, @kbd{M-!} doesn't work |
diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index b5bb75f7284..7bd3e4ac7fa 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi | |||
| @@ -266,9 +266,9 @@ and how to prevent it? | |||
| 266 | @subsubheading Answer | 266 | @subsubheading Answer |
| 267 | 267 | ||
| 268 | This message means that the last time you used Gnus, it | 268 | This message means that the last time you used Gnus, it |
| 269 | wasn't properly exited and therefor couldn't write its | 269 | wasn't properly exited and therefore couldn't write its |
| 270 | informations to disk (e.g. which messages you read), you | 270 | information to disk (e.g. which messages you read), you |
| 271 | are now asked if you want to restore those informations | 271 | are now asked if you want to restore that information |
| 272 | from the auto-save file. | 272 | from the auto-save file. |
| 273 | 273 | ||
| 274 | To prevent this message make sure you exit Gnus | 274 | To prevent this message make sure you exit Gnus |
| @@ -563,7 +563,7 @@ However, the first thing to do is to tell Gnus in which way | |||
| 563 | it should store the mail, in Gnus terminology which back end | 563 | it should store the mail, in Gnus terminology which back end |
| 564 | to use. Gnus supports many different back ends, the most | 564 | to use. Gnus supports many different back ends, the most |
| 565 | commonly used one is nnml. It stores every mail in one file | 565 | commonly used one is nnml. It stores every mail in one file |
| 566 | and is therefor quite fast. However you might prefer a one | 566 | and is therefore quite fast. However you might prefer a one |
| 567 | file per group approach if your file system has problems with | 567 | file per group approach if your file system has problems with |
| 568 | many small files, the nnfolder back end is then probably the | 568 | many small files, the nnfolder back end is then probably the |
| 569 | choice for you. To use nnml add the following to ~/.gnus.el: | 569 | choice for you. To use nnml add the following to ~/.gnus.el: |
| @@ -580,7 +580,7 @@ As you might have guessed, if you want nnfolder, it's | |||
| 580 | @end example | 580 | @end example |
| 581 | @noindent | 581 | @noindent |
| 582 | 582 | ||
| 583 | Now we need to tell Gnus, where to get it's mail from. If | 583 | Now we need to tell Gnus, where to get its mail from. If |
| 584 | it's a POP3 server, then you need something like this: | 584 | it's a POP3 server, then you need something like this: |
| 585 | 585 | ||
| 586 | @example | 586 | @example |
| @@ -1104,11 +1104,11 @@ I don't like the way the Summary buffer looks, how to tweak it? | |||
| 1104 | @subsubheading Answer | 1104 | @subsubheading Answer |
| 1105 | 1105 | ||
| 1106 | You've got to play around with the variable | 1106 | You've got to play around with the variable |
| 1107 | gnus-summary-line-format. It's value is a string of | 1107 | gnus-summary-line-format. Its value is a string of |
| 1108 | symbols which stand for things like author, date, subject | 1108 | symbols which stand for things like author, date, subject |
| 1109 | etc. A list of the available specifiers can be found in the | 1109 | etc. A list of the available specifiers can be found in the |
| 1110 | manual node "Summary Buffer Lines" and the often forgotten | 1110 | manual node "Summary Buffer Lines" and the often forgotten |
| 1111 | node "Formatting Variables" and it's sub-nodes. There | 1111 | node "Formatting Variables" and its sub-nodes. There |
| 1112 | you'll find useful things like positioning the cursor and | 1112 | you'll find useful things like positioning the cursor and |
| 1113 | tabulators which allow you a summary in table form, but | 1113 | tabulators which allow you a summary in table form, but |
| 1114 | sadly hard tabulators are broken in 5.8.8. | 1114 | sadly hard tabulators are broken in 5.8.8. |
| @@ -1838,7 +1838,7 @@ inconvenient since you are not displaying the found mail | |||
| 1838 | in Gnus. Here comes nnir into action. Nnir is a front end | 1838 | in Gnus. Here comes nnir into action. Nnir is a front end |
| 1839 | to search engines like swish-e or swish++ and | 1839 | to search engines like swish-e or swish++ and |
| 1840 | others. You index your mail with one of those search | 1840 | others. You index your mail with one of those search |
| 1841 | engines and with the help of nnir you can search trough | 1841 | engines and with the help of nnir you can search through |
| 1842 | the indexed mail and generate a temporary group with all | 1842 | the indexed mail and generate a temporary group with all |
| 1843 | messages which met your search criteria. If this sound | 1843 | messages which met your search criteria. If this sound |
| 1844 | cool to you get nnir.el from | 1844 | cool to you get nnir.el from |
| @@ -2190,7 +2190,7 @@ Starting Gnus is really slow, how to speed it up? | |||
| 2190 | 2190 | ||
| 2191 | @subsubheading Answer | 2191 | @subsubheading Answer |
| 2192 | 2192 | ||
| 2193 | The reason for this could be the way Gnus reads it's | 2193 | The reason for this could be the way Gnus reads its |
| 2194 | active file, see the node "The Active File" in the Gnus | 2194 | active file, see the node "The Active File" in the Gnus |
| 2195 | manual for things you might try to speed the process up. | 2195 | manual for things you might try to speed the process up. |
| 2196 | An other idea would be to byte compile your ~/.gnus.el (say | 2196 | An other idea would be to byte compile your ~/.gnus.el (say |
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 69b17a94d68..86aaadf8ae8 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -4622,7 +4622,7 @@ Sieve is a server-side mail filtering language. In Gnus you can use | |||
| 4622 | the @code{sieve} group parameter (@pxref{Group Parameters}) to specify | 4622 | the @code{sieve} group parameter (@pxref{Group Parameters}) to specify |
| 4623 | sieve rules that should apply to each group. Gnus provides two | 4623 | sieve rules that should apply to each group. Gnus provides two |
| 4624 | commands to translate all these group parameters into a proper Sieve | 4624 | commands to translate all these group parameters into a proper Sieve |
| 4625 | script that can be transfered to the server somehow. | 4625 | script that can be transferred to the server somehow. |
| 4626 | 4626 | ||
| 4627 | @vindex gnus-sieve-file | 4627 | @vindex gnus-sieve-file |
| 4628 | @vindex gnus-sieve-region-start | 4628 | @vindex gnus-sieve-region-start |
| @@ -8332,7 +8332,7 @@ Files with name matching this regular expression won't be viewed. | |||
| 8332 | Files with a @acronym{MIME} type matching this variable won't be viewed. | 8332 | Files with a @acronym{MIME} type matching this variable won't be viewed. |
| 8333 | Note that Gnus tries to guess what type the file is based on the name. | 8333 | Note that Gnus tries to guess what type the file is based on the name. |
| 8334 | @code{gnus-uu} is not a @acronym{MIME} package (yet), so this is slightly | 8334 | @code{gnus-uu} is not a @acronym{MIME} package (yet), so this is slightly |
| 8335 | kludgey. | 8335 | kludgy. |
| 8336 | 8336 | ||
| 8337 | @item gnus-uu-tmp-dir | 8337 | @item gnus-uu-tmp-dir |
| 8338 | @vindex gnus-uu-tmp-dir | 8338 | @vindex gnus-uu-tmp-dir |
| @@ -8976,7 +8976,7 @@ Translate many non-@acronym{ASCII} characters into their | |||
| 8976 | @acronym{ASCII} equivalents (@code{gnus-article-treat-non-ascii}). | 8976 | @acronym{ASCII} equivalents (@code{gnus-article-treat-non-ascii}). |
| 8977 | This is mostly useful if you're on a terminal that has a limited font | 8977 | This is mostly useful if you're on a terminal that has a limited font |
| 8978 | and doesn't show accented characters, ``advanced'' punctuation, and the | 8978 | and doesn't show accented characters, ``advanced'' punctuation, and the |
| 8979 | like. For instance, @samp{»} is tranlated into @samp{>>}, and so on. | 8979 | like. For instance, @samp{»} is translated into @samp{>>}, and so on. |
| 8980 | 8980 | ||
| 8981 | @item W Y f | 8981 | @item W Y f |
| 8982 | @kindex W Y f (Summary) | 8982 | @kindex W Y f (Summary) |
| @@ -11634,7 +11634,7 @@ message/external-body @acronym{MIME} type. | |||
| 11634 | @item r (Article) | 11634 | @item r (Article) |
| 11635 | @kindex r (Article) | 11635 | @kindex r (Article) |
| 11636 | Prompt for a file name, replace the @acronym{MIME} object with an | 11636 | Prompt for a file name, replace the @acronym{MIME} object with an |
| 11637 | external body refering to the file via the message/external-body | 11637 | external body referring to the file via the message/external-body |
| 11638 | @acronym{MIME} type. (@code{gnus-mime-replace-part}). | 11638 | @acronym{MIME} type. (@code{gnus-mime-replace-part}). |
| 11639 | 11639 | ||
| 11640 | @findex gnus-mime-delete-part | 11640 | @findex gnus-mime-delete-part |
| @@ -15033,7 +15033,7 @@ number. | |||
| 15033 | 15033 | ||
| 15034 | @item mail-source-default-file-modes | 15034 | @item mail-source-default-file-modes |
| 15035 | @vindex mail-source-default-file-modes | 15035 | @vindex mail-source-default-file-modes |
| 15036 | All new mail files will get this file mode. The default is 384. | 15036 | All new mail files will get this file mode. The default is @code{#o600}. |
| 15037 | 15037 | ||
| 15038 | @item mail-source-movemail-program | 15038 | @item mail-source-movemail-program |
| 15039 | @vindex mail-source-movemail-program | 15039 | @vindex mail-source-movemail-program |
| @@ -15123,10 +15123,10 @@ default file modes the new mail files get: | |||
| 15123 | 15123 | ||
| 15124 | @lisp | 15124 | @lisp |
| 15125 | (add-hook 'nnmail-pre-get-new-mail-hook | 15125 | (add-hook 'nnmail-pre-get-new-mail-hook |
| 15126 | (lambda () (set-default-file-modes 511))) | 15126 | (lambda () (set-default-file-modes #o700))) |
| 15127 | 15127 | ||
| 15128 | (add-hook 'nnmail-post-get-new-mail-hook | 15128 | (add-hook 'nnmail-post-get-new-mail-hook |
| 15129 | (lambda () (set-default-file-modes 551))) | 15129 | (lambda () (set-default-file-modes #o775))) |
| 15130 | @end lisp | 15130 | @end lisp |
| 15131 | 15131 | ||
| 15132 | @item nnmail-use-long-file-names | 15132 | @item nnmail-use-long-file-names |
| @@ -30012,7 +30012,7 @@ this: | |||
| 30012 | @node Score File Syntax | 30012 | @node Score File Syntax |
| 30013 | @subsection Score File Syntax | 30013 | @subsection Score File Syntax |
| 30014 | 30014 | ||
| 30015 | Score files are meant to be easily parseable, but yet extremely | 30015 | Score files are meant to be easily parsable, but yet extremely |
| 30016 | malleable. It was decided that something that had the same read syntax | 30016 | malleable. It was decided that something that had the same read syntax |
| 30017 | as an Emacs Lisp list would fit that spec. | 30017 | as an Emacs Lisp list would fit that spec. |
| 30018 | 30018 | ||
diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 3e13dbb0f23..c7495d8cc93 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi | |||
| @@ -669,7 +669,7 @@ We have already used the routine info display in the first part of this | |||
| 669 | tutorial. This was the invoked using @kbd{C-c ?}, and displays | 669 | tutorial. This was the invoked using @kbd{C-c ?}, and displays |
| 670 | information about the IDL routine near the cursor position. Wouldn't it | 670 | information about the IDL routine near the cursor position. Wouldn't it |
| 671 | be nice to have the same kind of information available for your own | 671 | be nice to have the same kind of information available for your own |
| 672 | routines and for the huge amount of code in major libraries like JHUPL | 672 | routines and for the huge amount of code in major libraries like JHUAPL |
| 673 | or the IDL-Astro library? In many cases, you may already have this | 673 | or the IDL-Astro library? In many cases, you may already have this |
| 674 | information. Files named @file{.idlwave_catalog} in library directories | 674 | information. Files named @file{.idlwave_catalog} in library directories |
| 675 | contain scanned information on the routines in that directory; many | 675 | contain scanned information on the routines in that directory; many |
| @@ -1580,8 +1580,8 @@ available will be emphasized (e.g. colored blue). For other items, the | |||
| 1580 | corresponding source code or DocLib header will be used as the help | 1580 | corresponding source code or DocLib header will be used as the help |
| 1581 | text. | 1581 | text. |
| 1582 | 1582 | ||
| 1583 | @cindex Completion, cancelling | 1583 | @cindex Completion, canceling |
| 1584 | @cindex Cancelling completion | 1584 | @cindex Canceling completion |
| 1585 | Completion is not a blocking operation --- you are free to continue | 1585 | Completion is not a blocking operation --- you are free to continue |
| 1586 | editing, enter commands, or simply ignore the @file{*Completions*} | 1586 | editing, enter commands, or simply ignore the @file{*Completions*} |
| 1587 | buffer during a completion operation. If, however, the most recent | 1587 | buffer during a completion operation. If, however, the most recent |
diff --git a/doc/misc/message.texi b/doc/misc/message.texi index d9062a32572..774bf180266 100644 --- a/doc/misc/message.texi +++ b/doc/misc/message.texi | |||
| @@ -1974,7 +1974,7 @@ that look like: | |||
| 1974 | Hallvard B Furuseth <h.b.furuseth@@usit.uio.no> writes: | 1974 | Hallvard B Furuseth <h.b.furuseth@@usit.uio.no> writes: |
| 1975 | @end example | 1975 | @end example |
| 1976 | 1976 | ||
| 1977 | @c FIXME: Add `message-insert-formated-citation-line' and | 1977 | @c FIXME: Add `message-insert-formatted-citation-line' and |
| 1978 | @c `message-citation-line-format' | 1978 | @c `message-citation-line-format' |
| 1979 | 1979 | ||
| 1980 | Point will be at the beginning of the body of the message when this | 1980 | Point will be at the beginning of the body of the message when this |
diff --git a/doc/misc/org.texi b/doc/misc/org.texi index 181e00f8e02..adc9cf0b139 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi | |||
| @@ -11399,16 +11399,16 @@ a file is retrieved with @code{org-publish-find-date}. | |||
| 11399 | @tab Should sorting be case-sensitive? Default @code{nil}. | 11399 | @tab Should sorting be case-sensitive? Default @code{nil}. |
| 11400 | 11400 | ||
| 11401 | @item @code{:sitemap-file-entry-format} | 11401 | @item @code{:sitemap-file-entry-format} |
| 11402 | @tab With this option one can tell how a sitemap's entry is formated in the | 11402 | @tab With this option one can tell how a sitemap's entry is formatted in the |
| 11403 | sitemap. This is a format string with some escape sequences: @code{%t} stands | 11403 | sitemap. This is a format string with some escape sequences: @code{%t} stands |
| 11404 | for the title of the file, @code{%a} stands for the author of the file and | 11404 | for the title of the file, @code{%a} stands for the author of the file and |
| 11405 | @code{%d} stands for the date of the file. The date is retrieved with the | 11405 | @code{%d} stands for the date of the file. The date is retrieved with the |
| 11406 | @code{org-publish-find-date} function and formated with | 11406 | @code{org-publish-find-date} function and formatted with |
| 11407 | @code{org-publish-sitemap-date-format}. Default @code{%t}. | 11407 | @code{org-publish-sitemap-date-format}. Default @code{%t}. |
| 11408 | 11408 | ||
| 11409 | @item @code{:sitemap-date-format} | 11409 | @item @code{:sitemap-date-format} |
| 11410 | @tab Format string for the @code{format-time-string} function that tells how | 11410 | @tab Format string for the @code{format-time-string} function that tells how |
| 11411 | a sitemap entry's date is to be formated. This property bypasses | 11411 | a sitemap entry's date is to be formatted. This property bypasses |
| 11412 | @code{org-publish-sitemap-date-format} which defaults to @code{%Y-%m-%d}. | 11412 | @code{org-publish-sitemap-date-format} which defaults to @code{%Y-%m-%d}. |
| 11413 | 11413 | ||
| 11414 | @item @code{:sitemap-sans-extension} | 11414 | @item @code{:sitemap-sans-extension} |
| @@ -12469,7 +12469,7 @@ block. E.g., @code{:results value html}. | |||
| 12469 | Results assumed to be LaTeX and are enclosed in a @code{begin_latex} block. | 12469 | Results assumed to be LaTeX and are enclosed in a @code{begin_latex} block. |
| 12470 | E.g., @code{:results value latex}. | 12470 | E.g., @code{:results value latex}. |
| 12471 | @item @code{code} | 12471 | @item @code{code} |
| 12472 | Result are assumed to be parseable code and are enclosed in a code block. | 12472 | Result are assumed to be parsable code and are enclosed in a code block. |
| 12473 | E.g., @code{:results value code}. | 12473 | E.g., @code{:results value code}. |
| 12474 | @item @code{pp} | 12474 | @item @code{pp} |
| 12475 | The result is converted to pretty-printed code and is enclosed in a code | 12475 | The result is converted to pretty-printed code and is enclosed in a code |
diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi index 3e9ee928822..192afe33cb4 100644 --- a/doc/misc/rcirc.texi +++ b/doc/misc/rcirc.texi | |||
| @@ -524,7 +524,7 @@ your full name, you might want to set it to some pseudonym. | |||
| 524 | 524 | ||
| 525 | @item rcirc-authinfo | 525 | @item rcirc-authinfo |
| 526 | @vindex rcirc-authinfo | 526 | @vindex rcirc-authinfo |
| 527 | @cindex authentification | 527 | @cindex authentication |
| 528 | @cindex identification | 528 | @cindex identification |
| 529 | @cindex nickserv | 529 | @cindex nickserv |
| 530 | @cindex login | 530 | @cindex login |
| @@ -547,7 +547,7 @@ And here are the valid method symbols and the arguments they require: | |||
| 547 | 547 | ||
| 548 | @table @code | 548 | @table @code |
| 549 | @item nickserv | 549 | @item nickserv |
| 550 | @cindex nickserv authentification | 550 | @cindex nickserv authentication |
| 551 | Use this symbol if you need to identify yourself as follows when | 551 | Use this symbol if you need to identify yourself as follows when |
| 552 | connecting to a network: @code{/msg nickserv identify secret}. The | 552 | connecting to a network: @code{/msg nickserv identify secret}. The |
| 553 | necessary arguments are the nickname you want to use this for, and the | 553 | necessary arguments are the nickname you want to use this for, and the |
| @@ -558,7 +558,7 @@ pick a password for it. Contact @code{nickserv} and check out the | |||
| 558 | details. (Using @code{/msg nickserv help}, for example.) | 558 | details. (Using @code{/msg nickserv help}, for example.) |
| 559 | 559 | ||
| 560 | @item chanserv | 560 | @item chanserv |
| 561 | @cindex chanserv authentification | 561 | @cindex chanserv authentication |
| 562 | Use this symbol if you need to identify yourself as follows if you want | 562 | Use this symbol if you need to identify yourself as follows if you want |
| 563 | to join a particular channel: @code{/msg chanserv identify #underground | 563 | to join a particular channel: @code{/msg chanserv identify #underground |
| 564 | secret}. The necessary arguments are the nickname and channel you want | 564 | secret}. The necessary arguments are the nickname and channel you want |
| @@ -569,7 +569,7 @@ the password to use. Contact @code{chanserv} and check out the details. | |||
| 569 | (Using @code{/msg chanserv help}, for example.) | 569 | (Using @code{/msg chanserv help}, for example.) |
| 570 | 570 | ||
| 571 | @item bitlbee | 571 | @item bitlbee |
| 572 | @cindex bitlbee authentification | 572 | @cindex bitlbee authentication |
| 573 | Use this symbol if you need to identify yourself in the Bitlbee channel | 573 | Use this symbol if you need to identify yourself in the Bitlbee channel |
| 574 | as follows: @code{identify secret}. The necessary arguments are the | 574 | as follows: @code{identify secret}. The necessary arguments are the |
| 575 | nickname you want to use this for, and the password to use. | 575 | nickname you want to use this for, and the password to use. |
| @@ -585,7 +585,7 @@ Bitlbee acts like an IRC server, but in fact it is a gateway to a lot of | |||
| 585 | other instant messaging services. You can either install Bitlbee | 585 | other instant messaging services. You can either install Bitlbee |
| 586 | locally or use a public Bitlbee server. There, you need to create an | 586 | locally or use a public Bitlbee server. There, you need to create an |
| 587 | account with a password. This is the nick and password you need to | 587 | account with a password. This is the nick and password you need to |
| 588 | provide for the bitlbee authentification method. | 588 | provide for the bitlbee authentication method. |
| 589 | 589 | ||
| 590 | Later, you will tell Bitlbee about your accounts and passwords on all | 590 | Later, you will tell Bitlbee about your accounts and passwords on all |
| 591 | the other instant messaging services, and Bitlbee will log you in. All | 591 | the other instant messaging services, and Bitlbee will log you in. All |
diff --git a/doc/misc/semantic.texi b/doc/misc/semantic.texi index dcfff1fcb96..8c56d2dc9f8 100644 --- a/doc/misc/semantic.texi +++ b/doc/misc/semantic.texi | |||
| @@ -380,7 +380,7 @@ with the search results format. | |||
| 380 | 380 | ||
| 381 | @item semanticdb-ref.el | 381 | @item semanticdb-ref.el |
| 382 | Tracks crossreferences. Cross references are needed when buffer is | 382 | Tracks crossreferences. Cross references are needed when buffer is |
| 383 | reparsed, and must alert other tables that any dependant caches may | 383 | reparsed, and must alert other tables that any dependent caches may |
| 384 | need to be flushed. References are in the form of include files. | 384 | need to be flushed. References are in the form of include files. |
| 385 | 385 | ||
| 386 | @end table | 386 | @end table |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index f7f340074a2..1cea074fa2b 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -528,8 +528,8 @@ differ. | |||
| 528 | @cindex methods, inline | 528 | @cindex methods, inline |
| 529 | @cindex methods, external | 529 | @cindex methods, external |
| 530 | Loading or saving a remote file requires that the content of the file | 530 | Loading or saving a remote file requires that the content of the file |
| 531 | be transfered between the two machines. The content of the file can | 531 | be transferred between the two machines. The content of the file can |
| 532 | be transfered using one of two methods: the @dfn{inline method} over | 532 | be transferred using one of two methods: the @dfn{inline method} over |
| 533 | the same connection used to log in to the remote machine, or the | 533 | the same connection used to log in to the remote machine, or the |
| 534 | @dfn{external method} through another connection using a remote copy | 534 | @dfn{external method} through another connection using a remote copy |
| 535 | program such as @command{rcp}, @command{scp} or @command{rsync}. | 535 | program such as @command{rcp}, @command{scp} or @command{rsync}. |
| @@ -3704,4 +3704,4 @@ for @value{emacsothername}. | |||
| 3704 | @c host and then send commands to it. | 3704 | @c host and then send commands to it. |
| 3705 | @c * Use `filename' resp. `file name' consistently. | 3705 | @c * Use `filename' resp. `file name' consistently. |
| 3706 | @c * Use `host' resp. `machine' consistently. | 3706 | @c * Use `host' resp. `machine' consistently. |
| 3707 | @c * Consistent small or capitalized words especially in menues. | 3707 | @c * Consistent small or capitalized words especially in menus. |