Re: Tramp mosh method

2012-09-03 Thread Tassilo Horn
Hi all,

I've also started using mosh, so I'm very interested in getting mosh
tramp support working.  I evaluated the snippet in Ted's last posting
after requiring tramp (the version included in emacs bzr) and set
tramp-debug to 10.

I tried to find-file /mosh:h...@tsdh.org:/home, and that's what I
get in the *debug tramp/mosh h...@tsdh.org* buffer.  (Well, I TAB-ed
more than once, so the messages might be a bit more longish than
needed.)

--8<---cut here---start->8---
;; GNU Emacs: 24.2.50.1 Tramp: 2.2.6-pre -*- mode: outline; -*-
10:48:14.729148 tramp-maybe-open-connection (3) # Opening connection for 
h...@tsdh.org using mosh...
10:48:14.748190 tramp-compute-multi-hops (1) # File error: Host `tsdh.org' 
looks like a remote host, `mosh' can only use the local host
10:48:14.748839 tramp-compute-multi-hops (3) # Opening connection for 
h...@tsdh.org using mosh...done
10:48:14.750143 tramp-get-connection-property (7) # process-name nil
10:48:14.750711 tramp-get-connection-property (7) # process-name nil
10:48:14.751388 tramp-get-file-property (8) # /hom file-name-all-completions nil
10:48:14.751579 tramp-get-file-property (8) # /ho file-name-all-completions nil
10:48:14.751763 tramp-get-file-property (8) # /h file-name-all-completions nil
10:48:14.751943 tramp-get-connection-property (7) # perl undef
10:48:14.752123 tramp-get-remote-perl (5) # Finding a suitable `perl' command
10:48:14.752296 tramp-get-connection-property (7) # remote-path undef
10:48:14.752484 tramp-get-connection-property (7) # process-name nil
10:48:14.752668 tramp-get-connection-property (7) # process-name nil
10:48:14.752844 tramp-get-connection-property (7) # process-buffer nil
10:48:14.753368 tramp-maybe-open-connection (3) # Opening connection for 
h...@tsdh.org using mosh...
10:48:14.754233 tramp-compute-multi-hops (1) # File error: Host `tsdh.org' 
looks like a remote host, `mosh' can only use the local host
10:48:14.754681 tramp-compute-multi-hops (3) # Opening connection for 
h...@tsdh.org using mosh...done
10:48:14.755579 tramp-get-connection-property (7) # process-name nil
10:48:14.756196 tramp-get-connection-property (7) # process-name nil
10:48:14.756830 tramp-get-connection-property (7) # process-name nil
10:48:14.757609 tramp-get-connection-property (7) # perl undef
10:48:14.757790 tramp-get-remote-perl (5) # Finding a suitable `perl' command
10:48:14.757966 tramp-get-connection-property (7) # remote-path undef
10:48:14.758169 tramp-get-connection-property (7) # process-name nil
10:48:14.758356 tramp-get-connection-property (7) # process-name nil
10:48:14.758534 tramp-get-connection-property (7) # process-buffer nil
10:48:14.759075 tramp-maybe-open-connection (3) # Opening connection for 
h...@tsdh.org using mosh...
10:48:14.759885 tramp-compute-multi-hops (1) # File error: Host `tsdh.org' 
looks like a remote host, `mosh' can only use the local host
10:48:14.760346 tramp-compute-multi-hops (3) # Opening connection for 
h...@tsdh.org using mosh...done
10:48:14.761489 tramp-get-connection-property (7) # process-name nil
10:48:14.762072 tramp-get-connection-property (7) # process-name nil
10:48:14.762544 tramp-get-connection-property (7) # process-name nil
10:48:14.762945 tramp-get-connection-property (7) # process-name nil
10:48:14.764123 tramp-get-connection-property (7) # process-name nil
10:48:14.764557 tramp-get-connection-property (7) # process-name nil
10:48:14.765195 tramp-get-connection-property (7) # process-name nil
10:48:14.765699 tramp-get-connection-property (7) # process-name nil
10:48:14.766152 tramp-get-connection-property (7) # process-name nil
10:48:14.767024 tramp-get-connection-property (7) # process-name nil
10:48:14.767272 tramp-get-connection-property (7) # process-name nil
10:48:14.777508 tramp-get-connection-property (7) # process-name nil
10:48:14.778129 tramp-get-connection-property (7) # process-name nil
10:48:14.778735 tramp-get-connection-property (7) # process-name nil
10:48:14.779449 tramp-get-file-property (8) # /hom file-name-all-completions nil
10:48:14.779648 tramp-get-file-property (8) # /ho file-name-all-completions nil
10:48:14.779840 tramp-get-file-property (8) # /h file-name-all-completions nil
10:48:14.780035 tramp-get-connection-property (7) # perl undef
10:48:14.780210 tramp-get-remote-perl (5) # Finding a suitable `perl' command
10:48:14.780388 tramp-get-connection-property (7) # remote-path undef
10:48:14.780581 tramp-get-connection-property (7) # process-name nil
10:48:14.780773 tramp-get-connection-property (7) # process-name nil
10:48:14.780956 tramp-get-connection-property (7) # process-buffer nil
10:48:14.781527 tramp-maybe-open-connection (3) # Opening connection for 
h...@tsdh.org using mosh...
10:48:14.782753 tramp-compute-multi-hops (1) # File error: Host `tsdh.org' 
looks like a remote host, `mosh' can only use the local host
10:48:14.783206 tramp-compute-multi-hops (3) # Opening connection for 
h...@tsdh.org using mosh...done
10:48:

Re: Access to repository-side files in version control repositories

2012-09-03 Thread Randy Yates
Hi Michael,

Michael Albinus  writes:
> [...]
> If you have opened a file under version control [...]

But that's just it - you can't. At least I've not seen a way to open a
file on a repository using emacs and the "standard" packages. Not
directly. 
I know you meant a file in your working copy, but that sorta brings out
my point - what if you don't have a working copy of the repo? What if
you do but you don't want to have to visit a wc file first, then open
the repository-side file? What if your wc file has nothing to do with
the repository-side file you want to open?

Sure, I could check the file out into a wc, then visit the file, but
that's like saying you could scp a file over, then edit it - who needs
tramp?

In other words, there are great advantages doing this using the standard
visit-file mechanism of emacs, not the least of which is convenience,
but in this case much more.

Let me tell you where I'm going with this. If tramp provided the
requested functionality, then this would greatly enrich ediff. I could
directly ediff two files on a repository. In my work (and I think many
others'), this would be EXTREMELY useful.
-- 
Randy Yates
Digital Signal Labs
http://www.digitalsignallabs.com

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: Tramp mosh method

2012-09-03 Thread Michael Albinus
Tassilo Horn  writes:

> Hi all,

Hi Tassilo,

> I tried to find-file /mosh:h...@tsdh.org:/home, and that's what I
> get in the *debug tramp/mosh h...@tsdh.org* buffer.  (Well, I TAB-ed
> more than once, so the messages might be a bit more longish than
> needed.)
>
> In *Messages* I get "byte-code: Host `tsdh.org' looks like a remote
> host, `mosh' can only use the local host".

That's simple to fix:

--8<---cut here---start->8---
*** ~/src/tramp/lisp/tramp-sh.el.~2.81~ 2012-09-03 15:25:57.740895595 +0200
--- ~/src/tramp/lisp/tramp-sh.el2012-09-03 15:13:43.631022840 +0200
***
*** 406,411 
--- 406,418 
  (tramp-copy-program "fcp")
  (tramp-copy-args(("-p" "%k")))
  (tramp-copy-keep-date   t)))
+ ;;;###tramp-autoload
+ (add-to-list 'tramp-methods
+   '("mosh"
+ (tramp-login-program"env LC_ALL=en_US.UTF-8 /usr/bin/mosh")
+ (tramp-login-args   (("-p" "%p") ("%u@%h")))
+ (tramp-remote-shell "/bin/sh")
+ (tramp-remote-shell-args("-c"

  ;;;###tramp-autoload
  (add-to-list 'tramp-default-method-alist
***
*** 4258,4263 
--- 4265,4272 
   ;; The host name is used for the remote shell command.
   (member
'("%h") (tramp-get-method-parameter method 'tramp-login-args))
+  (member
+   '("%u@%h") (tramp-get-method-parameter method 'tramp-login-args))
   ;; The host is local.  We cannot use `tramp-local-host-p'
   ;; here, because it opens a connection as well.
   (string-match tramp-local-host-regexp host))
