all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Problem with flyspell?
@ 2009-01-19 16:49 Angelo Graziosi
  2009-01-19 17:35 ` Agustin Martin
  0 siblings, 1 reply; 5+ messages in thread
From: Angelo Graziosi @ 2009-01-19 16:49 UTC (permalink / raw)
  To: emacs-devel

They are a few months I am working on several tex files on which I have
enabled flyspell-mode. These file have always been flyspelled correctly
using the italian dictionary without I choose it explicitly (I think
this happens because I have $LANG == it)

I do weekly build of Emacs trunk on Cygwin and the above behaviour has
been conserved since many months. Also with the build I did on Jan 12
2009. (This pushed me to make the following theory: flyspell-mode 'see'
the 'LANG' env. var. and sets the default dict. accordingly. Right?)

The build of few minutes ago has changed this (or my conjecture was
false): now all my files are spelled with english dictionary even if
Emacs says that (getenv "LANG") is 'it'!

I have to set explicitly the 'it' dictionary.

Is this new behaviour to be expected? or something changed between
20090112 and today 20090119 ?

Oops..., in the lisp/changelog I see:

2009-01-16 Agustín Martín <agustin.martin@hispalinux.es>

* textmodes/flyspell.el (flyspell-post-command-hook): Do nothing
unless flyspell-mode is enabled.
(flyspell-pre-point): Make buffer-local.


Is it the cause?


Cheers,
    Angelo.




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

* Re: Problem with flyspell?
  2009-01-19 16:49 Problem with flyspell? Angelo Graziosi
@ 2009-01-19 17:35 ` Agustin Martin
  2009-01-20  5:06   ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Agustin Martin @ 2009-01-19 17:35 UTC (permalink / raw)
  To: emacs-devel

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

On Mon, Jan 19, 2009 at 05:49:07PM +0100, Angelo Graziosi wrote:
> They are a few months I am working on several tex files on which I have
> enabled flyspell-mode. These file have always been flyspelled correctly
> using the italian dictionary without I choose it explicitly (I think
> this happens because I have $LANG == it)
>
> I do weekly build of Emacs trunk on Cygwin and the above behaviour has
> been conserved since many months. Also with the build I did on Jan 12
> 2009. (This pushed me to make the following theory: flyspell-mode 'see'
> the 'LANG' env. var. and sets the default dict. accordingly. Right?)
>
> The build of few minutes ago has changed this (or my conjecture was
> false): now all my files are spelled with english dictionary even if
> Emacs says that (getenv "LANG") is 'it'!
>
> I have to set explicitly the 'it' dictionary.
>
> Is this new behaviour to be expected? or something changed between
> 20090112 and today 20090119 ?
>
> Oops..., in the lisp/changelog I see:
>
> 2009-01-16 Agustín Martín <agustin.martin@hispalinux.es>
>
> * textmodes/flyspell.el (flyspell-post-command-hook): Do nothing
> unless flyspell-mode is enabled.
> (flyspell-pre-point): Make buffer-local.

No, the reason for the change is not there, but in ispell.el 1.244

2009-01-16  Agustín Martín <agustin.martin@hispalinux.es>

* textmodes/ispell.el (ispell-find-aspell-dictionaries): ...
Use correct dictionary alist for default.

if, as I guess, you use aspell.

As a matter of fact, you should have found the behavior you currently find
until ispell.el 1.228 (Thu Apr 24 2008). Before that, if an english aspell
dict was found, it was made the default, otherwise first entry in
ispell-dictionary-alist-1 was used. When moving to the new scheme, the alist
name was not updated, so ispell.el tried first to find 'en' in the original
alist, not in the aspell dicts alist, and since it was never found there
the fallback first entry was always used for default.

In the above change, 'en' is now found in the correct alist, so if an english
dict is installed it is used as default. Note that this change did nothing
else than making the code work as expected.

There is room for discussion about what should be 'expected'. I am beginning
to think that we should just set aspell default as the current fallback
default, without trying english first.

If there are no objections, I will commit attached patch. As a matter of
fact 'en' precedence did not work for a long time and there were no
complaints about that.

-- 
Agustin

[-- Attachment #2: ispell.el_plain-aspell-default.diff --]
[-- Type: text/x-diff, Size: 635 bytes --]

--- ispell.el.orig	2009-01-19 18:23:43.000000000 +0100
+++ ispell.el	2009-01-19 18:25:52.000000000 +0100
@@ -937,10 +937,7 @@
 	(setq found (nconc found (list dict)))))
     (setq ispell-aspell-dictionary-alist found)
     ;; Add a default entry
-    (let* ((english-dict (assoc "en" ispell-aspell-dictionary-alist))
-	   (default-dict
-	     (cons nil (or (cdr english-dict)
-			   '("[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil utf-8)))))
+    (let ((default-dict '(nil "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil utf-8)))
       (push default-dict ispell-aspell-dictionary-alist))))
 
 (defvar ispell-aspell-data-dir nil

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

* Re: Problem with flyspell?
@ 2009-01-19 20:49 Angelo Graziosi
  0 siblings, 0 replies; 5+ messages in thread
From: Angelo Graziosi @ 2009-01-19 20:49 UTC (permalink / raw)
  To: emacs-devel

Agustin Martin wrote:

> if, as I guess, you use aspell.

Indeed!

> As a matter of fact, you should have found the behavior you currently find
> until ispell.el 1.228 (Thu Apr 24 2008).

If I have well understood, that was the reason for which I did put (I do
not remember when)

(setq desktop-locals-to-save
       (cons 'ispell-local-dictionary desktop-locals-to-save))

in my .emacs file, otherwise I had to restore the 'it' dict. each time I
started Emacs. But then I noted that Emacs by default used 'it' so my
theory on LANG var. was born...

Thanks a lot for the detailed explanation!

    Angelo




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

* Re: Problem with flyspell?
@ 2009-01-19 22:15 Angelo Graziosi
  0 siblings, 0 replies; 5+ messages in thread
From: Angelo Graziosi @ 2009-01-19 22:15 UTC (permalink / raw)
  To: emacs-devel

Agustin Martin wrote:

> If there are no objections, I will commit attached patch. As a matter of
> fact 'en' precedence did not work for a long time and there were no
> complaints about that.

It works just fine1

I hope it is approved soon.


Cheers,
    Angelo.




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

* Re: Problem with flyspell?
  2009-01-19 17:35 ` Agustin Martin
@ 2009-01-20  5:06   ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2009-01-20  5:06 UTC (permalink / raw)
  To: emacs-devel

> There is room for discussion about what should be 'expected'. I am beginning
> to think that we should just set aspell default as the current fallback
> default, without trying english first.

As a general rule, we should follow the behavior of the tool, unless
there's a good reason not to.  So by default we should just use
ispell/aspell/unspell's default dictionary unless we know better
(e.g. maybe the user called set-language-environment).


        Stefan




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

end of thread, other threads:[~2009-01-20  5:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-19 16:49 Problem with flyspell? Angelo Graziosi
2009-01-19 17:35 ` Agustin Martin
2009-01-20  5:06   ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2009-01-19 20:49 Angelo Graziosi
2009-01-19 22:15 Angelo Graziosi

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.