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: ispell.el does not recover well after wrong aspell dict selection [patch] Date: Wed, 8 Feb 2006 12:03:00 +0100 Message-ID: <20060208110300.GA2793@agmartin.aq.upm.es> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="X1bOJ3K7DJ5YkBrT" X-Trace: sea.gmane.org 1139413610 16090 80.91.229.2 (8 Feb 2006 15:46:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Feb 2006 15:46:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 08 16:46:45 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 1F6rUB-00018f-6k for ged-emacs-devel@m.gmane.org; Wed, 08 Feb 2006 16:44:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6rGH-0006my-MP for ged-emacs-devel@m.gmane.org; Wed, 08 Feb 2006 10:29:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F6nNk-0006o1-L6 for emacs-devel@gnu.org; Wed, 08 Feb 2006 06:21:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F6nMQ-0006WX-5O for emacs-devel@gnu.org; Wed, 08 Feb 2006 06:19:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6n5w-0002o8-9g for emacs-devel@gnu.org; Wed, 08 Feb 2006 06:02:45 -0500 Original-Received: from [138.100.4.49] (helo=edison.ccupm.upm.es) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F6n9E-0008S6-Gq for emacs-devel@gnu.org; Wed, 08 Feb 2006 06:06:08 -0500 Original-Received: from mala.aq.upm.es (Agmartin.aq.upm.es [138.100.41.131]) by edison.ccupm.upm.es (8.12.10/8.12.10) with ESMTP id k18B2g3x027172; Wed, 8 Feb 2006 12:02:42 +0100 Original-Received: by mala.aq.upm.es (Postfix, from userid 1000) id 3381112501; Wed, 8 Feb 2006 12:03:00 +0100 (CET) Original-To: emacs-devel@gnu.org Mail-Followup-To: emacs-devel@gnu.org Content-Disposition: inline User-Agent: Mutt/1.5.11+cvs20060126 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:50204 Archived-At: --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I am noticing a problem arising when aspell is used as ispell-program-name and a non existent dict is selected. After issuing an spellchecking command and getting the error message, is no longer possible to change dictionary. E.g., if english aspell dict is not present and I try to spellcheck ----------------------------------------------------------------- any Local Variables: ispell-local-dictionary: "american" End: ----------------------------------------------------------------- M-x ispell-word Starting new Ispell process [american] ... ispell-init-process: Error: The file "/usr/lib/aspell/american" can not be opened for reading. M-x ispell-change-dictionary francais Starting new Ispell process [american] ... ispell-init-process: Error: The file "/usr/lib/aspell/american" can not be opened for reading. Dict is no changed. The reason for this is that in (ispell-change-dictionary) function (ispell-accept-buffer-local-defs) is called before dict is changed. That function calls (ispell-buffer-local-words) that tries to start a new ispell process with the old (wrong) dict value, producing the error, because dict is not yet changed, and so remains unchanged. Since seems that the only reason to call (ispell-accept-buffer-local-defs) is to get ispell-local-dictionary value if present in 'Local Variables', calling (ispell-buffer-local-dict) instead, as in attached patch, should work. (ispell-change-dictionary) Call ispell-buffer-local-dict instead of ispell-accept-buffer-local-defs -- Agustin --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ispell.el.use-ispell-buffer-local-dict.diff" --- ispell.el.orig 2006-02-01 11:33:55.000000000 +0100 +++ ispell.el 2006-02-08 11:29:39.000000000 +0100 @@ -2604,7 +2604,7 @@ (mapcar 'list (ispell-valid-dictionary-list))) nil t) current-prefix-arg)) - (unless arg (ispell-accept-buffer-local-defs)) + (unless arg (ispell-buffer-local-dict)) (if (equal dict "default") (setq dict nil)) ;; This relies on completing-read's bug of returning "" for no match (cond ((equal dict "") --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --X1bOJ3K7DJ5YkBrT--