From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Kelly Jones" Newsgroups: gmane.emacs.help Subject: Re: Auto-spell-checking buffers when I close emacs Date: Fri, 9 Feb 2007 20:36:24 -0700 Message-ID: <26face530702091936t1a284d08ubac8d15e1fbc7b36@mail.gmail.com> References: <26face530702091831r504481bai9d798918e778268@mail.gmail.com> <45CD3826.3090001@gatech.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1171078609 25186 80.91.229.12 (10 Feb 2007 03:36:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 10 Feb 2007 03:36:49 +0000 (UTC) Cc: emacs To: "Matthew Flaschen" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 10 04:36:42 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HFj2W-0007Tv-6x for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Feb 2007 04:36:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFj2V-0004YC-NX for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Feb 2007 22:36:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HFj2K-0004Y3-Kw for help-gnu-emacs@gnu.org; Fri, 09 Feb 2007 22:36:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HFj2I-0004Xd-BT for help-gnu-emacs@gnu.org; Fri, 09 Feb 2007 22:36:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFj2I-0004Xa-8h for help-gnu-emacs@gnu.org; Fri, 09 Feb 2007 22:36:26 -0500 Original-Received: from ug-out-1314.google.com ([66.249.92.171]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HFj2H-0001vm-SY for help-gnu-emacs@gnu.org; Fri, 09 Feb 2007 22:36:26 -0500 Original-Received: by ug-out-1314.google.com with SMTP id j3so103801ugf for ; Fri, 09 Feb 2007 19:36:25 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Hz5cVzfCedgg5my4USoGHngFzxzKRLlLdd0+lj9NNEQwMWW26iavSP7iMGAlTP92Fmww0WboZekHPbCUjHklph+WFB23DHZOQ/e04vLI/8y6t1qUpkZdsnVBj5SgMlKopKptrIxIuraGd5ePNxaDvAIZJUTU3ACj9D3pcbEsWuw= Original-Received: by 10.78.97.7 with SMTP id u7mr5224318hub.1171078584917; Fri, 09 Feb 2007 19:36:24 -0800 (PST) Original-Received: by 10.78.140.13 with HTTP; Fri, 9 Feb 2007 19:36:24 -0800 (PST) In-Reply-To: <45CD3826.3090001@gatech.edu> Content-Disposition: inline X-detected-kernel: Linux 2.4-2.6 (Google crawlbot) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:41048 Archived-At: On 2/9/07, Matthew Flaschen 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.