unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
@ 2016-05-01  8:54 ` Chunyang Xu
  2016-05-01 15:07   ` Eli Zaretskii
                     ` (6 more replies)
  0 siblings, 7 replies; 34+ messages in thread
From: Chunyang Xu @ 2016-05-01  8:54 UTC (permalink / raw)
  To: 23412


For example, when I try to insert "中文" with "zhongwen" via the
built-in Pinyin input method, "zhongwen" is keep shaking, here is a
video of this very annoying behavior:

https://youtu.be/56oLXo2wwJQ

It looks like only Emacs has this problem, other apps like TextEdit works fine.

I have following font setting in my init.el and don't set any Chinese
font manually.

;; Font#
(set-face-attribute 'default nil
                    :font "Source Code Pro-13")

Let me know if I need to provide more information.

In GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.4.0, NS appkit-1404.46 Version 10.11.4 (Build 15E65))
 of 2016-04-25 built on MBA.local
Repository revision: 12846626bfae795a173fdedf2850dfbd24065534
Windowing system distributor 'Apple', version 10.3.1404
Configured using:
 'configure --with-modules'

Configured features:
JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS
NS MODULES

Important settings:
  value of $LANG: en_CN.UTF-8
  locale-coding-system: utf-8-unix






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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2016-05-01  8:54 ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method Chunyang Xu
@ 2016-05-01 15:07   ` Eli Zaretskii
  2016-05-01 15:35     ` Chunyang Xu
  2016-05-27 19:16   ` Alan Third
                     ` (5 subsequent siblings)
  6 siblings, 1 reply; 34+ messages in thread
From: Eli Zaretskii @ 2016-05-01 15:07 UTC (permalink / raw)
  To: Chunyang Xu; +Cc: 23412

> From: Chunyang Xu <xuchunyang.me@gmail.com>
> Date: Sun, 01 May 2016 16:54:49 +0800
> 
> For example, when I try to insert "中文" with "zhongwen" via the
> built-in Pinyin input method, "zhongwen" is keep shaking, here is a
> video of this very annoying behavior:
> 
> https://youtu.be/56oLXo2wwJQ

All I see is constant refresh of the characters you typed -- is that
what you call "shaking"?

Thanks.





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2016-05-01 15:07   ` Eli Zaretskii
@ 2016-05-01 15:35     ` Chunyang Xu
  0 siblings, 0 replies; 34+ messages in thread
From: Chunyang Xu @ 2016-05-01 15:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 23412

On Sun, May 1, 2016 at 11:07 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Chunyang Xu <xuchunyang.me@gmail.com>
>> Date: Sun, 01 May 2016 16:54:49 +0800
>>
>> For example, when I try to insert "中文" with "zhongwen" via the
>> built-in Pinyin input method, "zhongwen" is keep shaking, here is a
>> video of this very annoying behavior:
>>
>> https://youtu.be/56oLXo2wwJQ
>
> All I see is constant refresh of the characters you typed -- is that
> what you call "shaking"?
>

Yes

> Thanks.





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2016-05-01  8:54 ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method Chunyang Xu
  2016-05-01 15:07   ` Eli Zaretskii
@ 2016-05-27 19:16   ` Alan Third
  2016-05-27 20:13     ` Chunyang Xu
  2017-04-26 17:43   ` hylom
                     ` (4 subsequent siblings)
  6 siblings, 1 reply; 34+ messages in thread
From: Alan Third @ 2016-05-27 19:16 UTC (permalink / raw)
  To: Chunyang Xu; +Cc: 23412

Chunyang Xu <xuchunyang.me@gmail.com> writes:

> For example, when I try to insert "中文" with "zhongwen" via the
> built-in Pinyin input method, "zhongwen" is keep shaking, here is a
> video of this very annoying behavior:
>
> https://youtu.be/56oLXo2wwJQ
>
> It looks like only Emacs has this problem, other apps like TextEdit works fine.
>
> I have following font setting in my init.el and don't set any Chinese
> font manually.
>
> ;; Font#
> (set-face-attribute 'default nil
>                     :font "Source Code Pro-13")
>
> Let me know if I need to provide more information.

Hi, I'm not sure what you mean by "external input method"? Is it
something outside of Emacs? An OS X setting?

How are you setting your input method?

Can you please try running emacs without any configuration and seeing if
you get the same issue? You can do this at the command line by typing
something like:

Emacs.app/Contents/MacOS/Emacs -Q
-- 
Alan Third





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2016-05-27 19:16   ` Alan Third
@ 2016-05-27 20:13     ` Chunyang Xu
  0 siblings, 0 replies; 34+ messages in thread
From: Chunyang Xu @ 2016-05-27 20:13 UTC (permalink / raw)
  To: Alan Third; +Cc: 23412

On Sat, May 28, 2016 at 3:16 AM, Alan Third <alan@idiocy.org> wrote:
> Chunyang Xu <xuchunyang.me@gmail.com> writes:
>
>> For example, when I try to insert "中文" with "zhongwen" via the
>> built-in Pinyin input method, "zhongwen" is keep shaking, here is a
>> video of this very annoying behavior:
>>
>> https://youtu.be/56oLXo2wwJQ
>>
>> It looks like only Emacs has this problem, other apps like TextEdit works fine.
>>
>> I have following font setting in my init.el and don't set any Chinese
>> font manually.
>>
>> ;; Font#
>> (set-face-attribute 'default nil
>>                     :font "Source Code Pro-13")
>>
>> Let me know if I need to provide more information.
>
> Hi, I'm not sure what you mean by "external input method"? Is it
> something outside of Emacs? An OS X setting?

