Go to the first, previous, next, last section, table of contents.


Mode-Specific Comments

When you wish to enter a comment in a piece of source code Jade has a command to do this (insert-comment); each major mode which wishes to allow comments (created by this command) must give the following variable a suitable function.

Variable: mode-comment-fun
This buffer-local variable contains the function to call when a comment is to be entered, basically the insert-comment command just calls this function.

Function: find-comment-pos
This function moves the cursor to a suitable position for inserting a comment in the current line.

Variable: comment-column
Buffer-local variable containing the canonical column number which comments should begin at (used by the find-comment-pos function). If the line extends past this column the next tab stop after the end of the line is used instead.

The following function is an example of what is needed in the mode-comment-fun variable; it is used by the C mode.

(defun c-insert-comment ()
  (interactive)
  (find-comment-pos)
  (insert "/*  */")
  (goto-left-char 3))


Go to the first, previous, next, last section, table of contents.