tags:

views:

97

answers:

3

It sounds easy but I can't fix it: I want to permanently disable automatic spell-checking in emacs. There must be a simple line for my init.el. Can somebody help me?

+3  A: 
(flyspell-mode 0)
Hamza Yerlikaya
With respect, this simply doesn't do what the question asked. Switching flyspell mode off in this manner does nothing to prevent it being switched back on again.
phils
That really didn't work in the "init.el". But with the help by user offby1 above I found a file called "myspell.el" in folder "site-lisp". There I could change (flyspell-mode t) to (flyspell-mode 0) and it worked :-) Thank you!
ploppy
+3  A: 

From a brief look, the simplest way I can see is to redefine the function:

(eval-after-load "flyspell"
  '(defun flyspell-mode (&optional arg)))

or you could use advice to force the argument to always be -1 (see C-h f turn-off-flyspell), but that would be slightly more complex and less efficient for no good reason.

If you want to know what is running it in the first place, you could use M-x debug-on-entry flyspell-mode, which will show a stack trace when the function is called (q to exit the debugger; C-h m to list other commands; M-: (info "(elisp)debugger") for help). Use M-x cancel-debug-on-entry to remove that breakpoint.

phils
+8  A: 

Figure out why it's on in the first place (it isn't enabled by default), then fix that. Either your init file is turning it on, or else some system-wide init file is. Read about those files: http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html

offby1
Thank you, I managed it :-) I found a file called "myspell.el" in folder "site-lisp". There I could change (flyspell-mode t) to (flyspell-mode 0) and it worked!
ploppy
I'd suggest deleting that file entirely, after figuring out where it came from and what it's trying to do.
offby1
Is site-lisp actually local to you, though? Make sure you're not disabling functionality for other users. If it's just you, and you are disabling only that portion of the file, you might as well delete that sexp entirely -- remove "(flyspell-mode t)" rather than replacing it with "(flyspell-mode 0)"
phils
I'm the only user, so there's no problem. I followed your advice and uncommented the "(flyspell-mode t)". It works well. I didn't dare to delete the file at all. Maybe I want flyspell back some time. Thank you all for your help :)
ploppy