From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: arthur miller Newsgroups: gmane.emacs.devel Subject: RE: A question about spellchecker Date: Tue, 8 Apr 2014 17:39:11 +0200 Message-ID: References: , <53438625.6090406@dancol.org>, , <5343C8BE.206@dancol.org>, , <5343CE2A.7050900@dancol.org>, , <837g6z7s42.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_f040c5fc-e0c8-47ff-bee1-4019d518a21e_" X-Trace: ger.gmane.org 1396972864 29477 80.91.229.3 (8 Apr 2014 16:01:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2014 16:01:04 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 08 18:00:58 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WXYSH-0007m2-Lt for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2014 18:00:57 +0200 Original-Received: from localhost ([::1]:41333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXYSH-0006H9-9N for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2014 12:00:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXYS3-00064k-I0 for emacs-devel@gnu.org; Tue, 08 Apr 2014 12:00:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXYRx-00084A-TS for emacs-devel@gnu.org; Tue, 08 Apr 2014 12:00:43 -0400 Original-Received: from blu0-omc2-s16.blu0.hotmail.com ([65.55.111.91]:14405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXYRs-0007xc-0K; Tue, 08 Apr 2014 12:00:32 -0400 Original-Received: from BLU183-W74 ([65.55.111.72]) by blu0-omc2-s16.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 8 Apr 2014 08:39:11 -0700 X-TMN: [ybWKMRscoT3oBLIEsB2nuzFqIzxfDw0A] X-Originating-Email: [arthur.miller@live.com] Importance: Normal In-Reply-To: <837g6z7s42.fsf@gnu.org> X-OriginalArrivalTime: 08 Apr 2014 15:39:11.0220 (UTC) FILETIME=[AFF64B40:01CF5340] X-detected-operating-system: by eggs.gnu.org: Windows XP X-Received-From: 65.55.111.91 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171342 Archived-At: --_f040c5fc-e0c8-47ff-bee1-4019d518a21e_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > Date: Tue=2C 8 Apr 2014 18:34:05 +0300 > From: eliz@gnu.org > Subject: Re: A question about spellchecker > To: arthur.miller@live.com > CC: dancol@dancol.org=3B emacs-devel@gnu.org >=20 > > From: arthur miller > > Date: Tue=2C 8 Apr 2014 15:07:57 +0200 > > Cc: "emacs-devel@gnu.org" > >=20 > > I have found what is problem with emacs and hunspell on my computer.=20 > > It does not seem tounderstand charset och stream it gets back from huns= pell.=20 > > It can actually spell all words not containing swedish characters (=F6= =E4=E5) with=20 > > swedish dictionary. When pressing with right mouse I get a pop-up with= =20 > > word suggestions=2C where all swedish characters are missinterpretted.= =20 > >=20 > > If I press M-$ (spell-word) I get message > >=20 > > "ispell-word: Ispell and its process have different character maps" . > >=20 > > Emacs has no problems with swedish chars in text-buffer itself=2C but i= n > > characters in stream it gets back from hunspell. > >=20 > > I have checked that encoding of file and LANG variable all use same enc= oding > > as the dictionary itself. > >=20 > > In image1 can be seen how it treats word *omv=E4rld* (for world) . > > I am not sure if this is a bug=2C or I am just not aware of correct set= ting. I have > > tryed to google around for solution but I haven't found any good answer= s. > >=20 > > I am using a development version of Emacs: > >=20 > > GNU Emacs 24.4.50.2 (x86_64-w64-mingw32) > >=20 > > Are bug-reports welcome since it is not official version of emacs? >=20 > It's not a real problem. Please tell where you got that Swedish > dictionary=2C and please try using the UTF-8 encoding instead of 8859-1. >=20 I answered your email on the other list=2C dictionaries are from OpenOffice= : http://archive.services.openoffice.org/pub/mirror/OpenOffice.org/contrib/= dictionaries/ I did try to use utf-8=2C I can copy my settings again: (after 'ispell (message "loading spellchecker") (defvar *load-start* (current-time)) (defun anarcat/time-to-ms (time) (+ (* (+ (* (car time) (expt 2 16)) (car (cdr time))) 1000000) (car (cd= r (cdr time))))) (add-to-list 'ispell-dictionary-alist '(("svenska" "[A-Z=D6=C4=C5a-z=F6=E4=E5]" "[^A-Z=D6=C4=C5a-z=F6=E4=E5]" "[']" nil ("-d" "sv_SE") t utf-8) ("svenska8" "[A-Z=D6=C4=C5a-z=F6=E4=E5]" "[^A-Z=D6=C4=C5a-z=F6=E4=E5]" "[']" nil ("-B" "-d" "sv_SE") t utf-8) ("english" "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-d" "en_US") nil utf-8))) (setq ispell-local-dictionary-alist ispell-dictionary-alist) (setq ispell-hunspell-dictionary-alist ispell-dictionary-alist) (setq ispell-dictionary "english") (setq-default ispell-program-name "hunspell") (setq ispell-extra-args '("-i" "utf-8")) (global-set-key (kbd "C-c d") 'switch-dictionary-sv-en)) And for Eamcs itself to prefer utf-8 (set-language-environment 'utf-8) (setq locale-coding-system 'utf-8) (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (set-selection-coding-system 'utf-8) (prefer-coding-system 'utf-8) = --_f040c5fc-e0c8-47ff-bee1-4019d518a21e_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable


>=3B Date: Tue=2C= 8 Apr 2014 18:34:05 +0300
>=3B From: eliz@gnu.org
>=3B Subject: = Re: A question about spellchecker
>=3B To: arthur.miller@live.com
&= gt=3B CC: dancol@dancol.org=3B emacs-devel@gnu.org
>=3B
>=3B >= =3B From: arthur miller <=3Barthur.miller@live.com>=3B
>=3B >=3B= Date: Tue=2C 8 Apr 2014 15:07:57 +0200
>=3B >=3B Cc: "emacs-devel@g= nu.org" <=3Bemacs-devel@gnu.org>=3B
>=3B >=3B
>=3B >=3B = I have found what is problem with emacs and hunspell on my computer.
&g= t=3B >=3B It does not seem tounderstand charset och stream it gets back f= rom hunspell.
>=3B >=3B It can actually spell all words not contain= ing swedish characters (=F6=E4=E5) with
>=3B >=3B swedish dictionar= y. When pressing with right mouse I get a pop-up with
>=3B >=3B wor= d suggestions=2C where all swedish characters are missinterpretted.
>= =3B >=3B
>=3B >=3B If I press M-$ (spell-word) I get message
&= gt=3B >=3B
>=3B >=3B "ispell-word: Ispell and its process have di= fferent character maps" .
>=3B >=3B
>=3B >=3B Emacs has no p= roblems with swedish chars in text-buffer itself=2C but in
>=3B >=3B= characters in stream it gets back from hunspell.
>=3B >=3B
>= =3B >=3B I have checked that encoding of file and LANG variable all use s= ame encoding
>=3B >=3B as the dictionary itself.
>=3B >=3B >=3B >=3B In image1 can be seen how it treats word *omv=E4rld* (for w= orld) .
>=3B >=3B I am not sure if this is a bug=2C or I am just not= aware of correct setting. I have
>=3B >=3B tryed to google around f= or solution but I haven't found any good answers.
>=3B >=3B
>= =3B >=3B I am using a development version of Emacs:
>=3B >=3B
= >=3B >=3B GNU Emacs 24.4.50.2 (x86_64-w64-mingw32)
>=3B >=3B >=3B >=3B Are bug-reports welcome since it is not official version of= emacs?
>=3B
>=3B It's not a real problem. Please tell where yo= u got that Swedish
>=3B dictionary=2C and please try using the UTF-8 e= ncoding instead of 8859-1.
>=3B
I answered your email on the other= list=2C dictionaries are from OpenOffice: http://archive.services.openoffice.org/pub/mirror/OpenOffice.or= g/contrib/dictionaries/
I did try to use utf-8=2C I can copy my sett= ings again:

