unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* A question about spellchecker
@ 2014-04-08  4:21 arthur miller
  2014-04-08  5:16 ` Daniel Colascione
  2014-04-08 15:11 ` Eli Zaretskii
  0 siblings, 2 replies; 16+ messages in thread
From: arthur miller @ 2014-04-08  4:21 UTC (permalink / raw)
  To: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

Just a simple question: why is there no spellchecker by default included in Emacs?

Hunspell seems to be most widely used at the moment, it is GPL-d and avaialable as a dll and or static lib to link with. Is there some special reason why it is not
included in Emacs as a default fallback so that users don't have to spend hours in configuring diverse options? If it is desired to use some other "ispellesque" 
spell editor, Emacs could just unload hunspell, and re-bind its ispell/flyspell functions to another dll, or exe. For me running hunspell as a separate process from Emacs is
painfully slow compared to how some other applications work. Shouldn't it be a bit faster if spellchecker was just a dll/so to load instead of starting up another process from Emacs 
and communicating through pipes?

I guess I am not the only one to come up with the thought, so I am just curious to what is behind the decision to still keep spellchecker out of Emacs?


 		 	   		  

[-- Attachment #2: Type: text/html, Size: 1217 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
  2014-04-08  4:21 A question about spellchecker arthur miller
@ 2014-04-08  5:16 ` Daniel Colascione
       [not found]   ` <BLU183-W65979B6E2198DC658D6CD4966B0@phx.gbl>
  2014-04-08 15:11 ` Eli Zaretskii
  1 sibling, 1 reply; 16+ messages in thread
From: Daniel Colascione @ 2014-04-08  5:16 UTC (permalink / raw)
  To: arthur miller, emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

On 04/07/2014 09:21 PM, arthur miller wrote:
> Just a simple question: why is there no spellchecker by default included
> in Emacs?

Integration with external spell checkers has worked for many years.

> Hunspell seems to be most widely used at the moment, it is GPL-d and
> avaialable as a dll and or static lib to link with. Is there some
> special reason why it is not
> included in Emacs as a default fallback so that users don't have to
> spend hours in configuring diverse options?

ispell has always worked out of the box for me. Can you describe the
configuration you had to perform? Maybe Emacs can automate it.

> If it is desired to use some
> other "ispellesque"
> spell editor, Emacs could just unload hunspell, and re-bind its
> ispell/flyspell functions to another dll, or exe. For me running
> hunspell as a separate process from Emacs is
> painfully slow compared to how some other applications work. Shouldn't
> it be a bit faster if spellchecker was just a dll/so to load instead of
> starting up another process from Emacs
> and communicating through pipes?

If IPC is fast enough for X11, it's fast enough for Emacs. I doubt
piping is the problem here. I've heard a few reports of flyspell being
slow lately, however. Maybe you can benchmark and see where the
bottleneck is. I don't see any reason to link Emacs directly against a
spell-checking library.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: A question about spellchecker
       [not found]         ` <5343CE2A.7050900@dancol.org>
@ 2014-04-08 13:07           ` arthur miller
  2014-04-08 15:34             ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: arthur miller @ 2014-04-08 13:07 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: emacs-devel@gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 2997 bytes --]

Sorry, I am a little bit new to this list - I just found it
difficult to read through all the text so I clumped all my answers on top.

I didn't ment anything bad, I appologize for inconvenience.

I have found what is problem with emacs and hunspell on my computer. 
It does not seem tounderstand charset och stream it gets back from hunspell. 
It can actually spell all words not containing swedish characters (öäå) with 
swedish dictionary. When pressing with right mouse I get a pop-up with 
word suggestions, where all swedish characters are missinterpretted. 

If I press M-$ (spell-word) I get message

"ispell-word: Ispell and its process have different character maps" .

Emacs has no problems with swedish chars in text-buffer itself, but in
characters in stream it gets back from hunspell.

I have checked that encoding of file and LANG variable all use same encoding
as the dictionary itself.

In image1 can be seen how it treats word *omvärld* (for world) .
I am not sure if this is a bug, or I am just not aware of correct setting. I have
tryed to google around for solution but I haven't found any good answers.

I am using a development version of Emacs:

GNU Emacs 24.4.50.2 (x86_64-w64-mingw32)

Are bug-reports  welcome since it is not official version of emacs?

best regards
/arthur

> Date: Tue, 8 Apr 2014 03:23:38 -0700
> From: dancol@dancol.org
> To: arthur.miller@live.com
> Subject: Re: A question about spellchecker
> 
> Please keep discussions on-list, and please don't top-post.
> 
> On 04/08/2014 03:20 AM, arthur miller wrote:
> > Thanks for the info.
> > 
> > I understand that modularization was a reason to keep only interface
> > to spellchecker, but a loadable dll could beas equally unloaded on request.
> 
> Not without infrastructure we don't have. Are you writing the patches?
> 
> > 
> > Say if user call (setq-default ispell-program-name "some-checker"), than
> > Eamcs
> > could unload its default dll, and correct its spell-checking interface
> > to somewhere
> > else. It is just a thought; I can't even build Emacs for myself, so I
> > wan't say too
> > much. But even preconfigured hunspell binary packaged with Emacs
> > would be nice since it is not in gnuwin32 distribution of gnu
> > applications. Also
> > preconfigured to work out-of-the-box - ready to just drop dictionaries
> > in .emacs.d
> > would be nice :).
> 
> Patches welcome.
> 
> > 
> > For my part I get this message when I try to use swedish dictionary:
> > 
> > ispell-word: Ispell and its process have different character maps
> 
> I'm no expert on ispell, sorry.
> 
> > 
> > I guess it is some configuration miss somewhere rather than bug.
> > 
> > By the way - is there some guide to emacs internals for novice-to-emacs
> > internals?
> 
> Your best bet is to look at existing code. The XEmacs internals manual
> also has some information that's relevant to Emacs as well.
> 
> 
> 
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 3616 bytes --]

[-- Attachment #2: spell1.png --]
[-- Type: image/png, Size: 21115 bytes --]

[-- Attachment #3: spell2.png --]
[-- Type: image/png, Size: 2921 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
  2014-04-08  4:21 A question about spellchecker arthur miller
  2014-04-08  5:16 ` Daniel Colascione
@ 2014-04-08 15:11 ` Eli Zaretskii
       [not found]   ` <BLU183-W1EA36DA7237C49B9E9ECF966B0@phx.gbl>
  1 sibling, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-04-08 15:11 UTC (permalink / raw)
  To: arthur miller; +Cc: emacs-devel

> From: arthur miller <arthur.miller@live.com>
> Date: Tue, 8 Apr 2014 06:21:54 +0200
> 
> Just a simple question: why is there no spellchecker by default included in Emacs?

If you mean as part of Emacs binary, then it's because we didn't see a
reason for that, and because doing that has the disadvantage of making
Emacs dependent on another project.

> Is there some special reason why it is not included in Emacs as a
> default fallback so that users don't have to spend hours in
> configuring diverse options?

Please describe the difficulties you had in configuring hunspell as
the speller.  It's hard to respond to such general statements.


> For me running hunspell as a separate process from Emacs is
> painfully slow compared to how some other applications work.

How slow is "painfully slow"?  Can you provide some numbers?  Can you
compare the speed of spell-checking an Emacs buffer with doing the
same using hunspell's own UI?



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
  2014-04-08 13:07           ` arthur miller
@ 2014-04-08 15:34             ` Eli Zaretskii
  2014-04-08 15:39               ` arthur miller
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-04-08 15:34 UTC (permalink / raw)
  To: arthur miller; +Cc: dancol, emacs-devel

> From: arthur miller <arthur.miller@live.com>
> Date: Tue, 8 Apr 2014 15:07:57 +0200
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> 
> I have found what is problem with emacs and hunspell on my computer. 
> It does not seem tounderstand charset och stream it gets back from hunspell. 
> It can actually spell all words not containing swedish characters (öäå) with 
> swedish dictionary. When pressing with right mouse I get a pop-up with 
> word suggestions, where all swedish characters are missinterpretted. 
> 
> If I press M-$ (spell-word) I get message
> 
> "ispell-word: Ispell and its process have different character maps" .
> 
> Emacs has no problems with swedish chars in text-buffer itself, but in
> characters in stream it gets back from hunspell.
> 
> I have checked that encoding of file and LANG variable all use same encoding
> as the dictionary itself.
> 
> In image1 can be seen how it treats word *omvärld* (for world) .
> I am not sure if this is a bug, or I am just not aware of correct setting. I have
> tryed to google around for solution but I haven't found any good answers.
> 
> I am using a development version of Emacs:
> 
> GNU Emacs 24.4.50.2 (x86_64-w64-mingw32)
> 
> Are bug-reports  welcome since it is not official version of emacs?

It's not a real problem.  Please tell where you got that Swedish
dictionary, and please try using the UTF-8 encoding instead of 8859-1.




^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: A question about spellchecker
  2014-04-08 15:34             ` Eli Zaretskii
@ 2014-04-08 15:39               ` arthur miller
  2014-04-08 16:21                 ` Agustin Martin
  2014-04-08 16:34                 ` Eli Zaretskii
  0 siblings, 2 replies; 16+ messages in thread
From: arthur miller @ 2014-04-08 15:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 3574 bytes --]



> Date: Tue, 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; emacs-devel@gnu.org
> 
> > From: arthur miller <arthur.miller@live.com>
> > Date: Tue, 8 Apr 2014 15:07:57 +0200
> > Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> > 
> > I have found what is problem with emacs and hunspell on my computer. 
> > It does not seem tounderstand charset och stream it gets back from hunspell. 
> > It can actually spell all words not containing swedish characters (öäå) with 
> > swedish dictionary. When pressing with right mouse I get a pop-up with 
> > word suggestions, where all swedish characters are missinterpretted. 
> > 
> > If I press M-$ (spell-word) I get message
> > 
> > "ispell-word: Ispell and its process have different character maps" .
> > 
> > Emacs has no problems with swedish chars in text-buffer itself, but in
> > characters in stream it gets back from hunspell.
> > 
> > I have checked that encoding of file and LANG variable all use same encoding
> > as the dictionary itself.
> > 
> > In image1 can be seen how it treats word *omvärld* (for world) .
> > I am not sure if this is a bug, or I am just not aware of correct setting. I have
> > tryed to google around for solution but I haven't found any good answers.
> > 
> > I am using a development version of Emacs:
> > 
> > GNU Emacs 24.4.50.2 (x86_64-w64-mingw32)
> > 
> > Are bug-reports  welcome since it is not official version of emacs?
> 
> It's not a real problem.  Please tell where you got that Swedish
> dictionary, and please try using the UTF-8 encoding instead of 8859-1.
> 
I answered your email on the other list, dictionaries are from OpenOffice: http://archive.services.openoffice.org/pub/mirror/OpenOffice.org/contrib/dictionaries/
I did try to use utf-8, 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 (cdr (cdr time)))))

  (add-to-list 'ispell-dictionary-alist '(("svenska"
                       "[A-ZÖÄÅa-zöäå]"
                       "[^A-ZÖÄÅa-zöäå]"
                       "[']"
                       nil
                       ("-d" "sv_SE")
                       t
                       utf-8)
                      ("svenska8"
                       "[A-ZÖÄÅa-zöäå]"
                       "[^A-ZÖÄÅa-zöäå]"
                       "[']"
                       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)

 		 	   		  

[-- Attachment #2: Type: text/html, Size: 6327 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
       [not found]   ` <BLU183-W1EA36DA7237C49B9E9ECF966B0@phx.gbl>
@ 2014-04-08 15:47     ` Eli Zaretskii
       [not found]       ` <BLU183-W50614F3A61A7E9DADB9E60966B0@phx.gbl>
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-04-08 15:47 UTC (permalink / raw)
  To: arthur miller; +Cc: emacs-devel

> From: arthur miller <arthur.miller@live.com>
> Date: Tue, 8 Apr 2014 17:32:44 +0200
> 
> Difficulty is in not knowing where to look and for what to look. I had to hunt down Hunspell.

You could ask on help-gnu-emacs.

> Even realizing I need Hunspell was not the most obvous thing on its own. Docs are full with references to
> ispell and aspell, so knowing that hunspell is what matters mostly today was not obvious at first
> glance. It tooks some time looking around for downloads to realize Hunspell is the latest and greatest
> (at least it seems so). I have seen that soem people still prefer aspell and ispell, but lets leave
> that discussion aside.

This is language-dependent: for some languages Aspell is slightly
better, for others Hunspell is much better.  I don't see how bundling
the speller with Emacs could help here, especially if the user's
language is not covered by a dictionary for that speller.

> Next thing was to find it and install it. I have adavantage I can download the source code and
> compile it. By the way, hunspell is not included in gnuwin32, and none of bigger applications that
> uses it comes with executable. I have not seen some binary download that I dared to download.
> Most of binaries were on sites with lot of adds and so on.

The ezwinports site is what I recommend (not surprisingly ;-)

> Lat configuration part - reading a lot of docs, looking around at EW and discovering obsolete 
> configurations and so on. Trial and error method, and as you mark I am still not able to get it
> to work properly with swedish characters.

The latest development trunk shouldn't have thee problems.  Did you
try just using Hunspell without any configuration?

> I didn't compiled hunspells UI, I just have hunspell.exe itself.

Maybe you configured it without ncurses, or didn't have ncurses
installed.  If ncurses is present, the compiled binary includes a UI,
you don't need a separate program for that.  Again, try the binaries
from ezwinports site.




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
  2014-04-08 15:39               ` arthur miller
@ 2014-04-08 16:21                 ` Agustin Martin
  2014-04-08 16:39                   ` Eli Zaretskii
  2014-04-08 16:50                   ` arthur miller
  2014-04-08 16:34                 ` Eli Zaretskii
  1 sibling, 2 replies; 16+ messages in thread
From: Agustin Martin @ 2014-04-08 16:21 UTC (permalink / raw)
  To: arthur miller, Emacs devel

On Tue, Apr 08, 2014 at 05:39:11PM +0200, arthur miller wrote:

> > > I have found what is problem with emacs and hunspell on my computer. 
> > > It does not seem tounderstand charset och stream it gets back from hunspell. 
> > > It can actually spell all words not containing swedish characters (öäå) with 
> > > swedish dictionary. When pressing with right mouse I get a pop-up with 
> > > word suggestions, where all swedish characters are missinterpretted. 
> > > 
> > > If I press M-$ (spell-word) I get message
> > > 
> > > "ispell-word: Ispell and its process have different character maps" .
> (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 (cdr (cdr time)))))
> 
>   (add-to-list 'ispell-dictionary-alist '(("svenska"
>                        "[A-ZÖÄÅa-zöäå]"
>                        "[^A-ZÖÄÅa-zöäå]"
>                        "[']"
>                        nil
>                        ("-d" "sv_SE")
>                        t
>                        utf-8)
>                       ("svenska8"
>                        "[A-ZÖÄÅa-zöäå]"
>                        "[^A-ZÖÄÅa-zöäå]"
>                        "[']"
>                        nil
>                        ("-B" "-d" "sv_SE")
>                        t
>                        utf-8)
>                       ("english"
>                        "[[:alpha:]]"
>                        "[^[:alpha:]]"
>                        "[']"
>                        t
>                        ("-d" "en_US")
>                        nil
>                        utf-8)))
> 

You should not need this at all. emacs24 should auto-detect available
hunspell dictionaries and offer them as possible choices when calling
`ispell-change-dictionary', doing proper communication in UTF-8 and using
[:alpha:] as you do for english (change that in your .emacs and see what
happens). 

I'd also doucle-check encoding for above diacritics, making sure they are
UTF-8 encoded as you declare them (but better use [:alpha:] as proposed
above).

Does this problem appear if you use automatically generated entries?

-- 
Agustin



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
  2014-04-08 15:39               ` arthur miller
  2014-04-08 16:21                 ` Agustin Martin
@ 2014-04-08 16:34                 ` Eli Zaretskii
  1 sibling, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2014-04-08 16:34 UTC (permalink / raw)
  To: arthur miller; +Cc: emacs-devel

> From: arthur miller <arthur.miller@live.com>
> CC: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Tue, 8 Apr 2014 17:39:11 +0200
> 
> > It's not a real problem.  Please tell where you got that Swedish
> > dictionary, and please try using the UTF-8 encoding instead of 8859-1.
> > 
> I answered your email on the other list, dictionaries are from OpenOffice: http://archive.services.openoffice.org/pub/mirror/OpenOffice.org/contrib/dictionaries/
> I did try to use utf-8, I can copy my settings again:

And I replied there that I have no problems using that dictionary with
the Hunspell binary from the ezwinports site.

Let's continue the discussion on that other list.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
       [not found]       ` <BLU183-W50614F3A61A7E9DADB9E60966B0@phx.gbl>
@ 2014-04-08 16:37         ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2014-04-08 16:37 UTC (permalink / raw)
  To: arthur miller; +Cc: emacs-devel

> From: arthur miller <arthur.miller@live.com>
> Date: Tue, 8 Apr 2014 18:14:45 +0200
> 
> Tested now with hunspell from ezqinport and it works out of the box.

Good.  As I said, I fixed wuite a few bugs in Hunspell while porting
it, some of them are not Windows specific bugs.

> How does ezwinport differ from gnuwin32 project? Seems to have same goal ...

The main difference is that ezwinports is alive, whereas GnuWin32 is
dead (last updated more than 3 years ago).  Therefore, GnuWin32 has
very old ports, and they are not being updated.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
  2014-04-08 16:21                 ` Agustin Martin
@ 2014-04-08 16:39                   ` Eli Zaretskii
  2014-04-09 16:27                     ` Eli Zaretskii
  2014-04-08 16:50                   ` arthur miller
  1 sibling, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-04-08 16:39 UTC (permalink / raw)
  To: Agustin Martin; +Cc: arthur.miller, emacs-devel

> Date: Tue, 8 Apr 2014 18:21:32 +0200
> From: Agustin Martin <agustin.martin@hispalinux.es>
> 
> >   (add-to-list 'ispell-dictionary-alist '(("svenska"
> >                        "[A-ZÖÄÅa-zöäå]"
> >                        "[^A-ZÖÄÅa-zöäå]"
> >                        "[']"
> >                        nil
> >                        ("-d" "sv_SE")
> >                        t
> >                        utf-8)
> >                       ("svenska8"
> >                        "[A-ZÖÄÅa-zöäå]"
> >                        "[^A-ZÖÄÅa-zöäå]"
> >                        "[']"
> >                        nil
> >                        ("-B" "-d" "sv_SE")
> >                        t
> >                        utf-8)
> >                       ("english"
> >                        "[[:alpha:]]"
> >                        "[^[:alpha:]]"
> >                        "[']"
> >                        t
> >                        ("-d" "en_US")
> >                        nil
> >                        utf-8)))
> > 
> 
> You should not need this at all. emacs24 should auto-detect available
> hunspell dictionaries and offer them as possible choices when calling
> `ispell-change-dictionary', doing proper communication in UTF-8 and using
> [:alpha:] as you do for english (change that in your .emacs and see what
> happens). 

The Windows binary from ezwinports doesn't yet comply with the
semantics of the -D switch that is required for what you describe.  I
will probably fix that some time soon.

> I'd also doucle-check encoding for above diacritics, making sure they are
> UTF-8 encoded as you declare them (but better use [:alpha:] as proposed
> above).

I don't think the encoding matters, Hunspell will convert as required.




^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: A question about spellchecker
  2014-04-08 16:21                 ` Agustin Martin
  2014-04-08 16:39                   ` Eli Zaretskii
@ 2014-04-08 16:50                   ` arthur miller
  1 sibling, 0 replies; 16+ messages in thread
From: arthur miller @ 2014-04-08 16:50 UTC (permalink / raw)
  To: Agustin Martin; +Cc: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 3194 bytes --]



