<p><strong>Update:</strong><br>
I added the missing doc comments for the return values. I also added a setter and getter function for <code>project_prefs.project_session</code>.</p>
<p><strong>For what do I need it?</strong><br>
As written at the top I want to add a functionality in the Workbench plugin to switch between projects. I plan to implement two ways of switching:</p>
<ol>
<li>using the popup menu of the Workbench sidebar</li>
<li>on activating of a document that means select/open the project to which the document belongs</li>
</ol>
<p>Option 1 works fine and does not need the access to <code>project_prefs.project_session</code>. The problem with option 2 was that Geany crashed if I close and open a new project in the callback function for <code>document-activate</code>. Calling it on idle worked but lead to all documents being closed including the just opened one if <code>project_prefs.project_session</code> is set. So I needed a setter and getter function to shortly disable the option and restore the old value after the new project is opened.</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/pull/2234?email_source=notifications&email_token=AAIOWJYHSNZLXYMOBAB4JSTQCQ4KLA5CNFSM4IHNIU32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3N2E3Y#issuecomment-517710447">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJZ6KIAYZ4LSI4NS2MLQCQ4KLANCNFSM4IHNIU3Q">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAIOWJ2P2YWGH462WG6SRBTQCQ4KLA5CNFSM4IHNIU32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3N2E3Y.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/pull/2234?email_source=notifications\u0026email_token=AAIOWJYHSNZLXYMOBAB4JSTQCQ4KLA5CNFSM4IHNIU32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3N2E3Y#issuecomment-517710447",
"url": "https://github.com/geany/geany/pull/2234?email_source=notifications\u0026email_token=AAIOWJYHSNZLXYMOBAB4JSTQCQ4KLA5CNFSM4IHNIU32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3N2E3Y#issuecomment-517710447",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>