Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libpd_add_to_help_path #332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

actondev
Copy link

While working with libpd (and launching the gui), I couldn't get use the help functions.
Now, by calling libpd_add_to_help_path("/usr/lib/puredata/doc/5.reference") (in linux) it works

@danomatika
Copy link
Member

Yes, this is normal behavior as libpd does not set any search paths by default.

@danomatika
Copy link
Member

danomatika commented May 15, 2021

Better is probably to have the local GUIs search paths added when launching the GUI, possibly by an additional argument in the start function.

EDIT: What do you think @umlaeute @millerpuckette ?

@umlaeute
Copy link
Contributor

Better is probably to have the local GUIs search paths added when launching the GUI, possibly by an additional argument in the start function.

i'm not sure i understand the context (libpd vs pd). which start function?

  • help-paths only make sense with a GUI
  • but help-patches are opened by the core (this is important if you are running GUI and core on different machines)

@danomatika
Copy link
Member

danomatika commented May 18, 2021

i'm not sure i understand the context (libpd vs pd). which start function?

You can start a local GUI from within libpd if a Pd installation is found and the libpd instance acts as the core. The issue is that libpd by default does not add any search or help paths. This PR proposes to add a function to add to libpd's help paths.

Normally, I'd say help paths are not needed for libpd since it's essentially an embedded, headless core. When working with the GUI, they could be which is why my thinking is more along the lines of: "optionally add some help paths from the Pd installation automatically when launching the GUI from within libpd." If it's too difficult or fragile to divine these paths, then this PR would also work, although it foists the path finding back onto the user.

@umlaeute
Copy link
Contributor

umlaeute commented May 18, 2021

the most important question for me is: why do we need to wrap the -helppath flag into a function in the first place?

afaict, libpd_add_to_search_path() will already achieve the same thing, without having to add yet another symbol of obscure use.

at least: i don't think i've used the -helppath startup flag in the last decade and think that this flag was a mistake in the first place (though doc/5.reference/ is typically in my help-path anyhow)

the only drawback i can think of, is that libpd_add_to_search_path() will expose all pd-files within the doc/5.reference/ folder as abstractions.
this is probably not a problem with the help-patches themselves, but there's also a very generically named [setctl] abstraction (used in slop~-help).

@danomatika
Copy link
Member

danomatika commented May 19, 2021

I would prefer the behavior matched desktop Pd, if possible, which is why I suggested having it done automatically if you choose to add paths when opening the GUI. We can then do help and search paths internally.

@umlaeute
Copy link
Contributor

umlaeute commented May 20, 2021

i think doing it automatically in libpd_start_gui() is fine with me (for whatever I have to say on this, which is precious little).

i'm pretty sure that it is much better than adding libpd_add_to_help_path().

automatically adding the help-paths has some side-effects on the (lib)Pd-instance though (obviously there are now help-paths which haven't been there before), and i wonder whether this should be undone in libpd_stop_gui() (otoh, the help-paths are never going to be used without the GUI, so little harm is done here; but what happens if you start different Pd-GUIs one after the other? which help-paths will be searched for in which priority?)

@danomatika
Copy link
Member

danomatika commented May 20, 2021 via email

@umlaeute
Copy link
Contributor

I just wonder what the right balance between “automatic” and “manual choice” is in this case.

hmm, what are the choices?
so far it only seems to be about adding the doc/5.reference/ folder to the help-paths.
is there anything else? (libpd makes it clear, that "unlike desktop pd, no search paths are set by default (ie. extra)")

if not, this makes the answer about the "right balance" a binary one (add, or not).

@danomatika
Copy link
Member

danomatika commented May 21, 2021 via email

@umlaeute
Copy link
Contributor

Manual choice would be adding the proposed function for manually adding the to the help paths, but as I’ve written previously, I don’t think it’s necessary.

seems we agree than (without having anything to say here, i think it is a bad idea to add a special function to the API for such a niche-case).

anyhow, here' another idea:
if the libpd_start_gui() function is still open for changes, you could add a second "flags" argument with a (currently single; but extendable in the future) flag to add the help-path (or not).

@danomatika
Copy link
Member

I think this is actually something that should be implemented upstream in sys_startgui(). libpd simply wraps this call.

@danomatika
Copy link
Member

Ping @millerpuckette

@danomatika
Copy link
Member

Looking at this again, it could be a problem as IOhannes notes, when you open multi copies of the GUI and possible end up adding different help paths each time and there is no way to clear the help paths. This is also tru for the search paths, however, although maybe that should be changed? I will need to let this one sit for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants