From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Suggestions for rcompile.el
Date: Thu, 19 Feb 2004 12:48:58 -0700 [thread overview]
Message-ID: <4035132A.3000502@yahoo.com> (raw)
In-Reply-To: 200402161637.i1GGbAe6009742@rackarberget.it.uu.se
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 <ihs_4664@yahoo.com>
* 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
prev parent reply other threads:[~2004-02-19 19:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-16 16:37 Suggestions for rcompile.el Alfred M. Szmidt
2004-02-19 19:48 ` Kevin Rodgers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4035132A.3000502@yahoo.com \
--to=ihs_4664@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.