# HG changeset patch # User Eli Zaretskii # Date 1094305513 0 # Node ID 09766a703f688a3faec3a064ad7fae102d4ef081 # Parent 06ff0be09a6a359311dd8a8ac601b08d60a17e2f (ispell-really-aspell): New defvar. (ispell-check-version): Set it. (ispell-send-replacement): New function. (ispell-process-line): Call ispell-send-replacement. diff -r 06ff0be09a6a -r 09766a703f68 lisp/textmodes/ispell.el --- a/lisp/textmodes/ispell.el Sat Sep 04 13:24:04 2004 +0000 +++ b/lisp/textmodes/ispell.el Sat Sep 04 13:45:13 2004 +0000 @@ -724,6 +724,8 @@ ispell-dictionary-alist-3 ispell-dictionary-alist-4 ispell-dictionary-alist-5 ispell-dictionary-alist-6)) +(defvar ispell-really-aspell nil) ; Non-nil if aspell extensions should be used + @@ -815,7 +817,12 @@ (< (car (read-from-string (buffer-substring-no-properties (match-beginning 3)(match-end 3)))) (car (cdr (cdr ispell-required-version))))) - (setq ispell-offset 0))) + (setq ispell-offset 0)) + ;; Check to see if it's really aspell. + (goto-char (point-min)) + (let (case-fold-search) + (setq ispell-really-aspell + (and (search-forward "(but really Aspell " nil t) t)))) (kill-buffer (current-buffer))) result)) @@ -1293,6 +1300,12 @@ (set-buffer buf) (erase-buffer))))))) +(defun ispell-send-replacement (misspelled replacement) + "Notify aspell that MISSPELLED should be spelled REPLACEMENT. +This allows it to improve the suggestion list based on actual mispellings." + (and ispell-really-aspell + (ispell-send-string (concat "$$ra " misspelled "," replacement "\n")))) + (defun ispell-send-string (string) "Send the string STRING to the Ispell process." @@ -2841,10 +2854,12 @@ (if (not (listp replace)) (progn (insert replace) ; insert dictionary word + (ispell-send-replacement (car poss) replace) (setq accept-list (cons replace accept-list))) (let ((replace-word (car replace))) ;; Recheck hand entered replacement word (insert replace-word) + (ispell-send-replacement (car poss) replace-word) (if (car (cdr replace)) (save-window-excursion (delete-other-windows) ; to correctly show help.