comparison lisp/textmodes/=ispell4.el @ 5400:dd2c5504bcc1

(ispell-highlight, ispell-dehighlight): New functions. (ispell-command-loop, ispell-next): Call them. (ispell-highlight, ispell-overlay): New variables.
author Richard M. Stallman <rms@gnu.org>
date Sat, 01 Jan 1994 10:22:02 +0000
parents ec02e2f72eae
children 9e51b51e8595
comparison
equal deleted inserted replaced
5399:67aa88583b90 5400:dd2c5504bcc1
340 (push-mark) 340 (push-mark)
341 (ispell-point next "at saved position.") 341 (ispell-point next "at saved position.")
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)
348 (error "Ispell has not yet been run")) 349 (error "Ispell has not yet been run"))
349 ((markerp (car ispell-bad-words)) 350 ((markerp (car ispell-bad-words))
534 (rescan nil) 535 (rescan nil)
535 first-line) 536 first-line)
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: ")
542 (undo-boundary) 544 (undo-boundary)
543 (let ((c (downcase (read-char))) 545 (let ((c (downcase (read-char)))
620 (texinfo-format-buffer)) 622 (texinfo-format-buffer))
621 (Info-validate) 623 (Info-validate)
622 (if (get-buffer " *problems in info file*") 624 (if (get-buffer " *problems in info file*")
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"))
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)))))
625 649
626 ;;;; ispell-complete-word 650 ;;;; ispell-complete-word
627 651
628 ;;; Brief Description: 652 ;;; Brief Description:
629 ;;; Complete word fragment at point using dictionary and replace with full 653 ;;; Complete word fragment at point using dictionary and replace with full