From: stephen@cogsci.ed.ac.uk (Stephen Eglen (CNS))
Subject: Re: ispelling lisp buffers
Date: 29 Jul 2003 14:36:46 +0100 [thread overview]
Message-ID: <b26ptjtzc7l.fsf@cogsci.ed.ac.uk> (raw)
In-Reply-To: uadaxcyvy.fsf@sdm.de
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))))))))))
next prev parent reply other threads:[~2003-07-29 13:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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) [this message]
2003-07-29 14:01 ` Klaus Berndl
2003-07-29 14:30 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b26ptjtzc7l.fsf@cogsci.ed.ac.uk \
--to=stephen@cogsci.ed.ac.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).