all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: tsuucat via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 38851@debbugs.gnu.org
Subject: bug#38851: 27.0.50; Recent my patch breaks isearch with macOS native input method
Date: Thu, 2 Jan 2020 03:25:13 +0900	[thread overview]
Message-ID: <CA6D9194-20BA-4F7D-852A-F32392883BE9@icloud.com> (raw)

[-- 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

             reply	other threads:[~2020-01-01 18:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-01 18:25 tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-01-03 20:29 ` bug#38851: 27.0.50; Recent my patch breaks isearch with macOS native input method 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA6D9194-20BA-4F7D-852A-F32392883BE9@icloud.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=38851@debbugs.gnu.org \
    --cc=tsuucat@icloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.