all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ispell default dictionary keeps reverting to "american"
@ 2007-09-02 11:02 Kevin Brubeck Unhammer
  2007-09-02 11:56 ` Sven Joachim
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Kevin Brubeck Unhammer @ 2007-09-02 11:02 UTC (permalink / raw)
  To: help-gnu-emacs

How do I make my default ispell dictionary -- for all files and file
types -- something other than "american"?

Using ispell-change-dictionary in .emacs just works on the buffers
loaded before that line in .emacs, for new buffers it's still
"american". I can change the ispell-dictionary variable as much as I
want, this has no effect on subsequent ispells, although if I ispell-
change-dictionary manually, this works in the open buffers. But how do
I change it for all _new_ buffers too?

Rather desperately, I tried customizing the ispell-dictionary-alist,
putting my dictionary ("nynorsk") first, no luck there. So I tried
(setq ispell-dictionary "nynorsk") in my .emacs, but whenever I try
spell-checking a word, ispell reverts this variable to "american" (I
eval'd it before and after M-$).


I'm running:
GNU Emacs 22.1.1 (i486-pc-linux-gnu, GTK+ Version 2.10.11) of
2007-08-15 on palmer, modified by Ubuntu
International Ispell Version 3.1.20 10/10/95, patch 1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ispell default dictionary keeps reverting to "american"
  2007-09-02 11:02 ispell default dictionary keeps reverting to "american" Kevin Brubeck Unhammer
@ 2007-09-02 11:56 ` Sven Joachim
  2007-09-02 17:15   ` Kevin Brubeck Unhammer
  2007-09-02 12:51 ` Peter Dyballa
       [not found] ` <mailman.168.1188737518.18990.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 10+ messages in thread
From: Sven Joachim @ 2007-09-02 11:56 UTC (permalink / raw)
  To: help-gnu-emacs

Kevin Brubeck Unhammer <pixiemotion@gmail.com> writes:

> How do I make my default ispell dictionary -- for all files and file
> types -- something other than "american"?
>
> Using ispell-change-dictionary in .emacs just works on the buffers
> loaded before that line in .emacs, for new buffers it's still
> "american". I can change the ispell-dictionary variable as much as I
> want, this has no effect on subsequent ispells, although if I ispell-
> change-dictionary manually, this works in the open buffers. But how do
> I change it for all _new_ buffers too?
>
> Rather desperately, I tried customizing the ispell-dictionary-alist,
> putting my dictionary ("nynorsk") first, no luck there. So I tried
> (setq ispell-dictionary "nynorsk") in my .emacs, but whenever I try
> spell-checking a word, ispell reverts this variable to "american" (I
> eval'd it before and after M-$).

Look at ispell-change-dictionary's docstring:

,----
| ispell-change-dictionary is an interactive compiled Lisp function in `ispell.el'.
| It is bound to <menu-bar> <tools> <spell> <ispell-change-dictionary>.
| (ispell-change-dictionary dict &optional arg)
| 
| Change to dictionary dict for Ispell.
| With a prefix arg, set it "globally", for all buffers.
| Without a prefix arg, set it "locally", just for this buffer.
`----

So I'd presume that C-u M-x ispell-change-dictionary (interactively)
or (setq ispell-change-dictionary "nynorsk" t) (in your .emacs) do the
trick.  Does that work?

Cheers,
       Sven

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ispell default dictionary keeps reverting to "american"
  2007-09-02 11:02 ispell default dictionary keeps reverting to "american" Kevin Brubeck Unhammer
  2007-09-02 11:56 ` Sven Joachim
@ 2007-09-02 12:51 ` Peter Dyballa
       [not found] ` <mailman.168.1188737518.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2007-09-02 12:51 UTC (permalink / raw)
  To: Kevin Brubeck Unhammer; +Cc: help-gnu-emacs


Am 02.09.2007 um 13:02 schrieb Kevin Brubeck Unhammer:

