annotate lisp/net/rcompile.el @ 99539:14811716c629

*** empty log message ***
author Eli Zaretskii <eliz@gnu.org>
date Fri, 14 Nov 2008 12:17:38 +0000
parents 91e5880a36c1
children a9dc0e7c3f2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1 ;;; rcompile.el --- run a compilation on a remote machine
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2
74509
f7702c5f335d Update copyright years.
Glenn Morris <rgm@gnu.org>
parents: 71485
diff changeset
3 ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004,
79714
6888fd3398e8 Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 78230
diff changeset
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
6 ;; Author: Albert <alon@milcse.rtsg.mot.com>
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
7 ;; Maintainer: FSF
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
8 ;; Created: 1993 Oct 6
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
9 ;; Keywords: tools, processes
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
10
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
11 ;; This file is part of GNU Emacs.
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
12
94677
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 88094
diff changeset
13 ;; GNU Emacs is free software: you can redistribute it and/or modify
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
94677
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 88094
diff changeset
15 ;; the Free Software Foundation, either version 3 of the License, or
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 88094
diff changeset
16 ;; (at your option) any later version.
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
17
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 ;; GNU Emacs is distributed in the hope that it will be useful,
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
21 ;; GNU General Public License for more details.
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
22
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
94677
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 88094
diff changeset
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
25
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
26 ;;; Commentary:
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
27
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
28 ;; This package is for running a remote compilation and using emacs to parse
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
29 ;; the error messages. It works by rsh'ing the compilation to a remote host
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
30 ;; and parsing the output. If the file visited at the time remote-compile was
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
31 ;; called was loaded remotely (ange-ftp), the host and user name are obtained
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
32 ;; by the calling ange-ftp-ftp-name on the current directory. In this case the
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
33 ;; next-error command will also ange-ftp the files over. This is achieved
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
34 ;; automatically because the compilation-parse-errors function uses
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
35 ;; default-directory to build its file names. If however the file visited was
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
36 ;; loaded locally, remote-compile prompts for a host and user and assumes the
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
37 ;; files mounted locally (otherwise, how was the visited file loaded).
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
38
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
39 ;; See the user defined variables section for more info.
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
40
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
41 ;; I was contemplating redefining "compile" to "remote-compile" automatically
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
42 ;; if the file visited was ange-ftp'ed but decided against it for now. If you
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
43 ;; feel this is a good idea, let me know and I'll consider it again.
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
44
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
45 ;; Installation:
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
46
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
47 ;; To use rcompile, you also need to give yourself permission to connect to
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
48 ;; the remote host. You do this by putting lines like:
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
49
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
50 ;; monopoly alon
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
51 ;; vme33
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
52 ;;
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
53 ;; in a file named .rhosts in the home directory (of the remote machine).
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
54 ;; Be careful what you put in this file. A line like:
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
55 ;;
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
56 ;; +
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
57 ;;
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
58 ;; Will allow anyone access to your account without a password. I suggest you
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
59 ;; read the rhosts(5) manual page before you edit this file (if you are not
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 42706
diff changeset
60 ;; familiar with it already)
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
61
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
62 ;;; Code:
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
63
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
64 (provide 'rcompile)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
65 (require 'compile)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
66 ;;; The following should not be needed.
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
67 ;;; (eval-when-compile (require 'ange-ftp))
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
68
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
69 ;;;; user defined variables
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
70
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
71 (defgroup remote-compile nil
64038
9a906236d900 (remote-compile): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents: 62573
diff changeset
72 "Run a compilation on a remote machine."
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
73 :group 'processes
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
74 :group 'tools)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
75
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
76
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
77 (defcustom remote-compile-host nil
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
78 "*Host for remote compilations."
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
79 :type '(choice string (const nil))
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
80 :group 'remote-compile)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
81
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
82 (defcustom remote-compile-user nil
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
83 "User for remote compilations.
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
84 nil means use the value returned by \\[user-login-name]."
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
85 :type '(choice string (const nil))
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
86 :group 'remote-compile)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
87
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
88 (defcustom remote-compile-run-before nil
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
89 "*Command to run before compilation.
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
90 This can be used for setting up environment variables,
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
91 since rsh does not invoke the shell as a login shell and files like .login
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
92 \(tcsh\) and .bash_profile \(bash\) are not run.
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
93 nil means run no commands."
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
94 :type '(choice string (const nil))
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
95 :group 'remote-compile)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
96
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
97 (defcustom remote-compile-prompt-for-host nil
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
98 "*Non-nil means prompt for host if not available from filename."
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
99 :type 'boolean
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
100 :group 'remote-compile)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
101
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
102 (defcustom remote-compile-prompt-for-user nil
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
103 "*Non-nil means prompt for user if not available from filename."
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
104 :type 'boolean
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
105 :group 'remote-compile)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
106
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
107 ;;;; internal variables
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
108
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
109 ;; History of remote compile hosts and users
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
110 (defvar remote-compile-host-history nil)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
111 (defvar remote-compile-user-history nil)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
112
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
113
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
114 ;;;; entry point
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
115
88094
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
116 ;; We use the Tramp internal function`tramp-make-tramp-file-name'.
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
117 ;; Better would be, if there are functions to provide user, host and
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
118 ;; localname of a remote filename, independent of Tramp's implementation.
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
119 ;; The function calls are wrapped by `funcall' in order to pacify the byte
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
120 ;; compiler. ange-ftp check removed, because it is handled also by Tramp.
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
121 ;;;###autoload
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
122 (defun remote-compile (host user command)
42706
be541feb06cc Fix typo.
Pavel Janík <Pavel@Janik.cz>
parents: 38420
diff changeset
123 "Compile the current buffer's directory on HOST. Log in as USER.
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
124 See \\[compile]."
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
125 (interactive
88094
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
126 (let (host user command prompt l l-host l-user)
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
127 (setq prompt (if (stringp remote-compile-host)
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
128 (format "Compile on host (default %s): "
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
129 remote-compile-host)
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
130 "Compile on host: ")
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
131 host (if (or remote-compile-prompt-for-host
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
132 (null remote-compile-host))
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
133 (read-from-minibuffer prompt
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
134 "" nil nil
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
135 'remote-compile-host-history)
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
136 remote-compile-host)
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
137 user (if remote-compile-prompt-for-user
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
138 (read-from-minibuffer (format
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
139 "Compile by user (default %s): "
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
140 (or remote-compile-user
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
141 (user-login-name)))
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
142 "" nil nil
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
143 'remote-compile-user-history)
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
144 remote-compile-user))
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
145 (setq command (read-from-minibuffer "Compile command: "
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
146 compile-command nil nil
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
147 '(compile-history . 1)))
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
148 (list (if (string= host "") remote-compile-host host)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
149 (if (string= user "") remote-compile-user user)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
150 command)))
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
151 (setq compile-command command)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
152 (cond (user
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
153 (setq remote-compile-user user))
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
154 ((null remote-compile-user)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
155 (setq remote-compile-user (user-login-name))))
71485
5b1bf37e044d * net/rcompile.el (remote-compile): Replace ange-ftp based
Michael Albinus <michael.albinus@gmx.de>
parents: 68648
diff changeset
156 (let* (localname ;; Pacify byte-compiler.
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
157 (compile-command
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
158 (format "%s %s -l %s \"(%scd %s; %s)\""
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
159 remote-shell-program
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
160 host
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
161 remote-compile-user
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
162 (if remote-compile-run-before
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
163 (concat remote-compile-run-before "; ")
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
164 "")
88094
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
165 ""
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
166 compile-command)))
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
167 (setq remote-compile-host host)
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
168 (save-some-buffers nil nil)
62573
b79d54436669 (remote-compile): Use compilation-start.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
169 (compilation-start compile-command)
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
170 ;; Set comint-file-name-prefix in the compilation buffer so
71485
5b1bf37e044d * net/rcompile.el (remote-compile): Replace ange-ftp based
Michael Albinus <michael.albinus@gmx.de>
parents: 68648
diff changeset
171 ;; compilation-parse-errors will find referenced files by Tramp.
38420
0a4a44975e06 (remote-compile): Use make-local-variable.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28210
diff changeset
172 (with-current-buffer compilation-last-buffer
88094
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
173 (when (fboundp 'tramp-make-tramp-file-name)
71485
5b1bf37e044d * net/rcompile.el (remote-compile): Replace ange-ftp based
Michael Albinus <michael.albinus@gmx.de>
parents: 68648
diff changeset
174 (set (make-local-variable 'comint-file-name-prefix)
88094
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
175 (tramp-make-tramp-file-name
81758
f03856eb136b * files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents: 75347
diff changeset
176 nil ;; method.
71485
5b1bf37e044d * net/rcompile.el (remote-compile): Replace ange-ftp based
Michael Albinus <michael.albinus@gmx.de>
parents: 68648
diff changeset
177 remote-compile-user
5b1bf37e044d * net/rcompile.el (remote-compile): Replace ange-ftp based
Michael Albinus <michael.albinus@gmx.de>
parents: 68648
diff changeset
178 remote-compile-host
5b1bf37e044d * net/rcompile.el (remote-compile): Replace ange-ftp based
Michael Albinus <michael.albinus@gmx.de>
parents: 68648
diff changeset
179 ""))))))
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
180
88094
21873b86ecb7 (remote-compile): Remove broken code.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
181 ;; arch-tag: 2866a132-ece4-4ce9-9f91-ec147f803f73
28210
b56f9152e329 Moved here from lisp.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
182 ;;; rcompile.el ends here