[Github-comments] [geany/geany] Emacs-style mode detection is too crude (#1531)

Vasiliy Faronov notifications at xxxxx
Tue Jul 4 21:17:18 UTC 2017


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/src/filetypes.c#L119-L188) 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.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/1531
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20170704/b8fba1a5/attachment.html>


More information about the Github-comments mailing list