> How do I make my default ispell dictionary -- for all files and file
> types -- something other than "american"?

Is the nynorsk dictionary installed on your Ubuntu system? What are  
the values of ispell-local-dictionary and ispell-library-directory?  
What is GNU Emacs showing in *Completions* buffer when you type

	M-x ispell-change-dictionary RET TAB

The values shown are the dictionaries found on your system in the  
directory pointed by ispell-library-directory.


Have you checked whether the modes of the buffers that use american  
for ispell do *not* change ispell-dictionary? Have you checked  
whether your buffer do *not* set ispell-dictionary locally? Are you  
sure that your setting of ispell-dictionary in ~/.emacs is executed?  
Some (message ...) might help.

--
Greetings

   Pete

The most exciting phrase to hear in science, the one that heralds new  
discoveries, is not "Eureka!" (I found it!) but "That's funny..."
                                       Isaac Asimov

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ispell default dictionary keeps reverting to "american"
  2007-09-02 11:56 ` Sven Joachim
@ 2007-09-02 17:15   ` Kevin Brubeck Unhammer
  2007-09-02 17:43     ` Sven Joachim
  0 siblings, 1 reply; 10+ messages in thread
From: Kevin Brubeck Unhammer @ 2007-09-02 17:15 UTC (permalink / raw)
  To: help-gnu-emacs

Sven Joachim skreiv:
> Look at ispell-change-dictionary's docstring:
>
> ,----
> | ispell-change-dictionary is an interactive compiled Lisp function in `ispell.el'.
> | It is bound to <menu-bar> <tools> <spell> <ispell-change-dictionary>.
> | (ispell-change-dictionary dict &optional arg)
> |
> | Change to dictionary dict for Ispell.
> | With a prefix arg, set it "globally", for all buffers.
> | Without a prefix arg, set it "locally", just for this buffer.
> `----
>
> So I'd presume that C-u M-x ispell-change-dictionary (interactively)
> or (setq ispell-change-dictionary "nynorsk" t) (in your .emacs) do the
> trick.  Does that work?

Seems like it should, yeah, but even with the prefix argument, the
value changes just before pressing M-$. I can start emacs, do "C-h v
ispell-dictionary" and it tells me it's set to "nynorsk", then I do M-
$ and I get only American suggestions for spelling, "C-h v ispell-
dictionary" again tells me that it's set to "american".

Right after starting emacs, I can do "C-u M-x ispell-change-dictionary
RET nynorsk", and it tells me "No change, using nynorsk dictionary",
but still on the first spellcheck it'll revert to "american". _After_
the first spellcheck though, I can use ispell-change-dictionary to set
it to "nynorsk" locally, and it stays that way in that buffer
(although setting it globally doesn't override "american", I have to
set it locally in each new buffer _after_ running at least one ispell-
check).

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ispell default dictionary keeps reverting to "american"
       [not found] ` <mailman.168.1188737518.18990.help-gnu-emacs@gnu.org>
@ 2007-09-02 17:27   ` Kevin Brubeck Unhammer
  2007-09-02 18:55     ` Peter Dyballa
       [not found]     ` <mailman.180.1188759356.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Kevin Brubeck Unhammer @ 2007-09-02 17:27 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa skreiv:
> Is the nynorsk dictionary installed on your Ubuntu system? What are
> the values of ispell-local-dictionary and ispell-library-directory?

ispell-local-dictionary is nil on a fresh startup (as it should be),
then "american" after the first spellcheck. ispell-dictionary, OTOH,
is "nynorsk" on a fresh startup and "american" after the first
spellcheck. According to the description of this variable, it should
be used to set ispell-local-dictionary to "nynorsk"...

> What is GNU Emacs showing in *Completions* buffer when you type
>
> 	M-x ispell-change-dictionary RET TAB
>
> The values shown are the dictionaries found on your system in the
> directory pointed by ispell-library-directory.

Possible completions are:
american			   bokmal
british				   canadian
default				   english
norsk				   norsk7-tex
nynorsk

> Have you checked whether the modes of the buffers that use american
> for ispell do *not* change ispell-dictionary? Have you checked
> whether your buffer do *not* set ispell-dictionary locally? Are you
> sure that your setting of ispell-dictionary in ~/.emacs is executed?
> Some (message ...) might help.

I tried emptying my .emacs from all but (ispell-change-dictionary
"nynorsk" t), no change... the dictionary starts being "nynorsk" and
changes to "american" after one ispell-check.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ispell default dictionary keeps reverting to "american"
  2007-09-02 17:15   ` Kevin Brubeck Unhammer
