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 16:11:47 -0800 Message-ID: References: <20210207140125.6rn7lfg33qnkb222@E15-2016.optimum.net> <87lfbzzpsm.fsf@gnus.org> <878s7z1urq.fsf@tcd.ie> <87wnvjm5ad.fsf@gnus.org> <87wnviqo5b.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14150"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) Cc: 46364@debbugs.gnu.org, Lars Ingebrigtsen , Bruno =?UTF-8?Q?F=C3=A9lix?= Rezende Ribeiro To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 09 01:35:15 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 1l9Gzq-0003ZU-Qc for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Feb 2021 01:35:14 +0100 Original-Received: from localhost ([::1]:59250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9Gzp-0008MX-Ol for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Feb 2021 19:35:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9GdO-0007jZ-Ro for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 19:12:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9GdO-0008Re-IG for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 19:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l9GdO-0004Pa-CN for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 19:12: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: Tue, 09 Feb 2021 00:12: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: patch confirmed Original-Received: via spool by 46364-submit@debbugs.gnu.org id=B46364.161282951816949 (code B ref 46364); Tue, 09 Feb 2021 00:12:02 +0000 Original-Received: (at 46364) by debbugs.gnu.org; 9 Feb 2021 00:11:58 +0000 Original-Received: from localhost ([127.0.0.1]:52160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9GdK-0004PI-DS for submit@debbugs.gnu.org; Mon, 08 Feb 2021 19:11:58 -0500 Original-Received: from mail-pj1-f47.google.com ([209.85.216.47]:54082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9GdG-0004P2-Py for 46364@debbugs.gnu.org; Mon, 08 Feb 2021 19:11:56 -0500 Original-Received: by mail-pj1-f47.google.com with SMTP id nm1so547984pjb.3 for <46364@debbugs.gnu.org>; Mon, 08 Feb 2021 16:11:54 -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=gnv6dllJmchqVN7EfX3zNcpft/E2u9yIODW61vW498A=; b=Ivz7vdg9eeDTH92eFUKt5PC0SSriK2tFK/b0qurEqBBTWAwyPCQ92CnRZyNUnOjG/+ Lytrz1BmTZQLNBUxXF/7pSmlqFKEWC1tr/5l41Aqy2oq/u1wn2UL0s2WG6tGyktQg/ip 5086AhFFivhQTuXp3ZvwZypcmBkkLZoe5lP815eMdZHPKiG+sAJB2gRFf0wfrMYyqAkr gqj0usJkvBvONNRNzC79ldJprsDsvbhgHlahpyIPYAfLM5rKSbI9scpvSrQcAO1EfYyP +8uxrjan9eYsrIwQEyja4+xm1XMU0fMhYDmCpgs7Us55LGY2Paqcsup+PB4LgTL5s98D HXDw== 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=gnv6dllJmchqVN7EfX3zNcpft/E2u9yIODW61vW498A=; b=rQ3Mbjqr0Gb/Kd4J3hl7llU88XTWYXEVIO3dpeeoFDHEP7AUjb6vStwqs/UX1iFr9Q UcMM8RFPeW35ibGQGwLMkoWnB5z1ZSbLZugAUIWFWIWrcYDei4Re8amnRTGjecOL3tW6 I/G4jHz9hLgIHpltGq3mGpCKpPDyDeHZV6dJBBVb2C1ZSQbJHMw08gA01MpnQ7g9Q0nz AjLmIcn83uD7om4sXu8B6u45P5J6UTNhYPgB7AxcwbN8ZuQ1/MFW940mnZGjlzlJlzZ5 VOTyOrpl49/gxWvWviN9m6zkOu+mFf/xRSQFRhbfzZHTDacIM+TnZtV7MTzFwYOmjM1r B5gA== X-Gm-Message-State: AOAM5315fFQup2kFex93qd4rOUoe3thTPUqDIyCT4neUQjIG6QtK40d2 YAyRcJvupfcbE+3JbT/iHYM= X-Google-Smtp-Source: ABdhPJwclCvmjeOij/emojbKdqV1bVaOj36sa6j9PWhJa4/AC332ovR+3nQd3c9GTrOPoyVZKXDj7g== X-Received: by 2002:a17:90a:2848:: with SMTP id p8mr1345376pjf.232.1612829508965; Mon, 08 Feb 2021 16:11:48 -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 b18sm20258639pfi.173.2021.02.08.16.11.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 16:11:48 -0800 (PST) In-Reply-To: <87wnviqo5b.fsf@tcd.ie> (Basil L. Contovounesios's message of "Mon, 08 Feb 2021 20:51:12 +0000") 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:199645 Archived-At: "Basil L. Contovounesios" writes: > Matt Armstrong writes: >> 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 > ^^^^^^^ > Bruno's ;) Yes, thank you. :-) >> 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. > > Given that lm-commentary is used outside of Emacs, I suggest its > behaviour be reverted to that in Emacs 27, and any sanitisation provided > as a separate function instead. I leave the decision to Lars and other Emacs maintainers. My opinion: while introducing a new function is surely safer, we should submit the patch I proposed. Why? I did a web search looking for callers of lm-commentary outside of Emacs proper. In every case I found code that called lm-commentary and then tried to do sanitization of the result (by removing the comment leaders from each line, etc.). For example, this is what MELPA does. See also : https://www.emacswiki.org/emacs/finder+.el It seems like the "sanitize" behavior is what callers want.