unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve.
@ 2021-04-28  7:24 tumashu
  2021-04-28 11:54 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: tumashu @ 2021-04-28  7:24 UTC (permalink / raw)
  To: emacs-devel@gnu.org


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



[-- Attachment #1.2: Type: text/html, Size: 111 bytes --]

[-- Attachment #2: 0001-lisp-international-mule-cmds.el-deactivate-input-met.patch --]
[-- Type: application/octet-stream, Size: 947 bytes --]

From cff0095c29f013304f345e58a0513b20a479d101 Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@163.com>
Date: Wed, 28 Apr 2021 15:21:55 +0800
Subject: [PATCH] * lisp/international/mule-cmds.el (deactivate-input-method):
 Tiny improve.

---
 lisp/international/mule-cmds.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index b99db46e45..3deb448632 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1500,7 +1500,8 @@ deactivate-input-method
 	(progn
 	  (setq input-method-function nil
 		current-input-method-title nil)
-	  (funcall deactivate-current-input-method-function))
+          (when (functionp deactivate-current-input-method-function)
+	    (funcall deactivate-current-input-method-function)))
       (unwind-protect
 	  (run-hooks 'input-method-deactivate-hook)
 	(setq current-input-method nil)
-- 
2.20.1


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

* Re: [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve.
  2021-04-28  7:24 [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve tumashu
@ 2021-04-28 11:54 ` Eli Zaretskii
  2021-04-28 12:33   ` tumashu
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-04-28 11:54 UTC (permalink / raw)
  To: tumashu; +Cc: emacs-devel

> Date: Wed, 28 Apr 2021 15:24:40 +0800 (CST)
> From: tumashu <tumashu@163.com>
> 
> --- a/lisp/international/mule-cmds.el
> +++ b/lisp/international/mule-cmds.el
> @@ -1500,7 +1500,8 @@ deactivate-input-method
>  	(progn
>  	  (setq input-method-function nil
>  		current-input-method-title nil)
> -	  (funcall deactivate-current-input-method-function))
> +          (when (functionp deactivate-current-input-method-function)
> +	    (funcall deactivate-current-input-method-function)))

Thanks, but could you please explain why this is needed?  IOW, in
which use case did you see this function called when
deactivate-current-input-method-function wasn't a function?



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

* Re:Re: [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve.
  2021-04-28 11:54 ` Eli Zaretskii
@ 2021-04-28 12:33   ` tumashu
  2021-04-28 15:03     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: tumashu @ 2021-04-28 12:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel@gnu.org

















At 2021-04-28 19:54:00, "Eli Zaretskii" <eliz@gnu.org> wrote:
>> Date: Wed, 28 Apr 2021 15:24:40 +0800 (CST)
>> From: tumashu <tumashu@163.com>
>> 
>> --- a/lisp/international/mule-cmds.el
>> +++ b/lisp/international/mule-cmds.el
>> @@ -1500,7 +1500,8 @@ deactivate-input-method
>>  	(progn
>>  	  (setq input-method-function nil
>>  		current-input-method-title nil)
>> -	  (funcall deactivate-current-input-method-function))
>> +          (when (functionp deactivate-current-input-method-function)
>> +	    (funcall deactivate-current-input-method-function)))
>
>Thanks, but could you please explain why this is needed?  IOW, in
>which use case did you see this function called when
>deactivate-current-input-method-function wasn't a function?

Yes, I have faced some bugs of pyim in evil environment, sometimes, this variable maybe is nil.
I can not find why.

https://github.com/tumashu/pyim/issues/361

https://github.com/tumashu/pyim/issues/275

https://github.com/tumashu/pyim/issues/367




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

* Re: [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve.
  2021-04-28 12:33   ` tumashu
@ 2021-04-28 15:03     ` Eli Zaretskii
  2021-04-28 22:37       ` tumashu
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-04-28 15:03 UTC (permalink / raw)
  To: tumashu; +Cc: emacs-devel

> Date: Wed, 28 Apr 2021 20:33:23 +0800 (CST)
> From: tumashu  <tumashu@163.com>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> 
> >> -	  (funcall deactivate-current-input-method-function))
> >> +          (when (functionp deactivate-current-input-method-function)
> >> +	    (funcall deactivate-current-input-method-function)))
> >
> >Thanks, but could you please explain why this is needed?  IOW, in
> >which use case did you see this function called when
> >deactivate-current-input-method-function wasn't a function?
> 
> Yes, I have faced some bugs of pyim in evil environment, sometimes, this variable maybe is nil.
> I can not find why.

I see traces of using defadvise there.  Could it be that the advice
calls deactivate-input-method incorrectly?



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

* Re:Re: [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve.
  2021-04-28 15:03     ` Eli Zaretskii
@ 2021-04-28 22:37       ` tumashu
  2021-05-08  9:54         ` tumashu
  0 siblings, 1 reply; 7+ messages in thread
From: tumashu @ 2021-04-28 22:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

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

maybe, but test a variable value is really a function before funcall it, seem to be better way, I think :-)





--
发自我的网易邮箱手机智能版
<br/><br/><br/>


----- Original Message -----
From: "Eli Zaretskii" <eliz@gnu.org>
To: tumashu <tumashu@163.com>
Cc: emacs-devel@gnu.org
Sent: Wed, 28 Apr 2021 18:03:10 +0300
Subject: Re: [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve.

> Date: Wed, 28 Apr 2021 20:33:23 +0800 (CST)
> From: tumashu  <tumashu@163.com>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> 
> >> -   (funcall deactivate-current-input-method-function))
> >> +          (when (functionp deactivate-current-input-method-function)
> >> +     (funcall deactivate-current-input-method-function)))
> >
> >Thanks, but could you please explain why this is needed?  IOW, in
> >which use case did you see this function called when
> >deactivate-current-input-method-function wasn't a function?
> 
> Yes, I have faced some bugs of pyim in evil environment, sometimes, this variable maybe is nil.
> I can not find why.

I see traces of using defadvise there.  Could it be that the advice
calls deactivate-input-method incorrectly?

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

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

* Re:Re:Re: [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve.
  2021-04-28 22:37       ` tumashu
@ 2021-05-08  9:54         ` tumashu
  2021-05-08 14:02           ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: tumashu @ 2021-05-08  9:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel@gnu.org

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

Is this patch rejected? :-/

















At 2021-04-29 06:37:58, "tumashu" <tumashu@163.com> wrote:

maybe, but test a variable value is really a function before funcall it, seem to be better way, I think :-)





--
发自我的网易邮箱手机智能版
<br/><br/><br/>


----- Original Message -----
From: "Eli Zaretskii" <eliz@gnu.org>
To: tumashu <tumashu@163.com>
Cc: emacs-devel@gnu.org
Sent: Wed, 28 Apr 2021 18:03:10 +0300
Subject: Re: [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve.

> Date: Wed, 28 Apr 2021 20:33:23 +0800 (CST)
> From: tumashu  <tumashu@163.com>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> 
> >> -   (funcall deactivate-current-input-method-function))
> >> +          (when (functionp deactivate-current-input-method-function)
> >> +     (funcall deactivate-current-input-method-function)))
> >
> >Thanks, but could you please explain why this is needed?  IOW, in
> >which use case did you see this function called when
> >deactivate-current-input-method-function wasn't a function?
> 
> Yes, I have faced some bugs of pyim in evil environment, sometimes, this variable maybe is nil.
> I can not find why.

I see traces of using defadvise there.  Could it be that the advice
calls deactivate-input-method incorrectly?

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

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

* Re: [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve.
  2021-05-08  9:54         ` tumashu
@ 2021-05-08 14:02           ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2021-05-08 14:02 UTC (permalink / raw)
  To: tumashu; +Cc: emacs-devel

> Date: Sat, 8 May 2021 17:54:13 +0800 (CST)
> From: tumashu  <tumashu@163.com>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> 
> Is this patch rejected? :-/

No, I just haven't had the time to think what I think about it.



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

end of thread, other threads:[~2021-05-08 14:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-28  7:24 [patch] * lisp/international/mule-cmds.el (deactivate-input-method): Tiny improve tumashu
2021-04-28 11:54 ` Eli Zaretskii
2021-04-28 12:33   ` tumashu
2021-04-28 15:03     ` Eli Zaretskii
2021-04-28 22:37       ` tumashu
2021-05-08  9:54         ` tumashu
2021-05-08 14:02           ` 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).