greasemonkey/greasemonkey — Issue #1460: MacOS greasemonkey.editor integration
Author: johan
Created: 2011-11-01 23:24:49+00:00
State: open

On MacOS X, most applications don't take aren't designed as command-line executables with a command line parameter, and instead rely on whatever mechanisms power the mac desktop environment.

Long story short, a typical mac application is a directory named something like /Applications/Emacs.app, and in order to launch it on a file from the command line, you invoke open -a Emacs /path/to/file.user.js – i e, drop ".app" and the whole path to the application for the -a argument. Currently I believe only power users are able to figure out ways around this to set their editor on Mac, maybe to /usr/local/bin/mate if they have some programmer oriented editor like TextMate installed.

I think the proper way to address this issue is to make a platform-specific hack for mac that asks for a *.app application in the "pick your editor" dialog, and to cook up some editor pref setting that allows more command-line customization - maybe something that is a json array of command-line arguments, with a "null" for the path argument, or string-interpolating "%s" in args > argv[0], or so.

Related issue: https://github.com/greasemonkey/greasemonkey/issues/1202 (which needs the latter on Windows, and presumably for the occasional really exotic or backwards unix editor).