Function: compilation-set-overlay-arrow
compilation-set-overlay-arrow is a byte-compiled function defined in
compile.el.gz.
Signature
(compilation-set-overlay-arrow W)
Documentation
Set up, or switch off, the overlay-arrow for window W.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/compile.el.gz
(defun compilation-set-overlay-arrow (w)
"Set up, or switch off, the overlay-arrow for window W."
(with-selected-window w ; So the later `goto-char' will work.
(if (and (eq compilation-context-lines t)
(equal (car (window-fringes w)) 0)) ; No left fringe
;; Insert a before-string overlay at the beginning of the line
;; pointed to by `overlay-arrow-position', such that it will
;; display in a 2-character margin.
(progn
(cond
((overlayp compilation-arrow-overlay)
(when (not (eq (overlay-start compilation-arrow-overlay)
overlay-arrow-position))
(if overlay-arrow-position
(move-overlay compilation-arrow-overlay
overlay-arrow-position overlay-arrow-position)
(compilation--tear-down-arrow-spec-in-margins))))
(overlay-arrow-position
(compilation--set-up-arrow-spec-in-margins)))
;; Ensure that the "=>" remains in the window by causing
;; the window to be scrolled, if needed.
(goto-char (overlay-start compilation-arrow-overlay)))
;; `compilation-context-lines' isn't t, or we've got a left
;; fringe, so remove any overlay arrow.
(when (overlayp compilation-arrow-overlay)
(compilation--tear-down-arrow-spec-in-margins)))))