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: Tue, 11 Feb 2020 02:08:14 +0900 Message-ID: References: <20200103202943.GA60724@breton.holly.idiocy.org> Reply-To: tsuucat Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_14A649C8-0E7B-477E-A4E4-0899597646B1" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="58337"; 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 Mon Feb 10 18:10:40 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 1j1Ca0-000F3H-Jn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Feb 2020 18:10:40 +0100 Original-Received: from localhost ([::1]:36610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1CZz-0000kM-9d for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Feb 2020 12:10:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57057) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1CYT-0007Uv-74 for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 12:09:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1CYQ-0000hC-PX for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 12:09:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1CYP-0000g8-Qm for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 12:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j1CYP-0004mB-LB for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 12:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: tsuucat Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Feb 2020 17:09: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.158135450518316 (code B ref 38851); Mon, 10 Feb 2020 17:09:01 +0000 Original-Received: (at 38851) by debbugs.gnu.org; 10 Feb 2020 17:08:25 +0000 Original-Received: from localhost ([127.0.0.1]:55337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1CXp-0004lM-27 for submit@debbugs.gnu.org; Mon, 10 Feb 2020 12:08:25 -0500 Original-Received: from pv50p00im-tydg10021701.me.com ([17.58.6.54]:38969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1CXn-0004lA-KE for 38851@debbugs.gnu.org; Mon, 10 Feb 2020 12:08:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1581354497; bh=BmXJTiQMAuEHZdv4j2syxO9t84Yg3hYS1JQ2H1SNT9Y=; h=From:Message-Id:Content-Type:Subject:Date:To; b=OYghuoKDiyO3+XI6hjiQ0m2RmwIpLr9HS8J/N+uywWKXdckDbkEVE8va7VSNRAoQx 21+jm3KIMsNpzJlxPG3O+5xKm1E2Dq7/K7t1yjkR/wqmeNUACg7XrQS1I5HTwgmUcI 7B5l1ox1Gx0mqDSGfJeGGEa+e2zTRlYTwRHzqLSUO4uKIS950p6XkWZtbiEkVx2zHm KT9c4CU0vy8MB+tGNYOnh0dDFTSI+8GQoosaWg0RSwnwuGY4gtW1JRCaXG5JkhxEFe hmJ/ro9NE+4jkWWa9pb39gzkMHgr/2auFlAkV6IbkEZnZnVVfBzvEZzNWWzhsWwUpo dIWNu2+FsSXpQ== Original-Received: from [192.168.129.33] (i220-109-150-92.s41.a008.ap.plala.or.jp [220.109.150.92]) by pv50p00im-tydg10021701.me.com (Postfix) with ESMTPSA id 3DE558405D3; Mon, 10 Feb 2020 17:08:17 +0000 (UTC) In-Reply-To: <20200103202943.GA60724@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-10_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=949 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-2002100129 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:175883 Archived-At: --Apple-Mail=_14A649C8-0E7B-477E-A4E4-0899597646B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > Thanks. I have no better ideas, so this will have to do. Does anyone > else have any opinions? I have some more explanation. After this commit = (https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3D9e77c1b7bcfd0807= be7fe67daf73c2320e864309 = ) which introduce input_was_pending, read_char became to redisplay always=20= after processing special event. ``` input_was_pending =3D input_pending; ``` is a way to prevent redisplay. The same code is placed at end of = read_char. Emacs at current emacs-27 branch cannot use isearch with macOS native=20 input method (I checked with macOS Japanese input method and get=20 ``` ns-delete-working-text: Wrong type argument: arrayp, nil ``` ). This is worse situation for macOS native input method users. Even if modifying keyboard.c is not acceptable, I think reverting the = position of=20 ``` if (workingText !=3D nil) [self deleteWorkingText]; ``` in insertText should be done. If the patch I sent before is acceptable, I have two patch for = improvement. 0001-proper-selection-window-position-for-isearch.patch This is to show candidate window for IM at proper position when isearch. 0001-Remove-unfavorable-deleteWorkingText.patch Currently clicking buffer or focusing out frame delete working text. To = prevent deleting working text by such a input. -- tsuucat= --Apple-Mail=_14A649C8-0E7B-477E-A4E4-0899597646B1 Content-Type: multipart/mixed; boundary="Apple-Mail=_D1C95C94-3811-4319-9866-1F989E40AA46" --Apple-Mail=_D1C95C94-3811-4319-9866-1F989E40AA46 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

