<p>The filetype extractor is a regex so it can be changed to read any (reasonable) filetype marks the users code already contains, it could be changed to read Vim's <code>vim: syntax=xxx</code>.  Its just got a default value for Emacs style because some C++ system headers which have no extensions have the Emacs mark and IIRC thats what the contributor wanted to detect at the time.</p>
<p>At the moment it is intended to <em>extract</em> the Geany filetype and nothing else.</p>
<p>As the extractor regex is user variable a comparison table shouldn't be hard coded into Geany (eg in the filetypes table), it should be a data file like <code>filetypes.extensions</code>, maybe <code>filetypes.alternative_names</code> with a list of alternative names like <code>filetypes.extensions</code> has a list of alternative extensions.  This will also allow it to work for custom filetypes as well as builtin ones.</p>
<p>PS the "human" name is actually the menu item name.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1531#issuecomment-312969759">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ35_jB0TUldzVdPJXWQNK69epVpVks5sKtbegaJpZM4ONsFx">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ-MkvTcLG9IBoC65vOeii_TDPa4wks5sKtbegaJpZM4ONsFx.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1531#issuecomment-312969759"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@elextr in #1531: The filetype extractor is a regex so it can be changed to read any (reasonable) filetype marks the users code already contains, it could be changed to read Vim's `vim: syntax=xxx`.  Its just got a default value for Emacs style because some C++ system headers which have no extensions have the Emacs mark and IIRC thats what the contributor wanted to detect at the time.\r\n\r\nAt the moment it is intended to *extract* the Geany filetype and nothing else.\r\n\r\nAs the extractor regex is user variable a comparison table shouldn't be hard coded into Geany (eg in the filetypes table), it should be a data file like `filetypes.extensions`, maybe `filetypes.alternative_names` with a list of alternative names like `filetypes.extensions` has a list of alternative extensions.  This will also allow it to work for custom filetypes as well as builtin ones.\r\n\r\nPS the \"human\" name is actually the menu item name.\r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1531#issuecomment-312969759"}}}</script>