Function: dcl-calc-command-indent-multiple

dcl-calc-command-indent-multiple is a byte-compiled function defined in dcl-mode.el.gz.

Signature

(dcl-calc-command-indent-multiple INDENT-TYPE CUR-INDENT EXTRA-INDENT LAST-POINT THIS-POINT)

Documentation

Indent lines to a multiple of dcl-basic-offset.

Set dcl-calc-command-indent-function to this function to customize indentation of command lines.

Command lines that need to be indented beyond the left margin are always indented to a column that is a multiple of dcl-basic-offset, as if tab stops were set at 4, 8, 12, etc.

This supports a formatting style like this (dcl-margin offset = 2, dcl-basic-offset = 4):

$ if cond
$ then
$ if cond
$ then
$ ! etc

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/dcl-mode.el.gz
;;; *** Perform indentation *************************************************


;;;---------------------------------------------------------------------------
(defun dcl-calc-command-indent-multiple
  (indent-type cur-indent extra-indent _last-point _this-point)
  "Indent lines to a multiple of dcl-basic-offset.

Set dcl-calc-command-indent-function to this function to customize
indentation of command lines.

Command lines that need to be indented beyond the left margin are
always indented to a column that is a multiple of dcl-basic-offset, as
if tab stops were set at 4, 8, 12, etc.

This supports a formatting style like this (dcl-margin offset = 2,
dcl-basic-offset = 4):

$ if cond
$ then
$   if cond
$   then
$       ! etc"
  ;; calculate indentation if it's an interesting indent-type,
  ;; otherwise return nil to get the default indentation
  (let ((indent))
    (cond
     ((equal indent-type 'indent)
      (setq indent (- cur-indent (% cur-indent dcl-basic-offset)))
      (setq indent (+ indent extra-indent))))))