I meant ”Pinyin - Simplified“ input method, which is shipped with the
OS X system. Yes and Yes.

> How are you setting your input method?

- Open System Preferences, click Keyboard, then click Input Sources.
- Click +, search and select "Chinese Simplified", then select the
"Pinyin - Simplified" input method
- Click Add

> Can you please try running emacs without any configuration and seeing if
> you get the same issue? You can do this at the command line by typing
> something like:
>
> Emacs.app/Contents/MacOS/Emacs -Q

Get the same issue.

> --
> Alan Third





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2016-05-01  8:54 ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method Chunyang Xu
  2016-05-01 15:07   ` Eli Zaretskii
  2016-05-27 19:16   ` Alan Third
@ 2017-04-26 17:43   ` hylom
  2017-05-01 12:26   ` bug#23412: Can this bug be fixed now? 张海君
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 34+ messages in thread
From: hylom @ 2017-04-26 17:43 UTC (permalink / raw)
  To: 23412

The same problem occured with Japanese input method, and both Emacs
25.1 and 25.2.

I think this is caused by commit 9e77c1b7bcfd0807be7fe67daf73c2320e864309
( http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-25.1&id=9e77c1b7bcfd0807be7fe67daf73c2320e864309
),
 and the problem don't occur when 'redisplay-dont-pause' variable is set to nil.

(but, 'redisplay-dont-pause' variable is obsolete since 24.5...)


-- 
Hiromichi Matsushima (hylom)





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

* bug#23412: Can this bug be fixed now?
  2016-05-01  8:54 ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method Chunyang Xu
                     ` (2 preceding siblings ...)
  2017-04-26 17:43   ` hylom
@ 2017-05-01 12:26   ` 张海君
  2019-10-27 11:49   ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method HaiJun Zhang
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 34+ messages in thread
From: 张海君 @ 2017-05-01 12:26 UTC (permalink / raw)
  To: 23412

It also makes many unused undo entries when inputing except cursor flicker.


It seems that hylom has found the commit which introduced the problem and gives a workaround.
I tried the workaround and it works. So can we fix this bug now?






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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2016-05-01  8:54 ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method Chunyang Xu
                     ` (3 preceding siblings ...)
  2017-05-01 12:26   ` bug#23412: Can this bug be fixed now? 张海君
@ 2019-10-27 11:49   ` HaiJun Zhang
  2019-10-28 11:26     ` Alan Third
  2019-12-04 11:19   ` bug#23412: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-12-17  9:18   ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  6 siblings, 1 reply; 34+ messages in thread
From: HaiJun Zhang @ 2019-10-27 11:49 UTC (permalink / raw)
  To: 23412@debbugs.gnu.org

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

After some debugging work, I think I find the cause.

See the discussion: https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg01096.html


