Keyman layouts in emacs on MacOS


I was wondering if any of you here would have had the same issues that I am having, and perhaps that someone might know a solution.

I use Keyman on all platforms to use the SIL Eurolatin and the SIL IPA inputs. On Linux, this works fine with (Spac)emacs, without any further configuration needed beyond that which is necessary to get iBus to work in general. On MacOS, however, Keyman works in every app except emacs.

So, the issue that I am seeing?

When you use a layout that makes use of modifying characters, essentially you get the intended character in addition to the characters typed to get it. So eg. normally on the Eurolatin keyboard you would type \ + d to get ð, a + \ + e to get æ, etc.; in Emacs on MacOS I am instead getting the whole thing printed, eg a + \ + e gives a\æ, not æ, \ + d gives \ð, not ð, etc.

I believe I had seen this info on Linux at one point, but the issue was due to the environment variables used to tell X11 whether it should be using iBus or something else. I don’t know what the MacOS equivalent would be; I have looked through the settings and I don’t see anything like that; I would think that surely all apps are using the same input method.

So I’m at a bit of a loss as to how to troubleshoot. A solution for now is to simply make a layout for emacs that copies the Eurolatin layout, and to switch internally to this layout, but that means that every time I want to switch to this layout I will have to make sure the system layout is set to British English and then to switch to the Eurolatin layout in Emacs, in other words, I would need to remember to switch layouts twice, which seems like a bit of a pain!

Any help or suggestions on what I might fiddle with/look at are welcome. Maybe there’s a way I can use autohotkey or something.

Thanks for any help!

Thanks for the detailed description of your issue. Everything works OK for me when I use the console version of Emacs run from the MacOS terminal. (I used Gnu Emacs 28.1.) But when I run the Cocoa version of Emacs, I am able to reproduce the problem just as you described.

There appears to be an incompatibility with the Cocoa version of Emacs and the way that it integrates with the Keyman system keyboard through MacOS. Unfortunately, the only workaround we currently have for this type of incompatibility actually made the problem worse when I tried it. So a fix for this is not something that we will be able to address quickly.

The only way I know around the issue for now is to use the version of Emacs from the console. Sorry I could not be of more help!

Using it in the terminal worked well (certainly a lot better than it did in the terminal I use on Linux), but I still had some issues, like certain key combinations (Emacs commands, not keyman character sequences) not working as expected, some lines of text seemingly being displayed at random with some kind of character reference code (not sure what kind), etc.

For anyone else who wants to use Emacs on MacOS with keyman and who finds this issue, though, a fix was to use this particular build of Emacs: GitHub - railwaycat/homebrew-emacsmacport: Emacs mac port formulae for the Homebrew package manager . Now keyman works as expected, as do all the regular emacs commands.