From unknown Wed Jun 18 23:07:16 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#26049 <26049@debbugs.gnu.org> To: bug#26049 <26049@debbugs.gnu.org> Subject: Status: 25.2; Extra lines not added to comment Reply-To: bug#26049 <26049@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:07:16 +0000 retitle 26049 25.2; Extra lines not added to comment reassign 26049 emacs submitter 26049 Antonin Houska severity 26049 normal tag 26049 patch fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 11:05:01 2017 Received: (at submit) by debbugs.gnu.org; 10 Mar 2017 16:05:01 +0000 Received: from localhost ([127.0.0.1]:49853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmN2K-0002cJ-Tm for submit@debbugs.gnu.org; Fri, 10 Mar 2017 11:05:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmKnV-00079L-Pe for submit@debbugs.gnu.org; Fri, 10 Mar 2017 08:41:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmKnO-00020y-Vt for submit@debbugs.gnu.org; Fri, 10 Mar 2017 08:41:28 -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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52848) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cmKnO-00020s-Se for submit@debbugs.gnu.org; Fri, 10 Mar 2017 08:41:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmKnM-0002cj-LZ for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2017 08:41:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmKnI-0001yx-J9 for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2017 08:41:24 -0500 Received: from mx1.mailbox.org ([80.241.60.212]:56092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cmKnI-0001yF-7I for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2017 08:41:20 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id C3F2D45A7E for ; Fri, 10 Mar 2017 14:41:17 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id KnrY10MPYGdg for ; Fri, 10 Mar 2017 14:41:16 +0100 (CET) From: Antonin Houska To: bug-gnu-emacs@gnu.org Subject: 25.2; Extra lines not added to comment MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Fri, 10 Mar 2017 14:41:15 +0100 Message-ID: <29145.1489153275@localhost> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 10 Mar 2017 11:05:00 -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: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Even though I have the following customizations in place '(comment-multi-line t) '(comment-style (quote extra-line)) comment-region command produces this /* some comment */ rather than this /* * some comment */ Attached is a patch that I use to fix the issue on my workstation. Besides fixing the (supposed) off-by-one error, the patch also removes trailing whitespace from the initial line of the comment ("/* "). (My knowledge of Elisp is not too advanced so I wonder if there's simpler way to trim whitespace from a string.) In GNU Emacs 25.2.3 (x86_64-suse-linux-gnu, X toolkit, Xaw scroll bars) of 2017-03-10 built on linux-j735 Repository revision: 6e788ef0e262fafc014c21f4ad52cc5dc9f1715b Windowing system distributor 'The X.Org Foundation', version 11.0.11702000 System Description: openSUSE Leap 42.1 (x86_64) Configured using: 'configure --prefix=3D/home/ah/emacs 'CC=3Dccache cc'' Configured features: XPM JPEG TIFF GIF PNG SOUND NOTIFY GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS LUCID X11 Important settings: value of $EMACSLOADPATH: :/home/ah/repos/pgqa/lisp/pgqa value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dlocal locale-coding-system: utf-8-unix Major mode: Messages Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-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 buffer-read-only: t column-number-mode: t line-number-mode: t global-visual-line-mode: t visual-line-mode: t transient-mark-mode: t Recent messages: Loading delsel...done For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: /home/ah/emacs/share/emacs/25.2/lisp/progmodes/ada-xref hides /home/ah/repo= s/elpa/packages/ada-mode/ada-xref /home/ah/emacs/share/emacs/25.2/lisp/progmodes/ada-stmt hides /home/ah/repo= s/elpa/packages/ada-mode/ada-stmt /home/ah/emacs/share/emacs/25.2/lisp/progmodes/ada-prj hides /home/ah/repos= /elpa/packages/ada-mode/ada-prj /home/ah/emacs/share/emacs/25.2/lisp/progmodes/ada-mode hides /home/ah/repo= s/elpa/packages/ada-mode/ada-mode /home/ah/repos/elpa/packages/ada-mode/ada-ref-man hides /home/ah/repos/elpa= /packages/ada-ref-man/ada-ref-man /home/ah/emacs/share/emacs/25.2/lisp/emacs-lisp/cl-generic hides /home/ah/r= epos/elpa/packages/cl-generic/cl-generic /home/ah/emacs/share/emacs/25.2/lisp/emacs-lisp/cl-lib hides /home/ah/repos= /elpa/packages/cl-lib/cl-lib /home/ah/emacs/share/emacs/25.2/lisp/obsolete/crisp hides /home/ah/repos/el= pa/packages/crisp/crisp /home/ah/emacs/share/emacs/25.2/lisp/obsolete/landmark hides /home/ah/repos= /elpa/packages/landmark/landmark /home/ah/emacs/share/emacs/25.2/lisp/net/pinentry hides /home/ah/repos/elpa= /packages/pinentry/pinentry /home/ah/emacs/share/emacs/25.2/lisp/emacs-lisp/seq hides /home/ah/repos/el= pa/packages/seq/seq /home/ah/repos/elpa/packages/all/all hides /home/ah/repos/elpa/packages/com= pany/test/all /home/ah/emacs/share/emacs/25.2/lisp/indent hides /home/ah/repos/elpa/packa= ges/js2-mode/tests/indent /home/ah/repos/elpa/packages/load-relative/test/install-pkgs hides /home/ah= /repos/elpa/packages/loc-changes/test/install-pkgs /home/ah/repos/elpa/packages/loc-changes/test/test-basic hides /home/ah/rep= os/elpa/packages/test-simple/test/test-basic Features: (shadow sort mail-extr warnings emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils cc-styles cc-align cc-engine cc-vars cc-defs windmove delsel cus-start cus-load go-mode-autoloads ggtags etags xref cl-seq project eieio eieio-core cl-macs compile comint ansi-color ring ewoc finder-inf package epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded 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 inotify dynamic-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 132187 8058) (symbols 48 24578 0) (miscs 40 57 129) (strings 32 28089 5577) (string-bytes 1 861163) (vectors 16 18787) (vector-slots 8 538382 3672) (floats 8 272 74) (intervals 56 204 0) (buffers 976 20) (heap 1024 37606 923)) --=20 Antonin Houska Cybertec Sch=C3=B6nig & Sch=C3=B6nig GmbH Gr=C3=B6hrm=C3=BChlgasse 26 A-2700 Wiener Neustadt Web: http://www.postgresql-support.de, http://www.cybertec.at --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=comment_extra_line.diff diff --git a/lisp/newcomment.el b/lisp/newcomment.el new file mode 100644 index 1af8929..75dbb07 *** a/lisp/newcomment.el --- b/lisp/newcomment.el *************** the region rather than at left margin." *** 1139,1144 **** --- 1139,1149 ---- ;; make the leading and trailing lines if requested (when lines + ;; Trim trailing whitespace from cs if there's some. + (let ((wp-pos (string-match "\\s-+$" cs))) + (if wp-pos + (setq cs (substring cs 0 wp-pos)))) + (let ((csce (comment-make-extra-lines cs ce ccs cce min-indent max-indent block))) *************** changed with `comment-style'." *** 1209,1215 **** (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") (<= (point) end)) (or block (not (string= "" comment-end))) ! (or block (progn (goto-char beg) (search-forward "\n" end t))))) ;; don't add end-markers just because the user asked for `block' (unless (or lines (string= "" comment-end)) (setq block nil)) --- 1214,1222 ---- (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") (<= (point) end)) (or block (not (string= "" comment-end))) ! (or block (progn (goto-char beg) (search-forward ! "\n" ! (min (1+ end) (point-max)) t))))) ;; don't add end-markers just because the user asked for `block' (unless (or lines (string= "" comment-end)) (setq block nil)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 14 12:11:15 2017 Received: (at 26049-done) by debbugs.gnu.org; 14 Mar 2017 16:11:15 +0000 Received: from localhost ([127.0.0.1]:55863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnp2Z-00061h-3a for submit@debbugs.gnu.org; Tue, 14 Mar 2017 12:11:15 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:49861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnp2X-00061Z-BL for 26049-done@debbugs.gnu.org; Tue, 14 Mar 2017 12:11:13 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F006121310; Tue, 14 Mar 2017 12:11:12 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Tue, 14 Mar 2017 12:11:12 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=NG7yMs0jYXv6rs4UYztbsCjNQCE=; b=JvtUNU kuFkXPgARm/2nLQeNGN9N0KvDUjzBsuBBFA0IYbW92eKbEfR1768DBnVHgF1Xz1P /zzGDAYhnfpsK66JOuBtuqePjD9mQs+cVUqfNbEDSePMIcsZI4k87MitqF4htKBP /KcO2QgVmOHCNuOONTgVyuGQmi1jAMCWYUvf8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=NG7yMs0jYXv6rs 4UYztbsCjNQCE=; b=p6cqFrGggwTJIwjt8WOWMBHnCezgKD35F7TMPBqc/ToHFU LujGV4l012p3iuDyX3StEZAEwcgGDuxLWXBLVS7nnjdxN/3bnynNPFrF2K4S8C+L Ww/KICmXslTPfTxx0FnlCr3WbZW1CRzLVTRGtxR7u5/Kz7VKbN5UTVZoNdV7U= X-ME-Sender: X-Sasl-enc: r0sA05Rml3VO0NbMqypVznt4k9N6AioFx6nxWR3f9q4y 1489507872 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id AEB017E430 for <26049-done@debbugs.gnu.org>; Tue, 14 Mar 2017 12:11:12 -0400 (EDT) Date: Tue, 14 Mar 2017 12:11:10 -0400 From: Leo Famulari To: 26049-done@debbugs.gnu.org Subject: Re: bug#26094: windowmaker 0.95.8 Message-ID: <20170314161110.GA1646@jasmine> References: <20170314062343.GA17598@jasmine> <87d1dkxoo8.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d1dkxoo8.fsf@elephly.net> User-Agent: Mutt/1.8.0 (2017-02-23) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 26049-done 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 (/) On Tue, Mar 14, 2017 at 09:12:07AM +0100, Ricardo Wurmus wrote: > > Leo Famulari writes: > > > From a314ef57f1aab9b32f3101ea51efef8424163893 Mon Sep 17 00:00:00 2001 > > From: Leo Famulari > > Date: Tue, 14 Mar 2017 02:12:53 -0400 > > Subject: [PATCH 1/2] gnu: windowmaker: Update to 0.95.8. > > > > * gnu/packages/gnustep.scm (windowmaker): Update to 0.95.8. > > LGTM! > > > * gnu/packages/gnustep.scm (windowmaker)[arguments]: Use modify-phases. > > This one also LGTM! Pushed master up to 962cbb24c5a9beea5c6bda0e7662bead7cb2c4ca From unknown Wed Jun 18 23:07:16 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: Did not alter fixed versions and reopened. Date: Tue, 14 Mar 2017 23:49:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # Did not alter fixed versions and reopened. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 27 23:28:24 2017 Received: (at 26049) by debbugs.gnu.org; 28 Mar 2017 03:28:24 +0000 Received: from localhost ([127.0.0.1]:48109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csho0-0005pB-1M for submit@debbugs.gnu.org; Mon, 27 Mar 2017 23:28:24 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:37171) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cshnx-0005ow-So for 26049@debbugs.gnu.org; Mon, 27 Mar 2017 23:28:22 -0400 Received: by mail-it0-f45.google.com with SMTP id 190so5318102itm.0 for <26049@debbugs.gnu.org>; Mon, 27 Mar 2017 20:28:21 -0700 (PDT) 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=cABvXy0nSjcBrBmVzD3tEq2J6ehjIOYAo5RkUN6nGPI=; b=Mm0ecTSSn9m+InhKua19lsPjHeHipB/BNZTs5fs8Jjq4xO21B9FW+w32e17FsyQyVR 4UojUhIeyys1hEDmZGNL8LAPTyfmR4kPX6l5xm/FJivjgB8xCzwPhOCInWMym24JdnOO w7yP+HTExN2KJXIWztaN8yG1BVYU8BDqX+2QJyn6/AGJ+C/J0DiwxokiuhXhRNqE7Q1E jeMj1aGX1S7YpA41AyajS9700zXE8zAxabtVuO1cdCbJPPNPdcb5fKc8zha/31NC7vrG ZXlxSopkdbciGpLq05jSBbYjH1+wDTVp69Gjgq8P20ZYEUcPFOayeMgRJ5yV7j+bI1LS npfA== 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=cABvXy0nSjcBrBmVzD3tEq2J6ehjIOYAo5RkUN6nGPI=; b=O8zrUsnasv8fZy8+YWZ3IRP9iqua76OREMjQlQpByB7dVicyyn0slaLxAJwTKTHZH5 qRIRlQo4aCTCOQJmK6KAFFExZXbpSarckHHCNiJLeqsYNxanLauJnWRLLty7Kc1zu1SL y+GTxJiCkkFAPiI5jgI5fif0iO+A6aGwizoRHySL4Yx5mpe1GZQTfgwX5RitvtW2Izqy RKIi88sxQT9hG6BMQSb0wAWSbyd/3xrt4O+nR7cO0L3h5JJrA+4tOVrdeh2xfpHBVbgF dyq5ZOj5FbH4qVPA2kM5i3Ed1FWBIbh0mtH4U/hdOYnCxZTlNLXtwPDoQKc5dBVwkJk2 N4IQ== X-Gm-Message-State: AFeK/H2RFeZyj70WnEYZgQQAMG8LGjMxQVc8UiwCkiYR9x39movCV8zf/Wjfk+BIA5cxtw== X-Received: by 10.36.205.194 with SMTP id l185mr13361209itg.87.1490671696156; Mon, 27 Mar 2017 20:28:16 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 189sm858885itx.25.2017.03.27.20.28.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Mar 2017 20:28:15 -0700 (PDT) From: npostavs@users.sourceforge.net To: Antonin Houska Subject: Re: bug#26049: 25.2; Extra lines not added to comment References: <29145.1489153275@localhost> Date: Mon, 27 Mar 2017 23:29:37 -0400 In-Reply-To: <29145.1489153275@localhost> (Antonin Houska's message of "Fri, 10 Mar 2017 14:41:15 +0100") Message-ID: <87r31i2i5a.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 26049 Cc: 26049@debbugs.gnu.org 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 (/) Antonin Houska writes: > Even though I have the following customizations in place > > '(comment-multi-line t) > '(comment-style (quote extra-line)) > > comment-region command produces this > > /* some comment */ > > rather than this > > /* > * some comment > */ > > Attached is a patch that I use to fix the issue on my workstation. Besides > fixing the (supposed) off-by-one error, the patch also removes trailing > whitespace from the initial line of the comment ("/* "). (My knowledge of > Elisp is not too advanced so I wonder if there's simpler way to trim > whitespace from a string.) > You can use use `string-trim-right' from subr-x. > (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") > (<= (point) end)) > (or block (not (string= "" comment-end))) > ! (or block (progn (goto-char beg) (search-forward > ! "\n" > ! (min (1+ end) (point-max)) t))))) Maybe (re-search-forward "$" end t) is better? It's a bit unclear to me what exactly all those tests are looking for. That code could use some comments... From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 28 08:52:34 2017 Received: (at 26049) by debbugs.gnu.org; 28 Mar 2017 12:52:34 +0000 Received: from localhost ([127.0.0.1]:48642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csqbx-0005sU-Qf for submit@debbugs.gnu.org; Tue, 28 Mar 2017 08:52:34 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:36526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csqbw-0005sH-Kv for 26049@debbugs.gnu.org; Tue, 28 Mar 2017 08:52:33 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 892AA45521; Tue, 28 Mar 2017 14:52:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id Jpyz9KQxlJfH; Tue, 28 Mar 2017 14:52:22 +0200 (CEST) From: Antonin Houska To: npostavs@users.sourceforge.net Subject: Re: bug#26049: 25.2; Extra lines not added to comment In-reply-to: <87r31i2i5a.fsf@users.sourceforge.net> References: <29145.1489153275@localhost> <87r31i2i5a.fsf@users.sourceforge.net> Comments: In-reply-to npostavs@users.sourceforge.net message dated "Mon, 27 Mar 2017 23:29:37 -0400." MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Tue, 28 Mar 2017 14:52:21 +0200 Message-ID: <7171.1490705541@localhost> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 26049 Cc: 26049@debbugs.gnu.org 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 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable npostavs@users.sourceforge.net wrote: > Antonin Houska writes: > > Even though I have the following customizations in place > > > > '(comment-multi-line t) > > '(comment-style (quote extra-line)) > > > > comment-region command produces this > > > > /* some comment */ > > > > rather than this > > > > /* > > * some comment > > */ > > > > Attached is a patch that I use to fix the issue on my workstation. Besi= des > > fixing the (supposed) off-by-one error, the patch also removes trailing > > whitespace from the initial line of the comment ("/* "). (My knowledge = of > > Elisp is not too advanced so I wonder if there's simpler way to trim > > whitespace from a string.) > > > You can use use `string-trim-right' from subr-x. Thanks. > > (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") > > (<=3D (point) end)) > > (or block (not (string=3D "" comment-end))) > > ! (or block (progn (goto-char beg) (search-forward > > ! "\n" > > ! (min (1+ end) (point-max= )) t))))) > Maybe (re-search-forward "$" end t) is better? It's a bit unclear to me > what exactly all those tests are looking for. That code could use some > comments... I've just verified your approach - it does work too. Yes, comments would be useful. For the test we're fixing now, the reason se= ems to be to ensure that the last line of the comment can be broken w/o affecti= ng the following (non-comment) text. Perhaps someone else might come up with better wording. New version of the patch is attached. --=20 Antonin Houska Cybertec Sch=C3=B6nig & Sch=C3=B6nig GmbH Gr=C3=B6hrm=C3=BChlgasse 26 A-2700 Wiener Neustadt Web: http://www.postgresql-support.de, http://www.cybertec.at --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=newcomment_v2.diff diff --git a/lisp/newcomment.el b/lisp/newcomment.el new file mode 100644 index 1af8929..f2d9735 *** a/lisp/newcomment.el --- b/lisp/newcomment.el *************** *** 69,74 **** --- 69,77 ---- ;;; Code: + (eval-when-compile + (require 'subr-x)) + ;;;###autoload (defalias 'indent-for-comment 'comment-indent) ;;;###autoload *************** the region rather than at left margin." *** 1139,1144 **** --- 1142,1150 ---- ;; make the leading and trailing lines if requested (when lines + ;; Trim trailing whitespace from cs if there's some. + (setq cs (string-trim cs)) + (let ((csce (comment-make-extra-lines cs ce ccs cce min-indent max-indent block))) *************** changed with `comment-style'." *** 1209,1215 **** (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") (<= (point) end)) (or block (not (string= "" comment-end))) ! (or block (progn (goto-char beg) (search-forward "\n" end t))))) ;; don't add end-markers just because the user asked for `block' (unless (or lines (string= "" comment-end)) (setq block nil)) --- 1215,1221 ---- (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") (<= (point) end)) (or block (not (string= "" comment-end))) ! (or block (progn (goto-char beg) (re-search-forward "$" end t))))) ;; don't add end-markers just because the user asked for `block' (unless (or lines (string= "" comment-end)) (setq block nil)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 28 22:24:10 2017 Received: (at 26049) by debbugs.gnu.org; 29 Mar 2017 02:24:10 +0000 Received: from localhost ([127.0.0.1]:49851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct3HN-0005pB-WF for submit@debbugs.gnu.org; Tue, 28 Mar 2017 22:24:10 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:36697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct3HM-0005oz-6G for 26049@debbugs.gnu.org; Tue, 28 Mar 2017 22:24:08 -0400 Received: by mail-it0-f43.google.com with SMTP id e75so78010441itd.1 for <26049@debbugs.gnu.org>; Tue, 28 Mar 2017 19:24:08 -0700 (PDT) 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=Y+z+ZmiYTzzJStsBHZ1IgAwBvFe721kGQw8qFPko6kE=; b=A52z5Saqjm0KEejiPJCznomR/I3gHWzZcNdnWbBsK5FygrynX9Cyzn2zHASYOUZ2uZ 8zOx+wEP7/J/1oVQ9x3FmPXhRkrtiXA7Ukrgx+CYgK/ykoivqC0M8DX4tO49Gorn4ien O5AnZG2Il1pEv1Wn7/fFq8zv3ZqJrQrsfEseLJ0nomOFJ+4GE1G6FU9Ar+7FHDXHhfOb qxPO7yDkAOoOEW/nbHQtY1yyfU1THAtg2ApFvJfiu/lYUVdAaqoC4/+cvrGNGCld9UmO 4uWtEUE1n58amMBZ95WImFmQjTGghDGYWHwzxak4thOFvimUPCXhFJMaVtiUmTutLr3Y /Z1Q== 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=Y+z+ZmiYTzzJStsBHZ1IgAwBvFe721kGQw8qFPko6kE=; b=t+QSqk917R47GxVjM9aerkilXrDVOpJtuq2m4F3znhRz7mHms+EQUrGKmfl0x7g/nx I/pXrsvbeL2D21C2VTf5UG4tDtVBMrem3HowPV8bpJ5VLSH91cJ10efjeeX91t0+xFZo FEUh5PNjz5wRsqiFikZkjARlpy0UzeZuwTXK0f0Scs0Twy1hg2rLUejdTePGiujOy0QE sZR4nA1faTLJPi/m8NYLdbtfq2YXdqKDPaE78RkdPt+P3LhZqr+KeMdQu1FEJrFGM4AV xFGeW7hfJtzPNP2wJHjCVLkHPbfgQlxkQwCx7zwytxypDU0aHhLtxoZxmcaHWiFveRaw wVaQ== X-Gm-Message-State: AFeK/H1aL7yv/ASrrAOJQiB4qPjcFsm42/l/W65mke80KrIee2kcoOmMl+DZDb3Z92hSEg== X-Received: by 10.36.124.139 with SMTP id a133mr20157849itd.84.1490754242460; Tue, 28 Mar 2017 19:24:02 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id p70sm3040513itg.0.2017.03.28.19.24.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Mar 2017 19:24:01 -0700 (PDT) From: npostavs@users.sourceforge.net To: Antonin Houska Subject: Re: bug#26049: 25.2; Extra lines not added to comment References: <29145.1489153275@localhost> <87r31i2i5a.fsf@users.sourceforge.net> <7171.1490705541@localhost> Date: Tue, 28 Mar 2017 22:25:23 -0400 In-Reply-To: <7171.1490705541@localhost> (Antonin Houska's message of "Tue, 28 Mar 2017 14:52:21 +0200") Message-ID: <87h92c3jl8.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 26049 Cc: 26049@debbugs.gnu.org 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 (/) Antonin Houska writes: > >> > (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") >> > (<= (point) end)) >> > (or block (not (string= "" comment-end))) >> > ! (or block (progn (goto-char beg) (search-forward >> > ! "\n" >> > ! (min (1+ end) (point-max)) t))))) > >> Maybe (re-search-forward "$" end t) is better? It's a bit unclear to me >> what exactly all those tests are looking for. That code could use some >> comments... > > I've just verified your approach - it does work too. "$" also matches at the end of buffer even if it doesn't end in newline (which is a very marginal corner case, I just happened to notice it because I didn't hit RET in my test buffer). > + ;; Trim trailing whitespace from cs if there's some. > + (setq cs (string-trim cs)) This would trim leading whitespace too, do we want that? From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 29 02:55:04 2017 Received: (at 26049) by debbugs.gnu.org; 29 Mar 2017 06:55:04 +0000 Received: from localhost ([127.0.0.1]:50004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct7VY-0005r7-Fq for submit@debbugs.gnu.org; Wed, 29 Mar 2017 02:55:04 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:37539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct7VX-0005qa-A4 for 26049@debbugs.gnu.org; Wed, 29 Mar 2017 02:55:03 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 3DB63456D3; Wed, 29 Mar 2017 08:54:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id p2RXZxYIi-Xo; Wed, 29 Mar 2017 08:54:55 +0200 (CEST) From: Antonin Houska To: npostavs@users.sourceforge.net Subject: Re: bug#26049: 25.2; Extra lines not added to comment In-reply-to: <87h92c3jl8.fsf@users.sourceforge.net> References: <29145.1489153275@localhost> <87r31i2i5a.fsf@users.sourceforge.net> <7171.1490705541@localhost> <87h92c3jl8.fsf@users.sourceforge.net> Comments: In-reply-to npostavs@users.sourceforge.net message dated "Tue, 28 Mar 2017 22:25:23 -0400." MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 29 Mar 2017 08:54:53 +0200 Message-ID: <20705.1490770493@localhost> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 26049 Cc: 26049@debbugs.gnu.org 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 (/) npostavs@users.sourceforge.net wrote: > Antonin Houska writes: > > > >> > (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") > >> > (<=3D (point) end)) > >> > (or block (not (string=3D "" comment-end))) > >> > ! (or block (progn (goto-char beg) (search-forward > >> > ! "\n" > >> > ! (min (1+ end) (point-= max)) t))))) > > > >> Maybe (re-search-forward "$" end t) is better? It's a bit unclear to = me > >> what exactly all those tests are looking for. That code could use some > >> comments... > > > > I've just verified your approach - it does work too. > "$" also matches at the end of buffer even if it doesn't end in newline > (which is a very marginal corner case, I just happened to notice it > because I didn't hit RET in my test buffer). IMO this is ok. If the 'extra-line value of `comment-style' tells that the comment should look like this /* * some comment */ it'd be kind of inconsistend if just a missing RET at the end of buffer resulted in this /* some comment */ which effectively means discrepancy from the customization setting. (The initial version of my patch ignored the `extra-line' setting in this special case, but it was a thinko rather than intention.) >=20 > > + ;; Trim trailing whitespace from cs if there's some. > > + (setq cs (string-trim cs)) >=20 > This would trim leading whitespace too, do we want that? I haven't noticed any related issue but yes, string-trim-right is more precise. If the (supposedly accidental) leading space should be removed from the value of `comment-start', it should probably happen elsewhere in the co= de because it's not specific to the 'extra-line style. --=20 Antonin Houska Cybertec Sch=C3=B6nig & Sch=C3=B6nig GmbH Gr=C3=B6hrm=C3=BChlgasse 26 A-2700 Wiener Neustadt Web: http://www.postgresql-support.de, http://www.cybertec.at From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 23 03:41:40 2017 Received: (at 26049) by debbugs.gnu.org; 23 Sep 2017 07:41:40 +0000 Received: from localhost ([127.0.0.1]:53466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvf4G-0006l4-Co for submit@debbugs.gnu.org; Sat, 23 Sep 2017 03:41:40 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:52930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvf4E-0006kp-44 for 26049@debbugs.gnu.org; Sat, 23 Sep 2017 03:41:38 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id D8F2B45CEB; Sat, 23 Sep 2017 09:41:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id wTByNH8fd4Ep; Sat, 23 Sep 2017 09:41:17 +0200 (CEST) From: Antonin Houska To: npostavs@users.sourceforge.net Subject: Re: bug#26049: 25.2; Extra lines not added to comment In-reply-to: <20705.1490770493@localhost> References: <29145.1489153275@localhost> <87r31i2i5a.fsf@users.sourceforge.net> <7171.1490705541@localhost> <87h92c3jl8.fsf@users.sourceforge.net> <20705.1490770493@localhost> Comments: In-reply-to Antonin Houska message dated "Wed, 29 Mar 2017 08:54:53 +0200." MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Sat, 23 Sep 2017 09:41:37 +0200 Message-ID: <17405.1506152497@localhost> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 26049 Cc: 26049@debbugs.gnu.org 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 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Antonin Houska wrote: > npostavs@users.sourceforge.net wrote: >=20 > > Antonin Houska writes: > > > > > >> > (progn (goto-char end) (end-of-line) (skip-syntax-backward "= ") > > >> > (<=3D (point) end)) > > >> > (or block (not (string=3D "" comment-end))) > > >> > ! (or block (progn (goto-char beg) (search-forward > > >> > ! "\n" > > >> > ! (min (1+ end) (poin= t-max)) t))))) > > > > > >> Maybe (re-search-forward "$" end t) is better? It's a bit unclear t= o me > > >> what exactly all those tests are looking for. That code could use s= ome > > >> comments... > > > > > > I've just verified your approach - it does work too. >=20 > > "$" also matches at the end of buffer even if it doesn't end in newline > > (which is a very marginal corner case, I just happened to notice it > > because I didn't hit RET in my test buffer). >=20 > IMO this is ok. If the 'extra-line value of `comment-style' tells that the > comment should look like this >=20 > /* > * some comment > */ >=20 > it'd be kind of inconsistend if just a missing RET at the end of buffer > resulted in this >=20 > /* some comment */ >=20 > which effectively means discrepancy from the customization setting. >=20 > (The initial version of my patch ignored the `extra-line' setting in this > special case, but it was a thinko rather than intention.) >=20 > >=20 > > > + ;; Trim trailing whitespace from cs if there's some. > > > + (setq cs (string-trim cs)) > >=20 > > This would trim leading whitespace too, do we want that? >=20 > I haven't noticed any related issue but yes, string-trim-right is more > precise. If the (supposedly accidental) leading space should be removed f= rom > the value of `comment-start', it should probably happen elsewhere in the = code > because it's not specific to the 'extra-line style. The next version of the patch (with string-trim replaced with string-trim-right) is below. Is there anything else I should do? --=20 Antonin Houska Cybertec Sch=C3=B6nig & Sch=C3=B6nig GmbH Gr=C3=B6hrm=C3=BChlgasse 26 A-2700 Wiener Neustadt Web: http://www.postgresql-support.de, http://www.cybertec.at --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=newcomment.diff diff --git a/lisp/newcomment.el b/lisp/newcomment.el new file mode 100644 index 1af8929..f2d9735 *** a/lisp/newcomment.el --- b/lisp/newcomment.el *************** *** 69,74 **** --- 69,77 ---- ;;; Code: + (eval-when-compile + (require 'subr-x)) + ;;;###autoload (defalias 'indent-for-comment 'comment-indent) ;;;###autoload *************** the region rather than at left margin." *** 1139,1144 **** --- 1142,1150 ---- ;; make the leading and trailing lines if requested (when lines + ;; Trim trailing whitespace from cs if there's some. + (setq cs (string-trim-right cs)) + (let ((csce (comment-make-extra-lines cs ce ccs cce min-indent max-indent block))) *************** changed with `comment-style'." *** 1209,1215 **** (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") (<= (point) end)) (or block (not (string= "" comment-end))) ! (or block (progn (goto-char beg) (search-forward "\n" end t))))) ;; don't add end-markers just because the user asked for `block' (unless (or lines (string= "" comment-end)) (setq block nil)) --- 1215,1221 ---- (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") (<= (point) end)) (or block (not (string= "" comment-end))) ! (or block (progn (goto-char beg) (re-search-forward "$" end t))))) ;; don't add end-markers just because the user asked for `block' (unless (or lines (string= "" comment-end)) (setq block nil)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 23 10:37:33 2017 Received: (at 26049) by debbugs.gnu.org; 23 Sep 2017 14:37:33 +0000 Received: from localhost ([127.0.0.1]:54706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvlYi-0002y8-Nh for submit@debbugs.gnu.org; Sat, 23 Sep 2017 10:37:32 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:49314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvlYg-0002xo-Rg; Sat, 23 Sep 2017 10:37:31 -0400 Received: by mail-io0-f181.google.com with SMTP id 21so6674594iof.6; Sat, 23 Sep 2017 07:37:30 -0700 (PDT) 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=dBKJwNxG4HAF1L6iKPDOkWsx8UICoP2ZvoRsEB+F7JM=; b=GOFuQ1+SP4tQlRrVQJvFq23eUWdlORG45lXMSysEb+/4vEHPA4Q6epbF/iqXSjePb1 PYyZfMCh2u6O3YjDyFsSlnBm8XBCO4+6HKTiaL0Sc3/E+Mevm9hlLjd0hKKBLRE2raIe RS20XtS7GUdaNhGycYllsvSBp+MxHigDpybF+S3QgG41rPSyBOlLXpAjTKDGNzRl+cL2 HiiUjOoSDlPgw5UwMA+VloWtOAbjfr64dmsWoN6NLo9XTOq1aMababyWwl/AonllhUBf 9t/LgV9JjH5Aw0vzpui4pEqUcp7PdiOL9XINgASsuSWyUklAbd+nQ3r7TcUCyKi8xdz7 zS7g== 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=dBKJwNxG4HAF1L6iKPDOkWsx8UICoP2ZvoRsEB+F7JM=; b=g1nbRG6OfQ1BUVw45dEvo3WSn7M0h/wTRUy4/DUBrHsnxCAvRTKMFinPv8f5J8+Bq8 e/5POdopQhMGBjaLAtbILQpZhvcUoOl8yZLIlaa/mrEO3BnrK9cz2lbfqPGTYpIfRT1s v8xEVorRdUPAcHMvJM4A2n0CXSZk7BJkM5EkBW+UoOfNOTskKcbrHeGzCaFxhsi0wdML Z+V8iel5UEwl+zv3YU5nZHwbLWak5tvQZqg3h9L3qviN2R85fTynrrqsV+b7NLiYD/xO Nr/Q/DV9jruAb1quOtJ57O++3s+rmZ5KO+svK1W+GNP8kJQjPENJiimwghcPIUDRwwC8 BI3w== X-Gm-Message-State: AHPjjUgIpI82nJA7Q8X3o/ZVp1JTX41C6692PI3uXSTpaSx5gHwEwuVg 1cWhWujfh3o1j/nfZreEt5mGoQ== X-Google-Smtp-Source: AOwi7QAiI/M2cLjYsnVzCh7hC4m9LrwTpZifAHG/uHQPuOF71Ug6hObhZf77wljt8lWZbcha4KKIGA== X-Received: by 10.107.146.197 with SMTP id u188mr3131308iod.44.1506177445069; Sat, 23 Sep 2017 07:37:25 -0700 (PDT) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id o185sm1031755ite.42.2017.09.23.07.37.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Sep 2017 07:37:24 -0700 (PDT) From: Noam Postavsky To: Antonin Houska Subject: Re: bug#26049: 25.2; Extra lines not added to comment References: <29145.1489153275@localhost> <87r31i2i5a.fsf@users.sourceforge.net> <7171.1490705541@localhost> <87h92c3jl8.fsf@users.sourceforge.net> <20705.1490770493@localhost> <17405.1506152497@localhost> Date: Sat, 23 Sep 2017 10:37:23 -0400 In-Reply-To: <17405.1506152497@localhost> (Antonin Houska's message of "Sat, 23 Sep 2017 09:41:37 +0200") Message-ID: <877ewpo50c.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 26049 Cc: 26049@debbugs.gnu.org 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: -2.1 (--) tags 26049 + patch quit Antonin Houska writes: > The next version of the patch (with string-trim replaced with > string-trim-right) is below. Is there anything else I should do? Could you please add a commit message (see CONTRIBUTE under "Commit messages" for conventions) and post a version produced via 'git format-patch' (that way I can grab the patch + commit message automagically). Have you assigned copyright for Emacs? (The patch is small enough to be applied regardless, but if not you should add "Copyright-paperwork-exempt: yes" to the commit message.) From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 06 05:14:03 2017 Received: (at 26049) by debbugs.gnu.org; 6 Nov 2017 10:14:03 +0000 Received: from localhost ([127.0.0.1]:53004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBePr-0006HQ-9e for submit@debbugs.gnu.org; Mon, 06 Nov 2017 05:14:03 -0500 Received: from mx2.mailbox.org ([80.241.60.215]:43458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBePo-0006Gl-GC for 26049@debbugs.gnu.org; Mon, 06 Nov 2017 05:14:01 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 274654CA19; Mon, 6 Nov 2017 11:13:52 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id OF3d4Vj0O8II; Mon, 6 Nov 2017 11:13:50 +0100 (CET) From: Antonin Houska To: Noam Postavsky Subject: Re: bug#26049: 25.2; Extra lines not added to comment In-reply-to: <877ewpo50c.fsf@users.sourceforge.net> References: <29145.1489153275@localhost> <87r31i2i5a.fsf@users.sourceforge.net> <7171.1490705541@localhost> <87h92c3jl8.fsf@users.sourceforge.net> <20705.1490770493@localhost> <17405.1506152497@localhost> <877ewpo50c.fsf@users.sourceforge.net> Comments: In-reply-to Noam Postavsky message dated "Sat, 23 Sep 2017 10:37:23 -0400." MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Mon, 06 Nov 2017 11:14:22 +0100 Message-ID: <7456.1509963262@localhost> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 26049 Cc: 26049@debbugs.gnu.org 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 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Noam Postavsky wrote: > tags 26049 + patch > quit >=20 > Antonin Houska writes: >=20 > > The next version of the patch (with string-trim replaced with > > string-trim-right) is below. Is there anything else I should do? >=20 > Could you please add a commit message (see CONTRIBUTE under "Commit > messages" for conventions) and post a version produced via 'git > format-patch' (that way I can grab the patch + commit message > automagically). See below. --=20 Antonin Houska Cybertec Sch=C3=B6nig & Sch=C3=B6nig GmbH Gr=C3=B6hrm=C3=BChlgasse 26 A-2700 Wiener Neustadt Web: http://www.postgresql-support.de, http://www.cybertec.at --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Handle-single-line-comments-correctly-Bug-26049.patch >From e782404ce76c05076b794e9506049d7ed4c55663 Mon Sep 17 00:00:00 2001 From: Antonin Houska Date: Mon, 6 Nov 2017 09:59:07 +0100 Subject: [PATCH] Handle single-line comments correctly (Bug#26049) * lisp/newcomment.el: the comment text had to contain at least one line break for the ending extra line to be added. The behavior seems more consistent if the end of the comment text is also considered a line break. While fixing this, also removed trailing white space from the comment initial line (/*). Copyright-paperwork-exempt: yes --- lisp/newcomment.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 2e644c3a99..950f3c85b4 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -69,6 +69,9 @@ ;;; Code: +(eval-when-compile + (require 'subr-x)) + ;;;###autoload (defalias 'indent-for-comment 'comment-indent) ;;;###autoload @@ -1141,6 +1144,9 @@ comment-region-internal ;; make the leading and trailing lines if requested (when lines + ;; Trim trailing whitespace from cs if there's some. + (setq cs (string-trim-right cs)) + (let ((csce (comment-make-extra-lines cs ce ccs cce min-indent max-indent block))) @@ -1211,7 +1217,7 @@ comment-region-default (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") (<= (point) end)) (or block (not (string= "" comment-end))) - (or block (progn (goto-char beg) (search-forward "\n" end t))))) + (or block (progn (goto-char beg) (re-search-forward "$" end t))))) ;; don't add end-markers just because the user asked for `block' (unless (or lines (string= "" comment-end)) (setq block nil)) -- 2.12.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 06 19:07:18 2017 Received: (at 26049) by debbugs.gnu.org; 7 Nov 2017 00:07:18 +0000 Received: from localhost ([127.0.0.1]:54901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBrQE-0000rE-6M for submit@debbugs.gnu.org; Mon, 06 Nov 2017 19:07:18 -0500 Received: from mail-io0-f169.google.com ([209.85.223.169]:46238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBrQB-0000qw-Cm; Mon, 06 Nov 2017 19:07:16 -0500 Received: by mail-io0-f169.google.com with SMTP id 101so297043ioj.3; Mon, 06 Nov 2017 16:07:15 -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=DCR0dIdvyVzzI1Nzy0K+qr0u6YkTzjacxoudVQD5kl0=; b=Pm77UAhSWTq/hp/HuIEZwzmAlAQAMdbvREHvigNG1BEIxvRLAf71ET7X6zH3VaVLw7 7vKji7AyjMAUkfjnNBkJ5D5BHZy6KNiBdxnrqOvJLUnsQySc1uXVOI8Nzi/CozIx+LcN VQrWz2zSfh/eu+dxoTrBccoULux580N7Xmj38EFK1aeT1HG80tr7LZ7PeVa0LZ5HsmXj It5+EFGVugmaRoP4CljhCx52JaxR5CxPdkUwt/JOIJcbZZCdH3SEpVdUVu7Ltykjz9/d K1f0UK79ZyCMYEEfUY3aeADwn0xQzWxwB/FTQIjrtytJQMumZNBraJ62Y0PD84/DHyMI Dx4g== 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=DCR0dIdvyVzzI1Nzy0K+qr0u6YkTzjacxoudVQD5kl0=; b=FFVBnDVptY4zU4U1Um+Jxu/8VFqOeoGJ0el1vymwaFg+5iSvGN3r5GGuQ+XZXQ4jR5 FQ0zvnezpTUFWxKwJi8lBR2xwYFMh/G6PALYER4Suc6p3gaLtoKbUJ6czKekZWKGQkx0 XNFXTdhB3VH5je36rBUpKFfq8Lb9NifbgscNJn0QPCdFNflYOePr8MWxL7cgzspiPVrD P1ABLLMhncoyeG/XEJosBRCyLfIEE9BKOmKXSns+GzIF2E8GFYrhU4DKqpzd1EOD5ucr qT51uT4Xvz2vwAli9aLdLa5gIInTHqCUq2YxUXHM/fCOkSRJa9UA/Hne8KWd0oUqiIe6 9gPg== X-Gm-Message-State: AJaThX6YG2m5iceomm3n118VFY6hXluRkXL/6yOZH9xkmy93THSe3Op6 X6R/+10oOheGRRACvgSvnVc/uA== X-Google-Smtp-Source: ABhQp+StPmq0VH32x+LOVaHYX08jGaSgW+jFltUHPA1E1pwZbxCDpi5hn0I4CKP+KUJEF/6P1vULNA== X-Received: by 10.107.58.67 with SMTP id h64mr22054665ioa.112.1510013229524; Mon, 06 Nov 2017 16:07:09 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id m141sm111669itm.12.2017.11.06.16.07.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2017 16:07:08 -0800 (PST) From: Noam Postavsky To: Antonin Houska Subject: Re: bug#26049: 25.2; Extra lines not added to comment References: <29145.1489153275@localhost> <87r31i2i5a.fsf@users.sourceforge.net> <7171.1490705541@localhost> <87h92c3jl8.fsf@users.sourceforge.net> <20705.1490770493@localhost> <17405.1506152497@localhost> <877ewpo50c.fsf@users.sourceforge.net> <7456.1509963262@localhost> Date: Mon, 06 Nov 2017 19:07:07 -0500 In-Reply-To: <7456.1509963262@localhost> (Antonin Houska's message of "Mon, 06 Nov 2017 11:14:22 +0100") Message-ID: <87zi7z54us.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 26049 Cc: 26049@debbugs.gnu.org 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: -2.1 (--) tags 26049 fixed close 26049 26.1 quit Antonin Houska writes: > Subject: [PATCH] Handle single-line comments correctly (Bug#26049) > > * lisp/newcomment.el: the comment text had to contain at least one > line break for the ending extra line to be added. The behavior seems > more consistent if the end of the comment text is also considered a > line break. > > While fixing this, also removed trailing white space from the comment > initial line (/*). > > Copyright-paperwork-exempt: yes Thanks, I rephrased/reformatted the message a bit and pushed to emacs-26. [1: db949166ec]: 2017-11-06 19:01:19 -0500 Handle single-line comments correctly (Bug#26049) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=db949166ecb9aeaa15aa41369a55b3ea6ceaa3b0 From unknown Wed Jun 18 23:07:16 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 05 Dec 2017 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator