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: Wed, 23 Apr 2008 16:40:25 -0400 Message-ID: References: <20080404120217.GA7503@agmartin.aq.upm.es> <20080416094933.GA4876@agmartin.aq.upm.es> <20080417175637.GA4277@agmartin.aq.upm.es> <20080421171519.GA7078@agmartin.aq.upm.es> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1208983397 5195 80.91.229.12 (23 Apr 2008 20:43:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Apr 2008 20:43:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 23 22:43:51 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 1Jolok-00057O-HX for ged-emacs-devel@m.gmane.org; Wed, 23 Apr 2008 22:43:50 +0200 Original-Received: from localhost ([127.0.0.1]:42589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jolo4-0004wl-PT for ged-emacs-devel@m.gmane.org; Wed, 23 Apr 2008 16:43:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jolnz-0004tc-05 for emacs-devel@gnu.org; Wed, 23 Apr 2008 16:43:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jolnx-0004rf-8a for emacs-devel@gnu.org; Wed, 23 Apr 2008 16:43:02 -0400 Original-Received: from [199.232.76.173] (port=35611 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jolnx-0004rU-3y for emacs-devel@gnu.org; Wed, 23 Apr 2008 16:43:01 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182] helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JollU-0002Uh-4c for emacs-devel@gnu.org; Wed, 23 Apr 2008 16:40:29 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArwEAH47D0hFxIud/2dsb2JhbACBUqxL X-IronPort-AV: E=Sophos;i="4.25,701,1199682000"; d="scan'208";a="18971694" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 23 Apr 2008 16:40:25 -0400 Original-Received: from pastel.home ([69.196.139.157]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id DYL87325; Wed, 23 Apr 2008 16:40:25 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D14368064; Wed, 23 Apr 2008 16:40:25 -0400 (EDT) In-Reply-To: <20080421171519.GA7078@agmartin.aq.upm.es> (Agustin Martin's message of "Mon, 21 Apr 2008 19:15:19 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:95862 Archived-At: >>>>> "Agustin" == Agustin Martin writes: > On Thu, Apr 17, 2008 at 09:38:51PM -0400, Stefan Monnier wrote: >> I think it's perfectly fine to include it in ispell.el (it doesn't have >> to be limited to the use of distro's tho, so I'd rather not use the word >> "distro". As a general rule, variables and functions should take names >> that describe what they do rather than in what context they'll be used) > Thanks, I now notice that this may also be used systemwide by sysadmins > for e.g., non-standard dicts, so removing the 'distro' word completely and > using ``ispell-initialize-spellchecker-hook'' instead. >> >> > I think this is better done as currently, just in the middle, that >> > is, after parsed aspell dicts, but before base-dicts. You do not know where >> > things come from if things are done at the end, and if you need to check it >> > you may end reusing half of the function. >> >> Is it ever necessary/important to distinguish whether it comes from the >> base or fom the parsed dicts? > I think that only in the function. >> > If the problem is about using a hook there, something like >> >> No, the problem is the dynamically scoped variables. But if there's no >> easy way to do without them, it's OK to use such things. Just use more >> descriptive names, and be sure to document them in the hook's docstring. > Thanks for all the suggestions, I am attaching updated patches. Feel free to > change if you think there are better names or ways of doing things. Gracias, installed with the following changelog: * ispell.el (ispell-set-spellchecker-params): New function to make sure right params and dictionary alists are used after spellchecker changes. (ispell-aspell-dictionary-alist, ispell-last-program-name) (ispell-initialize-spellchecker-hook): New variables and hook. (ispell-find-aspell-dictionaries): Use ispell-aspell-dictionary-alist. (ispell-maybe-find-aspell-dictionaries): Remove. Calls replaced by (ispell-set-spellchecker-params) calls. (ispell-have-aspell-dictionaries): Remove. * flyspell.el: Replace ispell-maybe-find-aspell-dictionaries by ispell-set-spellchecker-params. Please notice the format and use of present tense. Stefan