<p></p>
<p><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/Skif-off/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Skif-off">@Skif-off</a></p>
<ul>
<li>
<p><code>update_editor_menu</code> ­– GeanyLua is capable of sending signals to other Geany components.  So it could send a signal to a component that could interact with the menu.  Or a user may wish to take some other action that doesn't require direct interaction with the menu.  Lack of creativity does not make it useless.</p>
</li>
<li>
<p><code>key_press</code> – Are you having a <em>real</em> problem with the signal, or is this just hypothetical?  On a properly functioning system, checking whether the file exists takes a negligible amount of time.</p>
<p>On my computer, it takes just under a second on average to check for a nonexistent file a million times (code at the end of thie message).  That's about 0.001 <em>nano</em>seconds per keystroke.  That amounts to about 4.38 min of processing for someone typing at 100 wpm for a year <em>non-stop</em>.  I've already lost more time just reading your messages than I would have lost to the plugin over <em>many</em> years of normal use.</p>
</li>
</ul>
<pre><code>#include <time.h>

clock_t begin = clock();

for (int i = 0 ; i < 1000000 ; ++i) {
  char * file_does_not_exist = g_strconcat(geany->app->configdir, "file_does_not_exist", NULL);
  g_file_test(file_does_not_exist, G_FILE_TEST_IS_REGULAR);
}

clock_t end = clock();
double time_spent = (double)(end - begin) / CLOCKS_PER_SEC;

msgwin_status_add("time_spent = %f", time_spent);
</code></pre>

<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-plugins/pull/1112#issuecomment-933399566">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ3IURQ2IMPJL2BNPVLUFGG7BANCNFSM5ENCRBVA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJZRU5ALGCDS5XW62DTUFGG7BA5CNFSM5ENCRBVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOG6RIYDQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany-plugins/pull/1112#issuecomment-933399566",
"url": "https://github.com/geany/geany-plugins/pull/1112#issuecomment-933399566",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>