From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27403: 26.0.50; Indentation misalignment with Unicode code points >65535 Date: Sat, 17 Jun 2017 11:05:19 +0300 Message-ID: <83tw3fyr7k.fsf@gnu.org> References: <5bd704e4-b3e4-bcd3-eea6-66856fc47dd6@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1497686779 4661 195.159.176.226 (17 Jun 2017 08:06:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Jun 2017 08:06:19 +0000 (UTC) Cc: 27403@debbugs.gnu.org To: Adam Niederer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 17 10:06:15 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 1dM8kI-0000vm-7W for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Jun 2017 10:06:14 +0200 Original-Received: from localhost ([::1]:33744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dM8kN-0004oY-6a for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Jun 2017 04:06:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dM8k9-0004mj-Dj for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 04:06:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dM8k6-0007tf-8b for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 04:06:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dM8k5-0007t2-T1 for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 04:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dM8k5-0001l5-M2 for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2017 04:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Jun 2017 08:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27403 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27403-submit@debbugs.gnu.org id=B27403.14976867476739 (code B ref 27403); Sat, 17 Jun 2017 08:06:01 +0000 Original-Received: (at 27403) by debbugs.gnu.org; 17 Jun 2017 08:05:47 +0000 Original-Received: from localhost ([127.0.0.1]:52044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dM8jr-0001kd-Ao for submit@debbugs.gnu.org; Sat, 17 Jun 2017 04:05:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dM8jp-0001kQ-Na for 27403@debbugs.gnu.org; Sat, 17 Jun 2017 04:05:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dM8jh-0007Ve-FE for 27403@debbugs.gnu.org; Sat, 17 Jun 2017 04:05:40 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dM8jh-0007VM-Bk; Sat, 17 Jun 2017 04:05:37 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1336 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dM8jg-0000s4-MG; Sat, 17 Jun 2017 04:05:37 -0400 In-reply-to: <5bd704e4-b3e4-bcd3-eea6-66856fc47dd6@gmail.com> (message from Adam Niederer on Sat, 17 Jun 2017 02:28:41 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:133683 Archived-At: > From: Adam Niederer > Date: Sat, 17 Jun 2017 02:28:41 -0400 > > Hello, I believe I've found an indentation issue. To reproduce, start > emacs, create a buffer in js-mode, paste in this code, and press C-x h > TAB to indent the buffer: > > let x = /* 👍 */ { foo: 0 > bar: 0 } > > let x = /* ☺ */ { foo: 0 > bar: 0 } > > Both 25.2 and 26.0.50 add one extra space before "bar" in the first > first snippet with U+1F44D THUMBS UP SIGN in the comment, whereas the > second snippet with U+263A WHITE SMILING FACE properly aligns "bar" with > "foo". That's because U+1F44D is a double-width character: (char-width ?👍) => 2 while U+263A is not double-width. So as long as indentation works in columns and not in pixels, this is a "feature". > This appears to happen whenever the character in the comment needs a > surrogate pair. I don't believe surrogates have anything to do with this, since Emacs works with Unicode codepoints, not their UTF-16 encodings. > Interestingly, pressing TAB with one's point on the second line of each > snippet to dedent the line yields a correct result for both symbols: > > "👍", {"a": 2, > "b": 3} > > "☺", {"a":2, > "b":3} Which is probably a subtle bug: this should behave like the first snippet. Thanks.