> Date: Tue, 8 Apr 2014 18:21:32 +0200
> From: agustin.martin@hispalinux.es
> To: arthur.miller@live.com; emacs-devel@gnu.org
> Subject: Re: A question about spellchecker
> 
> On Tue, Apr 08, 2014 at 05:39:11PM +0200, arthur miller wrote:
> 
> > > > I have found what is problem with emacs and hunspell on my computer. 
> > > > It does not seem tounderstand charset och stream it gets back from hunspell. 
> > > > It can actually spell all words not containing swedish characters (öäå) with 
> > > > swedish dictionary. When pressing with right mouse I get a pop-up with 
> > > > word suggestions, where all swedish characters are missinterpretted. 
> > > > 
> > > > If I press M-$ (spell-word) I get message
> > > > 
> > > > "ispell-word: Ispell and its process have different character maps" .
> > (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 (cdr (cdr time)))))
> > 
> >   (add-to-list 'ispell-dictionary-alist '(("svenska"
> >                        "[A-ZÖÄÅa-zöäå]"
> >                        "[^A-ZÖÄÅa-zöäå]"
> >                        "[']"
> >                        nil
> >                        ("-d" "sv_SE")
> >                        t
> >                        utf-8)
> >                       ("svenska8"
> >                        "[A-ZÖÄÅa-zöäå]"
> >                        "[^A-ZÖÄÅa-zöäå]"
> >                        "[']"
> >                        nil
> >                        ("-B" "-d" "sv_SE")
> >                        t
> >                        utf-8)
> >                       ("english"
> >                        "[[:alpha:]]"
> >                        "[^[:alpha:]]"
> >                        "[']"
> >                        t
> >                        ("-d" "en_US")
> >                        nil
> >                        utf-8)))
> > 
> 
> You should not need this at all. emacs24 should auto-detect available
> hunspell dictionaries and offer them as possible choices when calling
> `ispell-change-dictionary', doing proper communication in UTF-8 and using
> [:alpha:] as you do for english (change that in your .emacs and see what
> happens). 
> 
> I'd also doucle-check encoding for above diacritics, making sure they are
> UTF-8 encoded as you declare them (but better use [:alpha:] as proposed
> above).
> 
> Does this problem appear if you use automatically generated entries?
> 
> -- 
> Agustin

Thanks for repaly and for information; I didn't know that Emacs 24 is updated
to find spellcheckers and configure settings on its own. 

Unfortunately it does not work for me. If I remove that list I get following error:

" Starting new Ispell process hunspell with en_US dictionary...
ispell-get-decoded-string: No data for dictionary "en_US", neither in `ispell-local-dictionary-alist' nor in `ispell-dictionary-alist' "

