unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: =?gb18030?B?QWxiZXJ0?= <georgealbert@qq.com>
To: =?gb18030?B?RWxpIFphcmV0c2tpaQ==?= <eliz@gnu.org>
Cc: =?gb18030?B?ZW1hY3MtZGV2ZWw=?= <emacs-devel@gnu.org>
Subject: =?gb18030?B?u9i4tKO6ILvYuLSjuiC72Li0o7ogu9i4tKO6IFtQQVRDSF0gQWRkIElNRSBzdGF0dXMgY2hhbmdlIHN1cHBvcnQgb24gd2luZG93cyBuYXRpdmVseQ==?=
Date: Mon, 13 Apr 2020 15:07:19 +0800	[thread overview]
Message-ID: <tencent_3B88496D9FE3E520DCE104CC1A0D7386450A@qq.com> (raw)
In-Reply-To: <83a73fkgqt.fsf@gnu.org>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 2801 bytes --]

Hi, Eli,


Thanks. I'll try it.





------------------&nbsp;ԭʼÓʼþ&nbsp;------------------
·¢¼þÈË:&nbsp;"Eli Zaretskii"<eliz@gnu.org&gt;;
·¢ËÍʱ¼ä:&nbsp;2020Äê4ÔÂ13ÈÕ(ÐÇÆÚÒ») ÏÂÎç3:05
ÊÕ¼þÈË:&nbsp;"Albert"<georgealbert@qq.com&gt;;
³­ËÍ:&nbsp;"emacs-devel"<emacs-devel@gnu.org&gt;;
Ö÷Ìâ:&nbsp;Re: »Ø¸´£º »Ø¸´£º »Ø¸´£º [PATCH] Add IME status change support on windows natively



Here's what I propose.

Change w32-set-ime-open-status to do this:

DEFUN ("w32-set-ime-open-status",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fw32_set_ime_open_status, Sw32_set_ime_open_status,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1, 1, 0,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doc: /* Set emacs IME open status on Windows. */)
&nbsp; (Lisp_Object status)
{
&nbsp;&nbsp;&nbsp; unsigned ime_status;
&nbsp;&nbsp;&nbsp; if (NILP (status))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ime_status = 0;
&nbsp;&nbsp;&nbsp; else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ime_status = 1;

&nbsp;&nbsp;&nbsp; PostThreadMessage (dwWindowsThreadId, WM_EMACS_IME_STATUS,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (WPARAM)ime_status, 0);

&nbsp;&nbsp;&nbsp; return Qnil;
}

