From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.bugs Subject: bug#19946: 24.4; js-mode, indentation Date: Sun, 20 Mar 2016 17:08:26 -0700 Message-ID: <56EF3B7A.6050807@dancol.org> References: <1424858977.3139392.232164745.05CFB51D@webmail.messagingengine.com> <87r3f6unew.fsf@gmail.com> <6420dbed-587e-87e1-e167-73359a65bf6b@yandex.ru> <1458500460.1739128.554550090.7C772DCA@webmail.messagingengine.com> <008e3b7c-4867-ce5b-153c-83ea3a31030d@yandex.ru> <1458503264.1747260.554579266.3BC0CBEA@webmail.messagingengine.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HSJtVlaph4HWcigxAMRa6aSOskmU9S5q9" X-Trace: ger.gmane.org 1458518964 1160 80.91.229.3 (21 Mar 2016 00:09:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Mar 2016 00:09:24 +0000 (UTC) Cc: Alan Mackenzie , 19946@debbugs.gnu.org, dan.colascione@gmail.com To: Dmitry Gutov , jostein@kjonigsen.net, Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 21 01:09:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ahnPF-000054-3M for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Mar 2016 01:09:13 +0100 Original-Received: from localhost ([::1]:54899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahnPB-0002fO-1j for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Mar 2016 20:09:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahnP7-0002eq-Dl for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2016 20:09:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahnP4-0006Y3-6x for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2016 20:09:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahnP4-0006Xx-0I for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2016 20:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ahnP3-0005O6-O6 for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2016 20:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Colascione Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2016 00:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19946 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19946-submit@debbugs.gnu.org id=B19946.145851892020668 (code B ref 19946); Mon, 21 Mar 2016 00:09:01 +0000 Original-Received: (at 19946) by debbugs.gnu.org; 21 Mar 2016 00:08:40 +0000 Original-Received: from localhost ([127.0.0.1]:55992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ahnOi-0005NI-Et for submit@debbugs.gnu.org; Sun, 20 Mar 2016 20:08:40 -0400 Original-Received: from dancol.org ([96.126.100.184]:40654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ahnOg-0005NA-H8 for 19946@debbugs.gnu.org; Sun, 20 Mar 2016 20:08:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject; bh=S45N8av4Og6+eCwWE+3I2VLtw3C8LjClHVx+gs4rUNY=; b=c8j8Ep3eJLso55x/D615Zid5PY5PmZI9exEsveywxdz4OpD1W2jIXNFOEU2CA1m1aPniPzDWDA6qtL3aaGOnNpnY2J1efwibdl+ZSpkoq4IMyvI5guOzonPuTv4NhSLOKkRRHzr6IJSHFjWeD6ugv+jthOye7VcY5yHbVp8Z9fThvzK+puLRNUnxHiHkjHAO5rZLHez2sHQ+/bJKJdrH/wPkvsHVPJfTXk/x7ih1FjEooAtuhJLh2JcoLiXBsgZEFc7LJksm0s8caIx+uDbweA3MimRRrf9wqRzZ6KwujLq2XORYwLchpgel1KVKmrdw8BxaPyrYvgrfh2i5OtRUiQ==; Original-Received: from [2620:10d:c090:180::2ef5] (helo=[IPv6:2620:10d:c081:1110:8000::23a6]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1ahnOc-0001Xo-25; Sun, 20 Mar 2016 17:08:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115198 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HSJtVlaph4HWcigxAMRa6aSOskmU9S5q9 Content-Type: multipart/mixed; boundary="4r1RecNltXrl2QTFPSTakhAVEKUd8cgIw" From: Daniel Colascione To: Dmitry Gutov , jostein@kjonigsen.net, =?UTF-8?Q?Simen_Heggest=c3=b8yl?= Cc: 19946@debbugs.gnu.org, dan.colascione@gmail.com, Alan Mackenzie Message-ID: <56EF3B7A.6050807@dancol.org> Subject: Re: bug#19946: 24.4; js-mode, indentation References: <1424858977.3139392.232164745.05CFB51D@webmail.messagingengine.com> <87r3f6unew.fsf@gmail.com> <6420dbed-587e-87e1-e167-73359a65bf6b@yandex.ru> <1458500460.1739128.554550090.7C772DCA@webmail.messagingengine.com> <008e3b7c-4867-ce5b-153c-83ea3a31030d@yandex.ru> <1458503264.1747260.554579266.3BC0CBEA@webmail.messagingengine.com> In-Reply-To: --4r1RecNltXrl2QTFPSTakhAVEKUd8cgIw Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 03/20/2016 12:49 PM, Dmitry Gutov wrote: > On 03/20/2016 09:47 PM, Jostein Kj=F8nigsen wrote: >=20 >>> diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el >>> index 15a52ba..dffdb77 100644 >>> --- a/lisp/progmodes/js.el >>> +++ b/lisp/progmodes/js.el >>> @@ -578,6 +578,7 @@ js-mode-syntax-table >>> (c-populate-syntax-table table) >>> (modify-syntax-entry ?$ "_" table) >>> (modify-syntax-entry ?` "\"" table) >>> + (modify-syntax-entry ?\C-M " " table) >>> table) >>> "Syntax table for `js-mode'.") >>> >> >> That works for me, at least in js-mode. >> >> While not a general solution to all weird files one might encounter >> while working in Emacs, it at least makes js-files behave as expected.= >> And in a fairly reusable manner too: I can copy this code and I'm home= >> free. >> >> Would pushing this up to cc-mode's c-populate-syntax-table function al= so >> be considered an option? Or does that just sound on overall way too >> risky? >=20 > I don't see any problem there, but that's up to Alan. It don't have any problem teaching specific modes about carriage returns, but this approach doesn't scale. A better approach, I think, would be to extend something like ws-butler for dealing with mixed-line-ending files. On load, we'd transform `\r\n' -> `\n', but *remember* which `\n's represent `\r\n` and perform the reverse translation when writing. This way, you'd preserve clowny extra carriage returns from other people, but see a clean, unified view in Emacs. --4r1RecNltXrl2QTFPSTakhAVEKUd8cgIw-- --HSJtVlaph4HWcigxAMRa6aSOskmU9S5q9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJW7zt6AAoJEN4WImmbpWBlzF4P/iNLFQQNiRE61Wr2/eAkxPkQ GEjFjRPzpxb+1obsq9xAlzawAHpq/CqJ0Az45mMKZQQmAlOIAxZFtXtJSAy5hOKu 5rVkIKch7QfOrZ6/FHa/svHHrO/bV8TO1ss3EizRzyrEgPay0l8OyLdwe0vWsi3s 7b2uGgr5Ez1+n9zuYwFibxPH0kvId8tayKV/OjdVUmL/HcKoXDtyUbt8znWyAuQF a0VBwLkgn+fW1dqnMXWk1OOiG0hOjQah7Kw2gfCodVGEoUeWaU6bBbNY9CgzmEuR u6u8JKmHosmyGTv54WmHk/S7p289O8lITrsNrxuPBMDJEtXebWYKac7uyBJDXrxr wlBQIori/tl1Tsl5pP1wJCVa/KUpitnBMxVrylZOj+tew3p1x/D21S6vVkSiOYyv n8K/yZ8vMeomrg5ol/kpK3u9j91b1PivjZy4jAXEnUgBxWVBQjTHz3GUtahpQLSF ulKL3Nfr3GHwmY5HudCbOIZ6Rn+pVHo+c09SUyOCzYMG+4sqfpOMmgpr1oRBCszb PIlbfN6pkXE5tLRTyhHNw67h0e3C6dp4Ie16+tNPnRNnYod6rglgzsTRmotaPUdd uFpeX7Q2XoBfK8XHX8ybGm3D/USndpRFh8HdHGBwIVLsv8EGGt8tlBNoyBfm1CF1 lNo6hs7s8CDmHiS1DP8w =JmjZ -----END PGP SIGNATURE----- --HSJtVlaph4HWcigxAMRa6aSOskmU9S5q9--