all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Agustin Martin <agustin.martin@hispalinux.es>
Subject: ispell.el does not recover well after wrong aspell dict selection [patch]
Date: Wed, 8 Feb 2006 12:03:00 +0100	[thread overview]
Message-ID: <20060208110300.GA2793@agmartin.aq.upm.es> (raw)

[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]

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

[-- Attachment #2: ispell.el.use-ispell-buffer-local-dict.diff --]
[-- Type: text/plain, Size: 456 bytes --]

--- 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 "")

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

                 reply	other threads:[~2006-02-08 11:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060208110300.GA2793@agmartin.aq.upm.es \
    --to=agustin.martin@hispalinux.es \
    /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.