all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Agustin Martin <agustin6martin@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Problem with flyspell?
Date: Mon, 19 Jan 2009 18:35:02 +0100	[thread overview]
Message-ID: <20090119173502.GA4589@agmartin.aq.upm.es> (raw)
In-Reply-To: <4974AF03.4050104@alice.it>

[-- 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

  reply	other threads:[~2009-01-19 17:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-19 16:49 Problem with flyspell? Angelo Graziosi
2009-01-19 17:35 ` Agustin Martin [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090119173502.GA4589@agmartin.aq.upm.es \
    --to=agustin6martin@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.