unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* ispelling lisp buffers
@ 2003-07-29 12:15 Klaus Berndl
  2003-07-29 12:41 ` Phillip Lord
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Klaus Berndl @ 2003-07-29 12:15 UTC (permalink / raw)



Hi,

is there some smart ispell command which is suitable for ispelling
source-code like emacs-lisp. Smart means that only comments and maybe strings
should be ispelled, nothing else!

Thanks for any pointer,
Klaus

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220

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

* Re: ispelling lisp buffers
  2003-07-29 12:15 ispelling lisp buffers Klaus Berndl
@ 2003-07-29 12:41 ` Phillip Lord
  2003-07-29 13:36 ` Stephen Eglen (CNS)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Phillip Lord @ 2003-07-29 12:41 UTC (permalink / raw)


>>>>> "Klaus" == Klaus Berndl <klaus.berndl@sdm.de> writes:

  Klaus> Hi,

  Klaus> is there some smart ispell command which is suitable for
  Klaus> ispelling source-code like emacs-lisp. Smart means that only
  Klaus> comments and maybe strings should be ispelled, nothing else!

  Klaus> Thanks for any pointer, Klaus

You could try "tmmofl", which I have used for this purpose. 

http://www.cs.man.ac.uk/~phillord/download/emacs/

Its a little cheesy. It uses font lock information to turn flyspell
(and auto-fill, or whatever you want) on and off. 

I seem to remember I stopped using it for this purpose. All commented
out program code gets checked for instance. 

Still you could try. 

Cheers

Phil

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

* Re: ispelling lisp buffers
  2003-07-29 12:15 ispelling lisp buffers Klaus Berndl
  2003-07-29 12:41 ` Phillip Lord
@ 2003-07-29 13:36 ` Stephen Eglen (CNS)
  2003-07-29 14:01 ` Klaus Berndl
  2003-07-29 14:30 ` Stefan Monnier
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Eglen	(CNS) @ 2003-07-29 13:36 UTC (permalink / raw)


Klaus Berndl <klaus.berndl@sdm.de> writes:

> Hi,
> 
> is there some smart ispell command which is suitable for ispelling
> source-code like emacs-lisp. Smart means that only comments and maybe strings
> should be ispelled, nothing else!
> 
> Thanks for any pointer,
> Klaus

I have this in my .emacs file, not sure if it still works.

Stephen
;;From: Sam Shteingold <sshteingold@cctrading.com>
;;Subject: Spell check only comments and string literals: 
;; ispell-comments-strings
;;Newsgroups: gnu.emacs.sources

(defun ispell-comments-strings (beg end)
  "Spell-check the comments and string literals in the region.
This quick hack assumes that initially we are inside neither.
Also, it sometimes needs a C-g in the end."
  (interactive "r")
  (let ((ispell-check-comments t) be)
    (save-excursion
      (goto-char beg)
      (while (< (point) end)
	(if 
	 (setq be (re-search-forward 
		   (concat "[^\\]\"\\|" (or comment-start "")) end t))
	 (ispell-region 
	  be (if (char-equal ?\" (char-after (1- (point))))
		 (or (re-search-forward "[^\\]\"" end t) (goto-char end))
		 (if (string= comment-end "") 
		     (progn (end-of-line) (point))
		     (or (re-search-forward comment-end end t) 
			 (goto-char end))))))))))

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

* Re: ispelling lisp buffers
  2003-07-29 12:15 ispelling lisp buffers Klaus Berndl
  2003-07-29 12:41 ` Phillip Lord
  2003-07-29 13:36 ` Stephen Eglen (CNS)
@ 2003-07-29 14:01 ` Klaus Berndl
  2003-07-29 14:30 ` Stefan Monnier
  3 siblings, 0 replies; 5+ messages in thread
From: Klaus Berndl @ 2003-07-29 14:01 UTC (permalink / raw)


On 29 Jul 2003, Klaus Berndl wrote:



>  
>  Hi,
>  
>  is there some smart ispell command which is suitable for ispelling
>  source-code like emacs-lisp. Smart means that only comments and maybe
>  strings should be ispelled, nothing else!
>  
>  Thanks for any pointer,

Again thanks for all posted pointers, but often it is best to search a little
bit in the obvious sources (e.g. ispell.el) before posting a problem ;-)

Just found in ispell.el (version 3.4) a command `ispell-comments-and-strings'
which does exactly what i searched for!

Sorry for the noise!
Klaus

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220

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

* Re: ispelling lisp buffers
  2003-07-29 12:15 ispelling lisp buffers Klaus Berndl
                   ` (2 preceding siblings ...)
  2003-07-29 14:01 ` Klaus Berndl
@ 2003-07-29 14:30 ` Stefan Monnier
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2003-07-29 14:30 UTC (permalink / raw)


> is there some smart ispell command which is suitable for ispelling
> source-code like emacs-lisp. Smart means that only comments and maybe strings
> should be ispelled, nothing else!

You might want to try `flyspell-prog-mode'.


        Stefan

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

end of thread, other threads:[~2003-07-29 14:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-29 12:15 ispelling lisp buffers Klaus Berndl
2003-07-29 12:41 ` Phillip Lord
2003-07-29 13:36 ` Stephen Eglen (CNS)
2003-07-29 14:01 ` Klaus Berndl
2003-07-29 14:30 ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).