Function: comint-indent-input-region
comint-indent-input-region is a byte-compiled function defined in
comint.el.gz.
Signature
(comint-indent-input-region FUN START END)
Documentation
Indent comint process output and input between START and END.
Output text between START and END is indented with FUN and input
text is indented 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-region (fun start end)
"Indent comint process output and input between START and END.
Output text between START and END is indented with FUN and input
text is indented in the indirect buffer created by
`comint-indirect-buffer', which see."
(if comint-use-prompt-regexp
(funcall fun start end)
(let ((opoint (copy-marker (point)))
final-point)
(unwind-protect
(comint--intersect-regions
(lambda (start end)
(goto-char opoint)
(if (= opoint (point))
(unwind-protect (funcall fun start end)
(setq final-point (copy-marker (point))))
(funcall fun start end)))
(lambda (start end)
(let ((min (point-min))
(max (point-max))
(final-point1 nil))
(unwind-protect
(with-current-buffer (comint-indirect-buffer)
(narrow-to-region min max)
(goto-char opoint)
(if (= opoint (point))
(unwind-protect
(funcall indent-region-function start end)
(setq final-point1 (point)))
(funcall indent-region-function start end)))
(when final-point1
(setq final-point (copy-marker final-point1))))))
start end)
(if final-point
(progn
(goto-char final-point)
(set-marker final-point nil))
(goto-char opoint))
(set-marker opoint nil)))))