However I have changed the list according to your instructions for diacritics to :alpha: and it works fine with Elis hunspell from ezwinport.

thanks for help all
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 3934 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
  2014-04-08 16:39                   ` Eli Zaretskii
@ 2014-04-09 16:27                     ` Eli Zaretskii
  2014-04-09 16:59                       ` arthur miller
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-04-09 16:27 UTC (permalink / raw)
  To: agustin.martin; +Cc: arthur.miller, emacs-devel

> Date: Tue, 08 Apr 2014 19:39:41 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: arthur.miller@live.com, emacs-devel@gnu.org
> 
> > You should not need this at all. emacs24 should auto-detect available
> > hunspell dictionaries and offer them as possible choices when calling
> > `ispell-change-dictionary', doing proper communication in UTF-8 and using
> > [:alpha:] as you do for english (change that in your .emacs and see what
> > happens). 
> 
> The Windows binary from ezwinports doesn't yet comply with the
> semantics of the -D switch that is required for what you describe.  I
> will probably fix that some time soon.

Done.  People who use Hunspell on Windows may wish to download the
latest binaries, and then you can remove the hacking of
ispell-dictionary-alist and ispell-local-dictionary-alist from your
.emacs.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: A question about spellchecker
  2014-04-09 16:27                     ` Eli Zaretskii
@ 2014-04-09 16:59                       ` arthur miller
  2014-04-09 17:27                         ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: arthur miller @ 2014-04-09 16:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1851 bytes --]



