unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Rlogin patch for global option flags
@ 2005-04-29 21:07 Michael Mauger
  2005-05-01 22:58 ` Thien-Thi Nguyen
  2005-09-18 12:14 ` Richard Stallman
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Mauger @ 2005-04-29 21:07 UTC (permalink / raw)


I have an elisp program to call `ssh' a la `rlogin'.  Essentially it sets
the `rlogin-program' variable to `ssh' and calls `rlogin'.  The problem
is that ssh (cygwin's port) running with the w32 version of CVS Emacs
needs the option `-tt' prior to the host name to open the connection
correctly.  The problem is that the `rlogin' function treats the `-tt' as
the remote host name because it is the first argument.  

The following patch modifies the `rlogin' function command line
interpretation by assuming that the second argument is the remote
hostname if the first argument starts with a dash.

Please review and apply if deemed suitable.

Index: emacs/lisp/net/rlogin.el
===================================================================
RCS file: /c/cvsroot/emacs/emacs/lisp/net/rlogin.el,v
retrieving revision 1.6
diff -c -r1.6 rlogin.el
*** emacs/lisp/net/rlogin.el    10 Apr 2004 05:55:47 -0000      1.6
--- emacs/lisp/net/rlogin.el    28 Apr 2005 23:37:49 -0000
***************
*** 182,188 ****
                     (append (rlogin-parse-words input-args)
                             rlogin-explicit-args)
                   (rlogin-parse-words input-args)))
!        (host (car args))
         (user (or (car (cdr (member "-l" args)))
                     (user-login-name)))
           (buffer-name (if (string= user (user-login-name))
--- 182,188 ----
                     (append (rlogin-parse-words input-args)
                             rlogin-explicit-args)
                   (rlogin-parse-words input-args)))
!        (host (if (string-match "^-" (car args)) (car (cdr args)) (car
args)))
         (user (or (car (cdr (member "-l" args)))
                     (user-login-name)))
           (buffer-name (if (string= user (user-login-name))

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

* Re: Rlogin patch for global option flags
  2005-04-29 21:07 Michael Mauger
@ 2005-05-01 22:58 ` Thien-Thi Nguyen
  2005-09-18 12:14 ` Richard Stallman
  1 sibling, 0 replies; 5+ messages in thread
From: Thien-Thi Nguyen @ 2005-05-01 22:58 UTC (permalink / raw)
  Cc: Emacs Devel

Michael Mauger <mmaug@yahoo.com> writes:

> needs the option `-tt' prior to the host name to open the
> connection correctly.

is the "prior to the host name" a hard requirement?

have you tried using `rlogin-explicit-args'?

thi

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

* Re: Rlogin patch for global option flags
@ 2005-05-02  0:18 Michael Mauger
  2005-05-02  2:53 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Mauger @ 2005-05-02  0:18 UTC (permalink / raw)
  Cc: Emacs Devel

--- Thien-Thi Nguyen wrote:
> Michael Mauger writes:
> 
> > needs the option `-tt' prior to the host name to open the
> > connection correctly.
> 
> is the "prior to the host name" a hard requirement?
> 
> have you tried using `rlogin-explicit-args'?
> 

Yes, I tried that.  Unfortunately, they are appended to the end of the
command line, rather than the beginning.  I was nervous about changing
that because it could break existing usage.

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

* Re: Rlogin patch for global option flags
  2005-05-02  0:18 Rlogin patch for global option flags Michael Mauger
@ 2005-05-02  2:53 ` Thien-Thi Nguyen
  0 siblings, 0 replies; 5+ messages in thread
From: Thien-Thi Nguyen @ 2005-05-02  2:53 UTC (permalink / raw)
  Cc: Emacs Devel

Michael Mauger <mmaug@yahoo.com> writes:

> Yes, I tried that.

ok, thanks for the clarification and for the original suggestion.
i have installed a change to rlogin.el:

        * net/rlogin.el (rlogin-parse-words): Delete func.
        (rlogin): Use split-string, not rlogin-parse-words.
        Also, if there are option-like elements in the parsed args,
        take the host to be the first arg immediately following them.
        Suggested by Michael Mauger.

(i took inspiration from the patch you posted, but did not use it
directly.)

thi

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

* Re: Rlogin patch for global option flags
  2005-04-29 21:07 Michael Mauger
  2005-05-01 22:58 ` Thien-Thi Nguyen
@ 2005-09-18 12:14 ` Richard Stallman
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2005-09-18 12:14 UTC (permalink / raw)
  Cc: emacs-devel

(Please forgive the delay--this message got lost for a few months.)

      The problem
    is that ssh (cygwin's port) running with the w32 version of CVS Emacs
    needs the option `-tt' prior to the host name to open the connection
    correctly.  The problem is that the `rlogin' function treats the `-tt' as
    the remote host name because it is the first argument.  

    The following patch modifies the `rlogin' function command line
    interpretation by assuming that the second argument is the remote
    hostname if the first argument starts with a dash.

That is a kludgy way to deal with the problem.  The user should
not need to type -tt every time.

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

end of thread, other threads:[~2005-09-18 12:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-02  0:18 Rlogin patch for global option flags Michael Mauger
2005-05-02  2:53 ` Thien-Thi Nguyen
  -- strict thread matches above, loose matches on Subject: below --
2005-04-29 21:07 Michael Mauger
2005-05-01 22:58 ` Thien-Thi Nguyen
2005-09-18 12:14 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).