all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Suggestions for rcompile.el
@ 2004-02-16 16:37 Alfred M. Szmidt
  2004-02-19 19:48 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Alfred M. Szmidt @ 2004-02-16 16:37 UTC (permalink / raw)


Hey,

I would implement the following features that I consider missing in
remote-compile (rcompile.el), but due to lack of time I can't.  So
maybe someone else finds the interesting and will hack them together.
And if that doesn't happen, I'll probobly implement them some day
myself.

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.

Second suggestion (might be considered a bug), when redefining
remote-shell-program to "ssh", you will get a "user@host password: "
prompt in the compilation buffer.  Where it waits for a password, this
should be changed so that it actually asks the user for the password
in the mini-buffer.  A simple work around for this (atleast in the
case of ssh) is to just use public keys.

Cheers!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Suggestions for rcompile.el
  2004-02-16 16:37 Suggestions for rcompile.el Alfred M. Szmidt
@ 2004-02-19 19:48 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2004-02-19 19:48 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-02-19 19:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-16 16:37 Suggestions for rcompile.el Alfred M. Szmidt
2004-02-19 19:48 ` Kevin Rodgers

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.