> Date: Wed, 9 Apr 2014 19:27:51 +0300
> From: eliz@gnu.org
> Subject: Re: A question about spellchecker
> To: agustin.martin@hispalinux.es
> CC: arthur.miller@live.com; emacs-devel@gnu.org
> 
> > Date: Tue, 08 Apr 2014 19:39:41 +0300
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: arthur.miller@live.com, emacs-devel@gnu.org
> > 
> > > You should not need this at all. emacs24 should auto-detect available
> > > hunspell dictionaries and offer them as possible choices when calling
> > > `ispell-change-dictionary', doing proper communication in UTF-8 and using
> > > [:alpha:] as you do for english (change that in your .emacs and see what
> > > happens). 
> > 
> > The Windows binary from ezwinports doesn't yet comply with the
> > semantics of the -D switch that is required for what you describe.  I
> > will probably fix that some time soon.
> 
> Done.  People who use Hunspell on Windows may wish to download the
> latest binaries, and then you can remove the hacking of
> ispell-dictionary-alist and ispell-local-dictionary-alist from your
> .emacs.
> 

That was fast! Great work.

Always cool to keep .emacs short.

Now - I have one question. Is it possible to pass name of dictionary instead of renaming
.dic and .aff files?

The reason: I belieave it is much easier to instruct people how to pass name of a file to
Emacs, than how to find what locale their Emacs or system use :). 

Furthermore, what if we wish to use two languages == two dictionaries. How to 
specify for ispell-change-dictionary if dictionaries are not set in list. Does hunspell
enumerate all dictionaries in folder? 

For example there is a list of country names and codes in rw-language-and-country-codes.el.
Any chance to use it and automate so users don't have to be instructed to rename dictionary
files?
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 2304 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
  2014-04-09 16:59                       ` arthur miller
