From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Possibly unwanted trailing spaces in comments created by M-; Date: Wed, 20 Jan 2016 21:16:18 +0000 Message-ID: <20160120211618.GB4798@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1453324452 6203 80.91.229.3 (20 Jan 2016 21:14:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Jan 2016 21:14:12 +0000 (UTC) Cc: "Geyslan G. Bem" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 20 22:14:05 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aM04q-00007Z-Vw for ged-emacs-devel@m.gmane.org; Wed, 20 Jan 2016 22:14:05 +0100 Original-Received: from localhost ([::1]:45089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aM04p-0000er-No for ged-emacs-devel@m.gmane.org; Wed, 20 Jan 2016 16:14:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aM04l-0000ed-TI for emacs-devel@gnu.org; Wed, 20 Jan 2016 16:14:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aM04i-000231-NE for emacs-devel@gnu.org; Wed, 20 Jan 2016 16:13:59 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:17077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aM04i-00022k-DL for emacs-devel@gnu.org; Wed, 20 Jan 2016 16:13:56 -0500 Original-Received: (qmail 44577 invoked by uid 3782); 20 Jan 2016 21:13:52 -0000 Original-Received: from acm.muc.de (p5B146BCF.dip0.t-ipconnect.de [91.20.107.207]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 20 Jan 2016 22:13:51 +0100 Original-Received: (qmail 14265 invoked by uid 1000); 20 Jan 2016 21:16:18 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:198460 Archived-At: Hello, Emacs. The following issue arose from bug #22369: Start the emacs-25 branch's emacs with "emacs -Q". Load the following file into a C Mode buffer: void main() { int i; int b; printf("format string"); } , then do "M-: (setq comment-style 'extra-line)". Now mark the function with C-M-h. Do M-; to comment the region. The result is this: 1 /* 2 * void main() 3 * { 4 * int i; 5 * 6 * int b; 7 * printf("format string"); 8 * } 9 */ 10 There is a trailing space on line 1 and 5 (but not on line 9). My feeling is that we shouldn't be inserting this trailing space on new lines, or on what used to be blank lines, even when `comment-start' ends in one or more spaces. For example, some version control setups reject patches with trailing spaces. Should I amend newcomment.el so that trailing spaces are not inserted? (Clearly, one could introduce a new user option as to whether these spaces are wanted, but this seems over the top.) Geyslan Bem, who submitted bug #22369, also requested a new comment style similar to 'extra-line, where an extra comment line would be inserted only above the existing text (or it might have been below). How do people feel about 'extra-above and 'extra-below being implemented (in the master branch, of course)? -- Alan Mackenzie (Nuremberg, Germany).