Sjur Moshagen wrote:
> The information found at
>
> http://www.xmlmind.com/xmleditor/user_faq.html#source_view
>
> doesn't work on the Mac.
>
> When running the macro, different things will happen depending on which
> editor is specified:
>
> - if the editor is a terminal editor (like emacs), the command will
> terminate with an error message saying that standard input isn't a tty
> - if the editor is a GUI application with a command line interface
> (like SubEthaEdit (SEE), started with the 'see' command), XXE will wait
> endlessly for a response, while nothing is ever reaching SEE
> - if the external editor is not specified, but the file is opened in
> the default editor using the command 'open', the file will indeed be
> opened by the default editor for the file type, but XXE will not be
> notified when the editing session is over, and thus you will loose all
> changes unless the document is manually reloaded
>
> This behaviour happens irrespectively of whether XXE is started by
> double clicking the icon, or with .../Resources/Java/xxe.
>
> Environment:
> XMLEditor 3.0 Standard Edition
> MacOS X, 10.4.2
> Java 1.4.2 (latest update from Apple)
> Default shell: bash
>
> I have not been able to figure out a working solution, but would be
> very interested in one, as it is a nice feature:-)
I don't think there is an XXE or a Java problem here. If you carefully
choose the command line used to execute the text editor, it will work fine.
-----
<command name="editXMLSource">
<macro>
<sequence>
<command name="XXE.save" parameter="[ifNeeded]" />
<command name="run" parameter='COMMAND_LINE_HERE "%D"' />
<command name="XXE.open" parameter="[reopenIfNewer]" />
</sequence>
</macro>
</command>
-----
Example, on the Mac (here Emacs is not Apple's standard emacs which is a
terminal editor. Here Emacs is a windowed app -- the MacOS/Carbon port I
think):
* with COMMAND_LINE_HERE=open -a Emacs, it will not work.
* with COMMAND_LINE_HERE=/Application/Emacs.app/MacOs/Emacs, it works
(with some Emacs-ian quirks which could be solved by using environment
variables).
In a nutshell, the command line must point to an executable binary (or
to a shell script, but this shell script must *not* start the text
editor as a background task using '&') for this macro to work.