From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Branham Newsgroups: gmane.emacs.bugs Subject: bug#26328: 26.0.50; checkdoc action for join lines drops final " Date: Thu, 15 Aug 2019 18:13:09 -0500 Message-ID: <877e7eowe2.fsf@gmail.com> References: <84y3vkqzmd.fsf@tm6592> <878sslnk5w.fsf@mouse.gnus.org> <8736iquuda.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="171195"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Marco Wahl , Noam Postavsky , 26328@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 16 01:14:24 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hyOwp-000iQ6-HP for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2019 01:14:23 +0200 Original-Received: from localhost ([::1]:47832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyOwo-0007NH-Ek for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 19:14:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42683) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyOwW-00078w-BH for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 19:14:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyOwV-00054X-52 for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 19:14:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43823) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyOwU-00054P-Uf for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 19:14:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hyOwU-0005oW-Oq for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 19:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Aug 2019 23:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26328 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 26328-submit@debbugs.gnu.org id=B26328.156591079922269 (code B ref 26328); Thu, 15 Aug 2019 23:14:02 +0000 Original-Received: (at 26328) by debbugs.gnu.org; 15 Aug 2019 23:13:19 +0000 Original-Received: from localhost ([127.0.0.1]:52640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyOvm-0005n2-TN for submit@debbugs.gnu.org; Thu, 15 Aug 2019 19:13:19 -0400 Original-Received: from mail-oi1-f169.google.com ([209.85.167.169]:33217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyOvl-0005ml-8o; Thu, 15 Aug 2019 19:13:17 -0400 Original-Received: by mail-oi1-f169.google.com with SMTP id u15so3526035oiv.0; Thu, 15 Aug 2019 16:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=4Rc36SmmWVTtNqwsCL7223IjHy2+DatTyD3opToChDY=; b=lAAbCFS8SrsEkrnI+DCaU73ltHQBi0ftJV71gW3fKIjLG466cSgTFv97NPaIo0zAkX qgnYg8+rxCQmho+SAHEHF8jggcmnYwtqE9jw85/BkqOhRvdbEAzB7yyZkySR6sx6zlPp MW8E1NnHeCFTEhP5gocjD+EjBL4SLpg6M8rhGPo7EDsygWnX7f9kgNRLXSA0kKeGORhH Mj8rClMjcvCTGFjMzfqGp379+9+L6auZ/Zz71NgKjSEeZUt48cvPRyHUh0j7EL4lqPhx p46HARsdufQ0LVEnCVmmFQKuQfyPOHPLj/eTj3wlGMqxfbLz5fsRYZiHyrIBQpiFhmpP sYtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=4Rc36SmmWVTtNqwsCL7223IjHy2+DatTyD3opToChDY=; b=PiAsW0GtDvdPSc1dsjDHnYuRGvsEF3OQMK31ETgxibG4tfLh6ljhdE2/lVND9d7ZOw z7znT1GIxUbW1Eb7Zsec3rzgjrfWt1y5+9w001b5kS/HHqKXw6hCW0FlMHd52ulh+sfG McAHyFHJiyLpx8WsFrfmPLU9tg34JO4s5r0EC+7KxIvyfRJMgwYVFS59P1mrvsMWYn4Z qcSmKVPV1t5UOLx2jqgzmRtNiNdqfQ9yUkcS2TVLdRB0JQkemRdvfeda0BGp5rRLD3r/ oYWSFMKcYw0gitWjTx1zEnupBpVUZsjyzTnohUghb3qhKZBrnHFSHn3EFrhKewr6c6XG Hzqw== X-Gm-Message-State: APjAAAVvrElzTvPWdoCVgp7gq+bY+H99LICqSEcuTMm5uNpXJqJG5tOj 9Dv821N1bxkf0HwsEmvIs0UyAmDKwBU= X-Google-Smtp-Source: APXvYqyrWqhz9KTqowdEjD+TpeskUH9qIdMrbQZHHOs7tiBcxtXfRYICmXSvV+J3hW02yxRd+60Sew== X-Received: by 2002:aca:4d4b:: with SMTP id a72mr2980975oib.87.1565910791373; Thu, 15 Aug 2019 16:13:11 -0700 (PDT) Original-Received: from mars (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id k25sm839746oig.50.2019.08.15.16.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2019 16:13:10 -0700 (PDT) In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 29 Jul 2019 13:09:05 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165154 Archived-At: --=-=-= Content-Type: text/plain tags 26328 + patch quit On Mon 29 Jul 2019 at 13:09, Lars Ingebrigtsen wrote: > Noam Postavsky 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-checkdoc-incorrectly-joining-lines.patch >From 41c09cedd36cea604bd6a1ea20dafdc44ce31da0 Mon Sep 17 00:00:00 2001 From: Alex Branham 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 --=-=-=--