Geany can detect a document’s filetype from an explicit Emacs-style mode declaration. The docs say:
The `GEANY_DEFAULT_FILETYPE_REGEX` default value is `-*-\s*([^\s]+)\s*-*-` which finds Emacs filetypes.
In fact, this only works if the captured name case-sensitively matches a Geany filetype name. So `-*-Sh-*-` works, but `-*-sh-*-` doesn’t. `-*-reStructuredText-*-` works in Geany, but not in Emacs, which expects `-*-rst-*-`.
Perhaps the [Geany filetypes table](https://github.com/geany/geany/blob/35a5d457f48c92ecb71b5a2ecf7d718701d5ef63...) should have an “Emacs mode name” field (like it already has a “human title” field), to be matched case-insensitively.
Failing that, at least the docs should be clarified.