diff options
| author | Gerd Moellmann | 1997-12-03 17:20:13 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1997-12-03 17:20:13 +0000 |
| commit | bc7d6816eea90f0623d9061cd2e29e92c22f217e (patch) | |
| tree | f9bb093963fe9796bb8471453df34b18e5d38f34 | |
| parent | 6b04f517ce06dbf5284b0bd803fd46fae9754773 (diff) | |
| download | emacs-bc7d6816eea90f0623d9061cd2e29e92c22f217e.tar.gz emacs-bc7d6816eea90f0623d9061cd2e29e92c22f217e.zip | |
New function ispell-comments-and-strings.
| -rw-r--r-- | lisp/textmodes/ispell.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index be445f276cc..60cf46da30d 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -80,6 +80,7 @@ | |||
| 80 | ;; ispell-region | 80 | ;; ispell-region |
| 81 | ;; ispell-buffer | 81 | ;; ispell-buffer |
| 82 | ;; ispell-message | 82 | ;; ispell-message |
| 83 | ;; ispell-comments-and-strings | ||
| 83 | ;; ispell-continue | 84 | ;; ispell-continue |
| 84 | ;; ispell-complete-word | 85 | ;; ispell-complete-word |
| 85 | ;; ispell-complete-word-interior-frag | 86 | ;; ispell-complete-word-interior-frag |
| @@ -1981,6 +1982,25 @@ With prefix argument, set the default directory." | |||
| 1981 | (message "Spell-checking done")))) | 1982 | (message "Spell-checking done")))) |
| 1982 | 1983 | ||
| 1983 | 1984 | ||
| 1985 | ;;;###autoload | ||
| 1986 | (defun ispell-comments-and-strings () | ||
| 1987 | "Check comments and strings in the current buffer for spelling errors." | ||
| 1988 | (interactive) | ||
| 1989 | (goto-char (point-min)) | ||
| 1990 | (let (state done) | ||
| 1991 | (while (not done) | ||
| 1992 | (setq done t) | ||
| 1993 | (setq state (parse-partial-sexp (point) (point-max) | ||
| 1994 | nil nil state 'syntax-table)) | ||
| 1995 | (when (or (nth 3 state) (nth 4 state)) | ||
| 1996 | (let ((start (point))) | ||
| 1997 | (setq state (parse-partial-sexp start (point-max) | ||
| 1998 | nil nil state 'syntax-table)) | ||
| 1999 | (when (or (nth 3 state) (nth 4 state)) | ||
| 2000 | (error "Unterminated string or comment.")) | ||
| 2001 | (save-excursion | ||
| 2002 | (setq done (not (ispell-region start (point)))))))))) | ||
| 2003 | |||
| 1984 | 2004 | ||
| 1985 | ;;;###autoload | 2005 | ;;;###autoload |
| 1986 | (defun ispell-buffer () | 2006 | (defun ispell-buffer () |