GNU bug report logs -
#26328
26.0.50; checkdoc action for join lines drops final "
Previous Next
Reported by: Marco Wahl <marcowahlsoft <at> gmail.com>
Date: Sat, 1 Apr 2017 08:53:01 UTC
Severity: normal
Tags: confirmed, fixed, patch
Found in version 26.0.50
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 26328 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tags 26328 + patch
quit
On Mon 29 Jul 2019 at 13:09, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> Noam Postavsky <npostavs <at> gmail.com> writes:
>
>> AFAICT, both proposed patches will do the wrong thing for this case:
>>
>> (defun foo ()
>> "Bla bla
>> bla bla. More words
>> bla bla bla.")
>
> Yup. It's rather unclear what that code is attempting to do...
How about we just use delete-indentation along with the
already-calculate position p that we just asked the user about? Patch
attached.
Thanks,
Alex
[0001-Fix-checkdoc-incorrectly-joining-lines.patch (text/x-patch, inline)]
From 41c09cedd36cea604bd6a1ea20dafdc44ce31da0 Mon Sep 17 00:00:00 2001
From: Alex Branham <alex.branham <at> gmail.com>
Date: Thu, 15 Aug 2019 18:04:33 -0500
Subject: [PATCH] Fix checkdoc incorrectly joining lines
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
Use delete-indentation rather than delete-region.
Bug#26328
---
lisp/emacs-lisp/checkdoc.el | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 830743f5f8..9e7291ba21 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1494,16 +1494,13 @@ checkdoc-this-string-valid-engine
(if (and (re-search-forward "[.!?:\"]\\([ \t\n]+\\|\"\\)"
(line-end-position) t)
(< (current-column) numc))
- (if (checkdoc-autofix-ask-replace
- 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))))))
+ (when (checkdoc-autofix-ask-replace
+ p (1+ p)
+ "1st line not a complete sentence. Join these lines? "
+ " " t)
+ ;; They said yes. We have more fill work to do...
+ (delete-indentation nil p (1+ p))
+ (setq msg nil)))))
(if msg
(checkdoc-create-error msg s (save-excursion
(goto-char s)
--
2.22.0
This bug report was last modified 5 years and 284 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.