[-- Attachment #2: Type: text/html, Size: 799 bytes --]

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-10-27 11:49   ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method HaiJun Zhang
@ 2019-10-28 11:26     ` Alan Third
  2019-10-29 13:24       ` HaiJun Zhang
  0 siblings, 1 reply; 34+ messages in thread
From: Alan Third @ 2019-10-28 11:26 UTC (permalink / raw)
  To: HaiJun Zhang; +Cc: 23412@debbugs.gnu.org

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

On Sun, Oct 27, 2019 at 11:49:20AM +0000, HaiJun Zhang wrote:
> After some debugging work, I think I find the cause.
> 
> See the discussion: https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg01096.html

Thanks for working this out. I suspect that we can remove a call to
delete the working text from the C code and just leave it to lisp.

Please try the attached patch.
-- 
Alan Third

[-- Attachment #2: 0001-Prevent-flicker-with-macOS-input-methods-bug-23412.patch --]
[-- Type: text/plain, Size: 812 bytes --]

From 201a496eb011ccc3a630fe9fa8d69da58a13b469 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Mon, 28 Oct 2019 11:21:29 +0000
Subject: [PATCH] Prevent flicker with macOS input methods (bug#23412)

* src/nsterm.m ([EmacsView setMarkedText:selectedRange:]): Don't
delete the working text as ns-put-working-text does that anyway.
---
 src/nsterm.m | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index 5583c6105c..2622242071 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6435,8 +6435,6 @@ - (void)setMarkedText: (id)aString selectedRange: (NSRange)selRange
            (unsigned long)selRange.length,
            (unsigned long)selRange.location);
 
-  if (workingText != nil)
-    [self deleteWorkingText];
   if ([str length] == 0)
     return;
 
-- 
2.21.0


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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-10-28 11:26     ` Alan Third
@ 2019-10-29 13:24       ` HaiJun Zhang
  2019-10-29 19:20         ` Alan Third
  0 siblings, 1 reply; 34+ messages in thread
From: HaiJun Zhang @ 2019-10-29 13:24 UTC (permalink / raw)
  To: Alan Third; +Cc: 23412@debbugs.gnu.org

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

在 2019年10月28日 +0800 PM7:26,Alan Third <alan@idiocy.org>,写道:
On Sun, Oct 27, 2019 at 11:49:20AM +0000, HaiJun Zhang wrote:
After some debugging work, I think I find the cause.

See the discussion: https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg01096.html

Thanks for working this out. I suspect that we can remove a call to
delete the working text from the C code and just leave it to lisp.

Please try the attached patch.
--
Alan Third

I tried the patch. It works well for almost all the use cases except the following one:
Press ESC to cancel the input. The working text will not be cleared as before. It will be cleared after inputting another char or pressing ENTER.

I think there are cases like the above when only ’ns-unput-working-text is fired without following ’ns-put-working-text.

In my modified ns-unput-working-text, it processes these cases. If the new working text is the same as the old one, then there will be no following ’ns-put-working-text and it clears the working text. Maybe the checking can be done in C?



[-- Attachment #2: Type: text/html, Size: 1849 bytes --]

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-10-29 13:24       ` HaiJun Zhang
@ 2019-10-29 19:20         ` Alan Third
  2019-10-30  1:15           ` HaiJun Zhang
  0 siblings, 1 reply; 34+ messages in thread
From: Alan Third @ 2019-10-29 19:20 UTC (permalink / raw)
  To: HaiJun Zhang; +Cc: 23412@debbugs.gnu.org

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

On Tue, Oct 29, 2019 at 01:24:11PM +0000, HaiJun Zhang wrote:
> I tried the patch. It works well for almost all the use cases except the following one:
> Press ESC to cancel the input. The working text will not be cleared
> as before. It will be cleared after inputting another char or
> pressing ENTER.

That makes sense. It looks like there is no explicit clear from the
toolkit.

> I think there are cases like the above when only
> ’ns-unput-working-text is fired without following
> ’ns-put-working-text.
> 
> In my modified ns-unput-working-text, it processes these cases. If
> the new working text is the same as the old one, then there will be
> no following ’ns-put-working-text and it clears the working text.
> Maybe the checking can be done in C?

I think in C we can get away with just checking whether the new text
is empty. If there is any text at all then replacing the working text
seems to do the right thing, even if the new text is shorter than the
old. I could be wrong, though, I’ve never really used these input
methods so don’t know if there are things I’m not testing.

New patch attached, please try it and let me know how it goes.
-- 
Alan Third

[-- Attachment #2: 0001-Prevent-text-flicker-with-macOS-input-methods-bug-23.patch --]
[-- Type: text/plain, Size: 1087 bytes --]

From dd965985108e36ab3e559834963765a23a44ca2b Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Mon, 28 Oct 2019 11:21:29 +0000
Subject: [PATCH] Prevent text flicker with macOS input methods (bug#23412)

* src/nsterm.m ([EmacsView setMarkedText:selectedRange:]): Don't
always delete the working text as ns-put-working-text does that.
---
 src/nsterm.m | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index 5583c6105c..afe7069aae 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6435,15 +6435,17 @@ - (void)setMarkedText: (id)aString selectedRange: (NSRange)selRange
            (unsigned long)selRange.length,
            (unsigned long)selRange.location);
 
-  if (workingText != nil)
-    [self deleteWorkingText];
   if ([str length] == 0)
-    return;
+    {
+      [self deleteWorkingText];
+      return;
+    }
 
   if (!emacs_event)
     return;
 
   processingCompose = YES;
+  [workingText release];
   workingText = [str copy];
   ns_working_text = build_string ([workingText UTF8String]);
 
-- 
2.21.0


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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-10-29 19:20         ` Alan Third
@ 2019-10-30  1:15           ` HaiJun Zhang
  2019-10-31 20:53             ` Alan Third
  0 siblings, 1 reply; 34+ messages in thread
From: HaiJun Zhang @ 2019-10-30  1:15 UTC (permalink / raw)
  To: Alan Third; +Cc: 23412@debbugs.gnu.org

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

在 2019年10月30日 +0800 AM3:20,Alan Third <alan@idiocy.org>,写道:

I think in C we can get away with just checking whether the new text
is empty. If there is any text at all then replacing the working text
seems to do the right thing, even if the new text is shorter than the
old. I could be wrong, though, I’ve never really used these input
methods so don’t know if there are things I’m not testing.

New patch attached, please try it and let me know how it goes.
--
Alan Third

It works perfectly now. Thanks.


[-- Attachment #2: Type: text/html, Size: 1001 bytes --]

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-10-30  1:15           ` HaiJun Zhang
@ 2019-10-31 20:53             ` Alan Third
  2019-12-05 11:21               ` Stefan Kangas
  0 siblings, 1 reply; 34+ messages in thread
From: Alan Third @ 2019-10-31 20:53 UTC (permalink / raw)
  To: HaiJun Zhang; +Cc: 23412-done@debbugs.gnu.org

On Wed, Oct 30, 2019 at 01:15:04AM +0000, HaiJun Zhang wrote:
> 在 2019年10月30日 +0800 AM3:20,Alan Third <alan@idiocy.org>,写道:
> > 
> > I think in C we can get away with just checking whether the new text
> > is empty. If there is any text at all then replacing the working text
> > seems to do the right thing, even if the new text is shorter than the
> > old. I could be wrong, though, I’ve never really used these input
> > methods so don’t know if there are things I’m not testing.
> > 
> > New patch attached, please try it and let me know how it goes.
>
> It works perfectly now. Thanks.

Thank you for finding the root cause! I’ve pushed the change to
master, so it should be available in Emacs 27 now.
-- 
Alan Third





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

* bug#23412:
  2016-05-01  8:54 ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method Chunyang Xu
                     ` (4 preceding siblings ...)
  2019-10-27 11:49   ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method HaiJun Zhang
@ 2019-12-04 11:19   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-12-04 22:50     ` bug#23412: HaiJun Zhang
  2019-12-17  9:18   ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  6 siblings, 1 reply; 34+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2019-12-04 11:19 UTC (permalink / raw)
  To: 23412

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

Hello.


As far as I tried, Emacs with macOS native input method still flicker.
I use default Japanese input method of macOS.  Flicker happens when I
press RET to input selected candidates. 

This is because insertText: in nsterm.m is called and emits a special
event '(ns-unput-working-text) and then normal input events.
read_char() function which processes these events always call redisplay() 
just after processing '(ns-unput-working-text) event.

We have to prevent redisplay after '(ns-unput-working-text) event
emited by insertText:.  To do it, I made a patch.  I don’t know this
is corrent way to prevent redisplaying.

--
tsuucat

[-- Attachment #2: 0001-Prevent-redisplay-between-events-from-insertText.patch --]
[-- Type: application/octet-stream, Size: 890 bytes --]

From 2bd7e86f7ce4991457c3a5ba524aa5d4fd4ecf95 Mon Sep 17 00:00:00 2001
From: Masahiro Nakamura <13937915+tsuu32@users.noreply.github.com>
Date: Wed, 4 Dec 2019 19:07:31 +0900
Subject: [PATCH] Prevent redisplay between events from insertText

---
 src/keyboard.c | 6 ++++++
 1 file changed, 6 insertions(+)

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


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

* bug#23412:
  2019-12-04 11:19   ` bug#23412: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2019-12-04 22:50     ` HaiJun Zhang
  0 siblings, 0 replies; 34+ messages in thread
From: HaiJun Zhang @ 2019-12-04 22:50 UTC (permalink / raw)
  To: 23412, tsuucat

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

With your patch, it is smoother now. I don’t known if there is a better way to do this(skipping redisplay for this event when there is an immediate following event).
在 2019年12月4日 +0800 PM11:37,tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org>,写道:
> Hello.
>
>
> As far as I tried, Emacs with macOS native input method still flicker.
> I use default Japanese input method of macOS. Flicker happens when I
> press RET to input selected candidates.
>
> This is because insertText: in nsterm.m is called and emits a special
> event '(ns-unput-working-text) and then normal input events.
> read_char() function which processes these events always call redisplay()
> just after processing '(ns-unput-working-text) event.
>
> We have to prevent redisplay after '(ns-unput-working-text) event
> emited by insertText:. To do it, I made a patch. I don’t know this
> is corrent way to prevent redisplaying.
>
> --
> tsuucat

[-- Attachment #2: Type: text/html, Size: 1468 bytes --]

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-10-31 20:53             ` Alan Third
@ 2019-12-05 11:21               ` Stefan Kangas
  2019-12-05 14:43                 ` Alan Third
  0 siblings, 1 reply; 34+ messages in thread
From: Stefan Kangas @ 2019-12-05 11:21 UTC (permalink / raw)
  To: Alan Third; +Cc: HaiJun Zhang, 23412-done@debbugs.gnu.org

Alan Third <alan@idiocy.org> writes:

> On Wed, Oct 30, 2019 at 01:15:04AM +0000, HaiJun Zhang wrote:
>> 在 2019年10月30日 +0800 AM3:20,Alan Third <alan@idiocy.org>,写道:
>> > 
>> > I think in C we can get away with just checking whether the new text
>> > is empty. If there is any text at all then replacing the working text
>> > seems to do the right thing, even if the new text is shorter than the
>> > old. I could be wrong, though, I’ve never really used these input
>> > methods so don’t know if there are things I’m not testing.
>> > 
>> > New patch attached, please try it and let me know how it goes.
>>
>> It works perfectly now. Thanks.
>
> Thank you for finding the root cause! I’ve pushed the change to
> master, so it should be available in Emacs 27 now.

That was five weeks ago.  If the issue has been fixed, should we also
go ahead and close this bug report?

Best regards,
Stefan Kangas





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-05 11:21               ` Stefan Kangas
@ 2019-12-05 14:43                 ` Alan Third
  0 siblings, 0 replies; 34+ messages in thread
From: Alan Third @ 2019-12-05 14:43 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: HaiJun Zhang, 23412-done@debbugs.gnu.org

On Thu, Dec 05, 2019 at 12:21:06PM +0100, Stefan Kangas wrote:
> Alan Third <alan@idiocy.org> writes:
> 
> > On Wed, Oct 30, 2019 at 01:15:04AM +0000, HaiJun Zhang wrote:
> >> 在 2019年10月30日 +0800 AM3:20,Alan Third <alan@idiocy.org>,写道:
> >> > 
> >> > I think in C we can get away with just checking whether the new text
> >> > is empty. If there is any text at all then replacing the working text
> >> > seems to do the right thing, even if the new text is shorter than the
> >> > old. I could be wrong, though, I’ve never really used these input
> >> > methods so don’t know if there are things I’m not testing.
> >> > 
> >> > New patch attached, please try it and let me know how it goes.
> >>
> >> It works perfectly now. Thanks.
> >
> > Thank you for finding the root cause! I’ve pushed the change to
> > master, so it should be available in Emacs 27 now.
> 
> That was five weeks ago.  If the issue has been fixed, should we also
> go ahead and close this bug report?

I thought I had, if you look at the cc list you might notice why it
didn’t. :)

A new wrinkle has been found, though, so it’s probably not worth
closing this and creating a new bug report, so I’d leave it open for
now if that’s OK.
-- 
Alan Third





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2016-05-01  8:54 ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method Chunyang Xu
                     ` (5 preceding siblings ...)
  2019-12-04 11:19   ` bug#23412: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2019-12-17  9:18   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-12-17 20:28     ` Alan Third
  6 siblings, 1 reply; 34+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2019-12-17  9:18 UTC (permalink / raw)
  To: alan; +Cc: 23412

Can you review my patch?

--
tsuucat





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-17  9:18   ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2019-12-17 20:28     ` Alan Third
  2019-12-18 15:55       ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 34+ messages in thread
From: Alan Third @ 2019-12-17 20:28 UTC (permalink / raw)
  To: tsuucat; +Cc: 23412

On Tue, Dec 17, 2019 at 06:18:28PM +0900, tsuucat wrote:
> Can you review my patch?

Hi,

Sorry, I was hoping someone else would have a look as I don’t really
know the ins and outs of redisplay, so I don’t know if this is a good
way to fix it.

I had a quick look to see if I could see any way to sort it in the NS
specific code but couldn’t see anything and haven’t really had a
chance to dig more deeply.
-- 
Alan Third





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-17 20:28     ` Alan Third
@ 2019-12-18 15:55       ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-12-18 20:44         ` Alan Third
  0 siblings, 1 reply; 34+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2019-12-18 15:55 UTC (permalink / raw)
  To: Alan Third; +Cc: 23412

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


> I had a quick look to see if I could see any way to sort it in the NS
> specific code but couldn’t see anything and haven’t really had a
> chance to dig more deeply.

Thanks.

I made another patch. Unlike <https://eow.alc.co.jp/search?q=unlike&ref=awlj> before this is NS specific version.

--
tsuucat

[-- Attachment #2.1: Type: text/html, Size: 1327 bytes --]

[-- Attachment #2.2: 0001-delete-workingText-last-in-insertText.patch --]
[-- Type: application/octet-stream, Size: 1740 bytes --]

From b163b00624ef3fa5cc3a31d62cdb12714cd6831f Mon Sep 17 00:00:00 2001
From: Masahiro Nakamura <tsuucat@icloud.com>
Date: Thu, 19 Dec 2019 00:32:54 +0900
Subject: [PATCH] delete workingText last in insertText

---
 lisp/term/ns-win.el | 3 +--
 src/nsterm.m        | 8 ++++----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 1841e67..1cbe566 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -317,8 +317,7 @@ ns-insert-working-text
   (ns-delete-working-text)
   (let ((start (point)))
     (insert ns-working-text)
-    (overlay-put (setq ns-working-overlay (make-overlay start (point)
-							(current-buffer) nil t))
+    (overlay-put (setq ns-working-overlay (make-overlay start (point)))
 		 'face 'ns-working-text-face)))
 
 (defun ns-echo-working-text ()
diff --git a/src/nsterm.m b/src/nsterm.m
index 52a9830..c5cc182 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6430,10 +6430,6 @@ - (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
@@ -6462,6 +6458,10 @@ - (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 #2.3: Type: text/html, Size: 246 bytes --]

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-18 15:55       ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2019-12-18 20:44         ` Alan Third
  2019-12-19  0:31           ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 34+ messages in thread
From: Alan Third @ 2019-12-18 20:44 UTC (permalink / raw)
  To: tsuucat; +Cc: 23412

On Thu, Dec 19, 2019 at 12:55:25AM +0900, tsuucat wrote:
> 
> > I had a quick look to see if I could see any way to sort it in the NS
> > specific code but couldn’t see anything and haven’t really had a
> > chance to dig more deeply.
> 
> Thanks.
> 
> I made another patch. Unlike before this is NS specific version.

I like it. Very neat.

Can I ask what this change 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)))

I believe this can be committed as copyright exempt, but if send any
more patches you’ll probably have to go through the copyright
assignment process.

Thanks!
-- 
Alan Third





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-18 20:44         ` Alan Third
@ 2019-12-19  0:31           ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-12-19  2:05             ` HaiJun Zhang
  0 siblings, 1 reply; 34+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2019-12-19  0:31 UTC (permalink / raw)
  To: Alan Third; +Cc: 23412


> Can I ask what this change 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 candidates) left nothing.

That’s because ns-delete-working-text (by  [self deleteWorkingText]) 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-spesific patch should 
have further modification.

--
tsuucat






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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-19  0:31           ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2019-12-19  2:05             ` HaiJun Zhang
  2019-12-19  5:57               ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 34+ messages in thread
From: HaiJun Zhang @ 2019-12-19  2:05 UTC (permalink / raw)
  To: Alan Third, tsuucat; +Cc: 23412

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

Since the working text is not the final text to insert to buffer, how about displaying it using after-string property of overlay? Such as:

(overlay-put (setq ns-working-overlay (make-overlay start (point)))
   ‘after-string (propertize ns-working-text ‘face 'ns-working-text-face))

在 2019年12月19日 +0800 AM8:32,tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org>,写道:
>
> > Can I ask what this change 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 candidates) left nothing.
>
> That’s because ns-delete-working-text (by [self deleteWorkingText]) 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-spesific patch should
> have further modification.
>
> --
> tsuucat
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 1994 bytes --]

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-19  2:05             ` HaiJun Zhang
@ 2019-12-19  5:57               ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-12-19  6:14                 ` HaiJun Zhang
                                   ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2019-12-19  5:57 UTC (permalink / raw)
  To: HaiJun Zhang, alan; +Cc: 23412

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


> Since the working text is not the final text to insert to buffer, how about displaying it using after-string property of overlay? Such as:
> 
> (overlay-put (setq ns-working-overlay (make-overlay start (point)))
>    ‘after-string (propertize ns-working-text ‘face 'ns-working-text-face))


I did it. It is good undo behavior.

After this, working text appears in read-only buffer. (Mac port-like
behavior)


[-- Attachment #2: 0001-insertText-flicker-patch.patch --]
[-- Type: application/octet-stream, Size: 2407 bytes --]

From 383e6547ee47ac874935a162e36e644b4076927d Mon Sep 17 00:00:00 2001
From: Masahiro Nakamura <tsuucat@icloud.com>
Date: Thu, 19 Dec 2019 00:32:54 +0900
Subject: [PATCH] insertText flicker patch

---
 lisp/term/ns-win.el | 10 ++++------
 src/nsterm.m        |  8 ++++----
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 1841e67..81e9a0c 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -316,10 +316,9 @@ ns-insert-working-text
   (interactive)
   (ns-delete-working-text)
   (let ((start (point)))
-    (insert ns-working-text)
-    (overlay-put (setq ns-working-overlay (make-overlay start (point)
-							(current-buffer) nil t))
-		 'face 'ns-working-text-face)))
+    (overlay-put (setq ns-working-overlay (make-overlay start (point)))
+                 'after-string
+                 (propertize ns-working-text 'face 'ns-working-text-face))))
 
 (defun ns-echo-working-text ()
   "Echo contents of `ns-working-text' in message display area.
@@ -342,8 +341,7 @@ ns-delete-working-text
          ;; Still alive?
          (overlay-buffer ns-working-overlay))
     (with-current-buffer (overlay-buffer ns-working-overlay)
-      (delete-region (overlay-start ns-working-overlay)
-                     (overlay-end ns-working-overlay))
+      (overlay-put ns-working-overlay 'after-string nil)
       (delete-overlay ns-working-overlay)))
    ((integerp ns-working-overlay)
     (let ((msg (current-message))
diff --git a/src/nsterm.m b/src/nsterm.m
index 52a9830..c5cc182 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6430,10 +6430,6 @@ - (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
@@ -6462,6 +6458,10 @@ - (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: 12 bytes --]



--
tsuucat

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-19  5:57               ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2019-12-19  6:14                 ` HaiJun Zhang
  2019-12-19  6:22                   ` HaiJun Zhang
  2019-12-19  7:02                 ` HaiJun Zhang
  2019-12-21 22:54                 ` Alan Third
  2 siblings, 1 reply; 34+ messages in thread
From: HaiJun Zhang @ 2019-12-19  6:14 UTC (permalink / raw)
  To: alan@idiocy.org, tsuucat; +Cc: 23412@debbugs.gnu.org

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

I think the overlay can be deleted in ns-delete-working-text, because new overlay is always created in ns-insert-working-text.
在 2019年12月19日 +0800 PM1:57,tsuucat <tsuucat@icloud.com>,写道:
>
> > Since the working text is not the final text to insert to buffer, how about displaying it using after-string property of overlay? Such as:
> >
> > (overlay-put (setq ns-working-overlay (make-overlay start (point)))
> >    ‘after-string (propertize ns-working-text ‘face 'ns-working-text-face))
>
>
> I did it. It is good undo behavior.
>
> After this, working text appears in read-only buffer. (Mac port-like
> behavior)
>
>
>
> --
> tsuucat

[-- Attachment #2: Type: text/html, Size: 1588 bytes --]

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-19  6:14                 ` HaiJun Zhang
@ 2019-12-19  6:22                   ` HaiJun Zhang
  0 siblings, 0 replies; 34+ messages in thread
From: HaiJun Zhang @ 2019-12-19  6:22 UTC (permalink / raw)
  To: alan@idiocy.org, tsuucat; +Cc: 23412@debbugs.gnu.org

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

Yes. It is deleted.
在 2019年12月19日 +0800 PM2:16,HaiJun Zhang <netjune@outlook.com>,写道:
> I think the overlay can be deleted in ns-delete-working-text, because new overlay is always created in ns-insert-working-text.
> 在 2019年12月19日 +0800 PM1:57,tsuucat <tsuucat@icloud.com>,写道:
> >
> > > Since the working text is not the final text to insert to buffer, how about displaying it using after-string property of overlay? Such as:
> > >
> > > (overlay-put (setq ns-working-overlay (make-overlay start (point)))
> > >    ‘after-string (propertize ns-working-text ‘face 'ns-working-text-face))
> >
> >
> > I did it. It is good undo behavior.
> >
> > After this, working text appears in read-only buffer. (Mac port-like
> > behavior)
> >
> >
> >
> > --
> > tsuucat

[-- Attachment #2: Type: text/html, Size: 1950 bytes --]

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-19  5:57               ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-12-19  6:14                 ` HaiJun Zhang
@ 2019-12-19  7:02                 ` HaiJun Zhang
  2019-12-21 22:54                 ` Alan Third
  2 siblings, 0 replies; 34+ messages in thread
From: HaiJun Zhang @ 2019-12-19  7:02 UTC (permalink / raw)
  To: alan@idiocy.org, tsuucat; +Cc: 23412@debbugs.gnu.org

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

I tried your patch. It works well.
在 2019年12月19日 +0800 PM1:57,tsuucat <tsuucat@icloud.com>,写道:
>
> > Since the working text is not the final text to insert to buffer, how about displaying it using after-string property of overlay? Such as:
> >
> > (overlay-put (setq ns-working-overlay (make-overlay start (point)))
> >    ‘after-string (propertize ns-working-text ‘face 'ns-working-text-face))
>
>
> I did it. It is good undo behavior.
>
> After this, working text appears in read-only buffer. (Mac port-like
> behavior)
>
>
>
> --
> tsuucat

[-- Attachment #2: Type: text/html, Size: 1496 bytes --]

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-19  5:57               ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-12-19  6:14                 ` HaiJun Zhang
  2019-12-19  7:02                 ` HaiJun Zhang
@ 2019-12-21 22:54                 ` Alan Third
  2019-12-22  3:33                   ` Eli Zaretskii
                                     ` (2 more replies)
  2 siblings, 3 replies; 34+ messages in thread
From: Alan Third @ 2019-12-21 22:54 UTC (permalink / raw)
  To: tsuucat; +Cc: HaiJun Zhang, 23412

On Thu, Dec 19, 2019 at 02:57:08PM +0900, tsuucat wrote:
> 
> > Since the working text is not the final text to insert to buffer, how about displaying it using after-string property of overlay? Such as:
> > 
> > (overlay-put (setq ns-working-overlay (make-overlay start (point)))
> >    ‘after-string (propertize ns-working-text ‘face 'ns-working-text-face))
> 
> 
> I did it. It is good undo behavior.

This sounds good. I’m unsure if it still qualifies for copyright
exemption as it looks to me like 18 lines changed. Eli?

> After this, working text appears in read-only buffer. (Mac port-like
> behavior)

I could have sworn we had another bug open for this, but I can’t find
it right now...
-- 
Alan Third





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-21 22:54                 ` Alan Third
@ 2019-12-22  3:33                   ` Eli Zaretskii
  2019-12-22  7:24                   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-12-22 11:32                   ` HaiJun Zhang
  2 siblings, 0 replies; 34+ messages in thread
From: Eli Zaretskii @ 2019-12-22  3:33 UTC (permalink / raw)
  To: Alan Third; +Cc: netjune, 23412, tsuucat

> Date: Sat, 21 Dec 2019 22:54:23 +0000
> From: Alan Third <alan@idiocy.org>
> Cc: HaiJun Zhang <netjune@outlook.com>, 23412@debbugs.gnu.org
> 
> This sounds good. I’m unsure if it still qualifies for copyright
> exemption as it looks to me like 18 lines changed. Eli?

The last part just moves the same code and changes a comment, so I
think we are good with accepting this.

Thanks.





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-21 22:54                 ` Alan Third
  2019-12-22  3:33                   ` Eli Zaretskii
@ 2019-12-22  7:24                   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-12-22 11:51                     ` Alan Third
  2019-12-22 11:32                   ` HaiJun Zhang
  2 siblings, 1 reply; 34+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2019-12-22  7:24 UTC (permalink / raw)
  To: Alan Third, Eli Zaretskii; +Cc: 23412

> This sounds good. I’m unsure if it still qualifies for copyright
> exemption as it looks to me like 18 lines changed. Eli?

Would you tell me copyright assignment form?

>> After this, working text appears in read-only buffer. (Mac port-like
>> behavior)
> 
> I could have sworn we had another bug open for this, but I can’t find
> it right now…

Maybe Bug#1453 (I found it at ns-win.el).

--
tsuucat




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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-21 22:54                 ` Alan Third
  2019-12-22  3:33                   ` Eli Zaretskii
  2019-12-22  7:24                   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2019-12-22 11:32                   ` HaiJun Zhang
  2019-12-22 12:02                     ` Alan Third
  2 siblings, 1 reply; 34+ messages in thread
From: HaiJun Zhang @ 2019-12-22 11:32 UTC (permalink / raw)
  To: tsuucat, Alan Third; +Cc: 23412

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

在 2019年12月22日 +0800 AM6:54,Alan Third <alan@idiocy.org>,写道:
>
> I could have sworn we had another bug open for this, but I can’t find
> it right now…

It may be the bug in the fixme of ns-insert-working-text?

  ;; FIXME: if buffer is read-only, don’t try to insert anything
  ;; and if text is bound to a command, execute that instead (Bug#1453)

Two issues in it. I don’t think the former is a problem to me. The working text is not the real text to be inserted into the buffer. It is just like a tip message.
For the latter, I think the better resolution is to let emacs interact with the input method. Let emacs tell the input method to switch to English when the buffer only accepts English chars.

[-- Attachment #2: Type: text/html, Size: 1278 bytes --]

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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-22  7:24                   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2019-12-22 11:51                     ` Alan Third
  2019-12-22 17:14                       ` Eli Zaretskii
  0 siblings, 1 reply; 34+ messages in thread
From: Alan Third @ 2019-12-22 11:51 UTC (permalink / raw)
  To: tsuucat; +Cc: 23412-done

On Sun, Dec 22, 2019 at 04:24:42PM +0900, tsuucat wrote:
> > This sounds good. I’m unsure if it still qualifies for copyright
> > exemption as it looks to me like 18 lines changed. Eli?
> 
> Would you tell me copyright assignment form?

Either Eli will send it to you or I believe you can contact
assign@gnu.org.

> >> After this, working text appears in read-only buffer. (Mac port-like
> >> behavior)
> > 
> > I could have sworn we had another bug open for this, but I can’t find
> > it right now…
> 
> Maybe Bug#1453 (I found it at ns-win.el).

That’s the one. I’ve just checked and sure enough your patch fixes it.
-- 
Alan Third





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-22 11:32                   ` HaiJun Zhang
@ 2019-12-22 12:02                     ` Alan Third
  0 siblings, 0 replies; 34+ messages in thread
From: Alan Third @ 2019-12-22 12:02 UTC (permalink / raw)
  To: HaiJun Zhang; +Cc: 23412, tsuucat

On Sun, Dec 22, 2019 at 07:32:57PM +0800, HaiJun Zhang wrote:
> 在 2019年12月22日 +0800 AM6:54,Alan Third <alan@idiocy.org>,写道:
> >
> > I could have sworn we had another bug open for this, but I can’t find
> > it right now…
> 
> It may be the bug in the fixme of ns-insert-working-text?
> 
>   ;; FIXME: if buffer is read-only, don’t try to insert anything
>   ;; and if text is bound to a command, execute that instead (Bug#1453)
> 
> Two issues in it. I don’t think the former is a problem to me. The
> working text is not the real text to be inserted into the buffer. It
> is just like a tip message. For the latter, I think the better
> resolution is to let emacs interact with the input method. Let emacs
> tell the input method to switch to English when the buffer only
> accepts English chars.

I think Tsuucat’s patch makes that comment obsolete. It inserts the
working text into the buffer at point, which I assumed was impossible
since it’s read‐only, and then deletes it once it’s completed and
dired picks up the correct character and does the right thing.

It maybe looks a little odd with the working text appearing in the
dired buffer, but I don’t think it’s a problem.

Thanks to everyone who’s helped resolved this bug!
-- 
Alan Third





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

* bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method
  2019-12-22 11:51                     ` Alan Third
@ 2019-12-22 17:14                       ` Eli Zaretskii
  0 siblings, 0 replies; 34+ messages in thread
From: Eli Zaretskii @ 2019-12-22 17:14 UTC (permalink / raw)
  To: Alan Third; +Cc: 23412, tsuucat

> Date: Sun, 22 Dec 2019 11:51:36 +0000
> From: Alan Third <alan@idiocy.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, 23412-done@debbugs.gnu.org
> 
> > Would you tell me copyright assignment form?
> 
> Either Eli will send it to you or I believe you can contact
> assign@gnu.org.

Form sent off-list.





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

end of thread, other threads:[~2019-12-22 17:14 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bebc4ca8-0a58-4ea0-8fb1-4dbb6d18e335@Spark>
2016-05-01  8:54 ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method Chunyang Xu
2016-05-01 15:07   ` Eli Zaretskii
2016-05-01 15:35     ` Chunyang Xu
2016-05-27 19:16   ` Alan Third
2016-05-27 20:13     ` Chunyang Xu
2017-04-26 17:43   ` hylom
2017-05-01 12:26   ` bug#23412: Can this bug be fixed now? 张海君
2019-10-27 11:49   ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method HaiJun Zhang
2019-10-28 11:26     ` Alan Third
2019-10-29 13:24       ` HaiJun Zhang
2019-10-29 19:20         ` Alan Third
2019-10-30  1:15           ` HaiJun Zhang
2019-10-31 20:53             ` Alan Third
2019-12-05 11:21               ` Stefan Kangas
2019-12-05 14:43                 ` Alan Third
2019-12-04 11:19   ` bug#23412: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-12-04 22:50     ` bug#23412: HaiJun Zhang
2019-12-17  9:18   ` bug#23412: 25.1.50; GUI Emacs on Mac OS X: text is keeping shaking/re-displaying when insert text with external input method tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-12-17 20:28     ` Alan Third
2019-12-18 15:55       ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-12-18 20:44         ` Alan Third
2019-12-19  0:31           ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-12-19  2:05             ` HaiJun Zhang
2019-12-19  5:57               ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-12-19  6:14                 ` HaiJun Zhang
2019-12-19  6:22                   ` HaiJun Zhang
2019-12-19  7:02                 ` HaiJun Zhang
2019-12-21 22:54                 ` Alan Third
2019-12-22  3:33                   ` Eli Zaretskii
2019-12-22  7:24                   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-12-22 11:51                     ` Alan Third
2019-12-22 17:14                       ` Eli Zaretskii
2019-12-22 11:32                   ` HaiJun Zhang
2019-12-22 12:02                     ` Alan Third

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).