Re: SWI-Prolog MacOS app

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 08/16/2013 02:46 PM, Paulo Moura wrote:

>> - Currently, I register Prolog for .pl and .prolog files (still
>> need to figure out how to get an icon there).   More?
>
> If more, than maybe give the option to set/unset registering of each
> specific extension in the application preferences.

I don't know whether you can do that.  You make these associations
in the Info.plist file in the app bundle.  Apple does seem to have
some ways to deal with the fact that multiple applications can
register for the same extension though.  Dunno how this works.

My .prolog files now nicely show up using an owl :-)  So, the
idea is to have the main load/run file with the .prolog extension
and then you can do the rest using .pl.

>> - Double clicking always sends a message to the already running
>> app, while I think you want to load the file into a new instance.
>> So, if a running app gets a file-open-event, it now runs
>>
>> open -n -a <myself> <file>
>>
>> Does that make sense?
>
> Could that be configure in the application preferences? Both
> scenarios seems sensible to me.

[Also to Samer] This is not really a normal Mac App in the sense
that opening the file gets you a Prolog shell with the file loaded.
The Prolog shell only has one global state.  Of course, you could
load subsequent files into the same shell, but it doesn't make
much sense.  You could also open subsequent files in the editor.
That might make a little more sense.  Maybe I can add a flag.
Something like

   on_mac_open_file_event with values
	
	- consult (consult in current instance)
	- new_instance (open the file in a new application instance)
	- edit (open the file in the editor)

>> - What if you just start Prolog from the Applications folder, it
>> now starts in this directory.  That is most likely not what you
>> want.  In Windows it creates a Prolog directory under the
>> `personal' folder and starts there.  Is there a similar convention
>> for the Mac?
>
>
> I would start by default in the user home directory.

Done that.  Bit hacky because it is non-trivial to see whether you
have been started from the Launcher or from Terminal.  At least,
I didn't manage to find a clean way.  What I now do is check there
are no commandline arguments and the working dir is just above the
app.

	Cheers --- Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.