From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Armstrong Newsgroups: gmane.emacs.bugs Subject: bug#46364: regression in lm-commentary Date: Mon, 08 Feb 2021 10:59:28 -0800 Message-ID: References: <20210207140125.6rn7lfg33qnkb222@E15-2016.optimum.net> <87lfbzzpsm.fsf@gnus.org> <878s7z1urq.fsf@tcd.ie> <87wnvjm5ad.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35193"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) Cc: "Basil L. Contovounesios" , 46364@debbugs.gnu.org, Bruno =?UTF-8?Q?F=C3=A9lix?= Rezende Ribeiro To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 08 23:33:28 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9F60-00095N-Bz for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Feb 2021 23:33:28 +0100 Original-Received: from localhost ([::1]:50386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9F5z-0004p8-Bo for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Feb 2021 17:33:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9BlT-0001oa-91 for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 14:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9BlT-0004SV-0G for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 14:00:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l9BlS-0007R6-TU for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 14:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matt Armstrong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Feb 2021 19:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46364 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 46364-submit@debbugs.gnu.org id=B46364.161281077828526 (code B ref 46364); Mon, 08 Feb 2021 19:00:02 +0000 Original-Received: (at 46364) by debbugs.gnu.org; 8 Feb 2021 18:59:38 +0000 Original-Received: from localhost ([127.0.0.1]:51926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9Bl3-0007Q2-Vf for submit@debbugs.gnu.org; Mon, 08 Feb 2021 13:59:38 -0500 Original-Received: from mail-pj1-f51.google.com ([209.85.216.51]:35991) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9Bl2-0007Po-Ea for 46364@debbugs.gnu.org; Mon, 08 Feb 2021 13:59:36 -0500 Original-Received: by mail-pj1-f51.google.com with SMTP id gx20so110867pjb.1 for <46364@debbugs.gnu.org>; Mon, 08 Feb 2021 10:59:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Q0uh7vqs0GRdA6RlyXq1p4tC0hpkIaDgmRDuy3BBWfc=; b=uo+0+ck/HfMO2VILAry4PrYhDzWInvoXm1ZpTHDI4qCIIENm3kCu1UoXbS8FvWLCjs ql+IS1wb52gzJNmx31bpQ51Bkp+UzqD/nOG8F+750hRIBj3qM+ZVQGVjQRYruTZ+7ckZ 7psnZQ+h70AzyHVBSKGkoQ0yu7ieMPGwA/oCS1abBj9f1yMT2/7K2zHO6oXo0icJF6n/ 3RsuW+/zvA7Ylr4mfhRunbbKY8LuARodz5w27JREKAcCfrA4IqlvpOwbYfdIaMdPOi8L kAjv2djc5fOXgPEOX8Vh70OJ9AU9Gw5/EBJMdQynEH1bmEXG6Jk2lbsEp5+tcWvGLSgV jKdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Q0uh7vqs0GRdA6RlyXq1p4tC0hpkIaDgmRDuy3BBWfc=; b=Mpu9ZFrGET+ddw9eK7kpzcEpZ2q8T+WSB8FlX7ZLnAit4se6F6RwBxlyNC9bMB8Su1 CKHZvf8RQNLhrtbNwoR76OCHEAlMHhygq2Im2DRcMdlUK09DCT7ZlbOYcDyRMfTE8mwY mVLP6NwpEDHyYFPo8/8l7vCKux9U1C0bqOIJ3rvIlBpNTS47yMy4NO+hC0sEi1WhKs2M tHzANcsxH/GYZkdr+N6ZarGbmlah94pQCN+WxTGoT6cvhyX78drnAhnqauqroVXwYT+E uWKud7Y6LuQkJus2UQ9r8nDFKSa0Y8g7bVtg1TK9b2ZYUYPkVJBSVffcdc6lMguzw1XN RQMw== X-Gm-Message-State: AOAM533ZFbVmQpavyCscnla0w/BM/Z1eTFkHavIjJeQgokqsK0HUpo8W eMYiGvvbTYKgZfbFFt4Rmhg= X-Google-Smtp-Source: ABdhPJw1rSqL9Qsf0iYHey+rDedwn3bT1TkuViETyBsF5pVhia0JlRA9qCA9gLpcTNngICeEle9/hA== X-Received: by 2002:a17:90a:8a13:: with SMTP id w19mr191147pjn.117.1612810770512; Mon, 08 Feb 2021 10:59:30 -0800 (PST) Original-Received: from matts-mbp-2016.lan (24-113-169-116.wavecable.com. [24.113.169.116]) by smtp.gmail.com with ESMTPSA id k69sm13616342pfd.4.2021.02.08.10.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 10:59:29 -0800 (PST) In-Reply-To: <87wnvjm5ad.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 08 Feb 2021 07:39:54 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199631 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Matt Armstrong writes: [...] >> It seems `lm-commentary' now strips all leading whitespace from every >> line, as a "sanitization" step, and this has the unsatisfying side >> effect of ruining any indentation formatting in the original commentary. > > Is the removal of the leading white-space the only problem with the > sanitization? Then perhaps that bit could be tweaked? I noticed that Basil's commit 963a9ffd66cb29f0370e9a4b854dddda242c54a6 consolidated normalization logic but also changed the regex slightly such that all leading whitespace was erased. I've attached a patch to go back to the old ways. It seems to work. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Preserve-leading-whitespace-in-lm-commentary.patch Content-Description: preserve leading whitespace >From eecfa79644edbda5830f77664379a0df59b76929 Mon Sep 17 00:00:00 2001 From: Matt Armstrong Date: Mon, 8 Feb 2021 10:44:34 -0800 Subject: [PATCH] Preserve leading whitespace in `lm-commentary'. * lisp/emacs-lisp/lisp-mnt.el (lm-commentary): Preserve leading whitespace. (Bug#46364) --- lisp/emacs-lisp/lisp-mnt.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index adb9cb2372..6d9c8c3279 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -495,7 +495,7 @@ lm-commentary (concat "^;;;[[:blank:]]*\\(" lm-commentary-header "\\):[[:blank:]\n]*") - "^;;[[:blank:]]*" ; double semicolon prefix + "^;;[[:blank:]]?" ; double semicolon prefix "[[:blank:]\n]*\\'") ; trailing new-lines "" (buffer-substring-no-properties start (lm-commentary-end)))))))) -- 2.30.0 --=-=-=--