[Geany-Devel] Devel Digest, Vol 93, Issue 2
Thomas Martitz
kugel at xxxxx
Thu Dec 17 10:45:37 UTC 2015
Am 15.12.2015 um 14:38 schrieb Jiří Techet:
>
>
> I can probably find an alternative workaround for
> document_close_all, e.g. iterate document_index(0) until it
> returns NULL, and call document_close; so I think should be ok too.
>
>
> Yep, it should be pretty easy to do this manually so the question is
> whether extra API is needed.
document_close_all() is useful on its own because there's an important
detail: it's transactional. Either all or no documents are closed. As a
consequence, if one or more docs spawned a dialog (because of being
unsaved) and that dialog is cancelled, then no file is closed.
This is what's done when Geany exits. This is impossible with just doing
document_close() in a loop (unless you export
document_account_for_unsaved()).
So yes, document_close_all() should be exported.
>
>
> Anyway, I'm sure document_close_all could be used by many plugins,
> but filetypes_detect_from_document is not needed. The project
> functions would be much appreciated. That's all on my xmas wishlist :)
>
>
> As it usually works, the best presents have to come from yourself,
> there will be just socks and pyjamas under the Christmas tree :-).
>
Right, Per should do the pull request, since he asks for the function.
More information about the Devel
mailing list