From unknown Sat Aug 09 09:36:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22369: 24.5; comment-style 'extra-line' doesn't correctly indent with tabs Resent-From: "Geyslan G. Bem" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jan 2016 01:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22369 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22369@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.145273635522772 (code B ref -1); Thu, 14 Jan 2016 01:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jan 2016 01:52:35 +0000 Received: from localhost ([127.0.0.1]:48672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJX5X-0005vE-F3 for submit@debbugs.gnu.org; Wed, 13 Jan 2016 20:52:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45841) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJWyD-0005k6-On for submit@debbugs.gnu.org; Wed, 13 Jan 2016 20:45:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJWy7-0007dV-Cp for submit@debbugs.gnu.org; Wed, 13 Jan 2016 20:44:56 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJWy7-0007dR-9U for submit@debbugs.gnu.org; Wed, 13 Jan 2016 20:44:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJWy6-00020h-52 for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2016 20:44:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJWy5-0007ci-3B for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2016 20:44:54 -0500 Received: from mail-vk0-x22e.google.com ([2607:f8b0:400c:c05::22e]:35520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJWy4-0007ce-T9 for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2016 20:44:53 -0500 Received: by mail-vk0-x22e.google.com with SMTP id k1so272126773vkb.2 for ; Wed, 13 Jan 2016 17:44:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=wje+oViWhtxfE9nyDUjU5aCnU4KE74CPgvgb1Y/oKEM=; b=D/rr/xWZHU3/DTxubgwceYV9jcAjH8BSr1Subt9fN9EsDDAPF8uZCNedN0WLOyeuWP eAhU0rmczfpEHj86y9FPP+g5CARt2+IrT2YH4AFybx/CK49Ow8NISskvcZG6JTJ+KIZM C4Vr/lnoZ4hjsPTneHFCqxxR8MtfttEtzvRACFX41f30YWVojQRBMmMTKACGM2AwEPfI dfsq+t7dH7mg4VKrrB4yqtHNFEUcIpemV6fbnDiUtindZkEIdG7SJ+Sy1ICOFk0HuxyY Elfa1cwA8xF9ZZoXrIh6kZ+5Eho0i99/RqevQbKeV0C0qY7UhFfHLfJijB4TV97XZPhg FP8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=wje+oViWhtxfE9nyDUjU5aCnU4KE74CPgvgb1Y/oKEM=; b=m8x8X/MPZPyl8PzAtDiElHjmUwi3nY8K27gh+ZCrOJnMyTjTLMfa0V/y+W0+UHGl9S k/GDnm1Q0IiIRxkoy1mZ1EbSX9k0Oyh50dt84wMZqe/j4dNlPM6TdIJ+KIbSrPjBlrzj ZkkBmJHWBk8zz8Aj8IJflMAaBseN3BNE2/+1+XhDgGU7L3tfWkFbt4F5NJKvgDfdRVva uz1s1fQyxbNlcRA7oQFscmB/kzU85OFj+P35bPGj3z2WuoJXcxW4sB9r3vXROtXOwx3S 7+b2TWroWiQDymOkQNlqi4peLhmO+FJzAgzvZTZ/1cFoHatYYXXSQwN4YwXztlj8NYs/ CgEg== X-Gm-Message-State: ALoCoQlxUZGmBoYCTxn/s/xj7vUuu4KrHSwyoStbBD+mDbNPPbCQJ9r0fsuoX8R2gFQaLEhjw/M9O4bCitfxqUzSuxmTkDwslg== MIME-Version: 1.0 X-Received: by 10.31.12.77 with SMTP id 74mr851896vkm.28.1452735892232; Wed, 13 Jan 2016 17:44:52 -0800 (PST) Received: by 10.31.47.130 with HTTP; Wed, 13 Jan 2016 17:44:52 -0800 (PST) Date: Wed, 13 Jan 2016 22:44:52 -0300 Message-ID: From: "Geyslan G. Bem" Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Wed, 13 Jan 2016 20:52:35 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) (setq c-basic-offset 8 tab-width 8 indent-tabs-mode t comment-style 'extra-line) (c-set-style "linux") Using the above settings the comment-dwim (with region active) indent the second and last lines with spaces instead of tabs. /* * void main() * { * int i; * int b; * printf("format string"); * } */ For better comprehension check out this http://stackoverflow.com/questions/34710840/c-comment-in-emacs-linux-kernel-style-v2 May I suggest the addition of a new comment-style option that does like this? /* void main() * { * int i; * int b; * printf("format string"); * } */ In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-09 on foutrelis Windowing system distributor `The X.Org Foundation', version 11.0.11800000 System Description: Arch Linux Configured using: `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' Important settings: value of $LC_CTYPE: pt_BR.UTF-8 value of $LC_MONETARY: pt_BR.UTF-8 value of $LC_NUMERIC: pt_BR.UTF-8 value of $LC_TIME: pt_BR.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Load-path shadows: /home/geyslan/.emacs.d/elpa/helm-20151106.2158/helm-multi-match hides /home/geyslan/.emacs.d/elpa/helm-core-20151104.0/helm-multi-match Features: (shadow sort gnus-util mail-extr emacsbug message idna format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils jka-compr find-func help-fns sregex re-builder debug tabify cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs help-mode go-mode-autoloads info easymenu package epg-config edmacro kmacro cl-loaddefs cl-lib time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 132515 7051) (symbols 48 21866 0) (miscs 40 226 747) (strings 32 23818 4361) (string-bytes 1 883190) (vectors 16 12839) (vector-slots 8 428611 6669) (floats 8 75 442) (intervals 56 799 191) (buffers 960 17) (heap 1024 45432 1517)) From unknown Sat Aug 09 09:36:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22369: 24.5; comment-style 'extra-line' doesn't correctly indent with tabs References: Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Fri, 15 Jan 2016 11:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22369 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: "Geyslan G. Bem" Cc: 22369@debbugs.gnu.org Received: via spool by 22369-submit@debbugs.gnu.org id=B22369.145285899310160 (code B ref 22369); Fri, 15 Jan 2016 11:57:01 +0000 Received: (at 22369) by debbugs.gnu.org; 15 Jan 2016 11:56:33 +0000 Received: from localhost ([127.0.0.1]:49668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aK2zY-0002dn-LD for submit@debbugs.gnu.org; Fri, 15 Jan 2016 06:56:32 -0500 Received: from mail.muc.de ([193.149.48.3]:20631) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aK2zW-0002df-JB for 22369@debbugs.gnu.org; Fri, 15 Jan 2016 06:56:31 -0500 Received: (qmail 56864 invoked by uid 3782); 15 Jan 2016 11:56:28 -0000 Date: 15 Jan 2016 11:56:28 -0000 Message-ID: <20160115115628.56863.qmail@mail.muc.de> From: Alan Mackenzie Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.2-RELEASE-p9 (amd64)) X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello, Geyslan. In article you wrote: > (setq c-basic-offset 8 > tab-width 8 > indent-tabs-mode t > comment-style 'extra-line) > (c-set-style "linux") > Using the above settings the comment-dwim (with region active) indent > the second and last lines with spaces instead of tabs. > /* > * void main() > * { > * int i; > * int b; > * printf("format string"); > * } > */ Yes. Thanks for taking the trouble to report this. The following patch should fix this bug. After applying the patch (in .../emacs-24.5/lisp), byte-compile the file with: $ emacs -Q -batch -f batch-byte-compile newcomment.el on the command line. If you then load the file (with M-x load-file) it should then work. However, the complication is that newcomment.el is a built-in part of Emacs rather than being a file loaded at runtime. So you then have the choice of either putting "(load newcomment.elc)" into your .emacs, or rebuilding Emacs entirely (which isn't that time-consuming or difficult). To do this, in directory .../emacs-24.5, do: $ make . If there are still problems with the fix, please report these to the bug mailing list at 22369@debbugs.gnu.org. > For better comprehension check out this > http://stackoverflow.com/questions/34710840/c-comment-in-emacs-linux-kernel-style-v2 > May I suggest the addition of a new comment-style option that does like this? > /* void main() > * { > * int i; > * int b; > * printf("format string"); > * } > */ OK, because of this feature request, I'll leave the bug open. This would indeed not be difficult to implement, but it'll have to be discussed on the developers' mailing list. > In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) > of 2015-09-09 on foutrelis > Windowing system distributor `The X.Org Foundation', version 11.0.11800000 > System Description: Arch Linux [ .... ] Here's the patch: --- newcomment.el~ 2015-04-02 07:23:06.000000000 +0000 +++ newcomment.el 2016-01-15 11:41:24.912588709 +0000 @@ -969,6 +969,14 @@ (goto-char (point-max)))))) (set-marker end nil)) +(defun comment-make-bol-ws (len) + "Make a white-space string of width LEN for use at BOL. +When `indent-tabs-mode' is non-nil, tab characters will be used." + (if (and indent-tabs-mode (> tab-width 0)) + (concat (make-string (/ len tab-width) ?\t) + (make-string (% len tab-width) ? )) + (make-string len ? ))) + (defun comment-make-extra-lines (cs ce ccs cce min-indent max-indent &optional block) "Make the leading and trailing extra lines. This is used for `extra-line' style (or `box' style if BLOCK is specified)." @@ -1004,8 +1012,8 @@ (setq cs (replace-match fill t t s))) (string-match re e) (setq ce (replace-match fill t t e)))) - (cons (concat cs "\n" (make-string min-indent ? ) ccs) - (concat cce "\n" (make-string (+ min-indent eindent) ? ) ce)))) + (cons (concat cs "\n" (comment-make-bol-ws min-indent) ccs) + (concat cce "\n" (comment-make-bol-ws (+ min-indent eindent)) ce)))) (defmacro comment-with-narrowing (beg end &rest body) "Execute BODY with BEG..END narrowing. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Aug 09 09:36:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22369: 24.5; comment-style 'extra-line' doesn't correctly indent with tabs Resent-From: "Geyslan G. Bem" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Fri, 15 Jan 2016 12:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22369 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 22369@debbugs.gnu.org Received: via spool by 22369-submit@debbugs.gnu.org id=B22369.145285987111535 (code B ref 22369); Fri, 15 Jan 2016 12:12:02 +0000 Received: (at 22369) by debbugs.gnu.org; 15 Jan 2016 12:11:11 +0000 Received: from localhost ([127.0.0.1]:49672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aK3Df-0002zu-0U for submit@debbugs.gnu.org; Fri, 15 Jan 2016 07:11:11 -0500 Received: from mail-vk0-f53.google.com ([209.85.213.53]:35728) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aK3Dd-0002zO-K0 for 22369@debbugs.gnu.org; Fri, 15 Jan 2016 07:11:06 -0500 Received: by mail-vk0-f53.google.com with SMTP id k1so297157001vkb.2 for <22369@debbugs.gnu.org>; Fri, 15 Jan 2016 04:11:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=oe+XQ2iMOvIkwnPrRVpGkdP8QSMJuR2omVcsakTFzqo=; b=cFpg52SnyWs4lgdOG/gyzPa7Gd5rRhg1iIIjKtj4OT+k8OtUqDNtVllLk9JblN2o9t u6I9CZRx6Yafao429Dgpp34cEc0ekhS8ocGwFugSoUHZTQLw3ydHr4TkG63poCzq2qZv BndZPxiwWYzCHp90yfshYFP2a1Dzn4fNLdbemOU9K7ZzGLE3Qofds8Nl0GMqUMUHes+v F0+yTzGtpPLuUi0OOwJS9qqsgKGogXqwDkU/fHnWapPUNdg6/3KN0VuSFCrdSGg0FVV+ cOVnwSJI2tMey90SeVXbyNSJVln2afHmKccFqK5XvctuTK/L2jLTioLtvJuqbYN3QlwI hmpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=oe+XQ2iMOvIkwnPrRVpGkdP8QSMJuR2omVcsakTFzqo=; b=LmLtAzOWSpw+jCVI1UwdOVkMnXc9mv9xWjyKQsMUWRysAwnRggDJ5gIeb3bVx12hue mJWB0E+V88VXKeVwxdMIDD1YN38LYSqA1DH696wfNsk0xRMHL/yHT1HoY0WcyBPJx4UD 95g9m/DOG9jhzUKLg2jttS0PzxZXF7PQecdjr7RCS+39Po4cldlfmJ2ZFY2+XL8GvS4Q IUvmXjJiWUi54u3pUYFwGuwXqGMlgw8BYVTnhLMTpePLDDLMwghWTYBnHCjGCwe2uthP RfLp8d5KaP9/jng2GLpSyXX0lFp2m+Uws70sglLi+K6GSRk0cW7mQY+3hd3Y/lFFwOGT Okog== X-Gm-Message-State: ALoCoQnxkkxxc8DC5kiYV6cyYlOGrvZgyL+V5xBxvf7VipuXfVD3v4PS1SHs4M4YU55lqezdL/Y7EzCIMW0wvKmffqd87Uj7xw== MIME-Version: 1.0 X-Received: by 10.31.162.200 with SMTP id l191mr7425520vke.69.1452859860123; Fri, 15 Jan 2016 04:11:00 -0800 (PST) Received: by 10.31.47.130 with HTTP; Fri, 15 Jan 2016 04:11:00 -0800 (PST) In-Reply-To: <20160115115628.56863.qmail@mail.muc.de> References: <20160115115628.56863.qmail@mail.muc.de> Date: Fri, 15 Jan 2016 09:11:00 -0300 Message-ID: From: "Geyslan G. Bem" Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2016-01-15 8:56 GMT-03:00 Alan Mackenzie : > Hello, Geyslan. > > In article you wrote: >> (setq c-basic-offset 8 >> tab-width 8 >> indent-tabs-mode t >> comment-style 'extra-line) >> (c-set-style "linux") > >> Using the above settings the comment-dwim (with region active) indent >> the second and last lines with spaces instead of tabs. > >> /* >> * void main() >> * { >> * int i; >> * int b; >> * printf("format string"); >> * } >> */ > > Yes. Thanks for taking the trouble to report this. The following patch > should fix this bug. After applying the patch (in .../emacs-24.5/lisp), > byte-compile the file with: > > $ emacs -Q -batch -f batch-byte-compile newcomment.el > > on the command line. If you then load the file (with M-x load-file) it > should then work. > > However, the complication is that newcomment.el is a built-in part of > Emacs rather than being a file loaded at runtime. So you then have the > choice of either putting "(load newcomment.elc)" into your .emacs, or > rebuilding Emacs entirely (which isn't that time-consuming or difficult). > To do this, in directory .../emacs-24.5, do: > > $ make > You're welcome and thank you for patching. > . > > If there are still problems with the fix, please report these to the bug > mailing list at 22369@debbugs.gnu.org. > >> For better comprehension check out this >> http://stackoverflow.com/questions/34710840/c-comment-in-emacs-linux-kernel-style-v2 > >> May I suggest the addition of a new comment-style option that does like this? > >> /* void main() >> * { >> * int i; >> * int b; >> * printf("format string"); >> * } >> */ > > OK, because of this feature request, I'll leave the bug open. This would > indeed not be difficult to implement, but it'll have to be discussed on > the developers' mailing list. Ok, I think that would be great have extra-lines (as it already is) and the suggested option named extra-bottom-line. > >> In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) >> of 2015-09-09 on foutrelis >> Windowing system distributor `The X.Org Foundation', version 11.0.11800000 >> System Description: Arch Linux > > [ .... ] > > Here's the patch: I'll test later. Thank you so much again. > > > --- newcomment.el~ 2015-04-02 07:23:06.000000000 +0000 > +++ newcomment.el 2016-01-15 11:41:24.912588709 +0000 > @@ -969,6 +969,14 @@ > (goto-char (point-max)))))) > (set-marker end nil)) > > +(defun comment-make-bol-ws (len) > + "Make a white-space string of width LEN for use at BOL. > +When `indent-tabs-mode' is non-nil, tab characters will be used." > + (if (and indent-tabs-mode (> tab-width 0)) > + (concat (make-string (/ len tab-width) ?\t) > + (make-string (% len tab-width) ? )) > + (make-string len ? ))) > + > (defun comment-make-extra-lines (cs ce ccs cce min-indent max-indent &optional block) > "Make the leading and trailing extra lines. > This is used for `extra-line' style (or `box' style if BLOCK is specified)." > @@ -1004,8 +1012,8 @@ > (setq cs (replace-match fill t t s))) > (string-match re e) > (setq ce (replace-match fill t t e)))) > - (cons (concat cs "\n" (make-string min-indent ? ) ccs) > - (concat cce "\n" (make-string (+ min-indent eindent) ? ) ce)))) > + (cons (concat cs "\n" (comment-make-bol-ws min-indent) ccs) > + (concat cce "\n" (comment-make-bol-ws (+ min-indent eindent)) ce)))) > > (defmacro comment-with-narrowing (beg end &rest body) > "Execute BODY with BEG..END narrowing. > > > -- > Alan Mackenzie (Nuremberg, Germany). > -- Regards, Geyslan G. Bem hackingbits.com From unknown Sat Aug 09 09:36:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22369: 24.5; comment-style 'extra-line' doesn't correctly indent with tabs References: Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Fri, 15 Jan 2016 12:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22369 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: 22369@debbugs.gnu.org Cc: "Geyslan G. Bem" Received: via spool by 22369-submit@debbugs.gnu.org id=B22369.145286175420727 (code B ref 22369); Fri, 15 Jan 2016 12:43:02 +0000 Received: (at 22369) by debbugs.gnu.org; 15 Jan 2016 12:42:34 +0000 Received: from localhost ([127.0.0.1]:49677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aK3i6-0005OF-DF for submit@debbugs.gnu.org; Fri, 15 Jan 2016 07:42:34 -0500 Received: from mail.muc.de ([193.149.48.3]:23718) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aK3i4-0005O5-Pb for 22369@debbugs.gnu.org; Fri, 15 Jan 2016 07:42:33 -0500 Received: (qmail 67455 invoked by uid 3782); 15 Jan 2016 12:42:31 -0000 Date: 15 Jan 2016 12:42:31 -0000 Message-ID: <20160115124231.67454.qmail@mail.muc.de> From: Alan Mackenzie Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.2-RELEASE-p9 (amd64)) X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Bug fixed in emacs-25 branch. Bug report left open, due to a feature request in it. -- Alan Mackenzie (Nuremberg, Germany). In article you wrote: > (setq c-basic-offset 8 > tab-width 8 > indent-tabs-mode t > comment-style 'extra-line) > (c-set-style "linux") > Using the above settings the comment-dwim (with region active) indent > the second and last lines with spaces instead of tabs. > /* > * void main() > * { > * int i; > * int b; > * printf("format string"); > * } > */ > For better comprehension check out this > http://stackoverflow.com/questions/34710840/c-comment-in-emacs-linux-kernel-style-v2 > May I suggest the addition of a new comment-style option that does like this? > /* void main() > * { > * int i; > * int b; > * printf("format string"); > * } > */ > In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) > of 2015-09-09 on foutrelis > Windowing system distributor `The X.Org Foundation', version 11.0.11800000 > System Description: Arch Linux > Configured using: > `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib > --localstatedir=/var --with-x-toolkit=gtk3 --with-xft > 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong > --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2 > LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' > Important settings: > value of $LC_CTYPE: pt_BR.UTF-8 > value of $LC_MONETARY: pt_BR.UTF-8 > value of $LC_NUMERIC: pt_BR.UTF-8 > value of $LC_TIME: pt_BR.UTF-8 > value of $LANG: en_US.UTF-8 > value of $XMODIFIERS: @im=ibus > locale-coding-system: utf-8-unix > Major mode: Emacs-Lisp > Minor modes in effect: > tooltip-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > tool-bar-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > line-number-mode: t > transient-mark-mode: t > Recent messages: > Load-path shadows: > /home/geyslan/.emacs.d/elpa/helm-20151106.2158/helm-multi-match hides > /home/geyslan/.emacs.d/elpa/helm-core-20151104.0/helm-multi-match > Features: > (shadow sort gnus-util mail-extr emacsbug message idna format-spec > rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 > mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums > mm-util mail-prsvr mail-utils jka-compr find-func help-fns sregex > re-builder debug tabify cc-langs cc-mode cc-fonts cc-guess cc-menus > cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs help-mode > go-mode-autoloads info easymenu package epg-config edmacro kmacro > cl-loaddefs cl-lib time-date tooltip electric uniquify ediff-hook > vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image > regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register > page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock > font-lock syntax facemenu font-core frame cham georgian utf-8-lang > misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew > greek romanian slovak czech european ethiopic indian cyrillic chinese > case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice > loaddefs button faces cus-face macroexp files text-properties overlay > sha1 md5 base64 format env code-pages mule custom widget > hashtable-print-readable backquote make-network-process dbusbind > gfilenotify dynamic-setting system-font-setting font-render-setting > move-toolbar gtk x-toolkit x multi-tty emacs) > Memory information: > ((conses 16 132515 7051) > (symbols 48 21866 0) > (miscs 40 226 747) > (strings 32 23818 4361) > (string-bytes 1 883190) > (vectors 16 12839) > (vector-slots 8 428611 6669) > (floats 8 75 442) > (intervals 56 799 191) > (buffers 960 17) > (heap 1024 45432 1517)) From unknown Sat Aug 09 09:36:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22369: 24.5; comment-style 'extra-line' doesn't correctly indent with tabs Resent-From: "Geyslan G. Bem" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Jan 2016 22:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22369 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 22369@debbugs.gnu.org Received: via spool by 22369-submit@debbugs.gnu.org id=B22369.145289521114108 (code B ref 22369); Fri, 15 Jan 2016 22:01:02 +0000 Received: (at 22369) by debbugs.gnu.org; 15 Jan 2016 22:00:11 +0000 Received: from localhost ([127.0.0.1]:50242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKCPf-0003bA-2Z for submit@debbugs.gnu.org; Fri, 15 Jan 2016 17:00:11 -0500 Received: from mail-vk0-f54.google.com ([209.85.213.54]:33220) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKCPd-0003Vz-3l for 22369@debbugs.gnu.org; Fri, 15 Jan 2016 17:00:05 -0500 Received: by mail-vk0-f54.google.com with SMTP id i129so167827613vkb.0 for <22369@debbugs.gnu.org>; Fri, 15 Jan 2016 14:00:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=awyGkLE5zs1PlqxsqJwd2CkNcvaBzbSPB+v8WbAYgQ0=; b=kuJJWVkcvn+VURqOe7HhAx9tx1bObJ4DegOmEH2UeGP47bXoeSzGdwp4wgNWXTX4TW nfG6xTJf8BaPcpHAmmH8/TvfIjYy5puLCsinFOIQBbiQXm9zd30VsHSPi7mBFbcdk0sL 2MJAwg1LeePWqcDRaVeHa1VIbVxJJNSeaEGgI0EEzqMw2GJx0b4599KNTQX5h9ThGeAQ CpBVn86KLcI923B6MmmJQFVcz6SQ8rNesuCxppGqrwey10ghh2bGasCZs68KXrd1M90E VUlIjaFyxkcPJcbf+lHqeSO1qTTuPyS0bl+7z6nyOMLWPwH/ixeOhm/GRcXeSC0xJEgW PNrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=awyGkLE5zs1PlqxsqJwd2CkNcvaBzbSPB+v8WbAYgQ0=; b=mGKoW6HzTgssLT9E66TchYRTAfy2efWkbrSycAqoG7yuPjtGM5CxXreejd+AhfF5lI iWroWgRaCvw+VTrPnZ2BbOKFyBzyxTAwA+a0X0/HCHj7xatUZx7/aXxfNuJsEGxKhm9e A4MEzeyfn/+BLaGUt8AkItFXHPpdOp3GbHF21k7mMMYrjlziOqK+1YuIoXiVYeC6/w1Q 7SThB52YKpJcna2inPsv3gw8fMC9qF/AiZHB6sJ7PfhHzOOP+V948MPQGISaChKAh7/x Y5m4JRBKou7Lc0q2pxTj7boIFUmAQCS8i0J/ngmp9NtOC+tPHfDMtPcEQjlxwPxX2Xlo cJQg== X-Gm-Message-State: ALoCoQkmBfAlig+Tx9RKSDlaulc6WWn2F0RdLGgcxLTrpVcfdthld5Ewudpgjs3z0DpThJVpQcyjAWwNmd+RF4I4DmpbP1l9jA== MIME-Version: 1.0 X-Received: by 10.31.16.140 with SMTP id 12mr8883068vkq.106.1452895199613; Fri, 15 Jan 2016 13:59:59 -0800 (PST) Received: by 10.31.47.130 with HTTP; Fri, 15 Jan 2016 13:59:59 -0800 (PST) In-Reply-To: <20160115124231.67454.qmail@mail.muc.de> References: <20160115124231.67454.qmail@mail.muc.de> Date: Fri, 15 Jan 2016 18:59:59 -0300 Message-ID: From: "Geyslan G. Bem" Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2016-01-15 9:42 GMT-03:00 Alan Mackenzie : > Bug fixed in emacs-25 branch. Alan, tested and it's ok. Thank you. I realized now that comment-dwim leaves a trailing space in the first line of the comment ( /* extra-line). This space isn't needed by c-indent-new-comment-line (M-j), so I think that it could be an issue too, since it's deliberately doing that. > > Bug report left open, due to a feature request in it. > > -- > Alan Mackenzie (Nuremberg, Germany). > > > In article you wrote: >> (setq c-basic-offset 8 >> tab-width 8 >> indent-tabs-mode t >> comment-style 'extra-line) >> (c-set-style "linux") > >> Using the above settings the comment-dwim (with region active) indent >> the second and last lines with spaces instead of tabs. > >> /* >> * void main() >> * { >> * int i; >> * int b; >> * printf("format string"); >> * } >> */ > >> For better comprehension check out this >> http://stackoverflow.com/questions/34710840/c-comment-in-emacs-linux-kernel-style-v2 > >> May I suggest the addition of a new comment-style option that does like this? > >> /* void main() >> * { >> * int i; >> * int b; >> * printf("format string"); >> * } >> */ > > > >> In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) >> of 2015-09-09 on foutrelis >> Windowing system distributor `The X.Org Foundation', version 11.0.11800000 >> System Description: Arch Linux > >> Configured using: >> `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib >> --localstatedir=/var --with-x-toolkit=gtk3 --with-xft >> 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong >> --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2 >> LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' > >> Important settings: >> value of $LC_CTYPE: pt_BR.UTF-8 >> value of $LC_MONETARY: pt_BR.UTF-8 >> value of $LC_NUMERIC: pt_BR.UTF-8 >> value of $LC_TIME: pt_BR.UTF-8 >> value of $LANG: en_US.UTF-8 >> value of $XMODIFIERS: @im=ibus >> locale-coding-system: utf-8-unix > >> Major mode: Emacs-Lisp > >> Minor modes in effect: >> tooltip-mode: t >> electric-indent-mode: t >> mouse-wheel-mode: t >> tool-bar-mode: t >> menu-bar-mode: t >> file-name-shadow-mode: t >> global-font-lock-mode: t >> font-lock-mode: t >> blink-cursor-mode: t >> auto-composition-mode: t >> auto-encryption-mode: t >> auto-compression-mode: t >> line-number-mode: t >> transient-mark-mode: t > >> Recent messages: > > >> Load-path shadows: >> /home/geyslan/.emacs.d/elpa/helm-20151106.2158/helm-multi-match hides >> /home/geyslan/.emacs.d/elpa/helm-core-20151104.0/helm-multi-match > >> Features: >> (shadow sort gnus-util mail-extr emacsbug message idna format-spec >> rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 >> mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums >> mm-util mail-prsvr mail-utils jka-compr find-func help-fns sregex >> re-builder debug tabify cc-langs cc-mode cc-fonts cc-guess cc-menus >> cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs help-mode >> go-mode-autoloads info easymenu package epg-config edmacro kmacro >> cl-loaddefs cl-lib time-date tooltip electric uniquify ediff-hook >> vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image >> regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register >> page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock >> font-lock syntax facemenu font-core frame cham georgian utf-8-lang >> misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew >> greek romanian slovak czech european ethiopic indian cyrillic chinese >> case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice >> loaddefs button faces cus-face macroexp files text-properties overlay >> sha1 md5 base64 format env code-pages mule custom widget >> hashtable-print-readable backquote make-network-process dbusbind >> gfilenotify dynamic-setting system-font-setting font-render-setting >> move-toolbar gtk x-toolkit x multi-tty emacs) > >> Memory information: >> ((conses 16 132515 7051) >> (symbols 48 21866 0) >> (miscs 40 226 747) >> (strings 32 23818 4361) >> (string-bytes 1 883190) >> (vectors 16 12839) >> (vector-slots 8 428611 6669) >> (floats 8 75 442) >> (intervals 56 799 191) >> (buffers 960 17) >> (heap 1024 45432 1517)) > > > -- Regards, Geyslan G. Bem hackingbits.com From unknown Sat Aug 09 09:36:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22369: 24.5; comment-style 'extra-line' doesn't correctly indent with tabs Resent-From: "Geyslan G. Bem" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Jan 2016 11:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22369 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie , 22369@debbugs.gnu.org Received: via spool by 22369-submit@debbugs.gnu.org id=B22369.14531156776021 (code B ref 22369); Mon, 18 Jan 2016 11:15:02 +0000 Received: (at 22369) by debbugs.gnu.org; 18 Jan 2016 11:14:37 +0000 Received: from localhost ([127.0.0.1]:52329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aL7lY-0001Yz-Tf for submit@debbugs.gnu.org; Mon, 18 Jan 2016 06:14:36 -0500 Received: from mail-vk0-f43.google.com ([209.85.213.43]:33095) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aL7lW-0001Yk-MU for 22369@debbugs.gnu.org; Mon, 18 Jan 2016 06:14:31 -0500 Received: by mail-vk0-f43.google.com with SMTP id i129so191453211vkb.0 for <22369@debbugs.gnu.org>; Mon, 18 Jan 2016 03:14:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=45MtxTSSBFkx1Kqm9/UOtq4laQ9dElzGSQsXhDDzK7c=; b=y8lAhCivDH1CkFg6D5oWmPouzntE4pH6M0ycyV3MLE/WOM5jl2/5t2iwgXoaMg2BCJ 6aDgNUM5UzFmzM5q4VH0U+BGhtrojnbH5lNFMEyuC8xjcQnM+FCJYeA/cSds95NMY6UC SouDpIbBbRuch9QOJaieSN5MrKB9Jorko4WgBxhwvo1hhUH3aiZmIpLzOQd/5HPqivpT u0EBMUV+vY5N5v4e9bFNlJLXbYBJFIjzGjZvGUbppNE+tGj2u53zNxVzEDklkSDBXzp9 8sXQY5QwL+k6MeCRA48WG6EKBMYBAIvj7ZTA9biQg86pTdp3mP224e9D1qYx9vzdmKCO yFUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=45MtxTSSBFkx1Kqm9/UOtq4laQ9dElzGSQsXhDDzK7c=; b=NeFwfCVnQvAlUEHGNAZ/ohT6cm+r5S/zFDM0LdCAyOsnsyIj9TbEgwpEq9tEYxRIp0 hQNnuy867FfIkmppG2IH93meV6O7oiJsIb1uQ5p6ANBLKHFTm3VAUPnQ4Nooa4fKTqkV fsUJNVq2ZfSWRKMPgO8Oh7xG0cKxH0MXDG+YJZpd1GrbFIQ4wtmoXcwHecrh5+xphCmM w0ZpncuYXa35V91lEj4yKqtq+XLO3WWg7J+WXaIbQSJ9N5hJv9SD9+spun4qFCyNYNon a6VJyu5/cKx7D6vKDAcJmNYQURya/6ufkdjyIxseUutRb4pmaL7Ajj5A4/qmP6kheL3C pXzw== X-Gm-Message-State: ALoCoQmi+NWLGksxdRKR7CdFjZ9FRZbDPrmVUELTKyx8AqcWZShA7thHyfUIGU5r1Vx/f8pSjkrN8QZ5tq/bASURAp7bmuIpdw== MIME-Version: 1.0 X-Received: by 10.31.15.4 with SMTP id 4mr15014431vkp.10.1453115664891; Mon, 18 Jan 2016 03:14:24 -0800 (PST) Received: by 10.31.58.76 with HTTP; Mon, 18 Jan 2016 03:14:24 -0800 (PST) In-Reply-To: References: <20160115124231.67454.qmail@mail.muc.de> Date: Mon, 18 Jan 2016 08:14:24 -0300 Message-ID: From: "Geyslan G. Bem" Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2016-01-16 10:22 GMT-03:00 Geyslan G. Bem : > > On 15 Jan 2016 18:59, "Geyslan G. Bem" wrote: >> >> 2016-01-15 9:42 GMT-03:00 Alan Mackenzie : >> > Bug fixed in emacs-25 branch. >> >> Alan, tested and it's ok. Thank you. >> >> I realized now that comment-dwim leaves a trailing space in the first >> line of the comment ( /* extra-line). > > Actually this space is on all empty lines. I managed it for my C style (/*, * and */) using (save-excursion ;; Cleaning only trailing spaces inserted by comment-region. ;; Existing ones are not touched. (replace-regexp "\\(/+\\|^\\s-+\\)\\(\\*\\)\\(\\s-+$\\)" "\\1\\2" nil beg end)) Maybe an optional parameter (trim-trailing-spaces) would be a good call for comment-region function. > >> This space isn't needed by >> c-indent-new-comment-line (M-j), so I think that it could be an issue >> too, since it's deliberately doing that. >> >> > >> > Bug report left open, due to a feature request in it. >> > >> > -- >> > Alan Mackenzie (Nuremberg, Germany). >> > >> > >> > In article you >> > wrote: >> >> (setq c-basic-offset 8 >> >> tab-width 8 >> >> indent-tabs-mode t >> >> comment-style 'extra-line) >> >> (c-set-style "linux") >> > >> >> Using the above settings the comment-dwim (with region active) indent >> >> the second and last lines with spaces instead of tabs. >> > >> >> /* >> >> * void main() >> >> * { >> >> * int i; >> >> * int b; >> >> * printf("format string"); >> >> * } >> >> */ >> > >> >> For better comprehension check out this >> >> >> >> http://stackoverflow.com/questions/34710840/c-comment-in-emacs-linux-kernel-style-v2 >> > >> >> May I suggest the addition of a new comment-style option that does like >> >> this? >> > >> >> /* void main() >> >> * { >> >> * int i; >> >> * int b; >> >> * printf("format string"); >> >> * } >> >> */ >> > >> > >> > >> >> In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) >> >> of 2015-09-09 on foutrelis >> >> Windowing system distributor `The X.Org Foundation', version >> >> 11.0.11800000 >> >> System Description: Arch Linux >> > >> >> Configured using: >> >> `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib >> >> --localstatedir=/var --with-x-toolkit=gtk3 --with-xft >> >> 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe >> >> -fstack-protector-strong >> >> --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2 >> >> LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' >> > >> >> Important settings: >> >> value of $LC_CTYPE: pt_BR.UTF-8 >> >> value of $LC_MONETARY: pt_BR.UTF-8 >> >> value of $LC_NUMERIC: pt_BR.UTF-8 >> >> value of $LC_TIME: pt_BR.UTF-8 >> >> value of $LANG: en_US.UTF-8 >> >> value of $XMODIFIERS: @im=ibus >> >> locale-coding-system: utf-8-unix >> > >> >> Major mode: Emacs-Lisp >> > >> >> Minor modes in effect: >> >> tooltip-mode: t >> >> electric-indent-mode: t >> >> mouse-wheel-mode: t >> >> tool-bar-mode: t >> >> menu-bar-mode: t >> >> file-name-shadow-mode: t >> >> global-font-lock-mode: t >> >> font-lock-mode: t >> >> blink-cursor-mode: t >> >> auto-composition-mode: t >> >> auto-encryption-mode: t >> >> auto-compression-mode: t >> >> line-number-mode: t >> >> transient-mark-mode: t >> > >> >> Recent messages: >> > >> > >> >> Load-path shadows: >> >> /home/geyslan/.emacs.d/elpa/helm-20151106.2158/helm-multi-match hides >> >> /home/geyslan/.emacs.d/elpa/helm-core-20151104.0/helm-multi-match >> > >> >> Features: >> >> (shadow sort gnus-util mail-extr emacsbug message idna format-spec >> >> rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 >> >> mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums >> >> mm-util mail-prsvr mail-utils jka-compr find-func help-fns sregex >> >> re-builder debug tabify cc-langs cc-mode cc-fonts cc-guess cc-menus >> >> cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs help-mode >> >> go-mode-autoloads info easymenu package epg-config edmacro kmacro >> >> cl-loaddefs cl-lib time-date tooltip electric uniquify ediff-hook >> >> vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image >> >> regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode >> >> register >> >> page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock >> >> font-lock syntax facemenu font-core frame cham georgian utf-8-lang >> >> misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew >> >> greek romanian slovak czech european ethiopic indian cyrillic chinese >> >> case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice >> >> loaddefs button faces cus-face macroexp files text-properties overlay >> >> sha1 md5 base64 format env code-pages mule custom widget >> >> hashtable-print-readable backquote make-network-process dbusbind >> >> gfilenotify dynamic-setting system-font-setting font-render-setting >> >> move-toolbar gtk x-toolkit x multi-tty emacs) >> > >> >> Memory information: >> >> ((conses 16 132515 7051) >> >> (symbols 48 21866 0) >> >> (miscs 40 226 747) >> >> (strings 32 23818 4361) >> >> (string-bytes 1 883190) >> >> (vectors 16 12839) >> >> (vector-slots 8 428611 6669) >> >> (floats 8 75 442) >> >> (intervals 56 799 191) >> >> (buffers 960 17) >> >> (heap 1024 45432 1517)) >> > >> > >> > >> >> >> >> -- >> Regards, >> >> Geyslan G. Bem >> hackingbits.com -- Regards, Geyslan G. Bem hackingbits.com From unknown Sat Aug 09 09:36:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22369: 24.5; comment-style 'extra-line' doesn't correctly indent with tabs Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Sep 2020 17:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22369 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: "Geyslan G. Bem" , 22369@debbugs.gnu.org Received: via spool by 22369-submit@debbugs.gnu.org id=B22369.160036432729519 (code B ref 22369); Thu, 17 Sep 2020 17:39:02 +0000 Received: (at 22369) by debbugs.gnu.org; 17 Sep 2020 17:38:47 +0000 Received: from localhost ([127.0.0.1]:38904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIxrq-0007g3-TE for submit@debbugs.gnu.org; Thu, 17 Sep 2020 13:38:47 -0400 Received: from quimby.gnus.org ([95.216.78.240]:43652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIxro-0007fl-88 for 22369@debbugs.gnu.org; Thu, 17 Sep 2020 13:38:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=t926QdOZS1Cnu3uLXwvBnESnXVuDIGFRSfFvZrjFETg=; b=DJhLwSCfxMf7G6vPEhgOmBIu8Z 3ht40rFV0V5p3jSyFQ6yJ3ifnMeJmAlr98Z8caOr8oThUWdjtMGE0mEFi19jzOTmmbXhwH/zrb9zE xINv7O6kjXrKCtXf/q7wa6bWhs5LxhaU2OygaDjQrEed9Sx6sFWVIW4y391BrOqtcdNk=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIxrf-00038C-3U; Thu, 17 Sep 2020 19:38:37 +0200 From: Lars Ingebrigtsen References: <20160115115628.56863.qmail@mail.muc.de> X-Now-Playing: African Head Charge's _Drastic Season_: "Snake In The Hole" Date: Thu, 17 Sep 2020 19:38:33 +0200 In-Reply-To: <20160115115628.56863.qmail@mail.muc.de> (Alan Mackenzie's message of "15 Jan 2016 11:56:28 -0000") Message-ID: <87a6xonw12.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alan Mackenzie writes: >> May I suggest the addition of a new comment-style option that does like this? > >> /* void main() >> * { >> * int i; >> * int b; >> * printf("format string"); >> * } >> */ > > OK, because of this f [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: >> May I suggest the addition of a new comment-style option that does like this? > >> /* void main() >> * { >> * int i; >> * int b; >> * printf("format string"); >> * } >> */ > > OK, because of this feature request, I'll leave the bug open. This would > indeed not be difficult to implement, but it'll have to be discussed on > the developers' mailing list. Was this ever discussed any further? It looks a bit odd to me... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Aug 09 09:36:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22369: 24.5; comment-style 'extra-line' doesn't correctly indent with tabs Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Sep 2020 19:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22369 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: "Geyslan G. Bem" , 22369@debbugs.gnu.org Received: via spool by 22369-submit@debbugs.gnu.org id=B22369.160037050815950 (code B ref 22369); Thu, 17 Sep 2020 19:22:02 +0000 Received: (at 22369) by debbugs.gnu.org; 17 Sep 2020 19:21:48 +0000 Received: from localhost ([127.0.0.1]:39115 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIzTY-00049B-1B for submit@debbugs.gnu.org; Thu, 17 Sep 2020 15:21:48 -0400 Received: from colin.muc.de ([193.149.48.1]:48285 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kIzTV-00048v-RU for 22369@debbugs.gnu.org; Thu, 17 Sep 2020 15:21:46 -0400 Received: (qmail 25442 invoked by uid 3782); 17 Sep 2020 19:21:39 -0000 Received: from acm.muc.de (p4fe15ef3.dip0.t-ipconnect.de [79.225.94.243]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Thu, 17 Sep 2020 21:21:38 +0200 Received: (qmail 4876 invoked by uid 1000); 17 Sep 2020 19:21:38 -0000 Date: Thu, 17 Sep 2020 19:21:38 +0000 Message-ID: <20200917192138.GA5562@ACM> References: <20160115115628.56863.qmail@mail.muc.de> <87a6xonw12.fsf@gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a6xonw12.fsf@gnus.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Lars and Geyslan. On Thu, Sep 17, 2020 at 19:38:33 +0200, Lars Ingebrigtsen wrote: > Alan Mackenzie writes: > >> May I suggest the addition of a new comment-style option that does like this? > >> /* void main() > >> * { > >> * int i; > >> * int b; > >> * printf("format string"); > >> * } > >> */ > > OK, because of this feature request, I'll leave the bug open. This would > > indeed not be difficult to implement, but it'll have to be discussed on > > the developers' mailing list. > Was this ever discussed any further? It looks a bit odd to me... I don't think there was any more discussion about this. To be exact, the feature request was to have another option for comment-style called something like bottom-extra which would add an extra comment line at the bottom of a group, but not one at the top. Four years on, I'm not convinced the feature is worth implementing, even if it wouldn't be difficult. It would involve extending the spec of comment-styles such that each entry would have EXTRA-TOP and EXTRA-BOTTOM in place of the current EXTRA. Backward compatibility could be had at the cost of counting the number of elements in each entry. One quirk the OP, Geyslan, pointed out was a possibly obtrusive space when an empty line gets commented in comment-style extra-line, something like: /* * foo(); * <=========== possibly obtrusive space. * bar(); */ I'm not sure whether or not this is a bug or a feature. If a bug, it wouldn't be difficult to fix. Geyslan, have you any more thoughts about this bug? > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Aug 09 09:36:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22369: 24.5; comment-style 'extra-line' doesn't correctly indent with tabs Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jan 2022 17:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22369 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: "Geyslan G. Bem" , 22369@debbugs.gnu.org Received: via spool by 22369-submit@debbugs.gnu.org id=B22369.16434756868961 (code B ref 22369); Sat, 29 Jan 2022 17:02:01 +0000 Received: (at 22369) by debbugs.gnu.org; 29 Jan 2022 17:01:26 +0000 Received: from localhost ([127.0.0.1]:34616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDr6L-0002KG-Uw for submit@debbugs.gnu.org; Sat, 29 Jan 2022 12:01:26 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDr6J-0002EY-Uu for 22369@debbugs.gnu.org; Sat, 29 Jan 2022 12:01:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qDBY4sJ7qi4gh6Q4qx9uwP/5kDQ4mR7uldjxIpRUwdQ=; b=CXidQIUVST3ejq64MghxaOZU+h eh6VeEVwyfCugHx3ctMtlXdxQrrZFs6HF5wUIXfNcxLKkhIKj1b1JwTbj0wfQws5mBHXhRYM4N9y8 YYpeeJokjo1a7+4ABndNVfIaM5WjwVdK7/iIjkHaOP81rWK5E0/WfeTJKDuDdHXwCsNk=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDr6B-0004p6-2v; Sat, 29 Jan 2022 18:01:17 +0100 From: Lars Ingebrigtsen References: <20160115115628.56863.qmail@mail.muc.de> <87a6xonw12.fsf@gnus.org> <20200917192138.GA5562@ACM> X-Now-Playing: Depeche Mode's _Stripped_: "Breathing in fumes" Date: Sat, 29 Jan 2022 18:01:14 +0100 In-Reply-To: <20200917192138.GA5562@ACM> (Alan Mackenzie's message of "Thu, 17 Sep 2020 19:21:38 +0000") Message-ID: <87h79m79yd.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alan Mackenzie writes: > I'm not sure whether or not this is a bug or a feature. If a bug, it > wouldn't be difficult to fix. > > Geyslan, have you any more thoughts about this bug? This was a year ago, and there weren't any further input here, so I'm guessing we're going with "it's a feature", and I'm therefore closing this bug report. (If there's something here that should be f [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Alan Mackenzie writes: > I'm not sure whether or not this is a bug or a feature. If a bug, it > wouldn't be difficult to fix. > > Geyslan, have you any more thoughts about this bug? This was a year ago, and there weren't any further input here, so I'm guessing we're going with "it's a feature", and I'm therefore closing this bug report. (If there's something here that should be fixed, please respond to the debbugs address and we'll reopen.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 12:01:33 2022 Received: (at control) by debbugs.gnu.org; 29 Jan 2022 17:01:33 +0000 Received: from localhost ([127.0.0.1]:34619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDr6T-0002QN-5j for submit@debbugs.gnu.org; Sat, 29 Jan 2022 12:01:33 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54876) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDr6R-0002KE-3Y for control@debbugs.gnu.org; Sat, 29 Jan 2022 12:01:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FKgIb6Yb5A+XzR8fvs+WTTg1bcWLhyNJRi8mAFKRJBQ=; b=oJtZec2I0G1NQd6c5IsUOzPD34 A0CVBFWvJIOI2kQ+KSTO6CL+70a4PUAqb3ckSaXTAJPqixFi1eMrLDx7e7zatSsr49koFOIkHm289 Keco1IP8cl7feWYPo5eb6uN+UPhz9LCAGshKlGoTMHIiwrmp0kINja408F/EiMyuRCDY=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDr6J-0004pH-99 for control@debbugs.gnu.org; Sat, 29 Jan 2022 18:01:25 +0100 Date: Sat, 29 Jan 2022 18:01:22 +0100 Message-Id: <87fsp679y5.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #22369 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 22369 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 22369 quit