From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#26049: 25.2; Extra lines not added to comment Date: Mon, 27 Mar 2017 23:29:37 -0400 Message-ID: <87r31i2i5a.fsf@users.sourceforge.net> References: <29145.1489153275@localhost> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1490671757 25746 195.159.176.226 (28 Mar 2017 03:29:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Mar 2017 03:29:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 26049@debbugs.gnu.org To: Antonin Houska Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 28 05:29:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cshog-0005bH-UO for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Mar 2017 05:29:07 +0200 Original-Received: from localhost ([::1]:49768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cshol-0004xe-Ck for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Mar 2017 23:29:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cshof-0004xX-Mr for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 23:29:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cshoc-0008Ur-KL for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 23:29:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49910) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cshoc-0008Un-FZ for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 23:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cshoc-0005q5-AY for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2017 23:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Mar 2017 03:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26049 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26049-submit@debbugs.gnu.org id=B26049.149067170422397 (code B ref 26049); Tue, 28 Mar 2017 03:29:02 +0000 Original-Received: (at 26049) by debbugs.gnu.org; 28 Mar 2017 03:28:24 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <29145.1489153275@localhost> (Antonin Houska's message of "Fri, 10 Mar 2017 14:41:15 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131027 Archived-At: 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...