18Chapter2 • Working With Editors
Jed extensibility is based on the s-lang libraries (www.s-lang.org) that were developed by
John E. Davis as a generic macro language that would become the basis for a number of differ-
ent programs. S-lang programs resemble C in syntax and layout.
2.1.2Understanding Syntax
By understanding the syntax of the programming, the editor can perform a number of
functions that make it easier for the programmer to move through the code, locate bugs more
quickly and perform other common functions.
Such functions include jumping to the beginning of a stanza in the code, highlighting that
stanza, automatic indenting, highlighting syntax, and quickly inserting comments and comment-
ing on entire sections of code.
2.1.3Tag Support
The
ctags
and
etags
utilities that come with Linux are able to build a list of the various
functions, classes, fragments, data blocks and other information within the various files that
make up the application. Not all information is available for all languages. For example, while
only subroutines are supported for the Perl language, support for the C/C++ languages includes:
•macros (names defined/undefined by #define / #undef)
•enumerators (enumerated values)
•function definitions, prototypes, and declarations
•class, enum, struct, and union names
•namespaces
•typedefs
•variables (definitions and declarations)
•class, struct, and union members
Both Emacs and vim provide the ability for the editor to understand standard tag files and
help the programmer quickly locate and edit the portion of code that he/she is working on.
Emacs uses the output from
etags
, while vi uses
ctags
.
2.1.4Folding Code
Folding code refers to the ability of the editor to hide portions of code while they are not
needed. For example, all of the functions or subroutines in the code can be folded so that only
the names of the functions are seen until the programmer unfolds that routine to work on it.
2.2Emacs
Emacs is a lisp-based editor that has been around in one form or another since the late 1970s;
despite its long history, it remains one of the most up-to-date and widely used editing environ-
Next Page >>
<< Previous Page
Back to the Table of Contents