]> git.eshelyaron.com Git - emacs.git/commitdiff
(ispell-really-aspell): New defvar.
authorEli Zaretskii <eliz@gnu.org>
Sat, 4 Sep 2004 13:46:13 +0000 (13:46 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 4 Sep 2004 13:46:13 +0000 (13:46 +0000)
(ispell-check-version): Set it.
(ispell-send-replacement): New function.
(ispell-process-line): Call ispell-send-replacement.

lisp/ChangeLog
lisp/textmodes/ispell.el

index 015f4fbc60f07bdafcc92f56ba94d9dc1e654cf7..152ca944c391141127bfc21bfa8518d3c3aa71e8 100644 (file)
@@ -1,3 +1,10 @@
+2004-09-04  Christopher J. Madsen  <cjm@pobox.com>
+
+       * textmodes/ispell.el (ispell-really-aspell): New defvar.
+       (ispell-check-version): Set it.
+       (ispell-send-replacement): New function.
+       (ispell-process-line): Call ispell-send-replacement.
+
 2004-09-04  Matt Hodges  <matt@stchem.bham.ac.uk>  (tiny change)
 
        * eshell/em-pred.el (eshell-predicate-help-string): Doc fix.
index 435e2e5f27a79d1ed7be369292a959fe0e3735ad..b98c9fc183d927c7de67c71ef38ba500a4fce101 100644 (file)
@@ -724,6 +724,8 @@ LANGUAGE.aff file \(e.g., english.aff\)."
              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 @@ Otherwise returns the library directory name, if that is defined."
                 (< (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 @@ pass it the output of the last ispell invocation."
            (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 @@ Returns the sum shift due to changes in word replacements."
              (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.