Don
Faire un don pour aider au developpement de WiPhA

Recherche




Préférences

 Nombre de membres 29 membres


Utilisateurs en ligne

( personne )
Visites

 147703 visiteurs

 10 visiteurs en ligne

forum.gifForum - External Editor - Sujet n°12


Sujet n°12 Problem with TextEdit / Mac OS X
    par RichWales - rank
le 28/09/2005 @ 21:35
RichWales
Thanks very, very much for this extension.  I'm having some trouble using it, though.

In Mac OS X 10.3.9, I tried using TextEdit as an external editor, but I got the following error:  "ExtEditor: Cannot run executable",
with the following details:

[Exception: "Component returned failure code: 0x80004005
(NS_ERROR_FAILURE) [nsIProcess.init]"

and a location: "JS frame :: chrome://exteditor/content/exteditor.js :: extEditorRunProgram :: line 596"

I also tried this extension in WinXP Home SP2, using gVim as the external editor.  It worked, but I'm going to need to try playing with some more, because I really need to be able to run gVim (or maybe VIM in an Xterm window) in a Cygwin context.  Right now, if I launch gVim as an external editor and try doing "!!some_command" stuff in gVim, it will only run DOS commands, not Cygwin commands.

So, it looks promising, but not quite what I need -- at least, not yet.
Site web RichWales Ecrire à RichWales Poster une réponse



Réponse n°1 par Globs - rank ( 24 messages )
le 28/09/2005 @ 21:51
Globs

Dixit...
In Mac OS X 10.3.9, I tried using TextEdit as an external editor, but I got the following error:  "ExtEditor: Cannot run executable",


Hi,
It's because 'this' TextEdit is not the real executable file. It's just a folder named TextEdit.app. Use the terminal and go look inside. The executable you should call in the extension is:

TextEdit.app/Contents/MacOS/TextEdit

But this is not a good editor to be used with my extension: after you edited your file, you need to quit TextEdit for the extension to get the modified message. You'd better find a gvim OS X version smile.

On Windows, you're right. Go ahead with Cygwin, it's the only way to feel good with this os, IMO.
Site web Globs Ecrire à Globs Poster une réponse

Haut

Réponse n°2 par RichWales - visiteur
le 28/09/2005 @ 22:39
Anonyme
Thanks for the help with getting TextEdit to work as an external editor in Mac OS X.  I agree completely, TextEdit is definitely not a good editor to use with this extension.  The only reason I used it for my initial test was because it was already on my Mac.

I would be grateful for any suggestions on how to make this extension launch gVim in a Cygwin context on my WinXP PC.
Ecrire à RichWales Poster une réponse

Haut

Réponse n°3 par Globs - rank ( 25 messages )
le 29/09/2005 @ 19:08
Globs
I can tell you what I do to launch NEdit in Windows using Cygwin. Then, you should be able to change the scri­pts to adapt it to gvim.

I actually launch nedit.bat with the file as a parameter.

@ECHO OFF

IF '%1'=='' GOTO EMPTY

:LOOP
IF '%1'=='' GOTO END
D:\cygwin\bin\sh.exe /cygdrive/c/nedit/start-nc.sh %1
SHIFT
GOTO LOOP

:EMPTY
D:\cygwin\bin\sh.exe /cygdrive/c/nedit/start-nc.sh

:END



This .bat calls start-nc.sh:
I highlighted the important parts.


#!/bin/sh

# Hide the command window:
/cygdrive/c/nedit/hidewndw  /n /fh "C:\WINDOWS\System32\cmd.exe"  # when dragging a file on the NEdit icon
/cygdrive/c/nedit/hidewndw  /n /fh "NEdit"  # when double-click the NEdit icon

# to find the display
export DISPLAY=127.0.0.1:0.0

# specify a home directory, NEdit needs it to store its preference files
export HOME=/cygdrive/c/nedit

# this is a new variable. when set, NEdit stores its preference files
# in this directory under the new names 'nedit.rc' (previous name '.nedit')
# and `autoload.nm' (previous name '.neditmacro')
export NEDIT_HOME=/cygdrive/c/nedit/neditrc

# for the keyboard, isn't always necessary
export XKEYSYMDB=/cygdrive/c/nedit/xkeysymdb

# to find the cygwin1.dll, shell commands, X libraries
export PATH=/cygdrive/c/nedit:/cygdrive/c/cygwin/bin:/usr/X11R6/bin/:"$­PATH"

# if you bind NEdit to file extensions, you should start your X server here
# to make sure not to forget to start it before NEdit!
# For example "/cygdrive/c/path-to-server/xserver &"
/cygdrive/c/Program\ Files/myXserver/xserver.exe &

# handling calls with multiple files, files and path names with empty spaces and
# upper-case - lower-case difference
if [ "$­1" != "" ]
then
    if [ "$­1" = "-wait" ]
    then
        opt="$­opt $­1"
        shift
    fi
    filename="$­*"
    # since under Windows there is o difference between small and capital
    # letters, but NEdit sees a difference internally, the file name and
    # path get translated to all lower-case
    filename=`cygpath -u "$­filename" | tr A-Z a-z`
    nc $­opt "$­filename"
else
    nc
fi


Not so easy, is it ?cool

Site web Globs Ecrire à Globs Poster une réponse

Haut

^ Haut ^

Site non déclaré à la CNIL dans le cadre de la dispense n°6
Vous disposez d'un droit d'accès, de modification, de rectification et de suppression des données qui vous concernent via votre profil.
GuppY - http://www.freeguppy.org/    Site créé avec GuppY v4.5.14 © 2004-2005 - Licence Libre CeCILL   GuppY - http://www.freeguppy.org/

Document généré en 0.22 seconde