(lemacs.info)Programs


Next: Running Prev: Text Up: Top

Editing Programs
****************

   Emacs has many commands designed to understand the syntax of
programming languages such as Lisp and C.  These commands can:

   * Move over or kill balanced expressions or "sexps" (Note: Lists.).

   * Move over or mark top-level balanced expressions ("defuns", in
     Lisp; functions, in C).

   * Show how parentheses balance (Note: Matching.).

   * Insert, kill, or align comments (Note: Comments.).

   * Follow the usual indentation conventions of the language (*note
     Grinding::.).

   The commands available for words, sentences, and paragraphs are
useful in editing code even though their canonical application is for
editing human language text.  Most symbols contain words (*note
Words::.); sentences can be found in strings and comments (*note
Sentences::.).  Paragraphs per se are not present in code, but the
paragraph commands are useful anyway, because Lisp mode and C mode
define paragraphs to begin and end at blank lines (*note
Paragraphs::.).  Judicious use of blank lines to make the program
clearer also provides interesting chunks of text for the paragraph
commands to work on.

   The selective display feature is useful for looking at the overall
structure of a function (Note: Selective Display.).  This feature
causes only the lines that are indented less than a specified amount to
appear on the screen.

* Program Modes
Major modes for editing programs.
* Lists
Expressions with balanced parentheses. There are editing commands to operate on them.
* Defuns
Each program is made up of separate functions. There are editing commands to operate on them.
* Grinding
Adjusting indentation to show the nesting.
* Matching
Insertion of a close-delimiter flashes matching open.
* Comments
Inserting, illing and aligning comments.
* Balanced Editing
Inserting two matching parentheses at once, etc.
* Lisp Completion
Completion on symbol names in Lisp code.
* Documentation
Getting documentation of functions you plan to call.
* Change Log
Maintaining a change history for your program.
* Tags
Go direct to any function in your program in one command. Tags remembers which file it is in.
* Fortran
Fortran mode and its special features.

automatically generated by info2www