help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto-spell-checking buffers when I close emacs


From: Kelly Jones
Subject: Re: Auto-spell-checking buffers when I close emacs
Date: Fri, 9 Feb 2007 20:36:24 -0700

On 2/9/07, Matthew Flaschen <matthew.flaschen@gatech.edu> wrote:
Kelly Jones wrote:
> Is there any way I can get emacs to auto-spell-check all buffers when
> I hit ctrl-x ctrl-c, and only exit if either 1) everything is spelled
> correctly, or 2) I complete (or abort) the spellcheck process?
>

Here's a start I just cooked up.  Add it to your .emacs file.  It will
spell-check quite literally every buffer (including internal buffers
like *Messages* and Completions.  I'm new to emacs and don't know a way
around that yet.  aspell needs to be installed.:

;Spell check
(setq-default ispell-program-name "aspell")

(defun spell-given-buffer (buffer)
"Spell-check a given buffer"
(set-buffer buffer)
(ispell-buffer))

(defun spell-all-buffers ()
"Spell-checks all buffers"
(interactive)
(mapcar 'spell-given-buffer (buffer-list)))

(add-to-list 'kill-emacs-query-functions 'spell-all-buffers)

Thanks, Matthew. I feel really bad, because, after reading your post, I added:

(add-to-list 'kill-emacs-query-functions 'ispell-buffer)

to ~/.emacs, and that does exactly what I want. The only part I was
missing (until I read your post) was "kill-emacs-query-functions".

I overstated my request: I sometimes use emacs to edit wiki pages and
want emacs to remind me if I try to save w/o spellchecking.

--
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]