Function: common-lisp-loop-part-indentation

common-lisp-loop-part-indentation is a byte-compiled function defined in cl-indent.el.gz.

Signature

(common-lisp-loop-part-indentation INDENT-POINT STATE)

Documentation

Compute the indentation of loop form constituents.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-indent.el.gz
(defun common-lisp-loop-part-indentation (indent-point state)
  "Compute the indentation of loop form constituents."
  (let* ((loop-indentation (save-excursion
			     (goto-char (elt state 1))
                             (current-column))))
    (when (and (eq lisp-indent-backquote-substitution-mode 'corrected))
      (save-excursion
        (goto-char (elt state 1))
        (cl-incf loop-indentation
                 (cond ((eq (char-before) ?,) -1)
                       ((and (eq (char-before) ?@)
                             (progn (backward-char)
                                    (eq (char-before) ?,)))
                        -2)
                       (t 0)))))

    (goto-char indent-point)
    (beginning-of-line)
    (list
     (cond ((not (lisp-extended-loop-p (elt state 1)))
	    (+ loop-indentation lisp-simple-loop-indentation))
	   ((looking-at "^\\s-*\\(:?\\sw+\\|;\\)")
	    (+ loop-indentation lisp-loop-keyword-indentation))
	   (t
	    (+ loop-indentation lisp-loop-forms-indentation)))
     ;; Tell the caller that the next line needs recomputation, even
     ;; though it doesn't start a sexp.
     loop-indentation)))