unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#38851: 27.0.50; Recent my patch breaks isearch with macOS native input method
@ 2020-01-01 18:25 tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-01-03 20:29 ` Alan Third
  0 siblings, 1 reply; 10+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-01-01 18:25 UTC (permalink / raw)
  To: 38851

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

I sent a patch for Bug#23412 and the patch was already merged.
(http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-27&id=ba042176d8931cdf9441b3b4919ec74b75019494)

Unfortunately, the patch breaks isearch with macOS native input method.
I tried to modify ns-echo-working-text function and ns-delete-working-text
function, but I cannot do it.
This is because input-pending-p now returns t after pressing RET to confirm 
the conversion. (isearch-update function uses input-pending-p)

The following patch treats ns-unput-working-text event by deleteWorkingText 
specially in read_char(). This solve the problem.


[-- Attachment #2: 0001-Change-redisplay-solution.patch --]
[-- Type: application/octet-stream, Size: 1756 bytes --]

From 9f337cfc6c5daea484b4e1d42d20e017e798cdee Mon Sep 17 00:00:00 2001
From: Masahiro Nakamura <tsuucat@icloud.com>
Date: Thu, 2 Jan 2020 01:21:40 +0900
Subject: [PATCH] Change redisplay solution

---
 src/keyboard.c | 6 ++++++
 src/nsterm.m   | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/keyboard.c b/src/keyboard.c
index 7d3b024..30fd526 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2896,6 +2896,12 @@ read_char (int commandflag, Lisp_Object map,
 	   example banishing the mouse under mouse-avoidance-mode.  */
 	timer_resume_idle ();
 
+#ifdef HAVE_NS
+      if (CONSP (c)
+          && (EQ (XCAR (c), intern ("ns-unput-working-text"))))
+        input_was_pending = input_pending;
+#endif
+
       if (current_buffer != prev_buffer)
 	{
 	  /* The command may have changed the keymaps.  Pretend there
diff --git a/src/nsterm.m b/src/nsterm.m
index c5cc182..52a9830 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6430,6 +6430,10 @@ - (void)insertText: (id)aString
   if (!emacs_event)
     return;
 
+  /* First, clear any working text.  */
+  if (workingText != nil)
+    [self deleteWorkingText];
+
   /* It might be preferable to use getCharacters:range: below,
      cf. https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CocoaPerformance/Articles/StringDrawing.html#//apple_ref/doc/uid/TP40001445-112378.
      However, we probably can't use SAFE_NALLOCA here because it might
@@ -6458,10 +6462,6 @@ - (void)insertText: (id)aString
       emacs_event->code = code;
       EV_TRAILER ((id)nil);
     }
-
-  /* Last, clear any working text.  */
-  if (workingText != nil)
-    [self deleteWorkingText];
 }
 
 
-- 
2.21.0


[-- Attachment #3: Type: text/plain, Size: 11 bytes --]


--
tsuucat

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-02-19 11:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-01 18:25 bug#38851: 27.0.50; Recent my patch breaks isearch with macOS native input method tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-01-03 20:29 ` Alan Third
2020-02-10 17:08   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-02-10 21:44     ` Alan Third
2020-02-10 22:21       ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-02-11 15:56         ` Eli Zaretskii
2020-02-11 17:22         ` Alan Third
2020-02-13 19:17           ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-02-19 11:14             ` Alan Third
2020-02-11 17:05       ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).