@ 2007-09-02 17:43     ` Sven Joachim
  2007-09-03  8:16       ` Kevin Brubeck Unhammer
  0 siblings, 1 reply; 10+ messages in thread
From: Sven Joachim @ 2007-09-02 17:43 UTC (permalink / raw)
  To: help-gnu-emacs

Kevin Brubeck Unhammer <pixiemotion@gmail.com> writes:

> Sven Joachim skreiv:
>> So I'd presume that C-u M-x ispell-change-dictionary (interactively)
>> or (setq ispell-change-dictionary "nynorsk" t) (in your .emacs) do the
>> trick.  Does that work?
>
> Seems like it should, yeah, but even with the prefix argument, the
> value changes just before pressing M-$. I can start emacs, do "C-h v
> ispell-dictionary" and it tells me it's set to "nynorsk", then I do M-
> $ and I get only American suggestions for spelling, "C-h v ispell-
> dictionary" again tells me that it's set to "american".
>
> Right after starting emacs, I can do "C-u M-x ispell-change-dictionary
> RET nynorsk", and it tells me "No change, using nynorsk dictionary",
> but still on the first spellcheck it'll revert to "american". _After_
> the first spellcheck though, I can use ispell-change-dictionary to set
> it to "nynorsk" locally, and it stays that way in that buffer
> (although setting it globally doesn't override "american", I have to
> set it locally in each new buffer _after_ running at least one ispell-
> check).

It is possible that you are using an outdated version of ispell.el.
Debian has such a beast in its dictionaries-common package, and I
presume the same is the case on Ubuntu.  What does
(locate-library "ispell") give?

