@@ -13,6 +13,9 @@ large-size programs and packages. These features include:
1313Unified interface to Support for Version Control Systems
1414(@acronym {VCS }) that record the history of changes to source files.
1515
16+ @item
17+ Commands for handling programming projects.
18+
1619@item
1720A specialized mode for maintaining @file {ChangeLog } files that provide
1821a chronological log of program changes.
@@ -38,6 +41,7 @@ Lisp Regression Testing}).
3841
3942@menu
4043* Version Control :: Using version control systems.
44+ * Projects :: Commands for handling source files in a project.
4145 * Change Log :: Maintaining a change history for your program.
4246 * Xref :: Find definitions and references of any function,
4347 method, struct, macro, @dots {} in your program.
@@ -1630,6 +1634,77 @@ different revision with @kbd{C-u C-x v v}.
16301634@include vc1-xtra.texi
16311635@end ifnottex
16321636
1637+ @node Projects
1638+ @section Working with Projects
1639+ @cindex projects
1640+
1641+ @cindex project root
1642+ A @dfn {project } is a collection of files used for producing one or
1643+ more programs. Files that belong to a project are typically stored in
1644+ a hierarchy of directories; the top-level directory of the hierarchy
1645+ is known as the @dfn {project root }.
1646+
1647+ @cindex project back-end
1648+ Whether a given directory is a root of some project is determined by
1649+ the project-specific infrastructure, known as @dfn {project back-end }.
1650+ Emacs currently supports two such back-ends: VC (@pxref {Version
1651+ Control }), whereby a VCS repository is considered a project; and EDE
1652+ (@pxref {EDE }). This is expected to be extended in the future to
1653+ support additional types of projects.
1654+
1655+ Which files do or don't belong to a project is also determined by
1656+ the project back-end. For example, the VC back-end doesn't consider
1657+ ``ignored'' files (@pxref {VC Ignore }) to be part of the project.
1658+
1659+ Emacs provides commands for handling project files conveniently.
1660+ This section describes these commands.
1661+
1662+ @cindex current project
1663+ All of the commands described here share the notion of the
1664+ @dfn {current project }. The current project is determined by the
1665+ @code {default-directory } (@pxref {File Names }) of the buffer that is
1666+ the current buffer when the command is invoked. If that directory
1667+ doesn't seem to belong to a recognizable project, these commands
1668+ prompt you for the project directory.
1669+
1670+ @findex project-find-file
1671+ The command @code {project-find-file } is a convenient way of visiting
1672+ files (@pxref {Visiting }) that belong to the current project. Unlike
1673+ @kbd {C-x C-f }, this command doesn't require to type the full file name
1674+ of the file to visit, you can type only the file's base name (i.e.,
1675+ omit the leading directories). In addition, the completion candidates
1676+ considered by the command include only the files belonging to the
1677+ current project, and nothing else. If there's a file name at point,
1678+ this command offers that file as the default to visit.
1679+
1680+ @findex project-find-regexp
1681+ The command @code {project-find-regexp } is similar to @code {rgrep }
1682+ (@pxref {Grep Searching }), but it searches only the files that belong
1683+ to the current project. The command prompts for the regular
1684+ expression to search, and pops up an Xref mode buffer with the search
1685+ results, where you can select a match using the Xref mode commands
1686+ (@pxref {Xref Commands }). When invoked with a prefix argument, this
1687+ command additionally prompts for the base directory from which to
1688+ start the search; this allows, for example, to limit the search only
1689+ to project files under a certain subdirectory of the project root.
1690+
1691+ @findex project-search
1692+ @kbd {M-x project-search } is an interactive variant of
1693+ @code {project-find-regexp }. It prompts for a regular expression to
1694+ search in the current project's files, but instead of finding all the
1695+ matches and displaying them, it stops when it finds a match and visits
1696+ the matched file at the locus of the match, allowing you to edit the
1697+ matched file. To find the rest of the matches, type @w {@kbd {M-x
1698+ fileloop-continue @key {RET }}}.
1699+
1700+ @findex project-query-replace-regexp
1701+ @kbd {M-x project-query-replace-regexp } is similar to
1702+ @code {project-search }, but it prompts you for whether to replace each
1703+ match it finds, like @code {query-replace } does (@pxref {Query
1704+ Replace }), and continues to the next match after you respond. If your
1705+ response causes Emacs to exit the query-replace loop, you can later
1706+ continue with @w {@kbd {M-x fileloop-continue @key {RET }}}.
1707+
16331708@node Change Log
16341709@section Change Logs
16351710
0 commit comments