From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: Suggestions for rcompile.el Date: Thu, 19 Feb 2004 12:48:58 -0700 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <4035132A.3000502@yahoo.com> References: <200402161637.i1GGbAe6009742@rackarberget.it.uu.se> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1077225341 23213 80.91.224.253 (19 Feb 2004 21:15:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2004 21:15:41 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Feb 19 22:15:34 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AtvWA-0004fF-00 for ; Thu, 19 Feb 2004 22:15:34 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AtvWA-0000pZ-00 for ; Thu, 19 Feb 2004 22:15:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AtvUA-0002oH-Up for emacs-devel@quimby.gnus.org; Thu, 19 Feb 2004 16:13:30 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AtvSe-0002Q6-Oz for emacs-devel@gnu.org; Thu, 19 Feb 2004 16:11:56 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AtuO6-0000fI-Bq for emacs-devel@gnu.org; Thu, 19 Feb 2004 15:03:42 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AtuAJ-00060O-N2 for emacs-devel@gnu.org; Thu, 19 Feb 2004 14:48:55 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AtuAG-0002rp-00 for ; Thu, 19 Feb 2004 20:48:52 +0100 Original-Received: from 170.207.51.80 ([170.207.51.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu Feb 19 19:48:52 2004 Original-Received: from ihs_4664 by 170.207.51.80 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu Feb 19 19:48:52 2004 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 161 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 170.207.51.80 User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20074 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20074 Alfred M. Szmidt wrote: > First suggestion, it would be nice when doing: C-u M-x remote-compile, > that the function would ask once again for the user/host questions. > It is quite annoying not to be able to specify a different host (or > user) sometimes. Or maybe it should act more or less like compile and > ask all questions all the time, and then have a remote-recompile > command instead. If you set remote-compile-prompt-for-user and/or -host, the following patch should do what you want even when you are visiting a remote file. The patch is a little lengthy because I was also able to clean up the code. 2004-02-19 Kevin Rodgers * net/rcompile.el (remote-compile): Always prompt for HOST remote-compile-prompt-for-host is set, even when visiting a remote file, and provide a default. Same for USER and remote-compile-prompt-for-user. (remote-compile-prompt-for-host, remote-compile-prompt-for-user): Update doc strings. *** emacs-21.3/lisp/net/rcompile.el.orig Thu May 16 10:03:59 2002 --- emacs-21.3/lisp/net/rcompile.el Thu Feb 19 12:09:14 2004 *************** *** 96,107 **** :group 'remote-compile) (defcustom remote-compile-prompt-for-host nil ! "*Non-nil means prompt for host if not available from filename." :type 'boolean :group 'remote-compile) (defcustom remote-compile-prompt-for-user nil ! "*Non-nil means prompt for user if not available from filename." :type 'boolean :group 'remote-compile) --- 96,107 ---- :group 'remote-compile) (defcustom remote-compile-prompt-for-host nil ! "*Non-nil means prompt for host." :type 'boolean :group 'remote-compile) (defcustom remote-compile-prompt-for-user nil ! "*Non-nil means prompt for user." :type 'boolean :group 'remote-compile) *************** *** 119,159 **** "Compile the current buffer's directory on HOST. Log in as USER. See \\[compile]." (interactive ! (let ((parsed (or (and (featurep 'ange-ftp) ! (ange-ftp-ftp-name default-directory)))) ! host user command prompt) ! (if parsed ! (setq host (nth 0 parsed) ! user (nth 1 parsed)) ! (setq prompt (if (stringp remote-compile-host) ! (format "Compile on host (default %s): " ! remote-compile-host) ! "Compile on host: ") ! host (if (or remote-compile-prompt-for-host ! (null remote-compile-host)) ! (read-from-minibuffer prompt ! "" nil nil ! 'remote-compile-host-history) ! remote-compile-host) ! user (if remote-compile-prompt-for-user ! (read-from-minibuffer (format ! "Compile by user (default %s)" ! (or remote-compile-user ! (user-login-name))) ! "" nil nil ! 'remote-compile-user-history) ! remote-compile-user))) ! (setq command (read-from-minibuffer "Compile command: " ! compile-command nil nil ! '(compile-history . 1))) ! (list (if (string= host "") remote-compile-host host) ! (if (string= user "") remote-compile-user user) ! command))) (setq compile-command command) - (cond (user - (setq remote-compile-user user)) - ((null remote-compile-user) - (setq remote-compile-user (user-login-name)))) (let* ((parsed (and (featurep 'ange-ftp) (ange-ftp-ftp-name default-directory))) (compile-command --- 119,150 ---- "Compile the current buffer's directory on HOST. Log in as USER. See \\[compile]." (interactive ! (let* ((parsed (and (featurep 'ange-ftp) ! (ange-ftp-ftp-name default-directory))) ! (host (or (and parsed (nth 0 parsed)) ! remote-compile-host)) ! (user (or (and parsed (nth 0 parsed)) ! remote-compile-user)) ! command) ! (when (or remote-compile-prompt-for-host (null host)) ! (setq host ! (read-string (if host ! (format "Compile on host (default: %s): " host) ! "Compile on host: ") ! nil 'remote-compile-host-history host))) ! (when (or remote-compile-prompt-for-user (null user)) ! (setq user ! (read-string (format "Compile on %s by user (default: %s): " ! host (or user (user-login-name))) ! nil ! 'remote-compile-user-history ! (or user (user-login-name))))) ! (setq command ! (read-from-minibuffer "Compile command: " ! compile-command nil nil ! '(compile-history . 1))) ! (list host user command))) (setq compile-command command) (let* ((parsed (and (featurep 'ange-ftp) (ange-ftp-ftp-name default-directory))) (compile-command *************** *** 160,172 **** (format "%s %s -l %s \"(%scd %s; %s)\"" remote-shell-program host ! remote-compile-user (if remote-compile-run-before (concat remote-compile-run-before "; ") "") (if parsed (nth 2 parsed) default-directory) ! compile-command))) ! (setq remote-compile-host host) (save-some-buffers nil nil) (compile-internal compile-command "No more errors") ;; Set comint-file-name-prefix in the compilation buffer so --- 151,164 ---- (format "%s %s -l %s \"(%scd %s; %s)\"" remote-shell-program host ! user (if remote-compile-run-before (concat remote-compile-run-before "; ") "") (if parsed (nth 2 parsed) default-directory) ! command))) ! (setq remote-compile-host host ! remote-compile-user user) (save-some-buffers nil nil) (compile-internal compile-command "No more errors") ;; Set comint-file-name-prefix in the compilation buffer so -- Kevin Rodgers