Subject: bug#26328: 26.0.50; checkdoc action for join lines drops final "

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 26 Jul 2019 12:51:23 +0200

Marco Wahl <[email-masked]> writes:

> Checkdoc drops the final " when the action to join the lines has been
> choosen.
>
> E.g. have checkdoc enabled and eval
>
>     (defun foo ()
>     "bla bla
>     bla."
>     )
>
> Suggestion for a fix:
>
> modified   lisp/emacs-lisp/checkdoc.el
> @@ -1520,7 +1520,7 @@ checkdoc-this-string-valid-engine
>  			 ;; They said yes.  We have more fill work to do...
>  			 (goto-char (match-beginning 1))
>  			 (delete-region (point) (match-end 1))
> -			 (insert "\n")
> +			 (insert "\"")
>  			 (setq msg nil))))))
>  	   (if msg
>  	       (checkdoc-create-error msg s (save-excursion

The " at the end of the doc string is removed by that `delete-region',
so it's all a bit confusing.  The following patch also fixes the problem
in this example, but I'm not quite sure what the code is attempting to
do here.

Anybody familiar with this code?

diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 830743f5f8..7ac557711a 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1498,12 +1498,7 @@ checkdoc-this-string-valid-engine
 			p (1+ p)
 			"1st line not a complete sentence.  Join these lines? "
 			" " t)
-		       (progn
-			 ;; They said yes.  We have more fill work to do...
-			 (goto-char (match-beginning 1))
-			 (delete-region (point) (match-end 1))
-			 (insert "\n")
-			 (setq msg nil))))))
+		       (setq msg nil)))))
 	   (if msg
 	       (checkdoc-create-error msg s (save-excursion
 					      (goto-char s)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no