Regards,
        Sven

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ispell default dictionary keeps reverting to "american"
  2007-09-02 17:27   ` Kevin Brubeck Unhammer
@ 2007-09-02 18:55     ` Peter Dyballa
       [not found]     ` <mailman.180.1188759356.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2007-09-02 18:55 UTC (permalink / raw)
  To: Kevin Brubeck Unhammer; +Cc: help-gnu-emacs


Am 02.09.2007 um 19:27 schrieb Kevin Brubeck Unhammer:

>> Have you checked whether the modes of the buffers that use american
>> for ispell do *not* change ispell-dictionary? Have you checked
>> whether your buffer do *not* set ispell-dictionary locally? Are you
>> sure that your setting of ispell-dictionary in ~/.emacs is executed?
>> Some (message ...) might help.
>
> I tried emptying my .emacs from all but (ispell-change-dictionary
> "nynorsk" t), no change... the dictionary starts being "nynorsk" and
> changes to "american" after one ispell-check.


It's not the complete answer and analysis.

It's obviously secure to put a statement like this one

	(defadvice load (before debug-log activate)
	  (message "(Tipp von Kai G) Lade jetzt: %s" (ad-get-arg 0)))

into ~/.emacs, because you describe that your setting of ispell's  
dictionary is valid until you load some file? Or does it already  
happen when you spell-check a "built-in" buffer like *scratch*,  
*Buffer List*, or *Messages*. So let's make the test more complete!

Make ~/.emacs report what the ispell-program-name is. In *shell*  
buffer or some other terminal determine the PID of GNU Emacs. Now  
start to spell-check some built-in buffer and don't quit! In that  
other terminal either use ps or pstree to determine all processes  
that GNU Emacs has spawned. Is ispell or aspell (the new default)  
doing the spell-check?

With the statement above you will be able to see which files of Elisp  
code are loaded when you load some text file. When you put the  
statement into the system init file, you can see a bit more of Elisp  
file loading.

When you've found that it's aspell (the new default) and not ispell,  
that is spell-checking, you could try something similiar to this:

       (setq ispell-program-name "ispell")
;     (setq ispell-program-name "aspell")
;
       (if (string= "aspell" ispell-program-name)
	(progn
;	  (setq ispell-extra-args "--norm-form=comp --norm-required --run- 
together")
;	  (setq ispell-dictionary "en_GB-ise-w_accents")
	  (setq ispell-dictionary "deutsch")
	  (set-default 'ispell-local-dictionary ispell-dictionary)
	  (add-hook 'TeX-language-en-hook (function (lambda () (ispell- 
change-dictionary "british"))))
	  (add-hook 'TeX-language-de-hook (function (lambda () (ispell- 
change-dictionary ispell-dictionary))))
	  (message "Alles für «a»spell")
	)
	  (setq ispell-dictionary "german8")
	  (add-hook 'TeX-language-en-hook (function (lambda () (ispell- 
change-dictionary "british"))))
	  (add-hook 'TeX-language-de-hook (function (lambda () (ispell- 
change-dictionary "deutsch8"))))
	  (message "Alles für »i«spell")
       )
       (add-hook 'LaTeX-mode-hook (function (lambda () (setq ispell- 
extra-args '("-t")))))


--
Greetings

   Pete
                       ~  o
                        ~_\\_/\
                       ~  O   O

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ispell default dictionary keeps reverting to "american"
  2007-09-02 17:43     ` Sven Joachim
@ 2007-09-03  8:16       ` Kevin Brubeck Unhammer
  0 siblings, 0 replies; 10+ messages in thread
From: Kevin Brubeck Unhammer @ 2007-09-03  8:16 UTC (permalink / raw)
  To: help-gnu-emacs

On Sep 2, 7:43 pm, Sven Joachim <svenj...@gmx.de> wrote:
> It is possible that you are using an outdated version of ispell.el.
> Debian has such a beast in its dictionaries-common package, and I
> presume the same is the case on Ubuntu.  What does
> (locate-library "ispell") give?
>
> Regards,
>         Sven

"Library is file /usr/share/emacs22/site-lisp/dictionaries-common/
ispell.elc", but near the top of *Messages* I have this:

"Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el
(source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el
(source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el
(source)...done"

so I guess that's my old version, Synaptic tells me it's 3.1.20.0-4-3.
When I have (ispell-change-dictionary "nynorsk" t)  in .emacs
*Messages* gives me this:

"Loading ispell...done
(Next global Ispell command will use nynorsk dictionary)
ispell.el is already loaded"

and on the first spellcheck, it goes:

"(Next local Ispell command will use american dictionary)
Starting new Ispell process..."

I then manually change to "nynorsk":

"Ispell process killed
(Next global Ispell command will use nynorsk dictionary)"

Which is weird. But having simply (setq ispell-program-name "aspell")
and nothing else in my .emacs seems to get "nynorsk" from my system
default or something, and works just fine. Perhaps that's just what
Ubuntu users are supposed to do?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ispell default dictionary keeps reverting to "american"
       [not found]     ` <mailman.180.1188759356.18990.help-gnu-emacs@gnu.org>
@ 2007-09-03  8:24       ` Kevin Brubeck Unhammer
  2007-09-03  9:39         ` Peter Dyballa
  0 siblings, 1 reply; 10+ messages in thread
From: Kevin Brubeck Unhammer @ 2007-09-03  8:24 UTC (permalink / raw)
  To: help-gnu-emacs

On Sep 2, 8:55 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
> Am 02.09.2007 um 19:27 schrieb Kevin Brubeck Unhammer:
> It's obviously secure to put a statement like this one
>
>         (defadvice load (before debug-log activate)
>           (message "(Tipp von Kai G) Lade jetzt: %s" (ad-get-arg 0)))
>
> into ~/.emacs, because you describe that your setting of ispell's
> dictionary is valid until you load some file? Or does it already
> happen when you spell-check a "built-in" buffer like *scratch*,
> *Buffer List*, or *Messages*. So let's make the test more complete!

It happens in *Messages* and so on, yes, to quote myself:

When I have (ispell-change-dictionary "nynorsk" t)  in .emacs
*Messages* gives me this:

"Loading ispell...done
(Next global Ispell command will use nynorsk dictionary)
ispell.el is already loaded"

and on the first spellcheck, it goes:

"(Next local Ispell command will use american dictionary)
Starting new Ispell process..."

I then manually change to "nynorsk":

"Ispell process killed
(Next global Ispell command will use nynorsk dictionary)"

> Make ~/.emacs report what the ispell-program-name is. In *shell*
> buffer or some other terminal determine the PID of GNU Emacs. Now
> start to spell-check some built-in buffer and don't quit! In that
> other terminal either use ps or pstree to determine all processes
> that GNU Emacs has spawned. Is ispell or aspell (the new default)
> doing the spell-check?

It's ispell yeah, but just using (setq ispell-program-name "aspell")
in my .emacs (and no "change-dictionary"-settings) completely fixed my
problem; probably my system default is "nynorsk", not "american", and
aspell uses that, while with ispell I for some reason get reverted to
American.

> With the statement above you will be able to see which files of Elisp
> code are loaded when you load some text file. When you put the
> statement into the system init file, you can see a bit more of Elisp
> file loading.

It tells me "default" is loading jetzt. I don't know how to fix the
ispell-thing, but setting it to aspell fixed it for me... thanks for
your help :-)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ispell default dictionary keeps reverting to "american"
  2007-09-03  8:24       ` Kevin Brubeck Unhammer
@ 2007-09-03  9:39         ` Peter Dyballa
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2007-09-03  9:39 UTC (permalink / raw)
  To: Kevin Brubeck Unhammer; +Cc: help-gnu-emacs


Am 03.09.2007 um 10:24 schrieb Kevin Brubeck Unhammer:

> It tells me "default" is loading jetzt. I don't know how to fix the
> ispell-thing, but setting it to aspell fixed it for me...

This default.el file somewhere in your $HOME hierarchy and in GNU  
Emacs' load-path is loaded and might change things you've set before.  
Do you have locate enabled? It can help to locate where files are.

Although using the default aspell instead of ispell has fixed your  
programme, there is some bug! It will re-appear in a different  
situation. I can use ispell without problem and I am pretty sure that  
not even debian based Ubuntu can turn GNU Emacs to not follow your  
will ...

--
Greetings

   Pete       (:
         _    / __    -    -
       _/ \__/_/        -     -
      (´`)      (´`)   -    -
       `´        `´

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-09-03  9:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-02 11:02 ispell default dictionary keeps reverting to "american" Kevin Brubeck Unhammer
2007-09-02 11:56 ` Sven Joachim
2007-09-02 17:15   ` Kevin Brubeck Unhammer
2007-09-02 17:43     ` Sven Joachim
2007-09-03  8:16       ` Kevin Brubeck Unhammer
2007-09-02 12:51 ` Peter Dyballa
     [not found] ` <mailman.168.1188737518.18990.help-gnu-emacs@gnu.org>
2007-09-02 17:27   ` Kevin Brubeck Unhammer
2007-09-02 18:55     ` Peter Dyballa
     [not found]     ` <mailman.180.1188759356.18990.help-gnu-emacs@gnu.org>
2007-09-03  8:24       ` Kevin Brubeck Unhammer
2007-09-03  9:39         ` Peter Dyballa

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.