From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Antonin Houska Newsgroups: gmane.emacs.bugs Subject: bug#26049: 25.2; Extra lines not added to comment Date: Fri, 10 Mar 2017 14:41:15 +0100 Message-ID: <29145.1489153275@localhost> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1489161923 22279 195.159.176.226 (10 Mar 2017 16:05:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Mar 2017 16:05:23 +0000 (UTC) To: 26049@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 10 17:05:18 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 1cmN2U-0004TO-HO for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Mar 2017 17:05:11 +0100 Original-Received: from localhost ([::1]:39702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmN2a-0005LZ-3f for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Mar 2017 11:05:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmN2R-0005K4-7N for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2017 11:05:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmN2N-00015B-6W for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2017 11:05:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmN2N-00014y-24 for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2017 11:05:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cmN2M-0002cf-Ex for bug-gnu-emacs@gnu.org; Fri, 10 Mar 2017 11:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Antonin Houska Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Mar 2017 16:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26049 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148916190110069 (code B ref -1); Fri, 10 Mar 2017 16:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Mar 2017 16:05:01 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) 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-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 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:130439 Archived-At: --=-=-= 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)) --=-=-=--