From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: ispell.el, flyspell.el: better ispell/aspell switching Date: Tue, 15 Apr 2008 14:40:23 -0400 Message-ID: References: <20080404120217.GA7503@agmartin.aq.upm.es> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1208285266 26921 80.91.229.12 (15 Apr 2008 18:47:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Apr 2008 18:47:46 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 15 20:48:15 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jlq5o-0007nI-4U for ged-emacs-devel@m.gmane.org; Tue, 15 Apr 2008 20:41:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jlq59-0004KC-Oh for ged-emacs-devel@m.gmane.org; Tue, 15 Apr 2008 14:40:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jlq56-0004Ju-Ao for emacs-devel@gnu.org; Tue, 15 Apr 2008 14:40:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jlq54-0004Jc-T1 for emacs-devel@gnu.org; Tue, 15 Apr 2008 14:40:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jlq54-0004JZ-PY for emacs-devel@gnu.org; Tue, 15 Apr 2008 14:40:34 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jlq54-0002Ue-3S for emacs-devel@gnu.org; Tue, 15 Apr 2008 14:40:34 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id AE5502CF9CC; Tue, 15 Apr 2008 14:40:32 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id D3A9F3FE0; Tue, 15 Apr 2008 14:40:24 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 92D34AF5C6; Tue, 15 Apr 2008 14:40:24 -0400 (EDT) In-Reply-To: <20080404120217.GA7503@agmartin.aq.upm.es> (Agustin Martin's message of "Fri, 4 Apr 2008 14:02:17 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:95305 Archived-At: >>>>> "Agustin" =3D=3D Agustin Martin writes: > Hi, > I come back with a rewritten approach for a problem in current ispell.el = and > flyspell.el when switching spellchecker in an emacs session. > The problem is as follows, when in an emacs run aspell is used for the fi= rst > time, ispell-dictionary-alist is filled with the aspell values, and if > ispell-program-name is customized or changed to ispell during that emacs = run > it inherits the aspell values, thus failing if there was an aspell entry > with the same name. Since ispell is still (rarely) needed for pseudo-enco= dings > like [\'a -> =E1] I think this should not happen and all ispell values sh= ould > be restored in such case. Also current behavior is too ispell/aspell > centric, in case support for another spellchecker is ever added. > In the proposed attached patches (ispell-maybe-find-aspell-dictionaries) = is > replaced by (more neutral) new (ispell-set-spellchecker-params) function. > That function will check if spellchecker is changed and fill > ``ispell-dictionary-alist'' with the appropriate values. As written it has > support for info provided by distros. Patches are mostly as currently used > in Debian, with some comments rewritten, and a naive check for [:alpha:] > used (instead of just discarding that for xemacs as in Debian). Keeping > those xemacs checks saves me a couple of patches, please leave them there= if > possible. This is a good change, but there are a few minor issues with it: - ispell-spellchecker-init-pre-hook is not documented. What are distro-override-dicts-alist and distro-fallback-dicts-alist? - (setq ispell-last-program-name ispell-program-name) should be done right after checking if they're equal, not at the end of the function. - (defvar ispell-aspell-dictionary-alist...) should be before the first use of that variable. BTW (this is unrelated to this patch, but I just noticed it while looking at the code): why are ispell-dictionary-alist* autoloaded? I just tried to remove the autoloads on them and I couldn't notice any negative effect. Stefan