<p>This commit provides 1 correction and 2.5 enhancements for Geany's context action:</p>
<ol>
<li>The correction is:</li>
</ol>
<ul>
<li>In case you hadn't set the context action, calling a popup menu on a selected text/word brings up a menu with all 'goto & context' items being enabled. The context doesn't work at that, of course. It should not be enabled: 1) when no text is selected 2) even more important: when there is no context action set. This commit corrects this.</li>
</ul>
<ol start="2">
<li>The enhancements are:</li>
</ol>
<ul>
<li>
<p>This commit introduces %f, %d, %e, %p, %l placeholders into the context string, i.e. the same ones as in Compile/ Build/ Run. Without them the context is somehow (indeed much) restricted.</p>
</li>
<li>
<p>(As consequence) the set context action is active when there is no selected text or a word under caret. Even if there are no placeholders in the context string it may contain a really useful command to access with a fast hotkey, all the more the context is specific to the file type. This commit always enables the context if it's defined in Geany's settings no matter there is or no placeholder in it.</p>
</li>
<li>
<p>(0.5 of enhancement) if there would be some new 'goto & context' menu items with their own requirements for access, this commit would facilitate their implementation.</p>
</li>
</ul>
<p>There are a few bla-bla left. This new Geany's context can respond not only to %s, %f, %d etc., but to all Geany's surroundings. E.g. it can show a current state of the project from different viewpoints. Or perform the various actions for maintainance of it. All that done without leaving Geany IDE. One of innumerable possible implementations is here:<br>
<a href="https://wiki.geany.org/howtos/using_with_tcl_tk" rel="nofollow">https://wiki.geany.org/howtos/using_with_tcl_tk</a><br>
As a matter of fact this commit was born of it.</p>
<hr>
<p>About the modifications of code.</p>
<ol>
<li>
<p>For the access to 'build_replace_placeholder' function (introducing %f, %d .. placeholders) I need to modify build.c and build.h.</p>
</li>
<li>
<p>It is included in the proper place of callbacks.c.</p>
</li>
<li>
<p>To unlock the context (and move its access check to other place) I need to comment a line of keybindings.c. Actually this unlocks the hotkey of context.</p>
</li>
<li>
<p>To enable a separate (from other 'goto' items) checking of context access, I need to modify ui_utils.c (and its ui_utils.h).</p>
</li>
<li>
<p>The real access to all 'goto' items (the context including) is checked in editor.c.</p>
</li>
</ol>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany/pull/1841'>https://github.com/geany/geany/pull/1841</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Correction and enhancements for context action</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1841/files#diff-0">src/build.c</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1841/files#diff-1">src/build.h</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1841/files#diff-2">src/callbacks.c</a>
    (10)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1841/files#diff-3">src/editor.c</a>
    (18)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1841/files#diff-4">src/keybindings.c</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1841/files#diff-5">src/ui_utils.c</a>
    (10)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1841/files#diff-6">src/ui_utils.h</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany/pull/1841.patch'>https://github.com/geany/geany/pull/1841.patch</a></li>
  <li><a href='https://github.com/geany/geany/pull/1841.diff'>https://github.com/geany/geany/pull/1841.diff</a></li>
</ul>

<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/pull/1841">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ37_8R5uMWMbLpktewc2JM-JpnKOks5trzj2gaJpZM4Thz7Y">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ2Pr3H19iwLqPWnMxbU2SIW4GEnjks5trzj2gaJpZM4Thz7Y.gif" height="1" width="1" alt="" /></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/pull/1841"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request 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":"DESCRIPTION","message":"Correction and enhancements for context action (#1841)"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1841"}}}</script>