From: Richard M. Stallman Date: Sat, 1 Jan 1994 10:22:02 +0000 (+0000) Subject: (ispell-highlight, ispell-dehighlight): New functions. X-Git-Tag: emacs-19.34~10451 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f7cf7ffe36fb4a18e2fc873431b87188c80fb9f1;p=emacs.git (ispell-highlight, ispell-dehighlight): New functions. (ispell-command-loop, ispell-next): Call them. (ispell-highlight, ispell-overlay): New variables. --- diff --git a/lisp/textmodes/ispell4.el b/lisp/textmodes/ispell4.el index d0402ec78cb..c47db01a230 100644 --- a/lisp/textmodes/ispell4.el +++ b/lisp/textmodes/ispell4.el @@ -342,6 +342,7 @@ Return value is t unless exit is due to typing `q'." (setq ispell-bad-words (cdr ispell-bad-words)) (set-marker next nil))) t) + (ispell-dehighlight) (if ispell-window-configuration (set-window-configuration ispell-window-configuration)) (cond ((null ispell-bad-words) @@ -536,6 +537,7 @@ L lookup; Q quit\n") (if (null message) (setq first-line (concat "No near misses for '" word "'")) (setq first-line (concat "Near misses for '" word "'"))) + (ispell-highlight start end) (while flag (ispell-show-choices word message first-line) (message "Ispell command: ") @@ -623,6 +625,28 @@ L lookup; Q quit\n") (kill-emacs 1)) (write-region (point-min) (point-max) "ispell.info")) +(defvar ispell-highlight t + "*Non-nil means to highlight ispell words.") + +(defvar ispell-overlay nil) + +(defun ispell-dehighlight () + (and ispell-overlay + (progn + (delete-overlay ispell-overlay) + (setq ispell-overlay nil)))) + +(defun ispell-highlight (start end) + (and ispell-highlight + (progn + (or ispell-overlay + (progn + (setq ispell-overlay (make-overlay start end)) + (overlay-put ispell-overlay 'face + (if (internal-find-face 'ispell) + 'ispell 'region)))) + (move-overlay ispell-overlay start end (current-buffer))))) + ;;;; ispell-complete-word ;;; Brief Description: