From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: tsuucat via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#38851: 27.0.50; Recent my patch breaks isearch with macOS native input method Date: Fri, 14 Feb 2020 04:17:29 +0900 Message-ID: <0929D5CF-1E2C-4CBD-8EBA-36C3194450D3@icloud.com> References: <20200103202943.GA60724@breton.holly.idiocy.org> <20200210214451.GB58269@breton.holly.idiocy.org> <1A7C89E7-E3E9-467A-8E6F-C51FBD5F2827@icloud.com> <20200211172234.GA59144@breton.holly.idiocy.org> Reply-To: tsuucat Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_1982A4D8-0029-4C74-A310-5AFE2E7374DF" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="54552"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 38851@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 13 20:18:21 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j2K0C-000E3n-MM for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Feb 2020 20:18:20 +0100 Original-Received: from localhost ([::1]:58278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2K0B-00043H-Oa for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Feb 2020 14:18:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46703) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2Jzw-00042p-8w for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2020 14:18:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2Jzu-0005DG-5P for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2020 14:18:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54503) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2Jzt-0005CP-TQ for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2020 14:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j2Jzt-0007Hh-Nq for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2020 14:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: tsuucat Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Feb 2020 19:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38851 X-GNU-PR-Package: emacs Original-Received: via spool by 38851-submit@debbugs.gnu.org id=B38851.158162145927974 (code B ref 38851); Thu, 13 Feb 2020 19:18:01 +0000 Original-Received: (at 38851) by debbugs.gnu.org; 13 Feb 2020 19:17:39 +0000 Original-Received: from localhost ([127.0.0.1]:60476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2JzX-0007H8-J4 for submit@debbugs.gnu.org; Thu, 13 Feb 2020 14:17:39 -0500 Original-Received: from pv50p00im-ztdg10011201.me.com ([17.58.6.39]:40219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2JzW-0007Gu-Kc for 38851@debbugs.gnu.org; Thu, 13 Feb 2020 14:17:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1581621452; bh=i1Izjzo8N5xryK7EOB488ONIZ8XS2N40MJl4ybd+R/o=; h=From:Message-Id:Content-Type:Subject:Date:To; b=xE2Y5JG6tPHOSkpXpn2uh2V3UDfzlGUemwmPSMmgHUh+PwMpIMU+ZuNWSA5JVa1Et L5iDz7oefdhK6kkcMr1Gbpp3YGM0CcS80hd2tbZs2Pw06n4rP6lVmsmtJ9wxzorh8U yj8McJrvfIPvtrVXdB69m++/RrLS4ipN1sIjY1cJT9m0qLc8M1uV1FSCwyShhNx2eZ 4B6Uo01NiW3RGlVCF9GZfWLJgyox6Fjuf8XCd1sgB1SSzY0wcAmjEc1SWsJJiLaz8o iMRepI2HFUE5dS+R8Un5Hr1K0qB4QVXau1NgEPfPBlL/D9OUKASwhYDvY7DsU/5g4L uzhXWXyNLRNgQ== Original-Received: from [192.168.129.33] (i220-109-150-92.s41.a008.ap.plala.or.jp [220.109.150.92]) by pv50p00im-ztdg10011201.me.com (Postfix) with ESMTPSA id 45B858004DF; Thu, 13 Feb 2020 19:17:31 +0000 (UTC) In-Reply-To: <20200211172234.GA59144@breton.holly.idiocy.org> X-Mailer: Apple Mail (2.3445.104.11) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2020-02-13_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-2002130136 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176010 Archived-At: --Apple-Mail=_1982A4D8-0029-4C74-A310-5AFE2E7374DF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Please squash your three new patches together and have a look at the > instructions in CONTRIBUTE regarding commit messages. OK. I squashed patches and attach the patch. Please tell me if there=E2=80= =99s=20 something wrong. --Apple-Mail=_1982A4D8-0029-4C74-A310-5AFE2E7374DF Content-Disposition: attachment; filename=0001-Fix-working-text-related-issues-on-NS-Bug-38851.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Fix-working-text-related-issues-on-NS-Bug-38851.patch" Content-Transfer-Encoding: quoted-printable =46rom=2001250b154fc19c7dc22d70907f3089ad4b43244d=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Masahiro=20Nakamura=20=0A= Date:=20Fri,=2014=20Feb=202020=2003:21:15=20+0900=0ASubject:=20[PATCH]=20= Fix=20working=20text=20related=20issues=20on=20NS=20(Bug#38851)=0A=0A*=20= src/keyboard.c=20(read_char):=20Prevent=20redsiplay=20right=20after=0A= ns-unput-working-text=20event.=0A*=20src/nsterm.m=20([EmacsView=20= insertText:]):=20Partially=20revert=20commit=0Aba04217.=0A([EmacsView=20= firstRectForCharacterRange:]):=20Fix=20candidate=20window=0Aposition=20= when=20cursor=20is=20on=20echoarea.=0A([EmacsView=20mouseDown:])=0A= ([EmacsView=20windowDidResignKey:]):=20Don't=20delete=20working=20text.=0A= ---=0A=20src/keyboard.c=20|=20=206=20++++++=0A=20src/nsterm.m=20=20=20|=20= 18=20++++++++++--------=0A=202=20files=20changed,=2016=20insertions(+),=20= 8=20deletions(-)=0A=0Adiff=20--git=20a/src/keyboard.c=20b/src/keyboard.c=0A= index=20bf1f5da..9dd7e00=20100644=0A---=20a/src/keyboard.c=0A+++=20= b/src/keyboard.c=0A@@=20-2901,6=20+2901,12=20@@=20read_char=20(int=20= commandflag,=20Lisp_Object=20map,=0A=20=09=20=20=20example=20banishing=20= the=20mouse=20under=20mouse-avoidance-mode.=20=20*/=0A=20=09= timer_resume_idle=20();=0A=20=0A+#ifdef=20HAVE_NS=0A+=20=20=20=20=20=20= if=20(CONSP=20(c)=0A+=20=20=20=20=20=20=20=20=20=20&&=20(EQ=20(XCAR=20= (c),=20intern=20("ns-unput-working-text"))))=0A+=20=20=20=20=20=20=20=20= input_was_pending=20=3D=20input_pending;=0A+#endif=0A+=0A=20=20=20=20=20=20= =20if=20(current_buffer=20!=3D=20prev_buffer)=0A=20=09{=0A=20=09=20=20/*=20= The=20command=20may=20have=20changed=20the=20keymaps.=20=20Pretend=20= there=0Adiff=20--git=20a/src/nsterm.m=20b/src/nsterm.m=0Aindex=20= 9d427b9..fddd4b0=20100644=0A---=20a/src/nsterm.m=0A+++=20b/src/nsterm.m=0A= @@=20-6473,6=20+6473,10=20@@=20-=20(void)insertText:=20(id)aString=0A=20=20= =20if=20(!emacs_event)=0A=20=20=20=20=20return;=0A=20=0A+=20=20/*=20= First,=20clear=20any=20working=20text.=20=20*/=0A+=20=20if=20= (workingText=20!=3D=20nil)=0A+=20=20=20=20[self=20deleteWorkingText];=0A= +=0A=20=20=20/*=20It=20might=20be=20preferable=20to=20use=20= getCharacters:range:=20below,=0A=20=20=20=20=20=20cf.=20= https://developer.apple.com/library/content/documentation/Cocoa/Conceptual= /CocoaPerformance/Articles/StringDrawing.html#//apple_ref/doc/uid/TP400014= 45-112378.=0A=20=20=20=20=20=20However,=20we=20probably=20can't=20use=20= SAFE_NALLOCA=20here=20because=20it=20might=0A@@=20-6501,10=20+6505,6=20= @@=20-=20(void)insertText:=20(id)aString=0A=20=20=20=20=20=20=20= emacs_event->code=20=3D=20code;=0A=20=20=20=20=20=20=20EV_TRAILER=20= ((id)nil);=0A=20=20=20=20=20}=0A-=0A-=20=20/*=20Last,=20clear=20any=20= working=20text.=20=20*/=0A-=20=20if=20(workingText=20!=3D=20nil)=0A-=20=20= =20=20[self=20deleteWorkingText];=0A=20}=0A=20=0A=20=0A@@=20-6600,13=20= +6600,18=20@@=20-=20(NSRect)firstRectForCharacterRange:=20= (NSRange)theRange=0A=20{=0A=20=20=20NSRect=20rect;=0A=20=20=20NSPoint=20= pt;=0A-=20=20struct=20window=20*win=20=3D=20XWINDOW=20= (FRAME_SELECTED_WINDOW=20(emacsframe));=0A+=20=20struct=20window=20*win;=0A= =20=0A=20=20=20NSTRACE=20("[EmacsView=20firstRectForCharacterRange:]");=0A= =20=0A=20=20=20if=20(NS_KEYLOG)=0A=20=20=20=20=20NSLog=20= (@"firstRectForCharRange=20request");=0A=20=0A+=20=20if=20(WINDOWP=20= (echo_area_window)=20&&=20!=20NILP=20(call0=20(intern=20= ("ns-in-echo-area"))))=0A+=20=20=20=20win=20=3D=20XWINDOW=20= (echo_area_window);=0A+=20=20else=0A+=20=20=20=20win=20=3D=20XWINDOW=20= (FRAME_SELECTED_WINDOW=20(emacsframe));=0A+=0A=20=20=20rect.size.width=20= =3D=20theRange.length=20*=20FRAME_COLUMN_WIDTH=20(emacsframe);=0A=20=20=20= rect.size.height=20=3D=20FRAME_LINE_HEIGHT=20(emacsframe);=0A=20=20=20= pt.x=20=3D=20WINDOW_TEXT_TO_FRAME_PIXEL_X=20(win,=20win->phys_cursor.x);=0A= @@=20-6713,8=20+6718,6=20@@=20-=20(void)mouseDown:=20(NSEvent=20= *)theEvent=0A=20=0A=20=20=20NSTRACE=20("[EmacsView=20mouseDown:]");=0A=20= =0A-=20=20[self=20deleteWorkingText];=0A-=0A=20=20=20if=20(!emacs_event)=0A= =20=20=20=20=20return;=0A=20=0A@@=20-7341,7=20+7344,6=20@@=20-=20= (void)windowDidResignKey:=20(NSNotification=20*)notification=0A=20=0A=20=20= =20if=20(emacs_event=20&&=20is_focus_frame)=0A=20=20=20=20=20{=0A-=20=20=20= =20=20=20[self=20deleteWorkingText];=0A=20=20=20=20=20=20=20= emacs_event->kind=20=3D=20FOCUS_OUT_EVENT;=0A=20=20=20=20=20=20=20= EV_TRAILER=20((id)nil);=0A=20=20=20=20=20}=0A--=20=0A2.21.0=0A=0A= --Apple-Mail=_1982A4D8-0029-4C74-A310-5AFE2E7374DF Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > Thanks for working on this and sorry again for the delay. Thank you too! -- tsuucat --Apple-Mail=_1982A4D8-0029-4C74-A310-5AFE2E7374DF--