Re: Fwd: emacs.app does not support -GSFilePath

2007-01-25 Thread Enrico Sersale

On 2007-01-25 03:06:09 +0200 Adrian Robert [EMAIL PROTECTED] wrote:


Hello,

Someone was asking me about whether Emacs.app supports the - GSFilePath 
option which GWorkspace uses to tell applications to open  files.  I thought 
that there were already two ways to do this in  OpenStep / Cocoa: -NSOpen 
option, and NSApplication- application:openFIle: method via DO or 
notifications.  Is this  correct or is the GNUstep-specific -GSFilePath 
really needed?


thanks,
Adrian


If the application is running GWorkspace uses -application:openFIle:, if not it 
launches it with -GSFilePath and the path of the file to open as arguments.

In NSWorkspace.m I read:

* pIf the Info-gnustep.plist of an application says that it
* can open files with a particular extension, then when NSWorkspace
* is asked to open such a file it will attempt to send an
* -application:openFile: message to the application (which must be
* handled by the applications delegate).  If the application is not
* running, NSWorkspace will instead attempt to launch the application
* passing the filename to open after a '-GSFilePath' flag
* in the command line arguments.  For a GNUstep application, the
* application will recognize this and invoke the -application:openFile:
* method passing it the file name.
* /p

and, in NSApplication.m, we find:

  /*
   *Now check to see if we were launched with arguments asking to
   *open a file.  We permit some variations on the default name.
   */
  if ((filePath = [defs stringForKey: @GSFilePath]) != nil
|| (filePath = [defs stringForKey: @NSOpen]) != nil)
{
  [_listener application: self openFile: filePath];
}
...

That is, NSApplication treats GSFilePath and NSOpen as the same thing and, 
if Emacs.app implements -application:openFIle: in its delegate, this is the method that will be 
called.



___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: Fwd: emacs.app does not support -GSFilePath

2007-01-25 Thread Fred Kiefer
Adrian Robert schrieb:
 Someone was asking me about whether Emacs.app supports the -GSFilePath
 option which GWorkspace uses to tell applications to open files.  I
 thought that there were already two ways to do this in OpenStep / Cocoa:
 -NSOpen option, and NSApplication-application:openFIle: method via DO
 or notifications.  Is this correct or is the GNUstep-specific
 -GSFilePath really needed?
 

Not sure, if I did understand your question. The code in [NSApplication
finishLaunching] supports NSOpen and GSFilePath, so if an application
inherits from this class it should just work with both parameters.


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Fwd: emacs.app does not support -GSFilePath

2007-01-24 Thread Adrian Robert

Hello,

Someone was asking me about whether Emacs.app supports the - 
GSFilePath option which GWorkspace uses to tell applications to open  
files.  I thought that there were already two ways to do this in  
OpenStep / Cocoa: -NSOpen option, and NSApplication- 
application:openFIle: method via DO or notifications.  Is this  
correct or is the GNUstep-specific -GSFilePath really needed?


thanks,
Adrian




___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev