From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Agustin Martin Newsgroups: gmane.emacs.devel Subject: Re: More problems with flyspell Date: Fri, 6 Jan 2006 01:11:20 +0100 Message-ID: <20060106001120.GA6376@agmartin.aq.upm.es> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1136512168 25083 80.91.229.2 (6 Jan 2006 01:49:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 6 Jan 2006 01:49:28 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 06 02:49:27 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eugj9-0000sK-8v for ged-emacs-devel@m.gmane.org; Fri, 06 Jan 2006 02:49:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eugks-0006k8-7q for ged-emacs-devel@m.gmane.org; Thu, 05 Jan 2006 20:50:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eugk2-0006jd-3G for emacs-devel@gnu.org; Thu, 05 Jan 2006 20:50:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Eugk0-0006j1-HP for emacs-devel@gnu.org; Thu, 05 Jan 2006 20:50:05 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eugk0-0006iv-93 for emacs-devel@gnu.org; Thu, 05 Jan 2006 20:50:04 -0500 Original-Received: from [138.100.4.49] (helo=edison.ccupm.upm.es) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Euglf-0007eA-Ga for emacs-devel@gnu.org; Thu, 05 Jan 2006 20:51:47 -0500 Original-Received: from debian ([138.100.247.74]) by edison.ccupm.upm.es (8.12.10/8.12.10) with ESMTP id k061mA5u017223; Fri, 6 Jan 2006 02:48:10 +0100 Original-Received: by debian (Postfix, from userid 1000) id EE59F17DF5; Fri, 6 Jan 2006 01:11:20 +0100 (CET) Original-To: emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i 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:48777 Archived-At: On Thu, Jan 05, 2006 at 02:37:42PM +0100, Piet van Oostrum wrote: > Some recent changes in flyspell.el (flyspell-accept-buffer-local-defs) have > caused me a problem. It hit me when I updated my CVS emacs this week: > > I want my email and news messages to be flyspell-checked automatically, > preferably with the right language. So in mail-mode-hook, message-mode-hook > and vm-mail-mode-hook I run a function that installs a first-change-hook. > In the latter I do some regular expression grepping to guess what language > the message is in. This only works when replying to a message, for an new > message the default is "Dutch". When I am going to enter a new message in > English, I manually run a command to reset it to English. Each time I call > (flyspell-mode 1). This used to work, but stopped with the recent version. > The reason is the optimization in flyspell-accept-buffer-local-defs. It > won't restart ispell because there was no buffer change. > So I think when > flyspell-accept-buffer-local-defs is called from flyspell-mode-on it should > do its work unconditionally. This can be done by setting > flyspell-last-buffer to nil in flyspell-mode-on. > > Or maybe another solution is to give flyspell-accept-buffer-local-defs a > parameter that tells whether to do the optimization and only do it in > time-critical situations. While we are with this, I have noticed that flyspell-accept-buffer-local-defs is called from flyspell-large-region, but not from flyspell-small-region. By the way, since none of both is supposed to be called directly, might be better to move that call to flyspell-region. that is the interactive function that will internally call flyspell-{large,small}-region. Since I would expect this to be affected by the same problem the preferred fix from those you propose above should also be applied here. -- Agustin