Thanks. I have no better ideas, so this will = have to do. Does anyone
else have any opinions?

which = introduce input_was_pending, read_char became to redisplay = always 
after processing special = event.

```
input_was_pending =3D = input_pending;
```
is a way to = prevent redisplay. The same code is placed at end of = read_char.


Emacs at current = emacs-27 branch cannot use isearch with macOS native 
input method (I checked with macOS Japanese input method and = get 
```
ns-delete-working-text: Wrong type argument: arrayp, = nil
```
).  This is worse = situation for macOS native input method users.
Even = if modifying keyboard.c is not acceptable, I think reverting the = position of 
```
  if (workingText !=3D nil)
  =   [self deleteWorkingText];
```
in insertText should be done.

If the patch I sent before is = acceptable, I have two patch for improvement.

0001-proper-selection-window-position-for-isearch.patch
This is to show candidate window for IM at proper position = when isearch.
= --Apple-Mail=_D1C95C94-3811-4319-9866-1F989E40AA46 Content-Disposition: attachment; filename=0001-proper-selection-window-position-for-isearch.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-proper-selection-window-position-for-isearch.patch" Content-Transfer-Encoding: quoted-printable =46rom=20db2b26d0891e60d67cad68982af44d759b407a58=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Masahiro=20Nakamura=20=0A= Date:=20Sat,=204=20Jan=202020=2020:19:42=20+0900=0ASubject:=20[PATCH]=20= proper=20selection=20window=20position=20for=20isearch=0A=0A---=0A=20= src/nsterm.m=20|=207=20++++++-=0A=201=20file=20changed,=206=20= insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20a/src/nsterm.m=20= b/src/nsterm.m=0Aindex=2052a9830..7674fb0=20100644=0A---=20= a/src/nsterm.m=0A+++=20b/src/nsterm.m=0A@@=20-6557,13=20+6557,18=20@@=20= -=20(NSRect)firstRectForCharacterRange:=20(NSRange)theRange=0A=20{=0A=20=20= =20NSRect=20rect;=0A=20=20=20NSPoint=20pt;=0A-=20=20struct=20window=20= *win=20=3D=20XWINDOW=20(FRAME_SELECTED_WINDOW=20(emacsframe));=0A+=20=20= struct=20window=20*win;=0A=20=0A=20=20=20NSTRACE=20("[EmacsView=20= firstRectForCharacterRange:]");=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=0A2.21.0=0A=0A= --Apple-Mail=_D1C95C94-3811-4319-9866-1F989E40AA46 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii

0001-Remove-unfavorable-deleteWorkingText.patch
Currently clicking buffer or focusing out frame delete working text. To prevent
deleting working text by such a input.
--Apple-Mail=_D1C95C94-3811-4319-9866-1F989E40AA46 Content-Disposition: attachment; filename=0001-Remove-unfavorable-deleteWorkingText.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Remove-unfavorable-deleteWorkingText.patch" Content-Transfer-Encoding: quoted-printable =46rom=203a5c22dfc70197cce8cc42680d500a56ba8146b3=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Masahiro=20Nakamura=20=0A= Date:=20Tue,=2011=20Feb=202020=2001:51:14=20+0900=0ASubject:=20[PATCH]=20= Remove=20unfavorable=20deleteWorkingText=0A=0A---=0A=20src/nsterm.m=20|=20= 3=20---=0A=201=20file=20changed,=203=20deletions(-)=0A=0Adiff=20--git=20= a/src/nsterm.m=20b/src/nsterm.m=0Aindex=207674fb0..c7450b4=20100644=0A= ---=20a/src/nsterm.m=0A+++=20b/src/nsterm.m=0A@@=20-6675,8=20+6675,6=20= @@=20-=20(void)mouseDown:=20(NSEvent=20*)theEvent=0A=20=0A=20=20=20= NSTRACE=20("[EmacsView=20mouseDown:]");=0A=20=0A-=20=20[self=20= deleteWorkingText];=0A-=0A=20=20=20if=20(!emacs_event)=0A=20=20=20=20=20= return;=0A=20=0A@@=20-7301,7=20+7299,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=_D1C95C94-3811-4319-9866-1F989E40AA46 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii

--
 tsuucat
--Apple-Mail=_D1C95C94-3811-4319-9866-1F989E40AA46-- --Apple-Mail=_14A649C8-0E7B-477E-A4E4-0899597646B1--