I've hit a brick wall with this. I'm running cygwin on a Windows 7 machine. I can't connect vai ange-ftp to an ftp server, hosted by godaddy.com. I do C-x C-f /username@ftp.foo.com: (to get a dir listing) or :index.html (file exists), and in both cases emacs asks me for my password, I enter it, and then emacs freezes. Hard freezes - only way to kill it is to use Task Manager, and kill two emacs-w32 processes.

I'm using the cygwin emacs-w32 program.

My .emacs includes (require 'cygwin-mount). I also tried (require 'setup-cygwin) (downloaded most recent version today), but that doesn't load properly. Error about "cannot find cygwin", having to do with a variable that sets the path to cygwin. I couldn't figure it out so commented out (require 'setup-cygwin).

So - suggestions? Could this relate to what ftp client emacs / ange-ftp is finding? Other things about my emacs setup for cygwin? I've been using cygwin emacs for about 6 months and most other things work, including running processes from within emacs (shell, tex, grep, diff, etc).


Here's the result of emacs-w32 --debug-init with (require 'steup-cygwin) in my .emacs. Alas I can't give any error info on the actual ange-ftp issue, since emacs just freezes.

Debugger entered--Lisp error: (wrong-type-argument stringp nil) file-directory-p(nil) (and (file-directory-p directory) (file-readable-p directory) directory) setcyg-dir-p(nil) (if (setcyg-dir-p cygwin-root-directory) nil (error "Cannot find Cygwin. Please customize option `cygwin-root-directory'")) eval-buffer(# nil "/cygdrive/c/Users/strozzi2/.emacs.d/lisp/setup-cygwin.el" nil t) ; Reading at buffer position 4972 load-with-code-conversion("/cygdrive/c/Users/strozzi2/.emacs.d/lisp/setup-cygwin.el" "/cygdrive/c/Users/strozzi2/.emacs.d/lisp/setup-cygwin.el" nil t) require(setup-cygwin) eval-buffer(# nil "/cygdrive/c/Users/strozzi2/.emacs" nil t) ; Reading at buffer position 1708 load-with-code-conversion("/cygdrive/c/Users/strozzi2/.emacs" "/cygdrive/c/Users/strozzi2/.emacs" t t) load("~/.emacs" t t) #[0 "\205\262

**** With new setup-cygwin.el from Drew, it behaves as he said. The relevant part of .emacs is:

(require 'cygwin-mount) (setq cygwin-root-directory "/c/cygdrive/cygwin64/") (require 'setup-cygwin)

Startup now works. C:/cygwin64/ didn't.

And ange-ftp works! Once I put ftp in passive mode to get around firewall. Success!

  • Try to post the exact error message(s). That might help someone help you. And start Emacs using the switch --debug-init. – Drew Jan 15 '16 at 21:43
  • OK, I just did what you asked. It may help sort out setup-cygwin, but won't directly address the ange-ftp error. – D Strozzi Jan 15 '16 at 23:07

The error tells you the problem, I think:

Cannot find Cygwin. Please customize option `cygwin-root-directory'

You need to set that variable. Use M-x customize-option RET cygwin-root-directory RET to do that.

(That said, the code should have handled a non-string argument to setcyg-dir-p. Download the latest setup-cygwin.el to get that fix.)

  • Thanks! I actually downloaded that file this morning. So I think the current version gives the error. – D Strozzi Jan 16 '16 at 2:00
  • I just updated it, before I wrote that. The error is correct - you need to customize the option. The minor fix to the code was to return nil if the value is not a string. Your problem does not come from setup-cygwin.el; it comes from your not having defined option cygwin-root-directory. – Drew Jan 16 '16 at 2:28
  • Yeah, you're right, I forgot to refresh the browser tab viewing that file from yesterday morning. My fault. I updated my question with more info. Now it loads. On to ange-ftp. – D Strozzi Jan 16 '16 at 14:46
  • ange-ftp works now too! Thanks for your help. – D Strozzi Jan 16 '16 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.