(after 'ispell
 =3B (message "loading spellchecke= r")
 =3B (defvar *load-start* (current-time))
 =3B (defun ana= rcat/time-to-ms (time)
 =3B =3B =3B (+ (* (+ (* (car time) (= expt 2 16)) (car (cdr time))) 1000000) (car (cdr (cdr time)))))

&nbs= p=3B (add-to-list 'ispell-dictionary-alist '(("svenska"
 =3B =3B=  =3B  =3B =3B =3B  =3B =3B =3B  =3B =3B=  =3B  =3B =3B =3B  =3B =3B "[A-Z=D6=C4=C5a-z=F6=E4= =E5]"
 =3B =3B =3B  =3B =3B =3B  =3B =3B=  =3B  =3B =3B =3B  =3B =3B =3B  =3B =3B= "[^A-Z=D6=C4=C5a-z=F6=E4=E5]"
 =3B =3B =3B  =3B =3B=  =3B  =3B =3B =3B  =3B =3B =3B  =3B =3B=  =3B  =3B =3B "[']"
 =3B =3B =3B  =3B = =3B =3B  =3B =3B =3B  =3B =3B =3B  =3B = =3B =3B  =3B =3B nil
 =3B =3B =3B  =3B = =3B =3B  =3B =3B =3B  =3B =3B =3B  =3B = =3B =3B  =3B =3B ("-d" "sv_SE")
 =3B =3B =3B &nb= sp=3B =3B =3B  =3B =3B =3B  =3B =3B =3B &nb= sp=3B =3B =3B  =3B =3B t
 =3B =3B =3B  = =3B =3B =3B  =3B =3B =3B  =3B =3B =3B  = =3B =3B =3B  =3B =3B utf-8)
 =3B =3B =3B &nb= sp=3B =3B =3B  =3B =3B =3B  =3B =3B =3B &nb= sp=3B =3B =3B  =3B ("svenska8"
 =3B =3B =3B &nbs= p=3B =3B =3B  =3B =3B =3B  =3B =3B =3B &nbs= p=3B =3B =3B  =3B =3B "[A-Z=D6=C4=C5a-z=F6=E4=E5]"
 = =3B =3B =3B  =3B =3B =3B  =3B =3B =3B  = =3B =3B =3B  =3B =3B =3B  =3B =3B "[^A-Z=D6=C4= =C5a-z=F6=E4=E5]"
 =3B =3B =3B  =3B =3B =3B &nbs= p=3B =3B =3B  =3B =3B =3B  =3B =3B =3B &nbs= p=3B =3B "[']"
 =3B =3B =3B  =3B =3B =3B &nb= sp=3B =3B =3B  =3B =3B =3B  =3B =3B =3B &nb= sp=3B =3B nil
 =3B =3B =3B  =3B =3B =3B &nbs= p=3B =3B =3B  =3B =3B =3B  =3B =3B =3B &nbs= p=3B =3B ("-B" "-d" "sv_SE")
 =3B =3B =3B  =3B = =3B =3B  =3B =3B =3B  =3B =3B =3B  =3B = =3B =3B  =3B =3B t
 =3B =3B =3B  =3B =3B=  =3B  =3B =3B =3B  =3B =3B =3B  =3B =3B=  =3B  =3B =3B utf-8)
 =3B =3B =3B  =3B = =3B =3B  =3B =3B =3B  =3B =3B =3B  =3B = =3B =3B  =3B ("english"
 =3B =3B =3B  =3B = =3B =3B  =3B =3B =3B  =3B =3B =3B  =3B = =3B =3B  =3B =3B "[[:alpha:]]"
 =3B =3B =3B &nbs= p=3B =3B =3B  =3B =3B =3B  =3B =3B =3B &nbs= p=3B =3B =3B  =3B =3B "[^[:alpha:]]"
 =3B =3B&nb= sp=3B  =3B =3B =3B  =3B =3B =3B  =3B =3B&nb= sp=3B  =3B =3B =3B  =3B =3B "[']"
 =3B =3B&n= bsp=3B  =3B =3B =3B  =3B =3B =3B  =3B =3B&n= bsp=3B  =3B =3B =3B  =3B =3B t
 =3B =3B = =3B  =3B =3B =3B  =3B =3B =3B  =3B =3B = =3B  =3B =3B =3B  =3B =3B ("-d" "en_US")
 =3B&nb= sp=3B =3B  =3B =3B =3B  =3B =3B =3B  =3B&nb= sp=3B =3B  =3B =3B =3B  =3B =3B nil
 =3B&nbs= p=3B =3B  =3B =3B =3B  =3B =3B =3B  =3B&nbs= p=3B =3B  =3B =3B =3B  =3B =3B utf-8)))

&nbs= p=3B (setq ispell-local-dictionary-alist ispell-dictionary-alist)
 = =3B (setq ispell-hunspell-dictionary-alist ispell-dictionary-alist)
&nbs= p=3B (setq ispell-dictionary "english")
 =3B (setq-default ispell-pr= ogram-name "hunspell")
 =3B (setq ispell-extra-args '("-i" "utf-8"))=
 =3B (global-set-key (kbd "C-c d") 'switch-dictionary-sv-en))
And for Eamcs itself to prefer utf-8

(set-language-environment 'ut= f-8)
(setq locale-coding-system 'utf-8)
(set-default-coding-systems '= utf-8)
(set-terminal-coding-system 'utf-8)
(set-selection-coding-syst= em 'utf-8)
(prefer-coding-system 'utf-8)

= = --_f040c5fc-e0c8-47ff-bee1-4019d518a21e_--