***
*** 4378,4383 
--- 4387,4398 
 p 60
 "Couldn't find local shell prompt %s" tramp-encoding-shell)

+   ;; "mosh" needs a row size > 0.
+   (tramp-message vec 6 "%s" "stty rows 40 columns 80")
+   (tramp-send-string vec "stty rows 40 columns 80")
+   (tramp-barf-if-no-shell-prompt
+p 5 "Couldn't find local shell prompt")
+
;; Now do all the connections as specified.
(while target-alist
  (let* ((hop (car target-alist))
--8<---cut here---end--->8---

However, mosh requires an interactive tty, and it swamps the Tramp
connection buffer with escape sequences then (you see it in the debug
buffer, when `tramp-verbose' is set to 10). I have no real idea how to
fix this.

> Bye,
> Tassilo

Best regards, Michael.

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: Access to repository-side files in version control repositories

2012-09-03 Thread Michael Albinus
Randy Yates  writes:

> Hi Michael,

Hi Randy,

>> If you have opened a file under version control [...]
>
> But that's just it - you can't. At least I've not seen a way to open a
> file on a repository using emacs and the "standard" packages. Not
> directly.
> I know you meant a file in your working copy, but that sorta brings out
> my point - what if you don't have a working copy of the repo? What if
> you do but you don't want to have to visit a wc file first, then open
> the repository-side file? What if your wc file has nothing to do with
> the repository-side file you want to open?

Tramp does not handle repositories. All it can do is supporting vc.el,
which operates over "working copies".

> Sure, I could check the file out into a wc, then visit the file, but
> that's like saying you could scp a file over, then edit it - who needs
> tramp?
>
> In other words, there are great advantages doing this using the standard
> visit-file mechanism of emacs, not the least of which is convenience,
> but in this case much more.
>
> Let me tell you where I'm going with this. If tramp provided the
> requested functionality, then this would greatly enrich ediff. I could
> directly ediff two files on a repository. In my work (and I think many
> others'), this would be EXTREMELY useful.

vc.el has great support in working over revisions. You can apply "M-x
ediff-revision", which does exactly what you want. And Tramp lets you
apply this command also for "remote working copies", if you're
interested in. Or you apply it for your local working copy, and vc.el
brings you the different revisions behind the scenes.

What do I miss?

Best regards, Michael.

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: Access to repository-side files in version control repositories

2012-09-03 Thread yary
Some version control GUI's come with a "repository browser" that lets
you list & look at everything that's ever been checked in. It sounds
like you're looking for that within Emacs, and it does seem like it
could be implemented by using Tramp's transparent remote file handling
and vc's transparent version control access. It also seems like a fair
amount of design (since a repository is more than a filesystem),
coding and testing!

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: Access to repository-side files in version control repositories

2012-09-03 Thread yary
On Mon, Sep 3, 2012 at 9:50 AM, Michael Albinus  wrote:
...
> vc.el has great support in working over revisions. You can apply "M-x
> ediff-revision", which does exactly what you want. And Tramp lets you
> apply this command also for "remote working copies", if you're
> interested in. Or you apply it for your local working copy, and vc.el
> brings you the different revisions behind the scenes.
>
> What do I miss?

I think the suggestion is "It would be good to run ediff (& anything
else) without even needing a working copy in any buffer. Just put in
the path to the repository, and the specific object in that
repository, and read it as if there was no local version- even if
there is a local working copy in $temp as part of the implementation."

It gets messy when the buffer is writable- one place where the design
becomes non-trivial...

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: Access to repository-side files in version control repositories

2012-09-03 Thread Randy Yates
Michael Albinus  writes:

> Randy Yates  writes:
>
>> Hi Michael,
>
> Hi Randy,
>
>>> If you have opened a file under version control [...]
>>
>> But that's just it - you can't. At least I've not seen a way to open a
>> file on a repository using emacs and the "standard" packages. Not
>> directly.
>> I know you meant a file in your working copy, but that sorta brings out
>> my point - what if you don't have a working copy of the repo? What if
>> you do but you don't want to have to visit a wc file first, then open
>> the repository-side file? What if your wc file has nothing to do with
>> the repository-side file you want to open?
>
> Tramp does not handle repositories. All it can do is supporting vc.el,
> which operates over "working copies".

I am requesting that this feature be considered.

>> Sure, I could check the file out into a wc, then visit the file, but
>> that's like saying you could scp a file over, then edit it - who needs
>> tramp?
>>
>> In other words, there are great advantages doing this using the standard
>> visit-file mechanism of emacs, not the least of which is convenience,
>> but in this case much more.
>>
>> Let me tell you where I'm going with this. If tramp provided the
>> requested functionality, then this would greatly enrich ediff. I could
>> directly ediff two files on a repository. In my work (and I think many
>> others'), this would be EXTREMELY useful.
>
> vc.el has great support in working over revisions. You can apply "M-x
> ediff-revision", which does exactly what you want. 

Well, not really. There are two things I would like to do that this 
does not provide:

  a) Directly get an arbitrary repository file into a buffer using a
  standard syntax using the visit-file mechanism. That means that I
  may not even have a wc of the repo checked out at all. Note that I
  just want to see the file (search it, copy it, etc.) in this scenario,
  not run a diff on it.

  b) Diff arbitrary repository-side files WITHOUT HAVING TO FIRST EDIT
  ANY WC FILE (by specifying the repository, file, and version). In
  fact, I may want to diff two repository-side files that reside in
  different repositories!

I see now vc.el provides some of this functionality, albeit not via a
standard visit-file mechanism. (I misinterpreted that part of the ediff
info page on this.) But I still think the ability to c-x f a
repository-side file brings a good bit more flexibility/capability to
emacs and its packages. 

My $0.02.
-- 
Randy Yates
Digital Signal Labs
http://www.digitalsignallabs.com

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: Access to repository-side files in version control repositories

2012-09-03 Thread Michael Albinus
Randy Yates  writes:

Hi Randy,

>   a) Directly get an arbitrary repository file into a buffer using a
>   standard syntax using the visit-file mechanism. That means that I
>   may not even have a wc of the repo checked out at all. Note that I
>   just want to see the file (search it, copy it, etc.) in this scenario,
>   not run a diff on it.
>
>   b) Diff arbitrary repository-side files WITHOUT HAVING TO FIRST EDIT
>   ANY WC FILE (by specifying the repository, file, and version). In
>   fact, I may want to diff two repository-side files that reside in
>   different repositories!
>
> I see now vc.el provides some of this functionality, albeit not via a
> standard visit-file mechanism. (I misinterpreted that part of the ediff
> info page on this.) But I still think the ability to c-x f a
> repository-side file brings a good bit more flexibility/capability to
> emacs and its packages. 

Got it. Yes, this might be useful.

But I don't believe, that Tramp shall be the primary target of that
request. Different version control systems use different repository
formats. The logic, how to retrieve a file revision from a given
repository, belongs to the different vc backends.

vc shall be extended by a unique interface to retrieve a named revision
from a repository, and to compare different revisions, w/o having a
working copy. Implementation of that functionality is the duty of the
respective vc backends.

I'll be happy to support access to the remote repositories via
Tramp. But I bet, there's no need to extend Tramp for this. If I'm
wrong, we still could work on Tramp.

I recommend you to file an Emacs change request, via "M-x report-emacs-bug".


Best regards, Michael.

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


problem with preserving emacs tramp file permissions

2012-09-03 Thread Konstantin Weiner
re: problem with preserving emacs tramp file permissions
when editing+saving an existing file on a remote location
/pscp:r...@xxx.xxx.xxx.xxx:/path/path/path/path
because "backup by renaming" will move the old file aside
and the new version of file is really creating a new file.

Sometimes the file is created as executable -rwxrwxrwx
but sometimes after saving it becomes -rw-rw-rw-
and I have to chmod it back to executable.

Please advise where to look and who to ask.

Thanks!
K
___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: problem with preserving emacs tramp file permissions

2012-09-03 Thread Michael Albinus
Konstantin Weiner  writes:

Hi Konstantin,

> Please advise where to look and who to ask.

As I have said the other mail, we need to know your Emacs and Tramp
versions first.

> Thanks!
> K

Best regards, Michael.

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel