On Thursday 27 September 2007, you wrote:
Ville Skyttä <scop(a)xemacs.org> writes:
> But in the absence of process-file or similar that we could use the tramp
> handlers for, let's leave tramp as is (patched) and go all the way then
> in vc - the attached patch is not that pretty but I think it should fix
> this issue. Could you test it?
Sorry to enter your discussion.
You're very much welcome, I'm glad you did!
But I believe it is not a good idea to
have tramp-related code in vc*.el. In order to hide such dependencies,
tramp-vc.el was introduced.
I see and agree. And I did mention that my patch wasn't pretty ;)
And indeed,
`tramp-send-command-and-check' has a different parameter list in Tramp
2.1. And since Tramp 2.1 is also intended for XEmacs, your patch would
fail there already.
Thanks for the info.
> (defun vc-user-login-name (file)
> "Return the name under which the user accesses the given FILE."
> (or (and (eq (string-match tramp-file-name-regexp file) 0)
Hmm. In GNU Emacs (please forgive me) the function `file-remote-p'
supports file name handlers for magic file names. Such a call is much
more robust wrt Tramp internals.
The code above comes as-is from GNU Emacs at the point I last synced it which
was somewhere before it went GPLv3 - I haven't looked at later versions there
because I think we're not ready to receive GPLv3 code in XEmacs yet.
(or (functionp 'process-file)
(defalias 'process-file 'tramp-handle-process-file))
The other altrnative would be to call `tramp-handle-process-file' directly.
This was the first approach I tried. However, it doesn't work for me,
evaluating (vc-user-login-name "/[some.host]foo/bar") I get this:
Debugger entered--Lisp error: (wrong-type-argument number-char-or-marker-p
nil)
vc-user-login-name("/[some.host]foo/bar")
eval((vc-user-login-name "/[some.host]foo/bar"))
eval-interactive((vc-user-login-name "/[some.host]foo/bar"))
eval-last-sexp(t)
#<compiled-function nil "...(13)" [standard-output terpri eval-last-sexp t] 2
1250159 nil>()
call-interactively(eval-print-last-sexp)
I'm not familiar with tramp and not quite sure how tramp-handle-process-file
is supposed to work - it appears to return what shell-command returns (nil
for my test cases? dunno - not documented) and that value is fed to zerop in
vc-user-login-name. I gather shell-command is wrapped by tramp's handler in
GNU Emacs so it could be different, but in XEmacs we get the usual unwrapped
shell-command which doesn't seem fit for this purpose.
Implementing process-file and the handler infrastructure would look like a
welcome addition, but it's much more work than I personally have time for at
the moment and probably would only work for bleeding edge XEmacs. And that's
a no go because the packages tree needs to work with earlier stable XEmacs
branches too for which largish feature work such as this is not generally
welcome.
I also briefly tried the old defadvice way by reverting the patch I posted to
tramp.el earlier, but couldn't get that to work either (I'm not sure about
the details but it could have been that I missed something I should have
changed in vc-hooks.el too).
If you have other ideas how to get around this, I'd be glad to hear about
them.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta