Function: comint-indent-input-line

comint-indent-input-line is a byte-compiled function defined in comint.el.gz.

Signature

(comint-indent-input-line FUN)

Documentation

Indent current line from comint process output or input.

If point is on output, call FUN, otherwise indent the current line in the indirect buffer created by comint-indirect-buffer, which see.

Source Code

;; Defined in /usr/src/emacs/lisp/comint.el.gz
(defun comint-indent-input-line (fun)
  "Indent current line from comint process output or input.
If point is on output, call FUN, otherwise indent the current
line in the indirect buffer created by `comint-indirect-buffer',
which see."
  (if (or comint-use-prompt-regexp
          (eq (get-text-property (point) 'field) 'output))
      (funcall fun)
    (let ((point (point))
          (min (point-min))
          (max (point-max)))
      (unwind-protect
          (with-current-buffer (comint-indirect-buffer)
            (narrow-to-region min max)
            (goto-char point)
            (narrow-to-region (field-beginning) (field-end))
            (unwind-protect (funcall indent-line-function)
              (setq point (point))))
        (goto-char point)))))