home *** CD-ROM | disk | FTP | other *** search
- #############################################################################
- File: CommentMode.FPL
- Author: Jesper Skov
- Email: jskov@iesd.auc.dk
- Short: Easy source code commenting
- Version: 2.2
- Date: 15.06.95
- Local settings: Quite a few!
- Global settings:
- Keysequence: "amiga ;" and "amiga :"
- Type: minor mode
- Prereq:
- Copyright: © 1994-1995, Jesper Skov
- #############################################################################
-
- FUNCTION
- The comment functions have been completely rewritten to improve
- control of how the comments look. With these functions it should be
- a bit easier to keep your code well commented :)
-
- Key-bindings: <amiga ;> InsertComment
- <amiga :> LineComment
-
-
- The InsertComment function is a copy-cat of the Emacs "indent-for-comment"
- function. The variable "comment_start_skip" is a regular expression
- describing how to find a comment on the line. It must therefore match
- the string you put in "comment_start". This variable and "comment_end"
- describe how the comment looks.
-
- The default values are:
- comment_start_skip : "//\\*+ " - a / followed by one or more *'s and a
- space.
- comment_start : "/* "
- comment_end : " */"
-
- These give you the standard C comment style (/*<comment>*/).
-
- I personally use these values:
- comment_start_skip : "////+ " - two or more /'s, followed by a space.
- comment_start : "// "
- comment_end : "" (empty)
-
- Which gives me C++/FPL comment style (// <comment>EOL).
-
- Activating this function on a line which already has a comment, will
- try to indent the comment to the correct "comment_column" and place
- the cursor after the string matching comment_start_skip.
-
-
- The LineComment function gives you an easy way of (visually) splitting the
- source code into function/routine "areas". When invoking this function
- you will be asked for a describing text, which will be right justified
- in the comment block. Example:
-
- //»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» This comment is created by LineComment ««
-
- The width of the comment block may be controlled with the "wall_right"
- variable. The appearance of the line comment is defined by the three
- variables below. Their default values are also listed:
-
- line_comment_start : "//"
- line_comment_body : "»" (This variable must be a single character!)
- line_comment_end : "««"
-
- An empty string cancels the operation (as does the Cancel gadget :)
-
-
- You may change the variables by activating the function CommentModePrefs(),
- which should also be accessible in the menu:
- Customizing->Program->CommentMode
-
- You should be aware of the fact that other minor modes may change the
- settings of this mode. Thereby the comment strings associated with each
- mode (read "type of text") are configurable in the appropriate minor mode's
- preference window (e.g. CMode may set the strings to something like the
- ones described in this document whereas the AsmMode would set the strings
- appropriate to assembler conventions).
-
-
- HISTORY (REV)
- 15.06.95 (2) Made into a minor mode (called CommentMode). You should update
- your User.FPL, and make sure that the major modes you use
- enable CommentMode if needed. Check out the FMC documentation.
- 02.03.95 (1) Put CommentPrefs in the menu.
- 26.02.95 (0) Rewritten from scratch. Much better commenting possible!
- 05.11.94 (2) Added right_wall constructor.
- 23.10.94 (1) ReadInfo("linelength") -> ReadInfo("line_length")
- 09.10.94 (0) Initial revision
-
- BUGS
- Nah, not today anyway :)
-
-
- IDEAS
- Kill comment.
- Wrapped comment (continue writing on next line).
-
- SEE ALSO
- FMC.FPL(.readme)
- C.J.Cherryh's "The Paladin" (ISBN: 0-671-65417-9)
-