From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#50840: 28.0.50; Support GNU style of multiline comments in C source code Date: Fri, 01 Oct 2021 16:57:01 -0400 Message-ID: References: <837df2moym.fsf@gnu.org> <83o888cyoc.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33072"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: acm@muc.de, 50840@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 01 22:58:10 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 1mWPbc-0008MP-UV for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Oct 2021 22:58:09 +0200 Original-Received: from localhost ([::1]:52808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWPbb-0004BF-NN for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Oct 2021 16:58:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWPbW-0004B2-4Q for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2021 16:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45932) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWPbV-0000oH-S6 for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2021 16:58:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWPbV-0001Wl-Rd for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2021 16:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Oct 2021 20:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50840 X-GNU-PR-Package: emacs Original-Received: via spool by 50840-submit@debbugs.gnu.org id=B50840.16331218335791 (code B ref 50840); Fri, 01 Oct 2021 20:58:01 +0000 Original-Received: (at 50840) by debbugs.gnu.org; 1 Oct 2021 20:57:13 +0000 Original-Received: from localhost ([127.0.0.1]:57469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWPai-0001VI-Vm for submit@debbugs.gnu.org; Fri, 01 Oct 2021 16:57:13 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:10110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWPag-0001V3-3Y for 50840@debbugs.gnu.org; Fri, 01 Oct 2021 16:57:11 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7D9108084E; Fri, 1 Oct 2021 16:57:04 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DADA98028B; Fri, 1 Oct 2021 16:57:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1633121822; bh=ed3oZp8s8WBh+NtoGjnI+7uVtGyZ5GpXT8LeNliHLng=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=oDuj8F4sGtxxZEURswIIF3PcDMZnzvUW4Lu0ak3ZUGe+9OKKfMwmXt00cbw3Vn60V ABreWQSEIuiZpe9+F/Ho/oEIYzP9HGD4yOODYkdri8nqcW+CMZ4ehvmShdxZSkfQpb AYyIDdODbYWbbo5SB74kvBFvkft3DWZUsnluYHh0kJHJOI00Lz5F82SmsrDLpQCtie +GDDUP+IYjREt4TCuMIGjKZsjy7EZ3DQmByGmZLcAHO5qTL5LXdjQX9V1FfSRTHnPH 5fX8VMOrqSGMupmh36HGIqaKTMCz97iTkrX2sWScf4jJY7e2RwA2YLcttnZfgk/3jG WfaPfoUNgme2A== Original-Received: from ceviche (modemcable004.216-203-24.mc.videotron.ca [24.203.216.4]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 95B8812033B; Fri, 1 Oct 2021 16:57:02 -0400 (EDT) In-Reply-To: <83o888cyoc.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 01 Oct 2021 22:50:11 +0300") 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:216086 Archived-At: > The actual use case is to convert a block of comments like this: > > // First line > // continuation line with more text, > // more text. And another sentence > // which continues here. > > to our comment style. I thought it was easy: first uncomment the > region, then comment the region using the proper style. But there's > no style to take a sequence of lines like this: > > First line > continuation line with more text, > more text. And another sentence > which continues here. > > and make it look like this: > > /* First line > continuation line with more text, > more text. And another sentence > which continues here. */ Ah, now that makes sense, thanks. >> If you want comment-region to produce something like the above, then >> maybe a patch like the following would make sense? > It's late down here, so instead of applying the patch and playing with > it, let me ask you: will this patch support the above use case? I don't think so because it will fail to indent the last 3 lines by the extra 3 spaces. >> The idea is to add a new value nil to `comment-style` which would >> instruct `comment-region` to refrain from adding `comment-continue` on >> eachline of a multiline comment. > The value nil doesn't sound like a good mnemonic. I think the style I > have in mind is a multi-line style, just without the "* " leader on > each line. Right (though you do want to use a leader on each line, just one of " " instead of " * "), but `comment-styles` doesn't have a field to specify that the comment-continuation should be empty, so I was going for a cheaper solution. I'll try again later for something less cheap ;-) Stefan