public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin Emacs and windows paths
@ 2012-03-10  6:18 Leo
  2012-03-10 14:21 ` Ken Brown
  2012-03-12 11:55 ` Ken Jackson
  0 siblings, 2 replies; 7+ messages in thread
From: Leo @ 2012-03-10  6:18 UTC (permalink / raw)
  To: cygwin

Hi there

Recently I bit the bullet and made the switch from NT Emacs to Cygwin
Emacs. And with this finally the annoying bash error message "cannot
set terminal process group (-1): Inappropriate ioctl for device"
disappeared... :-)

Now my normal Windows paths copied from Windows Explorer don't work
anymore in Emacs - and vice versa. I know I can use `cygpath` to
convert /on the command line/, but is there any integration for this 
in Cygwin Emacs?

Many thanks, Leo

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cygwin Emacs and windows paths
  2012-03-10  6:18 Cygwin Emacs and windows paths Leo
@ 2012-03-10 14:21 ` Ken Brown
  2012-03-10 22:19   ` Ken Brown
  2012-03-12 11:55 ` Ken Jackson
  1 sibling, 1 reply; 7+ messages in thread
From: Ken Brown @ 2012-03-10 14:21 UTC (permalink / raw)
  To: cygwin

On 3/10/2012 1:17 AM, Leo wrote:
> Hi there
>
> Recently I bit the bullet and made the switch from NT Emacs to Cygwin
> Emacs. And with this finally the annoying bash error message "cannot
> set terminal process group (-1): Inappropriate ioctl for device"
> disappeared... :-)
>
> Now my normal Windows paths copied from Windows Explorer don't work
> anymore in Emacs - and vice versa. I know I can use `cygpath` to
> convert /on the command line/, but is there any integration for this
> in Cygwin Emacs?

No.  There may actually be some obsolete Cygwin-specific code in 
files.el that's preventing this from working.  It's possible that emacs 
is trying to be too smart instead of letting Cygwin handle the file 
names.  (See, for instance, `convert-standard-filename'.)  I'll take a 
look at it when I get a chance.

But it's generally recommended that you use POSIX-style paths in the 
Cygwin environment.  For example, write `/cygdrive/c/foo' instead of 
`c:\foo'.  To save typing, you can put the following line into /etc/fstab:

   C: /c some_fs binary,posix=0 0 0

Then you can just type `/c/foo'.  See the Cygwin User's Guide for more 
information:

   http://cygwin.com/cygwin-ug-net/using.html#cygdrive
   http://cygwin.com/cygwin-ug-net/using.html#mount-table

Ken


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cygwin Emacs and windows paths
  2012-03-10 14:21 ` Ken Brown
@ 2012-03-10 22:19   ` Ken Brown
  2012-03-10 22:37     ` Leo
  0 siblings, 1 reply; 7+ messages in thread
From: Ken Brown @ 2012-03-10 22:19 UTC (permalink / raw)
  To: cygwin