@ 2014-04-09 17:27                         ` Eli Zaretskii
  2014-04-09 17:32                           ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2014-04-09 17:27 UTC (permalink / raw)
  To: arthur miller; +Cc: emacs-devel

> From: arthur miller <arthur.miller@live.com>
> CC: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Wed, 9 Apr 2014 18:59:56 +0200
> 
> Now - I have one question. Is it possible to pass name of dictionary instead of renaming
> .dic and .aff files?

Yes, of course: you have been doing that all the time with the -d
switch in your .emacs customizations.  My suggestion to copy files to
the locale names used by Windows is only so that Hunspell loads the
dictionary for your locale automatically at startup.

> The reason: I belieave it is much easier to instruct people how to pass name of a file to
> Emacs, than how to find what locale their Emacs or system use :). 

I think finding the locale is easier, just look here:

  http://www.microsoft.com/resources/msdn/goglobal/default.mspx

(Look in the last column.)

> Furthermore, what if we wish to use two languages == two dictionaries. How to 
> specify for ispell-change-dictionary if dictionaries are not set in list. Does hunspell
> enumerate all dictionaries in folder? 

Yes, with the latest binaries Hunspell will find all the installed
dictionaries, and ispell-change-dictionary will suggest them as
completions.

> 
> For example there is a list of country names and codes in rw-language-and-country-codes.el.
> Any chance to use it and automate so users don't have to be instructed to rename dictionary
> files?

That file is not what we need for ispell.el, no.  Again, renaming (or
rather copying) is only needed for the single dictionary that
corresponds to your Windows locale.  the other dictionaries don't need
to be renamed.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: A question about spellchecker
  2014-04-09 17:27                         ` Eli Zaretskii
