(defcustom dcl-basic-offset 4
"Number of columns to indent a block in DCL.
A block is the commands between THEN-ELSE-ENDIF and between the commands
-dcl-block-begin-regexp and dcl-block-end-regexp.
+`dcl-block-begin-regexp' and `dcl-block-end-regexp'.
The meaning of this variable may be changed if
-dcl-calc-command-indent-function is set to a function."
+`dcl-calc-command-indent-function' is set to a function."
:type 'integer)
A continuation line is a line that follows a line ending with `-'.
The meaning of this variable may be changed if
-dcl-calc-cont-indent-function is set to a function."
+`dcl-calc-cont-indent-function' is set to a function."
:type 'integer)
(defcustom dcl-margin-label-offset 2
"Number of columns to indent a margin label in DCL.
A margin label is a label that doesn't begin or end a block, i.e. it
-doesn't match dcl-block-begin-regexp or dcl-block-end-regexp."
+doesn't match `dcl-block-begin-regexp' or `dcl-block-end-regexp'."
:type 'integer)
CUR-INDENT + EXTRA-INDENT.
This package includes two functions suitable for this:
- dcl-calc-command-indent-multiple
- dcl-calc-command-indent-hang"
+ `dcl-calc-command-indent-multiple'
+ `dcl-calc-command-indent-hang'"
:type '(choice (const nil) function))
CUR-INDENT + EXTRA-INDENT.
This package includes one function suitable for this:
- dcl-calc-cont-indent-relative"
+ `dcl-calc-cont-indent-relative'"
:type 'function)
(list "endif" "else" dcl-label-r)
"Regexps that can trigger an electric reindent.
A list of regexps that will trigger a reindent if the last letter
-is defined as dcl-electric-character.
+is defined as `dcl-electric-character'.
E.g.: if this list contains `endif', the key `f' is defined as
-dcl-electric-character and you have just typed the `f' in
+`dcl-electric-character' and you have just typed the `f' in
`endif', the line will be reindented."
:type '(repeat regexp))
(comment-start curval)
(comment-start-skip curval)
)
- "Options and default values for dcl-set-option.
+ "Options and default values for `dcl-set-option'.
An alist with option variables and functions or keywords to get a
default value for the option.
(mapcar (lambda (option-assoc)
(format "%s" (car option-assoc)))
dcl-option-alist)
- "The history list for dcl-set-option.
-Preloaded with all known option names from dcl-option-alist")
+ "The history list for `dcl-set-option'.
+Preloaded with all known option names from `dcl-option-alist'")
;; Must be defined after dcl-cmd-r
;;;---------------------------------------------------------------------------
(defun dcl-show-line-type ()
- "Test dcl-get-line-type."
+ "Test `dcl-get-line-type'."
(interactive)
(let ((type (dcl-get-line-type)))
(cond
$ then
$ if cond
$ then
-$ ! etc
-"
+$ ! etc"
;; calculate indentation if it's an interesting indent-type,
;; otherwise return nil to get the default indentation
(let ((indent))
If you use this function you will probably want to add \"then\" to
dcl-electric-reindent-regexps and define the key \"n\" as
-dcl-electric-character.
-"
+dcl-electric-character."
(let ((case-fold-search t))
(save-excursion
(cond
Analyze the current line to see if it should be `outdented'.
Calculate the indentation of the current line, either with the default
-method or by calling dcl-calc-command-indent-function if it is
+method or by calling `dcl-calc-command-indent-function' if it is
non-nil.
If the current line should be outdented, calculate its indentation,
either with the default method or by calling
-dcl-calc-command-indent-function if it is non-nil.
+`dcl-calc-command-indent-function' if it is non-nil.
Rules for default indentation:
-If it is the first line in the buffer, indent dcl-margin-offset.
+If it is the first line in the buffer, indent `dcl-margin-offset'.
Go to the previous command line with a command on it.
Find out how much it is indented (cur-indent).
adjusted. Skip margin-label, continuations and comments while looking for
the first word. Save this buffer position as `last-point'.
If the first word after a label is SUBROUTINE, set extra-indent to
-dcl-margin-offset.
+`dcl-margin-offset'.
First word extra-indent
THEN +dcl-basic-offset
* the innermost nonclosed parenthesis
$ if ((a.eq.b .and. -
d.eq.c .or. f$function(xxxx, -
- yyy)))
-"
+ yyy)))"
(let ((case-fold-search t)
indent)
(save-excursion
;;;-------------------------------------------------------------------------
(defun dcl-indent-command ()
- "Indents the complete command line that point is on.
+ "Indent the complete command line that point is on.
This includes continuation lines."
(interactive "*")
(let ((type (dcl-get-line-type)))
;;;-------------------------------------------------------------------------
(defun dcl-electric-character (arg)
- "Inserts a character and indents if necessary.
+ "Insert a character and indent if necessary.
Insert a character if the user gave a numeric argument or the flag
`dcl-electric-characters' is not set. If an argument was given,
insert that many characters.
;;;-------------------------------------------------------------------------
(defun dcl-save-all-options ()
- "Save all dcl-mode options for this buffer.
-Saves or updates all dcl-mode related options in a `Local Variables:'
+ "Save all `dcl-mode' options for this buffer.
+Saves or updates all `dcl-mode' related options in a `Local Variables:'
section at the end of the current buffer."
(interactive "*")
(mapcar (lambda (option-assoc)