Function: ispell-highlight-spelling-error-overlay

ispell-highlight-spelling-error-overlay is a byte-compiled function defined in ispell.el.gz.

Signature

(ispell-highlight-spelling-error-overlay START END &optional HIGHLIGHT)

Documentation

Highlight the word from START to END using overlays.

When the optional third arg HIGHLIGHT is set, the word is highlighted otherwise it is displayed normally.

The variable ispell-highlight-face selects the face to use for highlighting.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/ispell.el.gz
(defun ispell-highlight-spelling-error-overlay (start end &optional highlight)
  "Highlight the word from START to END using overlays.
When the optional third arg HIGHLIGHT is set, the word is highlighted
otherwise it is displayed normally.

The variable `ispell-highlight-face' selects the face to use for highlighting."
  (if highlight
      (if ispell-overlay
	  (move-overlay ispell-overlay start end (current-buffer))
	(setq ispell-overlay (make-overlay start end))
	(overlay-put ispell-overlay 'priority 1001) ;higher than lazy overlays
	(overlay-put ispell-overlay 'face ispell-highlight-face))
    (if ispell-overlay
	(delete-overlay ispell-overlay)))
  (if (and ispell-lazy-highlight (boundp 'lazy-highlight-cleanup))
      (if highlight
	  (let ((isearch-string
		 (concat
		  "\\b"
		  (regexp-quote (buffer-substring-no-properties start end))
		  "\\b"))
		(isearch-regexp t)
		(isearch-regexp-function nil)
		(isearch-case-fold-search nil)
		(isearch-forward t)
		(isearch-other-end start)
		(isearch-error nil))
	    (isearch-lazy-highlight-new-loop
	     (if (boundp 'reg-start) reg-start)
	     (if (boundp 'reg-end)   reg-end)))
	(lazy-highlight-cleanup lazy-highlight-cleanup)
	(setq isearch-lazy-highlight-last-string nil))))