I'm working on creating my own compose key sequences in
~/.XCompose. As I add more and more sequences, occasionally I make typos or use the same sequence for different symbols.
Typo / Non-Existent Codes
<Multi_key> <non-existent-keysym> : other-non-existent-keysym
<Multi_key> <a> <b> : x # overrule by 2nd rule <Multi_key> <a> <b> : y
<Multi_key> <a> <b> <c> : y <Multi_key> <a> <b> : x # overruled by 1st rule
Is there a command that validates my
~/.XCompose file. Minimum requirement is a binary answer: Either »your XCompose is error free« or »your XCompose contains errors«. In case there are errors, a helpful error message like »collision for rule sequence prefix « would be welcome.
What I Tried
~/.XCompose containing all errors from above and opened a text editor. The text editor shows no errors (on the console). Correct and non-overruled sequences work, all other sequences are ignored.
man 5 XCompose. In the documentation itself I found nothing helpful. I looked at the references at the end of
man 5 XCompose. Only
mkcomposecache(1) looks promising (judging from the googled manpage), but seems to be missing on my system (Linux Mint 18.3). Neither
man -k mkcomposecache nor
apt search mkcomposecache find anything.
Edit: As @quixotic suggested, I compiled
mkcomposecache from the sources and ran it, but its exits status is
1, no matter what compose file I choose (with or without errors). There is no error message. No cache is generated. Example of how I call the program:
$ mkcomposecache en_US.UTF-8 /usr/share/X11/locale/en_US.UTF-8/Compose /tmp/ * XOpenDisplay: Success $ echo $? 1
/usr/share/X11/locale/en_US.UTF-8/Compose is Ubuntu's original compose file and should be error free. I guess there is a reason why it is not packaged in the Ubuntu and Arch Linux repositories.
I doubt that
mkcomposecache is what I need, even if it would work.