From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.bugs Subject: bug#6806: another reason for the patch Date: Tue, 17 Jan 2017 21:56:18 -0700 Message-ID: <874m0xhsp9.fsf@tromey.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1484715441 14813 195.159.176.226 (18 Jan 2017 04:57:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 18 Jan 2017 04:57:21 +0000 (UTC) To: 6806@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 18 05:57:16 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 1cTiJ1-0002ln-Io for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Jan 2017 05:57:07 +0100 Original-Received: from localhost ([::1]:39249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTiJ6-00036s-82 for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Jan 2017 23:57:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTiIz-00036l-8A for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 23:57:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTiIw-0007yE-54 for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 23:57:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36055) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cTiIw-0007y5-1B for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 23:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cTiIv-0004IL-P8 for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 23:57:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Tom Tromey Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jan 2017 04:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6806 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6806-submit@debbugs.gnu.org id=B6806.148471540116474 (code B ref 6806); Wed, 18 Jan 2017 04:57:01 +0000 Original-Received: (at 6806) by debbugs.gnu.org; 18 Jan 2017 04:56:41 +0000 Original-Received: from localhost ([127.0.0.1]:34254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTiIb-0004He-CE for submit@debbugs.gnu.org; Tue, 17 Jan 2017 23:56:41 -0500 Original-Received: from gproxy6-pub.mail.unifiedlayer.com ([67.222.39.168]:41083) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1cTiIZ-0004HO-5F for 6806@debbugs.gnu.org; Tue, 17 Jan 2017 23:56:39 -0500 Original-Received: (qmail 4232 invoked by uid 0); 18 Jan 2017 04:56:24 -0000 Original-Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy6.mail.unifiedlayer.com with SMTP; 18 Jan 2017 04:56:24 -0000 Original-Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id ZgwK1u00K2f2jeq01gwNlw; Tue, 17 Jan 2017 21:56:24 -0700 X-Authority-Analysis: v=2.1 cv=JsBi8qIC c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IgFoBzBjUZAA:10 a=mDV3o1hIAAAA:8 a=ef2z-JSiy3HnivcjHRMA:9 a=zstS-IiYAAAA:8 a=GdCdrrut13jPOpArN2cA:9 a=_FVE-zBwftR9WsbkzFJk:22 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc: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=nsMuxiaAzlkSn7F4mvjxcJCkRt3qG8gf3w5te13gnMY=; b=Ui0dWKeaATciplC4sj/uFgQ2Sm k+3RsxeEQfcdV6yLAX2jAZjCEsx5mkOMv3mEaEs3OYFdFjIIpnAfhoEFzjNyGMXzf4MOvHxtuAyd/ XgVbZjbbKM2lSv5V8gFif0tx3; Original-Received: from 174-16-146-181.hlrn.qwest.net ([174.16.146.181]:35972 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1cTiIF-0005Zi-LC; Tue, 17 Jan 2017 21:56:19 -0700 X-Attribution: Tom X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box522.bluehost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.146.181 X-Exim-ID: 1cTiIF-0005Zi-LC X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-146-181.hlrn.qwest.net (bapiya) [174.16.146.181]:35972 X-Source-Auth: tom+tromey.com X-Email-Count: 9 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== 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:128196 Archived-At: --=-=-= Content-Type: text/plain Hi. I'd like to resurrect this bug. While working in JS I found a bug, which I tracked down to the same change indicated here. Basically, auto-fill in JS mode will sometimes insert a "/*" on a filled line, where it should not. You can see a precise recipe in the new test case, in the attached patch. One funny thing is that if you do this interactively (in my real-world case I had auto-fill-mode enabled), you have to be sure that there isn't a newline after point. If there is a newline, the filling works properly. Anyway, let me know what you think. I'd like to check this in, but, given the comments in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=6806#23 I suppose I would not close the bug. Tom --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=P Content-Description: the patch commit 5a615aeae34a257a1879134a883c61bc42f41691 Author: Tom Tromey Date: Tue Jan 17 21:50:14 2017 -0700 Set comment-multi-line in js-mode Bug#6806: * lisp/progmodes/js.el (js-mode): Set comment-multi-line to t. * test/lisp/progmodes/js-tests.el (js-mode-auto-fill): New test. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 2e5c6ae..cfd58d2 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3852,6 +3852,7 @@ js-mode comment-start-skip "\\(//+\\|/\\*+\\)\\s *") (setq-local comment-line-break-function #'c-indent-new-comment-line) (setq-local c-block-comment-start-regexp "/\\*") + (setq-local comment-multi-line t) (setq-local electric-indent-chars (append "{}():;," electric-indent-chars)) ;FIXME: js2-mode adds "[]*". diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index 84749ef..7cb737c 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -85,6 +85,20 @@ (should (= (current-column) x)) (forward-line)))) +(ert-deftest js-mode-auto-fill () + (with-temp-buffer + (js-mode) + (setq fill-column 70) + (insert "/* ") + (dotimes (_ 16) + (insert "test ")) + (do-auto-fill) + ;; The bug is that, after auto-fill, the second line starts with + ;; "/*", whereas it should start with " * ". + (goto-char (point-min)) + (forward-line) + (should (looking-at " \\* test")))) + (provide 'js-tests) ;;; js-tests.el ends here --=-=-=--