Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   Commands by Topic
      . . .
      Language Modes
         Asm Mode
         Batch Mode
         C Mode
         . . .
         Visual Basic Mode
      More Programming Features
         . . .
         Accessing Help
         Context-Sensitive Help
         Commenting Commands
      Fixing Mistakes
         Undoing
         Interrupting a Command
      . . .

Previous   Up    Next
Context-Sensitive Help  Commands by Topic   Undoing


Epsilon User's Manual and Reference > Commands by Topic > More Programming Features >

Commenting Commands

The Alt-; command creates a comment on the current line, using the commenting style of the current language mode. The comment begins at the column specified by the comment-column variable (by default 40). (However, if the comment is the first thing on the line and indent-comment-as-code is nonzero, it indents to the column specified by the buffer's language-specific indentation function.) If the line already has a comment, this command moves the comment to the comment column. (Also see the align-region command described in Aligning to align all comments in a region to the same column.)

With a numeric argument, Alt-; searches for the next comment in the buffer and goes to its start. With a negative argument, Alt-; searches backwards for a comment. Press Alt-; again to reindent the comment.

By default (and in modes that don't specify a commenting style), comments begin with the ; character and continue to the end of the line. C mode recognizes both old-style /* */ comments, and the newer C++-style comments //, and by default creates the latter. Set the variable new-c-comments to 0 if you want Alt-; to create old-style comments.

The Ctrl-X ; command sets future comments to begin at the current column. With a positive argument, it sets the comment column based on the indentation of the previous comment in the buffer. If the current line has a comment, this command reindents it.

With a negative argument (as in Alt-<Minus> Ctrl-X ;), the Ctrl-X ; command doesn't change the comment column at all. Instead, it kills any comment on the current line. The command saves the comment in a kill buffer.

You can comment out a region of text by pressing Ctrl-C Ctrl-R. Epsilon adds a comment delimiter to the start of each line in the region between point and mark. With a numeric argument, as in Ctrl-U Ctrl-C Ctrl-R, Epsilon removes such a comment delimiter from each line.

The comment commands look for comments using regular expression patterns (see Regular Expressions) contained in the buffer-specific variables comment-pattern (which should match the whole comment) and comment-start (which should match the sequence that begins a comment, like "/*"). When creating a comment, it inserts the contents of the buffer-specific variables comment-begin and comment-end around the new comment. When Epsilon puts a buffer in C mode, it decides how to set these variables based on the new-c-comments variable.

In certain modes, including C and Perl modes, Epsilon normally auto-fills text in block comments as you type, breaking overly long lines. See the c-auto-fill-mode variable for C and Perl modes, tex-auto-fill-mode for TeX, html-auto-fill-mode for HTML, xml-auto-fill-mode for XML, and misc-language-fill-mode in Makefile, VHDL, Visual Basic, Python, PostScript, Conf, and Ini modes. As with normal auto-fill mode (see Formatting Text), use Ctrl-X F to set the right margin for filling. Set the c-fill-column variable to change the default right margin in C and Perl mode buffers; margin-right in other modes.

You can manually refill the current paragraph in a block comment by pressing Alt-q. If you provide a numeric prefix argument to Alt-q, say by typing Alt-2 Alt-q, it will fill using the current column as the right margin. By default, Epsilon doesn't apply auto-filling to a comment line that also contains non-comment text (such as a C statement with a comment after it on the same line). Use Alt-q to break such lines.

The auto-fill-comment-rules variable lets you customize certain aspects of Epsilon's behavior when breaking and filling comment lines.

Standard bindings:

  Alt-;  indent-for-comment
 Ctrl-X ;  set-comment-column
 Alt-<Minus> Ctrl-X ;  kill-comment
 Ctrl-C Ctrl-R  comment-region
 



Previous   Up    Next
Context-Sensitive Help  Commands by Topic   Undoing


Lugaru Copyright (C) 1984, 2012 Lugaru Software Ltd. All Rights Reserved.