emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug 130397


From: Kenichi Handa
Subject: Re: Bug 130397
Date: Wed, 19 Jan 2005 21:52:09 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3.50 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, Juri Linkov <address@hidden> writes:
> Now a new problem was uncovered: after selecting a correct word from
> a list of near misses returned from ispell, ispell.el replaces the
> misspelled word with a selected word, and inserts it into the buffer
> not in its original mule-unicode charset, but in iso8859.

Perhaps the following function can be utilized somewhere in
ispell to do that, but, as I still don't understand ispell
code that much, I'd like to ask someone else to modify
ispell to use it.

;; Destructively modify WORD by converting each character in it to the
;; equivalent character of CHARSET.

(defun ispell-adjust-charset (word charset)
  (let ((len (length word)))
    (if (< len (string-bytes word))
        (dotimes (i len)
          (let ((c (aref word i))
                this-charset equiv-chars)
            (if (and (>= c 128)
                     (not (eq (setq this-charset (char-charset c)) charset))
                     (or (memq this-charset '(mule-unicode-0100-24ff 
                                              mule-unicode-2500-34ff))
                         (setq c (aref ucs-mule-8859-to-mule-unicode c)))
                     (setq equivs (aref ispell-unified-chars-table c)))
                (catch 'tag
                  (dotimes (j (length equiv-chars))
                    (when (eq (char-charset (aref equiv-chars j)) charset)
                      (aset word i (aref equiv-chars j))
                      (throw 'tag nil))))))))))

---
Ken'ichi HANDA
address@hidden

PS. I personally feel it's a waste of time to struggle with
charset matters in ispell that much because emacs-unicode
should not have such a problem.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]