Subject: bug#6411: closed (Re: bug#6411: Ispell string or comment, bug#6411: Ispell string or comment)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 26 Aug 2020 11:27:02 +0000

Your bug report

#6411: Ispell string or comment

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
6411: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6411
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#6411: Ispell string or comment, bug#6411: Ispell string or comment
From: Štěpán Němec <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Wed, 26 Aug 2020 13:27:47 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

On Thu, 09 Apr 2020 09:21:34 +0300
Eli Zaretskii wrote:

>> Here's my take on it.
>
> LGTM, thanks.
>
> Let's wait for a few days for comments, before pushing this.

Many a week has passed without further comments, so I have now pushed
the changes to master, having addressed the points raised:

2020-04-08T20:32:51+02:[email-masked]
2aefd55904 (ispell: Commands to check comments or strings at point or in region)
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=2aefd55904

2020-04-09T16:17:57+02:[email-masked]
e48c60e7c9 (Document ispell comment/string checking commands in the user manual)
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=e48c60e7c9

I am closing this bug report.

Thank you and sorry for the delay,

  Štěpán

Subject: Ispell string or comment
From: Lennart Borgman <[email-masked]>
To: Emacs Bugs <[email-masked]>
Date: Sat, 12 Jun 2010 19:57:43 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Here is a suggestion for a function ispell-comment-or-string for spell
checking of current comment or string, see attachement.
=== modified file 'lisp/textmodes/ispell.el'
--- trunk/lisp/textmodes/ispell.el	2010-05-13 10:36:03 +0000
+++ patched/lisp/textmodes/ispell.el	2010-06-12 17:53:38 +0000
@@ -3266,11 +3266,21 @@

 ;;;###autoload
-(defun ispell-comments-and-strings ()
+(defun ispell-comments-and-strings (only-current)
   "Check comments and strings in the current buffer for spelling errors."
-  (interactive)
+  (interactive (list nil))
+  (let (state done)
+    (if (not only-current)
   (goto-char (point-min))
-  (let (state done)
+      (let* ((here (point))
+             (state (parse-partial-sexp (point-min) (point)))
+             (inside (or (nth 3 state) (nth 4 state)))
+             (start (when inside (nth 8 state))))
+        (if start
+            (goto-char start)
+          (setq done t)
+          (goto-char here)
+          (message "Not inside a string or comment"))))
     (while (not done)
       (setq done t)
       (setq state (parse-partial-sexp (point) (point-max)
@@ -3282,8 +3292,14 @@
 	    (if (or (nth 3 state) (nth 4 state))
 		(error "Unterminated string or comment"))
 	    (save-excursion
-	      (setq done (not (ispell-region start (point))))))))))
+	      (setq done (not (ispell-region start (point)))))))
+      (when only-current (setq done t)))))
 
+;;;###autoload
+(defun ispell-comment-or-string ()
+  "Check comments or strings at point for spelling errors."
+  (interactive)
+  (ispell-comments-and-strings t))
 
 ;;;###autoload
 (defun ispell-buffer ()