>write the documentation explaining what this plugin is supposed to do, sounds 
>like it does something different to what @eht16 understood "pin" to mean, and 
>I have always been confused about what it was meant to do.

I'm happy to elaborate an idea or re-frame a goal if I haven't made myself 
clear to someone. In this case, I didn't know I wasn't being understood. Please 
let me know next time if you are confused by my description or feel I need to 
expand on it more.

>and do not describe it in terms of some other software, eg do not say "like 
>firefox/eclipse/vscode/libreoffice" ;-)

I feel that's an unnecessarily rigid policy and I don't really plan to stop 
using them (when I believe it's appropriate) based on your demand. I believe 
that comparisons can be a useful tool when trying to describe something; but I 
acknowledge that sometimes comparisons aren't always adequate and shouldn't be 
solely relied upon to express a desired feature.

> [end getting in ahead]

I don't know what that means.

>relating to [Return NULL from document_get_current() if document is 'untitled' 
>geany#3770](https://github.com/geany/geany/pull/3770) and depending on the 
>answer to the above, you should be working with notebook pages, not documents. 
> I'm pretty sure that plugins can open pages that do not have documents, let 
>alone files.

I don't know what you mean. I work with documents when I use Geany. The plugin 
apparently uses a sidebar notebook 
(`plugin->geany_data->main_widgets->sidebar_notebook`). I use the plugin to 
open or switch to documents. Maybe our miscommunication stems from my lack of 
experience developing Geany or GTK development, but feel free to elaborate.

> 
>And a hint always check `document_valid()` on a document pointer in any 
>callback if you pass it via the data pointer, the user can always close pages 
>and documents or reorder pages manually.

I searched for `document_valid` in the geany-plugins source code and no results 
came up. When I searched for `document_get_current`, many results came up. I'm 
confused as to why you would suggest I use a function that no other plugin 
developer uses... and apparently isn't even a function included in [the 
API](https://www.geany.org/manual/reference/globals_func_d.html#index_d).

I'm not accessing any GeanyDocument pointers passed through a callback. In one 
case, I pass the file_name member as a gchar, after it's been validated by 
another function.

Due to [#3770](https://github.com/geany/geany/pull/3770) I use this to validate 
the file_name after I enter a callback function:

```
  GeanyDocument* doc = document_get_current();
  if (!(doc && doc->is_valid))
    return;

  if (doc->file_name == NULL)
    return;
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1308#issuecomment-1952468458
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany-plugins/pull/1308/c1952468...@github.com>

Reply via email to