Then in w32fns.c do this to handle the WM_EMACS_IME_STATUS message:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case WM_EMACS_IME_STATUS:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!set_ime_open_status_fn)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {
		&nbsp; HIMC context = get_ime_context_fn (w32_system_caret_hwnd);
		&nbsp; if (!context)
		&nbsp;&nbsp;&nbsp; break;
		&nbsp; BOOL ime_status = get_ime_open_status_fn (context);
		&nbsp; BOOL new_status = (wParam != 0);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (ime_status != new_status)
		&nbsp;&nbsp;&nbsp; set_ime_open_status_fn (context, new_status);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; release_ime_context_fn (w32_system_caret_hwnd, context);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;

Then you can get rid of the 2 static variables.

This is entirely untested, so please make sure it works as intended.

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

  reply	other threads:[~2020-04-13  7:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13  4:09 [PATCH] Add IME status change support on windows natively Albert
2020-04-13  4:53 ` Eli Zaretskii
2020-04-13  5:47   ` Eli Zaretskii
2020-04-13  6:06     ` =?gb18030?B?u9i4tKO6IFtQQVRDSF0gQWRkIElNRSBzdGF0dXMgY2hhbmdlIHN1cHBvcnQgb24gd2luZG93cyBuYXRpdmVseQ==?= =?gb18030?B?QWxiZXJ0?=
2020-04-13  6:13       ` =?gb18030?B?u9i4tKO6?= [PATCH] Add IME status change support on windows natively Eli Zaretskii
2020-04-13  8:50         ` 回复: " Valtteri Vuorikoski
2020-04-13  9:06           ` Eli Zaretskii
2020-04-13  9:18             ` Valtteri Vuorikoski
2020-04-13  6:12   ` =?gb18030?B?u9i4tKO6IFtQQVRDSF0gQWRkIElNRSBzdGF0dXMgY2hhbmdlIHN1cHBvcnQgb24gd2luZG93cyBuYXRpdmVseQ==?= =?gb18030?B?QWxiZXJ0?=
2020-04-13  6:24     ` =?gb18030?B?u9i4tKO6?= [PATCH] Add IME status change support on windows natively Eli Zaretskii
2020-04-13  6:27       ` =?gb18030?B?u9i4tKO6ILvYuLSjuiBbUEFUQ0hdIEFkZCBJTUUgc3RhdHVzIGNoYW5nZSBzdXBwb3J0IG9uIHdpbmRvd3MgbmF0aXZlbHk=?= =?gb18030?B?QWxiZXJ0?=
2020-04-13  6:32         ` =?gb18030?B?u9i4tKO6ILvYuLSjuiBbUEFUQ0hdIEFkZCBJTUUgc3RhdHVzIGNoYW5nZSBzdXBwb3J0IG9uIHdpbmRvd3MgbmF0aXZlbHk=?= =?gb18030?B?QWxiZXJ0?=
2020-04-13  6:43         ` =?gb18030?B?u9i4tKO6ILvYuLSjug==?= [PATCH] Add IME status change support on windows natively Eli Zaretskii
2020-04-13  6:47           ` =?gb18030?B?u9i4tKO6ILvYuLSjuiC72Li0o7ogW1BBVENIXSBBZGQgSU1FIHN0YXR1cyBjaGFuZ2Ugc3VwcG9ydCBvbiB3aW5kb3dzIG5hdGl2ZWx5?= =?gb18030?B?QWxiZXJ0?=
2020-04-13  7:05             ` 回复: 回复: 回复: [PATCH] Add IME status change support on windows natively Eli Zaretskii
2020-04-13  7:07               ` =?gb18030?B?QWxiZXJ0?= [this message]
2020-04-13  7:21                 ` =?gb18030?B?u9i4tKO6ILvYuLSjuiC72Li0o7ogu9i4tKO6?= " Eli Zaretskii
2020-04-13  7:25                   ` Eli Zaretskii
2020-04-13  7:26                   ` =?gb18030?B?u9i4tKO6ILvYuLSjuiC72Li0o7ogu9i4tKO6ILvYuLSjuiBbUEFUQ0hdIEFkZCBJTUUgc3RhdHVzIGNoYW5nZSBzdXBwb3J0IG9uIHdpbmRvd3MgbmF0aXZlbHk=?= =?gb18030?B?QWxiZXJ0?=
2020-04-13  9:22                     ` =?gb18030?B?u9i4tKO6ILvYuLSjuiC72Li0o7ogu9i4tKO6ILvYuLSjuiBbUEFUQ0hdIEFkZCBJTUUgc3RhdHVzIGNoYW5nZSBzdXBwb3J0IG9uIHdpbmRvd3MgbmF0aXZlbHk=?= =?gb18030?B?QWxiZXJ0?=
2020-04-13  9:33                       ` [PATCH] Add IME status change support on windows natively Eli Zaretskii
2020-04-13 10:02                         ` =?gb18030?B?u9i4tKO6IFtQQVRDSF0gQWRkIElNRSBzdGF0dXMgY2hhbmdlIHN1cHBvcnQgb24gd2luZG93cyBuYXRpdmVseQ==?= =?gb18030?B?QWxiZXJ0?=
2020-04-13 13:10                           ` [PATCH] Add IME status change support on windows natively Eli Zaretskii
2020-04-13 13:15                             ` =?gb18030?B?u9i4tKO6IFtQQVRDSF0gQWRkIElNRSBzdGF0dXMgY2hhbmdlIHN1cHBvcnQgb24gd2luZG93cyBuYXRpdmVseQ==?= =?gb18030?B?QWxiZXJ0?=
2020-04-13 13:44                               ` [PATCH] Add IME status change support on windows natively Eli Zaretskii
2020-04-13 14:52                                 ` =?gb18030?B?u9i4tKO6IFtQQVRDSF0gQWRkIElNRSBzdGF0dXMgY2hhbmdlIHN1cHBvcnQgb24gd2luZG93cyBuYXRpdmVseQ==?= =?gb18030?B?QWxiZXJ0?=
2020-04-13 15:32                                   ` =?gb18030?B?u9i4tKO6?= [PATCH] Add IME status change support on windows natively Eli Zaretskii
2020-04-13 15:01                                 ` =?gb18030?B?u9i4tKO6IFtQQVRDSF0gQWRkIElNRSBzdGF0dXMgY2hhbmdlIHN1cHBvcnQgb24gd2luZG93cyBuYXRpdmVseQ==?= =?gb18030?B?QWxiZXJ0?=
2020-04-14  2:13   ` [PATCH] Add IME status change support on windows natively Richard Stallman
2020-04-14  5:54     ` Eli Zaretskii
2020-04-15  2:56       ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=tencent_3B88496D9FE3E520DCE104CC1A0D7386450A@qq.com \
    --to=georgealbert@qq.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 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).