* [patch] 21.3 ispell.el to support aspell better
@ 2004-09-01 22:11 Jari Aalto+mail.emacs
0 siblings, 0 replies; only message in thread
From: Jari Aalto+mail.emacs @ 2004-09-01 22:11 UTC (permalink / raw)
Cc: cjm
At http://aspell.neT there is additional patch to ispell.el. In 21.3
sources is was not yet present so I applied it and the patch seems to work
ok. Here is the diffs that might be good idea for new release as well.
2004-09-02 Thu Jari Aalto <jari dot aalto A T poboxes dot com>
* textmodes/ispell.el: 1.1.1.1 Applied Aspell patch from
ftp://ftp.gnu.org/gnu/aspell/ispell.el-aspell-0.1.diff
From: Christopher J. Madsen <cjm at pobox com>
Date: Fri, 20 Dec 2002 14:46:22 -0600 (CST)
The attached patch will notify aspell of the replacements you make so
it can improve the suggestion list in the future.
Index: ispell.el
===================================================================
RCS file: /cygdrive/l/data/vc/cvsroot/lisp/emacs/21.3/lisp/textmodes/ispell.el,v
retrieving revision 1.1.1.1
diff -u -IId: -b -w -c -r1.1.1.1 ispell.el
*** ispell.el 26 Jun 2003 18:06:40 -0000 1.1.1.1
--- ispell.el 1 Sep 2004 21:59:24 -0000
***************
*** 721,726 ****
--- 721,728 ----
(defconst ispell-version "ispell.el 3.4 -- Fri Aug 4 09:41:50 PDT 2000")
+ (defvar ispell-really-aspell nil) ;Non-nil if aspell extensions should be used
+
(defun check-ispell-version (&optional interactivep)
"Ensure that `ispell-program-name' is valid and the correct version.
***************
*** 788,794 ****
(< (car (read-from-string (buffer-substring-no-properties
(match-beginning 3)(match-end 3))))
(car (cdr (cdr ispell-required-version)))))
! (setq ispell-offset 0)))
(kill-buffer (current-buffer)))
result))
--- 790,801 ----
(< (car (read-from-string (buffer-substring-no-properties
(match-beginning 3)(match-end 3))))
(car (cdr (cdr ispell-required-version)))))
! (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))
***************
*** 1305,1310 ****
--- 1312,1323 ----
(delete-region start (point)))
(setq more-lines (= 0 (forward-line))))))))))))))
+ (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"))))
+
;;;###autoload
***************
*** 2703,2712 ****
--- 2716,2727 ----
(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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-09-01 22:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-01 22:11 [patch] 21.3 ispell.el to support aspell better Jari Aalto+mail.emacs
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).