aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-01-01 10:22:02 +0000
committerRichard M. Stallman1994-01-01 10:22:02 +0000
commitf7cf7ffe36fb4a18e2fc873431b87188c80fb9f1 (patch)
tree74da141555ae4c3b2f10204e09e775c120920add
parent5cb1595fb3d9ec9b63ef322d3750aba9320331f7 (diff)
downloademacs-f7cf7ffe36fb4a18e2fc873431b87188c80fb9f1.tar.gz
emacs-f7cf7ffe36fb4a18e2fc873431b87188c80fb9f1.zip
(ispell-highlight, ispell-dehighlight): New functions.
(ispell-command-loop, ispell-next): Call them. (ispell-highlight, ispell-overlay): New variables.
-rw-r--r--lisp/textmodes/ispell4.el24
1 files changed, 24 insertions, 0 deletions
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'."
342 (setq ispell-bad-words (cdr ispell-bad-words)) 342 (setq ispell-bad-words (cdr ispell-bad-words))
343 (set-marker next nil))) 343 (set-marker next nil)))
344 t) 344 t)
345 (ispell-dehighlight)
345 (if ispell-window-configuration 346 (if ispell-window-configuration
346 (set-window-configuration ispell-window-configuration)) 347 (set-window-configuration ispell-window-configuration))
347 (cond ((null ispell-bad-words) 348 (cond ((null ispell-bad-words)
@@ -536,6 +537,7 @@ L lookup; Q quit\n")
536 (if (null message) 537 (if (null message)
537 (setq first-line (concat "No near misses for '" word "'")) 538 (setq first-line (concat "No near misses for '" word "'"))
538 (setq first-line (concat "Near misses for '" word "'"))) 539 (setq first-line (concat "Near misses for '" word "'")))
540 (ispell-highlight start end)
539 (while flag 541 (while flag
540 (ispell-show-choices word message first-line) 542 (ispell-show-choices word message first-line)
541 (message "Ispell command: ") 543 (message "Ispell command: ")
@@ -623,6 +625,28 @@ L lookup; Q quit\n")
623 (kill-emacs 1)) 625 (kill-emacs 1))
624 (write-region (point-min) (point-max) "ispell.info")) 626 (write-region (point-min) (point-max) "ispell.info"))
625 627
628(defvar ispell-highlight t
629 "*Non-nil means to highlight ispell words.")
630
631(defvar ispell-overlay nil)
632
633(defun ispell-dehighlight ()
634 (and ispell-overlay
635 (progn
636 (delete-overlay ispell-overlay)
637 (setq ispell-overlay nil))))
638
639(defun ispell-highlight (start end)
640 (and ispell-highlight
641 (progn
642 (or ispell-overlay
643 (progn
644 (setq ispell-overlay (make-overlay start end))
645 (overlay-put ispell-overlay 'face
646 (if (internal-find-face 'ispell)
647 'ispell 'region))))
648 (move-overlay ispell-overlay start end (current-buffer)))))
649
626;;;; ispell-complete-word 650;;;; ispell-complete-word
627 651
628;;; Brief Description: 652;;; Brief Description: