Commit bc7d6816 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

New function ispell-comments-and-strings.

parent 6b04f517
......@@ -80,6 +80,7 @@
;; ispell-region
;; ispell-buffer
;; ispell-message
;; ispell-comments-and-strings
;; ispell-continue
;; ispell-complete-word
;; ispell-complete-word-interior-frag
......@@ -1981,6 +1982,25 @@ With prefix argument, set the default directory."
(message "Spell-checking done"))))
(defun ispell-comments-and-strings ()
"Check comments and strings in the current buffer for spelling errors."
(goto-char (point-min))
(let (state done)
(while (not done)
(setq done t)
(setq state (parse-partial-sexp (point) (point-max)
nil nil state 'syntax-table))
(when (or (nth 3 state) (nth 4 state))
(let ((start (point)))
(setq state (parse-partial-sexp start (point-max)
nil nil state 'syntax-table))
(when (or (nth 3 state) (nth 4 state))
(error "Unterminated string or comment."))
(setq done (not (ispell-region start (point))))))))))
(defun ispell-buffer ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment