gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Enrico Sersale
Subject: Re: Fwd: emacs.app does not support -GSFilePath
Date: Thu, 25 Jan 2007 13:27:24 +0200
User-agent: GNUMail (Version 1.2.0)

On 2007-01-25 03:06:09 +0200 Adrian Robert <address@hidden> 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:

* <p>If 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]