bug#81506: [PATCH] Extend w32 window events to expose IME composition string interface

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
> From: Stefan Monnier <[email protected]>
> Cc: dANiuu zHaO <[email protected]>,  [email protected]
> Date: Tue, 28 Jul 2026 11:21:59 -0400
> 
> >> +	case WM_IME_COMPOSITION:
> >> +	  {
> >> +	    int len = (int) msg.msg.lParam;
> >> +	    char *buf = (char *) msg.msg.wParam;
> >> +	    Lisp_Object str = make_string_from_utf8 (buf, len);
> >> +	    CALLN (Frun_hook_with_args, Qw32_ime_composition_hook, str);
> >
> > Can't say I like calling Lisp from inside read_socket_hook.  Stefan,
> > is that safe enough?
> 
> IIRC `read_socket_hook` is run "asynchronously" from things like
> `maybe_quit` so it's not allowed to run ELisp code.  Instead, it needs
> to stash data somewhere (typically the input event queue) for later
> synchronous processing from the command loop (or the
> wait_reading_process_output loop).

Right, that's what I thought.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.