From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: HaiJun Zhang Newsgroups: gmane.emacs.bugs Subject: bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method Date: Thu, 19 Dec 2019 10:05:59 +0800 Message-ID: References: <20191217202837.GA18094@breton.holly.idiocy.org> <20191218204422.GA22550@breton.holly.idiocy.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="5dfadb0d_5072367_191" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="223103"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 23412@debbugs.gnu.org To: Alan Third , tsuucat Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 19 03:07:17 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ihlDg-000vuW-U3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Dec 2019 03:07:17 +0100 Original-Received: from localhost ([::1]:34992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihlDf-00070v-4O for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Dec 2019 21:07:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59630) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihlDV-00070l-27 for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 21:07:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihlDT-0008LH-R2 for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 21:07:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihlDS-0008IS-KW for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 21:07:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ihlDS-0003Xt-EZ for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2019 21:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: HaiJun Zhang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Dec 2019 02:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23412 X-GNU-PR-Package: emacs Original-Received: via spool by 23412-submit@debbugs.gnu.org id=B23412.157672118213582 (code B ref 23412); Thu, 19 Dec 2019 02:07:02 +0000 Original-Received: (at 23412) by debbugs.gnu.org; 19 Dec 2019 02:06:22 +0000 Original-Received: from localhost ([127.0.0.1]:44161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ihlCo-0003X0-5l for submit@debbugs.gnu.org; Wed, 18 Dec 2019 21:06:22 -0500 Original-Received: from mail-oln040092255080.outbound.protection.outlook.com ([40.92.255.80]:26593 helo=APC01-HK2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ihlCj-0003Wg-KR for 23412@debbugs.gnu.org; Wed, 18 Dec 2019 21:06:21 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W60+uA71TmOpWhZ6Y4AEwVsJJDFgrlfwnJLtfliBjNlWRJCTokbShuqSPZOM9M1eX14MIiAoypz2sg5D1UMBmVPEH8SPrjSAJeaRz8KXfPg02pJhNducQI74CO+YodKRsOEL15qGGE2stCu22dfsAX2F1/QaIMrw1tBPyBpDSPHnYrYpbunY1eDtd1OXRQEuzD9mGOr2Tekiu2buCArg3IlmkEeuq7LLennI6U4/XFU/+/KhfHNdZjeo6cTfuSVe2f1/QMaFropz1XyUdlXv2kvhY5HsWJpYHPqa+ByD9sV2CiNZrRyCkrtbDaoj24IeMVtHv9u/tstyYy6y7949wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rbFprsZIm2ZYRxhRLcPL+30LiE+iVAjWk5Q4enZarqk=; b=Gj4FTN8ay5rCIvUU4uVYyUH4PmkOntAkYvgqcSHAlj4mBdEJwpi8m9WsiHLRV72X9oNFS4A9k4GjRcvpbejuglYFQyhl16301LPRQc2H8rYl/rOfdIIdi6a2d1Bl9NbQHiUoiPcAhYqgSy7CD7CCR/Xaa4HI44F+seqX1Zqze/Z8suZTPo73ooUGp8SCbcgopZA7Y5XSbuVALb9HcgbE7AEeDbqXiw+IwRWI8jhwHv0LxmxTJriEb951/vKzXBM2u0IC1tTsOwxtRBEQwXDjOgEx3IYtX17ChK2y6Bdihl/RMgPts1P+k69kC5QQW6izo66p17GwyE03y1VnzKc1zQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rbFprsZIm2ZYRxhRLcPL+30LiE+iVAjWk5Q4enZarqk=; b=Ysfn+1p7L4yvKnf5JlxaKfx9OSaSYNSWXvElxJywHIgwExHuXpXFDNlhKbYNq6UYLdQa07MWdUbvEqq1t0ZJpM6NqKVnhbxcfithP+QrG3k+Dn1cU7jTDfIizfxQy2wkZPLv9QAFNJomKN4JQ3slHrO1pDLNVBGr8+ckz911ZVEzIdx7X3jTP4g8yPsRbGD8rQw403WBhdY0XGYyqQpbRExliaQBqOXQ0ZLaL/Zk2S918dJkWnlW0a3/Uj3D/NlPeFLJJl5XWhN+sU52kDOVuI7xrvhGhnO2MTaSO44Sk+XeXDlJNLAfENL44l3YuuHB1h96YSRJ1n3BVHCWZ9KnNg== Original-Received: from SG2APC01FT017.eop-APC01.prod.protection.outlook.com (10.152.250.60) by SG2APC01HT071.eop-APC01.prod.protection.outlook.com (10.152.251.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14; Thu, 19 Dec 2019 02:06:08 +0000 Original-Received: from PS1PR03MB3606.apcprd03.prod.outlook.com (10.152.250.53) by SG2APC01FT017.mail.protection.outlook.com (10.152.250.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14 via Frontend Transport; Thu, 19 Dec 2019 02:06:08 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:EEF6704D82C9477E08604A6198E00A46590702A26FB0E87DDBE621A30B4D3B8C; UpperCasedChecksum:D29FA1D28AC4CAC8DA31FDEE08BF8E78614BAC5983EDB3898A134C708AA8C2AF; SizeAsReceived:8972; Count:48 Original-Received: from PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b05a:28e4:205a:d7d4]) by PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b05a:28e4:205a:d7d4%5]) with mapi id 15.20.2559.012; Thu, 19 Dec 2019 02:06:08 +0000 In-Reply-To: X-Readdle-Message-ID: 1ac1382a-e068-4992-9130-b2d06e2fa6f6@Spark X-ClientProxiedBy: HK0PR01CA0060.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::24) To PS1PR03MB3606.apcprd03.prod.outlook.com (2603:1096:803:4e::17) X-Microsoft-Original-Message-ID: <1ac1382a-e068-4992-9130-b2d06e2fa6f6@Spark> Original-Received: from [192.168.1.103] (1.193.168.19) by HK0PR01CA0060.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=) via Frontend Transport; Thu, 19 Dec 2019 02:06:07 +0000 X-Readdle-Message-ID: 1ac1382a-e068-4992-9130-b2d06e2fa6f6@Spark X-Microsoft-Original-Message-ID: <1ac1382a-e068-4992-9130-b2d06e2fa6f6@Spark> X-TMN: [BMCgAonzvt86cf4t4+7RkODSMNfNFYBl] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: abaa0f36-647c-4dd8-e8eb-08d78428033b X-MS-TrafficTypeDiagnostic: SG2APC01HT071: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rzRxwKIcZNWL10tNJLQb5TPUQfDaAKWb6SA9Udx1cxrqPKL7yy7ruJvmFYTT/LupSMA580NLIvms4MyrVuRKzV0MBl7193Hz6dnYlxOXUlRMNaB2n1oJhR7DIg2B6jTvn0VOHOnKjdwImbOigK4yRk024KhbNFdV4vMMIVoi6dT5rpwnEQzjECWhyN5KfCct X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: abaa0f36-647c-4dd8-e8eb-08d78428033b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2019 02:06:08.7648 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2APC01HT071 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: 209.51.188.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:173540 Archived-At: --5dfadb0d_5072367_191 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Since the working text is not the final text to insert to buffer, how abo= ut displaying it using after-string property of overlay=3F Such as: (overlay-put (setq ns-working-overlay (make-overlay start (point))) =C2=A0 =C2=A0=E2=80=98after-string (propertize ns-working-text =E2=80=98f= ace 'ns-working-text-face)) =E5=9C=A8 2019=E5=B9=B412=E6=9C=8819=E6=97=A5 +0800 AM8:32=EF=BC=8Ctsuuca= t via Bug reports for GNU Emacs, the Swiss army knife of text editors =EF=BC=8C=E5=86=99=E9=81=93=EF=BC=9A > > > Can I ask what this change does=3F > > > > - (overlay-put (setq ns-working-overlay (make-overlay start (point) > > - (current-buffer) nil t)) > > + (overlay-put (setq ns-working-overlay (make-overlay start (point)))= > > > At first I thought it would be fixed just by moving =5Bself deleteWorki= ngText=5D in nsterm.m. > However as a result insertText (ex: pressing RET to input selected cand= idates) left nothing. > > That=E2=80=99s because ns-delete-working-text (by =5Bself deleteWorking= Text=5D) delete all inserted > chars including chars inserted by insertText-emited normal input events= . This patch prevent > ns-working-overlay expanding its size in insertText. > > > Unfortunately I found the patch change behavior of undo worse. So NS-sp= esific patch should > have further modification. > > -- > tsuucat > > > > --5dfadb0d_5072367_191 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Since the working text is not the final text to insert to= buffer, how about displaying it using after-string property of overlay? Su= ch as:

(overlay-put (setq ns-working-overlay (make-overlay start= (point)))
   =E2=80=98after-string (propertize ns-working= -text =E2=80=98face 'ns-working-text-face))

=E5=9C=A8 2019=E5=B9=B412=E6=9C=8819=E6= =97=A5 +0800 AM8:32=EF=BC=8Ctsuucat via Bug reports for GNU Emacs, the = Swiss army knife of text editors <bug-gnu-emacs@gnu.org>=EF=BC=8C=E5= =86=99=E9=81=93=EF=BC=9A

Can I ask what this ch= ange does?

- (overlay-put (setq ns-working-overlay (make-overlay start (point)
- (current-buffer) nil t))
+ (overlay-put (setq ns-working-overlay (make-overlay start (point)))


At first I thought it would be fixed just by moving [self deleteWorkingText= ] in nsterm.m.
However as a result insertText (ex: pressing RET to input selected candidat= es) left nothing.

That=E2=80=99s because ns-delete-working-text (by [self deleteWorkingText])= delete all inserted
chars including chars inserted by insertText-emited normal input events. Th= is patch prevent
ns-working-overlay expanding its size in insertText.


Unfortunately I found the patch change behavior of undo worse. So NS-spesif= ic patch should
have further modification.

--
tsuucat




--5dfadb0d_5072367_191--