Subject: Re: bug#60711: Compose fails to generate ≤ and ≥ (only those two! and only in emacs!)

From: Gregory Heytings <[email-masked]>
Date: Mon, 16 Jan 2023 12:31:45 +0000

>
> The part where XmbLookupString returns the correct character.
>

What do you mean?  Conceptually the code does this:

while (XPending (display))
   {
     XNextEvent (display, &event);
     if (XFilterEvent (&event, None) == True)
       continue;
     if (event.type == KeyPress)
       {
         XmbLookupString(input_context, &event.xkey, buffer, sizeof (buffer) - 1, &keysym, &status);
         if (status == XLookupChars)
           {
             /* do something with buffer */
           }
       }
   }

There is nothing that must be kept around in that code.

>
> In addition, the input method may chose to commit a string without a key 
> event.  This results in an XIM_COMMIT event being sent from the input 
> method with a string, which, in one of the worst misdesigns ever, makes 
> Xlib put back a fake key event onto the event queue, then stash the 
> string somewhere, and return it upon the next call to XmbLookupString.
>

I'm sure there are possible complications, but AFAIU they do not change 
the pattern outlined above.