all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ispell.el does not recover well after wrong aspell dict selection [patch]
@ 2006-02-08 11:03 Agustin Martin
  0 siblings, 0 replies; only message in thread
From: Agustin Martin @ 2006-02-08 11:03 UTC (permalink / 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-08 11:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-08 11:03 ispell.el does not recover well after wrong aspell dict selection [patch] Agustin Martin

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.