Lugaru's Epsilon
Programmer's
Editor

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

Previous   Up    Next
Accessing 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.

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.

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 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. 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.

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.

Standard bindings:

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



Previous   Up    Next
Accessing Help  Commands by Topic   Undoing


Lugaru Copyright (C) 1984, 2020 by Lugaru Software Ltd. All rights reserved.