Function: lua-calculate-string-or-comment-indentation

lua-calculate-string-or-comment-indentation is a byte-compiled function defined in lua-mode.el.gz.

Signature

(lua-calculate-string-or-comment-indentation)

Documentation

This should be run when point at current-indentation is in a string.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/lua-mode.el.gz
(defun lua-calculate-string-or-comment-indentation ()
  "This should be run when point at `current-indentation' is in a string."
  (if (and (lua-string-p)
           (not lua-indent-string-contents))
      ;; If inside string and strings aren't to be indented, return
      ;; current indentation.
      (current-indentation)

    ;; At this point, we know that we're inside comment, so make sure
    ;; close-bracket is unindented like a block that starts after
    ;; left-shifter.
    (let ((left-shifter-p (looking-at "\\s *\\(?:--\\)?\\]\\(?1:=*\\)\\]")))
      (save-excursion
        (goto-char (lua-comment-or-string-start-pos))
        (+ (current-indentation)
           (if (and left-shifter-p
                    (looking-at (format "--\\[%s\\["
                                        (match-string-no-properties 1))))
               0
             lua-indent-level))))))