[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Couple minor tramp bugs

From: Michael Albinus
Subject: Re: Couple minor tramp bugs
Date: Thu, 03 Aug 2006 15:25:53 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/20.7 (hpux)

"Jeff Costlow" <address@hidden> writes:


> I'm running tramp 2.1.6 on the latest cygwin emacs 21.2.1.
> I have encountered a couple problems.  The first is that emacs does not
> have file-remote-p (apparently Xemacs does?)
> Adding the following line to my .emacs solves the problem.  I'm sure
> there is a better solution.

file-remote-p has been introduced with Emacs 22. XEmacs has it for a
while (I don't know since when).

For Emacs 21, file-remote-p is defined in tramp-util.el. Unfortunately,
this package was not loaded on Windows machines. This has been fixed
in CVS some weeks ago; will be released with Tramp 2.1.7. As
workaround you might use the code from there:

;;; emacs does not have file-remote-p, but it's apparently required by tramp
(if (not (fboundp 'file-remote-p))
    ;; Emacs 21
    (defalias 'file-remote-p (symbol-function 'tramp-handle-file-remote-p)))

> I also was not able to M-x revert-file.  This is apparently caused by
> the tramp-cache-before-revert function that defines a nil localname, and
> then uses it.  It seems to be better off when it uses bfn.
> --- tramp-cache.el      2006-08-02 11:03:07.570130600 -0700
> +++ tramp-cache.el~     2006-07-28 08:30:37.636923900 -0700
> @@ -149,17 +149,17 @@
>  (defun tramp-cache-before-revert-function ()
>    "Flush all Tramp cache properties from buffer-file-name."
>    (let ((bfn (buffer-file-name))
>         ;; Pacify byte-compiler.
>         v localname)
>      (when (and (stringp bfn)
>                (tramp-tramp-file-p bfn))
>        (with-parsed-tramp-file-name bfn nil
> -       (tramp-flush-file-property v bfn)))))
> +       (tramp-flush-file-property v localname)))))

I don't believe that's the solution. localname is defined in order to
satisfy the byte-compiler; it is defined again inside the macro
with-parsed-tramp-file-name, and the value from there is used.

Your solution uses bfn, which is a remote file. This doesn't make
sense - the parameter FILE of tramp-flush-file-property is intended to
be a local file name.

Could you, please, give me a recipe how you were "not able to M-x
revert-file"? What's the buffer where you have called revert-file?
What's the buffer-file-name from that buffer?

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]