From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Slawomir Nowaczyk Newsgroups: gmane.emacs.devel Subject: Re: Default remote user name in tramp Date: Fri, 16 Sep 2005 12:55:08 +0200 Message-ID: <20050916125246.5B74.SLAWOMIR.NOWACZYK.847@student.lu.se> References: <20050915093637.5B63.SLAWOMIR.NOWACZYK.847@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1126868530 20531 80.91.229.2 (16 Sep 2005 11:02:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 16 Sep 2005 11:02:10 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 16 13:02:02 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EGDxm-0001In-P0 for ged-emacs-devel@m.gmane.org; Fri, 16 Sep 2005 13:01:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EGDxl-0008Oy-T8 for ged-emacs-devel@m.gmane.org; Fri, 16 Sep 2005 07:01:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EGDwH-0007u2-50 for emacs-devel@gnu.org; Fri, 16 Sep 2005 06:59:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EGDwC-0007rS-MX for emacs-devel@gnu.org; Fri, 16 Sep 2005 06:59:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EGDwA-0007kv-Er for emacs-devel@gnu.org; Fri, 16 Sep 2005 06:59:23 -0400 Original-Received: from [130.235.16.11] (helo=himmelsborg.cs.lth.se) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EGDsE-0008Gt-SG for emacs-devel@gnu.org; Fri, 16 Sep 2005 06:55:19 -0400 Original-Received: from [127.0.0.1] (slawek@dain [130.235.16.76]) by himmelsborg.cs.lth.se (8.12.11/8.12.11/perf-jw-tr) with ESMTP id j8GAtDsw007972 for ; Fri, 16 Sep 2005 12:55:13 +0200 (CEST) Original-To: emacs-devel@gnu.org In-Reply-To: X-Esmandil_Citation: done X-Mailer-Plugin: Popup Memopad for Becky!2 Ver.0.02 Rev.2 X-Mailer: Becky! ver. 2.21.04 [en] X-MIME-Autoconverted: from 8bit to quoted-printable by himmelsborg.cs.lth.se id j8GAtDsw007972 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42982 Archived-At: On Thu, 15 Sep 2005 23:08:38 +0200 Michael Albinus wrote: #> > Is there any chance to have the following small patch applied to #> > tramp.el? It allows one to specify default user name for remote host= s. #> I'm a little bit reserved applying this patch. Tramp 2.1, the #> developpers version, has such a customization mean (both #> `tramp-default-user=C2=B4and `tramp-default-user-alist=C2=B4). Tramp 2= .0, #> which is part of Emacs 22, has been frozen a while ago, and should #> receive bug fixes only. OK, I see... I wasn't aware Tramp is being developed outside Emacs CVS. There is no point in applying my patch in this case. #> So if you are couraged enough, you could use Tramp 2.1. I have tried Tramp-2.1.3, but it doesn't work for me at all. I get=20 "format-spec: Invalid format string" error from macro at line 5783 of tramp.el, in defun tramp-maybe-open-connection. I will try to investigate further when I have time. #> Or you could try to apply one of the recipes in #> . #> This is from the Tramp 2.1 documentation (you'll find #> `tramp-default-user=C2=B4 there), but most of the recipes should be #> applicable for Tramp 2.0 too. A couple of those look interesting, although neither is as easy to use as default user name :) #> > Some time ago tramp used to take user-login-name as a default #> > remote user name if it was not specified by "user@host". Now, #> > however, default user name is nil -- which makes tramp not work #> > unless user name is specified on every request, at least for me #> > (I use "plink" method and it doesn't seem to recognise remote #> > prompt "login as:" and keeps waiting for password prompt). #>=20 #> That sounds like a bug. "login as:" would not be recognized as #> login prompt, see `tramp-login-prompt-regexp=C2=B4. Could you try to #> customize that regexp to your needs, and see whether it works #> better? Something like ".*ogin.*: *" I would recommend. Please tell #> then whether it helps. I tried that. When I do: (setq tramp-login-prompt-regexp "[Ll]ogin\\( as\\)?: *") my "login as:" prompt gets recognised and tramp proceeds trying to login using my user-login-name... cool :)=20 Except there is, apparently, a bug which causes tramp to strip last letter from user name (i.e. if my user-login-name is "slawek", tramp tries to login using "slawe"). Setting user-login-name to "slawekX" seems to work for me at the moment ;) I don't have any more time to hunt this bug right now, but I will try to figure it out later. Thanks for your ideas. --=20 Best wishes, Slawomir Nowaczyk ( slawomir.nowaczyk.847@student.lu.se ) If the code and the comments disagree, then both are probably wrong.