> On 11/03/2012, at 1:20 AM, Ken Brown wrote:
>
>> On 3/10/2012 1:17 AM, Leo wrote:
>>> Now my normal Windows paths copied from Windows Explorer don't work
>>> anymore in Emacs - and vice versa. I know I can use `cygpath` to
>>> convert /on the command line/, but is there any integration for this
>>> in Cygwin Emacs?
>> No.  There may actually be some obsolete Cygwin-specific code in files.el that's preventing this from working.  It's possible that emacs is trying to be too smart instead of letting Cygwin handle the file names.  (See, for instance, `convert-standard-filename'.)  I'll take a look at it when I get a chance.
> I'm thinking of a cygwin-specific package which converts the internal Cygwin paths to normal Windows path when copied to the clipboardÂ…
>
> This can be too hard though: The problem might be to determine when the clipboard is copied for use outside emacs and when for use inside emacs. But I'll try at least to make some lisp code to convert per key-binding. Do you thinking it's advisable to call cygpath for doing the conversion? Are there some internal bindings already for this in Cygwin Emacs?

Please reply to the list instead of directly to me.  To avoid messing up 
the threading in the mailing list archives, I'm replying to the original 
thread, with your message to me pasted in.

I do think it's advisable to call cygpath, and I don't know of any 
bindings in the code that you can use.  But I had to do something 
similar once in order to make browse-url work properly on Cygwin.  (In 
that case I had to convert from POSIX paths to Windows paths.)  Take a 
look at the Cygwin-specific code in the function browse-url-file-url in 
lisp/net/browse-url.el.  You may be able to use a similar idea.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cygwin Emacs and windows paths
  2012-03-10 22:19   ` Ken Brown
@ 2012-03-10 22:37     ` Leo
  0 siblings, 0 replies; 7+ messages in thread
From: Leo @ 2012-03-10 22:37 UTC (permalink / raw)
  To: cygwin


On 11/03/2012, at 9:19 AM, Ken Brown wrote:

>> On 11/03/2012, at 1:20 AM, Ken Brown wrote:
>> 
>> This can be too hard though: The problem might be to determine when the clipboard is copied for use outside emacs and when for use inside emacs. But I'll try at least to make some lisp code to convert per key-binding. Do you thinking it's advisable to call cygpath for doing the conversion? Are there some internal bindings already for this in Cygwin Emacs?
> 
> Please reply to the list instead of directly to me.  To avoid messing up the threading in the mailing list archives, I'm replying to the original thread, with your message to me pasted in.

Extremely sorry about this. With Apple Mail I use a "modern" Mail client not anymore tailored to classic mailing lists - so I have to set things like Plain-text setting, 70-character wrapping and correct reply-to by hand…

> I do think it's advisable to call cygpath, and I don't know of any bindings in the code that you can use.  But I had to do something similar once in order to make browse-url work properly on Cygwin.  (In that case I had to convert from POSIX paths to Windows paths.)  Take a look at the Cygwin-specific code in the function browse-url-file-url in lisp/net/browse-url.el.  You may be able to use a similar idea.
> 

Thanks heaps for this! I had a quick look at browse-url.el and it has the right stuff in there. Cool!

Cheers, Leo

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cygwin Emacs and windows paths
  2012-03-10  6:18 Cygwin Emacs and windows paths Leo
  2012-03-10 14:21 ` Ken Brown
@ 2012-03-12 11:55 ` Ken Jackson
  2012-03-12 12:19   ` Leo
  1 sibling, 1 reply; 7+ messages in thread
From: Ken Jackson @ 2012-03-12 11:55 UTC (permalink / raw)
  To: cygwin

On 03/10/2012 01:17 AM, Leo wrote:
> Now my normal Windows paths copied from Windows Explorer don't work
> anymore in Emacs - and vice versa. I know I can use `cygpath` to
> convert /on the command line/, but is there any integration for this
> in Cygwin Emacs?
I prefer to wrap everything in a shell script.  This is the one I use,
though I actually use "cygpath -w" because I still use NTemacs
because I don't always start X.

EVAL isn't needed but I make all my shell scripts work with -n or
--dry-run so I can see what would happen.

  #!/bin/sh
  ARGS=();  EVAL=eval;  EMACS=emacs;  AMP='&'
  while [ $# -gt 0 ]; do
      case "$1" in
          -e|--existing)    EMACS='emacsclient --no-wait';  AMP=  ;;
          -n|-nn|--dry-run) EVAL='echo #'                         ;;
          -*|+*)            ARGS[${#ARGS[*]}]="'$1'"              ;;
          *)                ARGS[${#ARGS[*]}]="'$(cygpath "$1")'" ;;
      esac
      shift
  done
  $EVAL $EMACS "${ARGS[@]}" "$AMP"

-Ken Jackson

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cygwin Emacs and windows paths
  2012-03-12 11:55 ` Ken Jackson
@ 2012-03-12 12:19   ` Leo
  2012-03-12 23:58     ` Ken Jackson
  0 siblings, 1 reply; 7+ messages in thread
From: Leo @ 2012-03-12 12:19 UTC (permalink / raw)
  To: cygwin

On 12/03/2012, at 10:09 PM, Ken Jackson wrote:

> On 03/10/2012 01:17 AM, Leo wrote:
>> Now my normal Windows paths copied from Windows Explorer don't work
>> anymore in Emacs - and vice versa. I know I can use `cygpath` to
>> convert /on the command line/, but is there any integration for this
>> in Cygwin Emacs?
> I prefer to wrap everything in a shell script.  This is the one I use,
> though I actually use "cygpath -w" because I still use NTemacs
> because I don't always start X.

Ken, you still use NTEmacs? How does *your* NTEmacs cope with the new bash/cygwin environment? Don't you get the "Inappropriate ioctl for device" error?
It would be very convenient to find a way back to NTemacs with cygwin-bash inside it…

Leo


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Cygwin Emacs and windows paths
  2012-03-12 12:19   ` Leo
@ 2012-03-12 23:58     ` Ken Jackson
  0 siblings, 0 replies; 7+ messages in thread
From: Ken Jackson @ 2012-03-12 23:58 UTC (permalink / raw)
  To: cygwin

On 03/12/2012 08:19 AM, Leo wrote:
 > On 12/03/2012, at 10:09 PM, Ken Jackson wrote:
 > >> On 03/10/2012 01:17 AM, Leo wrote:
 >>> Now my normal Windows paths copied from Windows Explorer don't work
 >>> anymore in Emacs - and vice versa. I know I can use `cygpath` to
 >>> convert /on the command line/, but is there any integration for this
 >>> in Cygwin Emacs?
 >>
 >> I prefer to wrap everything in a shell script. This is the one I use,
 >> though I actually use "cygpath -w" because I still use NTemacs
 >> because I don't always start X.
 >
 > Ken, you still use NTEmacs? How does *your* NTEmacs cope with the new 
bash/cygwin
 > environment?  Don't you get the "Inappropriate ioctl for device" error?
 > It would be very convenient to find a way back to NTemacs with 
cygwin-bash inside itÂ…

I've never seen that error.

But I guess you're talking about running bash inside emacs--which I
never do.  It's been my habit for years, whether on Linux or Cygwin,
to have multiple terminal windows open and to press ALT-TAB to get
to one of them when I need the command line.

-Ken Jackson

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-12 23:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-10  6:18 Cygwin Emacs and windows paths Leo
2012-03-10 14:21 ` Ken Brown
2012-03-10 22:19   ` Ken Brown
2012-03-10 22:37     ` Leo
2012-03-12 11:55 ` Ken Jackson
2012-03-12 12:19   ` Leo
2012-03-12 23:58     ` Ken Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).