From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Allow inserting non-BMP characters Date: Fri, 29 Dec 2017 22:27:09 +0200 Message-ID: <83incpfffm.fsf@gnu.org> References: <20171225210115.13789-1-phst@google.com> <83d132hz9e.fsf@gnu.org> <834lodii55.fsf@gnu.org> <83zi65grxv.fsf@gnu.org> <20171226213642.GB82103@breton.holly.idiocy.org> <83shbwhm70.fsf@gnu.org> <20171228113820.GA83324@breton.holly.idiocy.org> <834loahl4j.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1514579180 17475 195.159.176.226 (29 Dec 2017 20:26:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 29 Dec 2017 20:26:20 +0000 (UTC) Cc: phst@google.com, alan@idiocy.org, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 29 21:26:15 2017 Return-path: Envelope-to: ged-emacs-devel@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 1eV1EJ-0003zH-FN for ged-emacs-devel@m.gmane.org; Fri, 29 Dec 2017 21:26:11 +0100 Original-Received: from localhost ([::1]:53652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eV1GI-0007dc-E1 for ged-emacs-devel@m.gmane.org; Fri, 29 Dec 2017 15:28:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eV1FZ-0007dQ-9U for emacs-devel@gnu.org; Fri, 29 Dec 2017 15:27:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eV1FW-0005Rk-Kw for emacs-devel@gnu.org; Fri, 29 Dec 2017 15:27:29 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eV1FW-0005RE-HY; Fri, 29 Dec 2017 15:27:26 -0500 Original-Received: from [176.228.60.248] (port=3607 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eV1FV-0003CE-Oz; Fri, 29 Dec 2017 15:27:26 -0500 In-reply-to: (message from Philipp Stephani on Fri, 29 Dec 2017 20:14:41 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221458 Archived-At: > From: Philipp Stephani > Date: Fri, 29 Dec 2017 20:14:41 +0000 > Cc: alan@idiocy.org, phst@google.com, emacs-devel@gnu.org > > diff --git a/src/coding.c b/src/coding.c > index 1705838ffa..9903d87b92 100644 > --- a/src/coding.c > +++ b/src/coding.c > @@ -1515,13 +1515,6 @@ encode_coding_utf_8 (struct coding_system *coding) > /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". > Return true if a text is encoded in one of UTF-16 based coding systems. */ > > -#define UTF_16_HIGH_SURROGATE_P(val) \ > - (((val) & 0xFC00) == 0xD800) > - > -#define UTF_16_LOW_SURROGATE_P(val) \ > - (((val) & 0xFC00) == 0xDC00) > - > - > static bool > detect_coding_utf_16 (struct coding_system *coding, > struct coding_detection_info *detect_info) > @@ -1686,7 +1679,7 @@ decode_coding_utf_16 (struct coding_system *coding) > > if (surrogate) > { > - if (! UTF_16_LOW_SURROGATE_P (c)) > + if (! char_low_surrogate_p (c)) Please don't. This makes decoding UTF-16 a tad slower for no good reason (more than a tad in unoptimized builds). (Why can't you just accept what I'm saying? Don't my position and my experience mean anything to you?)