@ 2014-04-09 17:32                           ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2014-04-09 17:32 UTC (permalink / raw)
  To: arthur.miller; +Cc: emacs-devel

> Date: Wed, 09 Apr 2014 20:27:55 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
> 
> > The reason: I belieave it is much easier to instruct people how to pass name of a file to
> > Emacs, than how to find what locale their Emacs or system use :). 
> 
> I think finding the locale is easier, just look here:
> 
>   http://www.microsoft.com/resources/msdn/goglobal/default.mspx
> 
> (Look in the last column.)

Actually, an even easier way (on Windows) is this:

  M-: (w32-get-locale-info (w32-get-current-locale-id)) RET



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-04-09 17:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-08  4:21 A question about spellchecker arthur miller
2014-04-08  5:16 ` Daniel Colascione
     [not found]   ` <BLU183-W65979B6E2198DC658D6CD4966B0@phx.gbl>
     [not found]     ` <5343C8BE.206@dancol.org>
     [not found]       ` <BLU183-W20EF6E63CF75718EECC5EE966B0@phx.gbl>
     [not found]         ` <5343CE2A.7050900@dancol.org>
2014-04-08 13:07           ` arthur miller
2014-04-08 15:34             ` Eli Zaretskii
2014-04-08 15:39               ` arthur miller
2014-04-08 16:21                 ` Agustin Martin
2014-04-08 16:39                   ` Eli Zaretskii
2014-04-09 16:27                     ` Eli Zaretskii
2014-04-09 16:59                       ` arthur miller
2014-04-09 17:27                         ` Eli Zaretskii
2014-04-09 17:32                           ` Eli Zaretskii
2014-04-08 16:50                   ` arthur miller
2014-04-08 16:34                 ` Eli Zaretskii
2014-04-08 15:11 ` Eli Zaretskii
     [not found]   ` <BLU183-W1EA36DA7237C49B9E9ECF966B0@phx.gbl>
2014-04-08 15:47     ` Eli Zaretskii
     [not found]       ` <BLU183-W50614F3A61A7E9DADB9E60966B0@phx.gbl>
2014-04-08 16:37         ` Eli Zaretskii

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).