This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Windows Editor problem

On 3 Aug 2002 at 12:02, Michael Hoffman wrote:

> On Sat, 3 Aug 2002, Raphael wrote:
> > EDITOR=c:/Textpad/TextPad.exe
> >
> > [...]
> > It starts ok, but any file passed through by cygwin misses the first
> > two characters. An example /tmp/crontab.1188 would become mp/crontab.1188
> TextPad appears to be processing /tmp/crontab.1188 as the /t option
> followed by the file name. Non-Cygwin programs generally don't support
> Cygwin paths. Use cygpath. Here's an example for use with Emacs, a
> non-Cygwin program:
> emacs ()
> {
>     command emacs "`cygpath -w \"$@\"`" &
> }
> If you want to set EDITOR perhaps you could make a shell script which does
> the cygpathing.

I have a shell script that I use to edit files with PFE (a Winblows 
programmer's editor that I prefer to unix editors, as the controls 
are more what I'm used to and there's no esc-meta-alt-control-shift 

Here it is:

touch "$1"
fixed=$(cygpath -sw "$1")
C:PFE/PFE32.EXE "$fixed"&

Give it a nonexistent filename and it makes it a zero length file, so 
it can be used to start working on uncreated files, the way unix 
expects. (Without the "touch" command trying to create and work on 
foo.c with foo.c makes PFE complain about the file not being 
found.) I actually have nano set as EDITOR though, and use PFE mainly 
for editing source code.

I've seen some queer glitches using this, however -- some cases where 
the PFE edit buffer has been totally scrogged for no apparent reason, 
only if I've been launching files with that script. Not very common, 
and PFE keeps backups of files so it hasn't caused much data loss.

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]