Function: lua-calculate-indentation-block-modifier

lua-calculate-indentation-block-modifier is a byte-compiled function defined in lua-mode.el.gz.

Signature

(lua-calculate-indentation-block-modifier &optional PARSE-END)

Documentation

Return amount by which this line modifies the indentation.

Beginnings of blocks add lua-indent-level once each, and endings of blocks subtract lua-indent-level once each. This function is used to determine how the indentation of the following line relates to this one.

The argument PARSE-END is a buffer position that bounds the calculation.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/lua-mode.el.gz
(defun lua-calculate-indentation-block-modifier (&optional parse-end)
  "Return amount by which this line modifies the indentation.
Beginnings of blocks add `lua-indent-level' once each, and endings of
blocks subtract `lua-indent-level' once each.  This function is used to
determine how the indentation of the following line relates to this one.

The argument PARSE-END is a buffer position that bounds the calculation."
  (let (indentation-info)
    (save-excursion
      ;; First go back to the line that starts it all
      ;; lua-calculate-indentation-info will scan through the whole thing
      (let ((case-fold-search nil))
        (setq indentation-info
              (lua-accumulate-indentation-info
               (lua-calculate-indentation-info parse-end)))))

    (if (eq (car indentation-info) 'absolute)
        (- (cdr indentation-info) (current-indentation))
      (cdr indentation-info))))