From the NannyMUD documentation

LAST CHANGE

2002-12-05

TOPIC

NAME

        ange-ftp - A way to edit files in the mud using Emacs.

DESCRIPTION

	_0._Notation_

	[description]
	  This denotes a variable part that should be replaced with the
	  appropriate data. For example [PWD] should be replaced with
	  your NannyMUD Wizard's password.

	C-Key
	  This denotes that you press the control key and another key at the
	  same time. For example, C-A would mean that you press the control
	  key and the a key.

	[TEXT]
	  This marks an argument that should be replaced by the appropriate
	  data. For example, [PWD] should be replaced with your NannyMUD
	  wizard's password.


        This document is intended to describe how to set up ange-ftp to work
        with NannyMUDs ftp. There are two parts here: one dealing with the
        UNIX operating system, and one dealing with Windows95/NT.

        If you have NTEmacs also check this page:
        http://www.cs.washington.edu/homes/voelker/ntemacs.html#ange-ftp


	_1._UNIX_operating_systems_

        There are several ways of getting ange-ftp to work. We will
	describe a few here.


	_1.1_Build_.netrc_

	This step is optional, but will speed up your connection process.
	If you do not want to create a .netrc file, skip to 1.2 below.
	Create a file called .netrc with this content in your homedir (or
	add the row if the file is already there):

        --%X-------
        machine "mud.lysator.liu.se 2345" login [NAME] password [PWD]
        --%X-------

        'machine' is the FTP-server you want to connect to, in this case
        NannyMUDs FTP-server called mud.lysator.liu.se, at port 2345.
        [NAME] is your wizard characters name.
        [PWD] is your wizards characters password.

        After you have created the file you need to alter the
        file protection on .netrc:

        --%X-------
        ~/# chmod 600 .netrc    
        --%X-------
	

        _1.2_Edit_.emacs_

        Add the following to your .emacs file:
        
        ;; --- Connection to NannyMUD ---
        ;; --- Courtesy of the wizard Hans: hans@NannyMUD ---

        ;; Block 1
        (require 'ange-ftp)

        ;; Block 2
        (defun ftp-nanny()
          "Connects to the ftp server for NannyMUD."
                 (interactive)
                 (find-file "/[NAME]@mud.lysator.liu.se 2345:~"))

        ;; If you want to use ftp passive mode (which you must do in
	;; order to get around certain firewalls), you may want to
	;; add have this:

        (defun ange-ftp-set-passive ()
         (ange-ftp-raw-send-cmd proc "passive"))

        (add-hook 'ange-ftp-process-startup-hook 'ange-ftp-set-passive)
	
        ;; Block 3
        ;; Bind C-; to run the new function
        (global-set-key [?\C-;] 'ftp-nanny)

        ;; --- End NannyMUD block ---

        (replace [NAME] with your wizards name).

        The NannyMUD block is composed of 3 different parts: the first one
        loads the ange-ftp package into your emacs; the second one defines a
        function that will connect to NannyMUD in the right way; the third
        creates a key-binding that will enable you to connect using just
        one key (in this example, it is C-;). 

		
	_1.3_Connect_

	Now you are ready to connect to NannyMUD. First of all, restart your
	Emacs so that the new .emacs can be loaded. Now, depending from how
	many of the previous steps you have completed, some (or all) of the
	following should work: 

	
        _1.3.1_No_setting_required_

	C-x C-f (To open the file-open dialog also known as M-x find-file)
	        (if you are using Xemacs, you can just click on the 'open'
		 button) 
	Then enter:
          /[NAME]@mud.lysator.liu.se[C-q][SPACE]2345:/[C-q]~

        where C-Q was used to escape a space before the port number, and
        another one to escape the ~.

	This way should always work, even if you don't have a .netrc, nor
	the second, nor the third block of the .emacs.

	If you set your .netrc you should just get the listing of your 
	home directory; otherwise, you are prompted for your wizard's
	password. Also, if you set your .netrc file in the open-file dialog
	you should also be able to write the somewhat shortened version
	/@mud[tab]
	and then emacs will complete it for you.


	_1.3.2_Using_the_function_defined_in.emacs_

	If you set the function ftp-nanny (see second block in the .emacs
	file) then the following should also work:

	C-x C-f (To open the file-open dialog also known as M-x find-file)
	        (if you are using Xemacs, you can just click on the 'open'
	        button)
	Then enter:
	  ftp-nanny


	_1.3.3_Using_the_special_key_

	If you have defined the key to connect in your .emacs, just type:

	[C-;]
	
	or whatever you have defined instead of this, and you are in.
	
        Once you are connected you can use your emacs to edit files just 
        as if the were found on your local filesystem.


	_2._Windows95/NT_

	Most of the steps described above should work also for Windows 
	operating systems. However, you need to get another ftp program that
	works with Emacs, since the standard one provided with the system
	does not. This could be a place to find one (19990513):

        http://www.cs.washington.edu/homes/voelker/ntemacs/contrib/ftp.exe
 
        Put the new ftp somewhere, making sure you DO NOT OVERWRITE THE
        ORIGINAL ONE provided by your system.


	_2.1_Using_the.emacs_file_
	
        Make sure you have emacs 19.34.6 or newer, or you will need to find a
        special (and old, and what fun is that?) version of ange-ftp.el. Then
        fix your .emacs file, which should be in c:\.emacs.

        Assuming your emacs is located in d:/emacs-19.34/, put this into your
        .emacs:
 
        (require 'ange-ftp)          
        (setq load-path (cons "d:/emacs-19.34/lisp" load-path))
        (setq ange-ftp-ftp-program-name "d:/emacs-19.34/bin/ftp.exe")
        (setq ange-ftp-tmp-name-template "d:/emacs-19.34/temp/ange-ftp")
        (setq ange-ftp-gateway-tmp-name-template "d:/emacs-19.34/temp/ange-ftp")
 
        You also need to have a .netrc in c:\.netrc. You can check the help
        on ange-ftp in emacs itself to see what should go in this file.

	Now you can safely run through the steps described for the Unix 
	operating system. :)


	_2.2_Without_using_the_.emacs_file_

	If you have ange-ftp, but cannot get your .emacs to to the work for
	you, this should still work:

	C-x C-f /[NAME]@mud.lysator.liu.se[C-q][SPACE]2345:/players/[NAME]

NOTE

        This is of course dependent on ftp on both sides, if either side
        fails to work correctly it will not work. Also, since you are using

NOTE

        FTP it will be slower than if the files resided on your local
        filesystem.

SEE ALSO

        ftp in wizinfo/ftp