Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!cornell!batcomputer!pyramid!hplabs!hplabsz!mayer From: mayer@hplabsz.HPL.HP.COM (Niels Mayer) Newsgroups: comp.emacs Subject: Re: remote editing Message-ID: <836@hplabsz.HPL.HP.COM> Date: Wed, 7-Oct-87 19:50:45 EDT Article-I.D.: hplabsz.836 Posted: Wed Oct 7 19:50:45 1987 Date-Received: Sat, 10-Oct-87 18:50:16 EDT References: <2257@umn-cs.UUCP> Reply-To: mayer@hplabsz.UUCP (Niels Mayer) Organization: Hewlett-Packard Laboratories Lines: 70 An intersting extension you might want to consider once you have remote editing up and running: When you want to do a 'make' after you've just edited a remote file, use a modified version of compile.el that looks at a buffer-local variable containing the remote host's name and run the compilation through rsh(1) on the remote host. Under HPUX+GNU, we can access remote files by opening a network connection via M-X netunam, and then access the file normally with ^X^F /net/host/path/file. I made a simple and crufty extension to compile.el that looks to see whether the buffer-file-name is remote and if so, I execute the compile command in a remsh (HPUX equivalent to rsh, renamed to prevent conflict with SYSV rsh which is a restricted sh).... Those of you using ftp.el or rcp.el to do remote editing may want to do something similar by storing the appropriate information in a buffer-local variable and munging compile.el appropriately. here's the relevant diffs between the 18.47 version of compile.el and my version: 82,91c82,119 < (setq compilation-process < (start-process "compilation" "*compilation*" < shell-file-name < "-c" (concat "exec " command))) < (with-output-to-temp-buffer "*compilation*" < (princ "cd ") < (princ default-directory) < (terpri) < (princ command) < (terpri)) --- > (cond > ((string-match "/net" default-directory) > (let (host > host-dir) > (setq host (substring default-directory > (+ 1 (match-end 0)) > (string-match "/" default-directory (+ 1 (match-end 0))))) > (setq host-dir (substring default-directory > (- (match-end 0) 1) > (length default-directory))) > (let ((default-directory (getenv "HOME"))) ;to prevent shell bug caused by pwd being a /net directory > (setq compilation-process > (start-process "compilation" "*compilation*" > "/usr/bin/remsh" host > "cd " host-dir ";" command))) > (with-output-to-temp-buffer "*compilation*" > (princ "remsh ") > (princ host) > (terpri) > (princ "cd ") > (princ host-dir) > (terpri) > (princ command) > (terpri)) > ) > ) > (t > (setq compilation-process > (start-process "compilation" "*compilation*" > shell-file-name > "-c" (concat "exec " command))) > (with-output-to-temp-buffer "*compilation*" > (princ "cd ") > (princ default-directory) > (terpri) > (princ command) > (terpri)) > ))