Commit 966a6506 authored by Chong Yidong's avatar Chong Yidong
Browse files

* eieio.texi:

* ede.texi: New files.

* Build EIEIO and EDE manuals.
parent f58f7520
2009-10-07 Chong Yidong <>
* Build EIEIO and EDE manuals.
2009-10-07 Eric Ludlam <>
* eieio.texi:
* ede.texi: New files.
2009-10-05 Michael Albinus <>
* tramp.texi (Remote processes): Association of a pty is not supported.
......@@ -47,7 +47,9 @@ INFO_TARGETS = \
$(infodir)/dbus \
$(infodir)/dired-x \
$(infodir)/ebrowse \
$(infodir)/ede \
$(infodir)/ediff \
$(infodir)/eieio \
$(infodir)/emacs-mime \
$(infodir)/epa \
$(infodir)/erc \
......@@ -93,7 +95,9 @@ DVI_TARGETS = \
dbus.dvi \
dired-x.dvi \
ebrowse.dvi \
ede.dvi \
ediff.dvi \
eieio.dvi \
emacs-mime.dvi \
epa.dvi \
erc.dvi \
......@@ -208,12 +212,24 @@ $(infodir)/ebrowse: ebrowse.texi
ebrowse.dvi: ebrowse.texi
$(ENVADD) $(TEXI2DVI) ${srcdir}/ebrowse.texi
ede : $(infodir)/ede
$(infodir)/ede: ede.texi
cd $(srcdir); $(MAKEINFO) ede.texi
ede.dvi: ede.texi
$(ENVADD) $(TEXI2DVI) ${srcdir}/ede.texi
ediff : $(infodir)/ediff
$(infodir)/ediff: ediff.texi
cd $(srcdir); $(MAKEINFO) ediff.texi
ediff.dvi: ediff.texi
$(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi
eieio : $(infodir)/eieio
$(infodir)/eieio: eieio.texi
cd $(srcdir); $(MAKEINFO) eieio.texi
eieio.dvi: eieio.texi
$(ENVADD) $(TEXI2DVI) ${srcdir}/eieio.texi
emacs-mime : $(infodir)/emacs-mime
$(infodir)/emacs-mime: emacs-mime.texi
cd $(srcdir); $(MAKEINFO) --enable-encoding emacs-mime.texi
\input texinfo
@setfilename ../../info/ede
@settitle Emacs Development Environment
This file describes EDE, the Emacs Development Environment.
Copyright @copyright{} 1998, 1999, 2000, 2001, 2004, 2005, 2008, 2009
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below. A copy of the license
is included in the section entitled ``GNU Free Documentation License.''
(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
modify this GNU manual. Buying copies from the FSF supports it in
developing GNU and promoting software freedom.''
@end quotation
@end copying
* ede: (ede). Project management for Emacs
@end format
@end ifinfo
@center @titlefont{EDE (The Emacs Development Environment)}
@sp 4
@center by Eric Ludlam
@end titlepage
@macro cedet{}
@end macro
@macro semantic{}
@end macro
@macro srecode{}
@end macro
@macro eieio{}
@end macro
@macro ede{}
@end macro
@macro cogre{}
@end macro
@macro speedbar{}
@end macro
@node top, EDE Project Concepts, (dir), (dir)
@top EDE
@comment node-name, next, previous, up
@ede{} is the Emacs Development Environment: an Emacs extension that
simplifies building and debugging programs in Emacs. It attempts to
emulate a typical IDE (Integrated Development Environment). @ede{}
can manage or create your makefiles and other building environment
duties, allowing you to concentrate on writing code rather than
support files. It aims to make it much easier for new programmers to
learn and adopt GNU ways of doing things.
@end ifnottex
* EDE Project Concepts:: @ede{} Project Concepts
* EDE Mode:: Turning on @ede{} mode.
* Creating a project:: Creating a project.
* Modifying your project:: Adding and removing files and targets.
* Building and Debugging:: Initiating a build or debug session.
* Miscellaneous commands:: Other project related commands.
* Simple projects:: Projects not managed by @ede{}.
* Extending EDE:: Programming and extending @ede{}.
@end menu
@node EDE Project Concepts, EDE Mode, top, top
@chapter @ede{} Project Concepts
@ede{} is a generic interface for managing projects. It specifies a
single set of menus and keybindings, while supporting multiple ways to
express a project via a build system.
In the subsequent chapters, we will describe the different project
types (@pxref{Creating a project}), as well as the commands to build
and debug projects (@pxref{Building and Debugging}).
In @ede{}, a project hierarchy matches a directory hierarchy. The
project's topmost directory is called the @dfn{project root}, and its
subdirectories are @dfn{subprojects}.
Each project can contain multiple @dfn{targets}. A target, at the
simplest level, is a named collection of files within a project. A
target can specify two different types of information:
A collection of files to be added to a distribution (e.g., a tarball
that you intend to distribute to others).
A collection of files that can be built into something else (e.g., a
program or compiled documentation).
@end enumerate
Lastly, @ede{} provides a way for other tools to easily learn file
associations. For example, a program might need to restrict some sort
of search to files in a single target, or to discover the location of
documentation or interface files. @ede{} can provide this
@node EDE Mode, Creating a project, EDE Project Concepts, top
@chapter @ede{} Mode
@ede{} is implemented as a minor-mode, which augments other modes such as C
mode, and Texinfo mode. You can turn @ede{} on for all buffers by running
the command @code{global-ede-mode}, or by putting this in your
@file{~/.emacs} file:
(global-ede-mode t)
@end example
When @ede{} is active for a given buffer, the menu item
``Development'' appears. This menu provides several menu items for
high-level @ede{} commands. These menu items, and their corresponding
keybindings, are independent of the type of project you are actually
working on.
@node Creating a project, Modifying your project, EDE Mode, top
@chapter Creating a project
To create a new project, first visit a file that you want to include
in that project. If you have a hierarchy of directories, choose a
file in the topmost directory first. From this buffer, type @kbd{M-x
ede-new}, or click on the @samp{Create Project} item in the
@samp{Development} menu.
The @command{ede-new} command prompts for the type of project you
would like to create. Each project type has its own benefits or
language specific enhancements. @ede{} supports four different
project types: @samp{Make}, @samp{Automake}, @samp{direct Automake},
and @samp{Simple}.
For the @samp{Make} project type, @ede{} creates a @dfn{project file},
called @file{Project.ede}, in each project directory. Information
about the project is stored in this file. This project autogenerates
a @file{Makefile}.
For the @samp{Automake} project type, @ede{} creates a
@file{Project.ede} project file similar to a @samp{Make} project.
Unlike a @samp{Make} project, this project autogenerates a
@file{} file. @ede{} handles the Automake bootstrapping
routines, which import and maintain a @file{} script and
other required files.
For the @samp{direct Automake} project type, @ede{} reads directly
from the Automake files.
You cannot create direct Automake projects with the @command{ede-new}
command. Instead, when you visit a project with existing Automake
files, @ede{} automatically detects them.
The @samp{Simple} project type provides light-weight constructs for
identifying a project root and looking up files. If you already have
a non-@ede{} project infrastructure, you can use a @samp{Simple}
project to provide other Emacs packages, such as Semantic, with some
information about the project. @xref{Simple projects}.
@end itemize
A subproject is merely a project in a subdirectory of another project.
You can create a subproject by using the @command{ede-new} command (or
the @samp{Create Project} menu item), while visiting a buffer in a
subdirectory of the project root. This new project is automatically
added to the parent project, and will be automatically loaded when
@ede{} reads the parent project.
When using a project command that involves a makefile, @ede{} uses
the top-most project's makefile as a starting place for the build. How
the toplevel project handles subprojects in the build process is
dependent on that project's type.
@node Modifying your project, Building and Debugging, Creating a project, top
@chapter Modifying your project
In this chapter, we describe the generic features for manipulating
projects, including the targets and files within them. Subsequent
chapters, which describe specific project types, will provide more
detailed information about exactly what these features do.
* Add/Remove target::
* Add/Remove files::
* Customize Features::
* EDE Project Features::
@end menu
@node Add/Remove target, Add/Remove files, Modifying your project, Modifying your project
@section Add/Remove target
To create a new target, type @kbd{C-c . t} (@code{M-x ede-new-target})
or use the @samp{Add Target} menu item in the @samp{Project Options}
submenu. This prompts for a target name, and adds the current buffer
to that target.
The @command{ede-new-target} command also prompts for a @dfn{target
type}. Each target type has its own build process and class of files
that it will accept.
To remove a target from the project, type @kbd{M-x ede-delete-target},
or use the @samp{Remove Target} menu item in the @samp{Project
Options} submenu.
@node Add/Remove files, Customize Features, Add/Remove target, Modifying your project
@section Add/Remove files
To add the current file to an existing target, type @kbd{C-c . a}
(@code{ede-add-file}), or or use the @samp{Add File} menu item in the
@samp{Target Options} submenu.
You can add a file to more than one target; this is OK.
To remove the current file from a target, type @kbd{C-c . d}
(@code{ede-remove-file}), or or use the @samp{Remove File} menu item
in the @samp{Target Options} submenu. If the file belongs to multiple
targets, this command prompts for each target it could be removed
While working in a project, if you visit a file that is not part of an
existing target, @ede{} automatically prompts for a target. If you do
not wish to add the file to any target, you can choose @samp{none}.
You can customize this behavior with the variable
@node Customize Features, EDE Project Features, Add/Remove files, Modifying your project
@section Customize Features
A project, and its targets, are objects using the @samp{EIEIO} object
system. @xref{Top,,,eieio,EIEIO manual}. These objects have data
fields containing important information related to your work.
If the high-level functions aren't enough, you can tweak all
user-customizable fields at any time by running the command
@command{customize-project} or @command{customize-target}. This loads
the current project or target into a customization buffer, where you
can tweak individual slots. This is usually necessary for complex
Some project modes do not have a project file, but directly read a
Makefile or other existing file. Instead of directly editing the
object, you can edit the file by typine @kbd{C-c . e}
(@code{ede-edit-file-target}). You should ``rescan'' the project
afterwards (@pxref{Miscellaneous commands}).
@node EDE Project Features, , Customize Features, Modifying your project
@section EDE Project Features
This section details user facing features of an @ede{} @samp{Make}
style project. An @samp{Automake} project has similar options (but a
direct Automake project does not).
To modify any of the specific features mentioned here, you need to
customize the project or target with @command{customize-project} or
When you are customizing, you are directly manipulating slot values in
@eieio{} objects. @xref{Extending EDE}, if you are interested in
additional details.
* Changing Compilers and Flags::
* Configurations::
@end menu
@node Changing Compilers and Flags, Configurations, EDE Project Features, EDE Project Features
@subsection Changing Compilers and Flags
Targets that build stuff need compilers. To change compilers, you
need to customize the desired target.
In the @samp{[Make]} section, you can choose a new compiler or linker
from the list. If a linker you need is not available, you will need
to create a new one. @xref{Compiler and Linker objects}.
If an existing compiler or linker is close, but you need to modify
some flag set such as adding an include path you will need to add a
configuration variable.
To start, you should create the basic setup, and construct a makefile
with @command{ede-proj-regenerate}. Look in the @file{Makefile} to
see what commands are inserted. Once you have determined the variable
you need to modify, you can add a configuration for it.
@node Configurations, , Changing Compilers and Flags, EDE Project Features
@subsection Configurations
Configurations specify different ways to build a project. For
example, you may configure a project to be in ``debug'' mode, or
perhaps in ``release'' mode.
The project, and each target type all have a slot named
@code{configuration-variables}. To add new variables to a
configuration find this slot in the custom buffer, and insert a new
configuration. Name it either ``debug'' or ``release'', then insert
some number of name/value pairs to it.
You can have any number of valid configurations too. To add a new
configuration, customize your project. Work in the @samp{[Settings]}
block for ``configurations''. Add a new named configuration here.
To switch between different active configurations, modify the
``configuration default'' slot.
@node Building and Debugging, Miscellaneous commands, Modifying your project, top
@chapter Building and Debugging
@ede{} provides the following ``project-aware'' compilation and
debugging commands:
@table @kbd
@item C-c . c
Compile the current target (@code{ede-compile-target}).
@item C-c . C
Compile the entire project (@code{ede-compile-project}).
@item c-c . D
Debug the current target (@code{ede-debug-target}).
@item M-x ede-make-dist
Build a distribution file for your project.
@end table
These commands are also available from the @samp{Development} menu.
@node Miscellaneous commands, Simple projects, Building and Debugging, top
@chapter Miscellaneous commands
If you opt to go in and edit @ede{} project files directly---for
instance, by using @kbd{C-c . e} (@pxref{Customize Features})---you
must then ``rescan'' the project files to update the internal data
structures. To rescan the current project, type @kbd{C-c . g}
@ede{} can help you find files in your project, via the command
@kbd{C-c . f} (@code{ede-find-file}). This prompts for a file name;
you need not specify the directory. EDE then tries to visit a file
with that name somewhere in your project.
@ede{} can use external tools to help with file finding. To do this,
customize @code{ede-locate-setup-options}.
@defvar ede-locate-setup-options
List of locate objects to try out by default.
Listed in order of preference. If the first item cannot be used in
a particular project, then the next one is tried.
It is always assumed that @dfn{ede-locate-base} is at end of the list.
@end defvar
@ede{} also provides a project display mode for the speedbar
(@pxref{Speedbar,,,emacs,GNU Emacs Manual}). This allows you to view
your source files as they are structured in your project: as a
hierarchical tree, grouped according to target.
To activate the speedbar in this mode, type @kbd{C-c . s}
@node Simple projects, Extending EDE, Miscellaneous commands, top
@section Simple Projects
There is a wide array of Simple projects. The root for simple
projects is the class @code{ede-simple-project}. This handles the
infrastructure of storing a .ede file if needed.
The class @code{ede-simple-project} is designed to be subclassed.
Then key @ede{} methods can be overridden to provide a quick wrapper
over any project.
A second project type is @code{ede-cpp-root}. This project type is
designed to be created for a directory hierarchy full of C/C++ code.
It can be configured with minimal lisp knowledge to do header file
lookup for @semantic{}, improving code completion performance.
* ede-cpp-root:: This project marks the root of a C/C++ code project.
* ede-simple subclassing:: Create your own simple project.
* ede-emacs:: A project for working with Emacs.
* ede-linux:: A project for working with Linux kernels.
* Custom Locate:: Customizing how to locate files in a simple project
@end menu
@node ede-cpp-root
@subsection ede-cpp-root
The @code{ede-cpp-root} project type allows you to create a single
object with no save-file in your @file{.emacs} file. It allows @ede{}
to provide the @semantic{} package with the ability to find header
files quickly.
The @code{ede-cpp-root} class knows a few things about C++ projects,
such as the prevalence of "include" directories, and typical
file-layout stuff. If this isn't sufficient, you can subclass
@code{ede-cpp-root-project} and add your own tweaks in just a few
lines. See the end of this file for an example.
In the most basic case, add this to your @file{.emacs} file, modifying
appropriate bits as needed.
(ede-cpp-root-project "SOMENAME" :file "/dir/to/some/file")
@end example
Replace @var{SOMENAME} with whatever name you want, and the filename
to an actual file at the root of your project. It might be a
Makefile, a README file. Whatever. It doesn't matter. It's just a
key to hang the rest of @ede{} off of.
The most likely reason to create this project, is to speed up
searching for includes files, or to simplify bootstrapping @semantic{}'s
ability to find files without much user interaction. In conjunction
with @semantic{} completion, having a short include path is key. You can
override the default include path and system include path like this:
(ede-cpp-root-project "NAME" :file "FILENAME"
:include-path '( "/include" "../include" "/c/include" )
:system-include-path '( "/usr/include/c++/3.2.2/" )
:spp-table '( ("MOOSE" . "")
("CONST" . "const") ) )
@end example
In this case each item in the include path list is searched. If the
directory starts with "/", then that expands to the project root
directory. If a directory does not start with "/", then it is
relative to the default-directory of the current buffer when the file
name is expanded.
The include path only affects C/C++ header files. Use the slot
@code{:header-match-regexp} to change it.
The @code{:system-include-path} allows you to specify full directory
names to include directories where system header files can be found.
These will be applied to files in this project only.
The @code{:spp-table} provides a list of project specific #define
style macros that are unique to this project, passed in to the
compiler on the command line, or are in special headers.
See the @code{semantic-lex-c-preprocessor-symbol-map} for more
on how to format this entry.
If there is a single file in your project, you can instead set the
@code{:spp-files} to a list of file names relative to the root of your
project. Specifying this is like setting the variable
@code{semantic-lex-c-preprocessor-symbol-file} in semantic.
If you want to override the file-finding tool with your own
function you can do this:
(ede-cpp-root-project "NAME" :file "FILENAME" :locate-fcn 'MYFCN)
@end example
Where @var{MYFCN} is a symbol for a function. The locate function can
be used in place of @code{ede-expand-filename} so you can quickly
customize your custom target to use specialized local routines instead
of the default @ede{} routines. The function symbol must take two
@table @var
@item NAME
The name of the file to find.
@item DIR
The directory root for this cpp-root project.
@end table
If the cpp-root project style is right for you, but you want a dynamic
loader, instead of hard-coding path name values in your @file{.emacs}, you
can do that too, but you will need to write some lisp code.
To do that, you need to add an entry to the
@code{ede-project-class-files} list, and also provide two functions to
teach @ede{} how to load your project pattern
It would look like this:
(defun MY-FILE-FOR-DIR (&optional dir)
"Return a full file name to the project file stored in DIR."
<write your code here, or return nil>
(defun MY-ROOT-FCN ()
"Return the root fcn for `default-directory'"
;; You might be able to use `ede-cpp-root-project-root'
;; and not write this at all.
(defun MY-LOAD (dir)
"Load a project of type `cpp-root' for the directory DIR.
Return nil if there isn't one."
;; Use your preferred constructin method here.
(ede-cpp-root-project "NAME" :file (expand-file-name "FILE" dir)
:locate-fcn 'MYFCN)
(add-to-list 'ede-project-class-files
(ede-project-autoload "cpp-root"
:name "CPP ROOT"
:file 'ede-cpp-root
:proj-file 'MY-FILE-FOR-DIR
:proj-root 'MY-ROOT-FCN
:load-type 'MY-LOAD
:class-sym 'ede-cpp-root)
@end example
This example only creates an auto-loader, and does not create a new kind
of project.
@xref{ede-cpp-root-project}, for details about the class that defines
the @code{ede-cpp-root} project type.
@node ede-simple subclassing
@subsection ede-simple Subclassing
todo - Write some doc.
In the meantime look in the commentary of ede-simple.el
@node ede-emacs
@subsection ede-emacs
The @code{ede-emacs} project automatically identifies an Emacs source
tree, and enables EDE project mode for it.
It pre-populates the C Preprocessor symbol map for correct parsing,
and has an optimized include file identification function.
@node ede-linux
@subsection ede-linux
The @code{ede-linux} project will automatically identify a Linux
Kernel source tree, and enable EDE project mode for it.
It pre-populates the C Preprocessor symbol map for reasonable parsing,
and has an optimized include file identification function.
@node Custom Locate
@subsection Custom Locate
The various simple project styles all have one major drawback, which
is that the files in the project are not completely known to EDE.
When the EDE API is used to try and file files by some reference name
in the project, then that could fail.
@@TODO - Add ID Utils and CScope examples
@ede{} can therefore use some external locate commands, such as the unix
``locate'' command, or ``GNU Global''.
Configuration of the tool you want to use such as @code{locate}, or
@code{global} will need to be done without the aid of @ede{}. Once
configured, however, @ede{} can use it.
To enable one of these tools, set the variable
@code{ede-locate-setup-options} with the names of different locate
objects. @ref{Miscellaneous commands}.
Configure this in your @file{.emacs} before loading in CEDET or EDE.
If you want to add support for GNU Global, your configuration would
look like this:
(setq ede-locate-setup-options '(ede-locate-global ede-locate-base))
@end example