4.1.4 Continuation Lines and Filling

In IDL, a newline character terminates a statement unless preceded by a ‘$’. If you would like to start a continuation line, use M-RET, which calls the command idlwave-split-line. It inserts the continuation character ‘$’, terminates the line and indents the new line. The command M-RET can also be invoked inside a string to split it at that point, in which case the ‘+’ concatenation operator is used.

When filling comment paragraphs, IDLWAVE overloads the normal filling functions and uses a function which creates the hanging paragraphs customary in IDL routine headers. When auto-fill-mode is turned on (toggle with C-c C-a), comments will be auto-filled. If the first line of a paragraph contains a match for idlwave-hang-indent-regexp (a dash-space by default), subsequent lines are positioned to line up after it, as in the following example.

;=================================
; x - an array containing
;     lots of interesting numbers.
;
; y - another variable where
;     a hanging paragraph is used
;     to describe it.
;=================================

You can also refill a comment at any time paragraph with M-q. Comment delimiting lines as in the above example, consisting of one or more ‘;’ followed by one or more of the characters ‘+=-_*’, are kept in place, as is.

User Option: idlwave-fill-comment-line-only (t)

Non-nil means auto fill will only operate on comment lines.

User Option: idlwave-auto-fill-split-string (t)

Non-nil means auto fill will split strings with the IDL ‘+’ operator.

User Option: idlwave-split-line-string (t)

Non-nil means idlwave-split-line will split strings with ‘+’.

User Option: idlwave-hanging-indent (t)

Non-nil means comment paragraphs are indented under the hanging indent given by idlwave-hang-indent-regexp match in the first line of the paragraph.

User Option: idlwave-hang-indent-regexp ("- ")

Regular expression matching the position of the hanging indent in the first line of a comment paragraph.

User Option: idlwave-use-last-hang-indent (nil)

Non-nil means use last match on line for idlwave-indent-regexp.