Function: show-paren--show-context-in-overlay
show-paren--show-context-in-overlay is a byte-compiled function
defined in paren.el.gz.
Signature
(show-paren--show-context-in-overlay TEXT)
Documentation
Show TEXT in an overlay at the top-left of the current window.
Source Code
;; Defined in /usr/src/emacs/lisp/paren.el.gz
(defun show-paren--show-context-in-overlay (text)
"Show TEXT in an overlay at the top-left of the current window."
(setq text (replace-regexp-in-string "\n" " " text))
(show-paren--delete-context-overlay)
(let* ((beg (window-start))
(end (save-excursion
(goto-char beg)
(line-end-position))))
(setq show-paren--context-overlay (make-overlay beg end)))
(overlay-put show-paren--context-overlay 'display text)
;; Use the (default very high) `show-paren-priority' ensuring that
;; not other overlays shine through (bug#59527).
(overlay-put show-paren--context-overlay 'priority
show-paren-priority)
(overlay-put show-paren--context-overlay
'face `(:box
( :line-width (1 . -1)
:color ,(face-attribute 'shadow :foreground))))
(add-hook 'post-command-hook #'show-paren--delete-context-overlay
nil 'local))