emacs-devel
[Top][All Lists]
Advanced

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

Re: tramp+recentf: persistent errors due to expand-file-name


From: Michael Albinus
Subject: Re: tramp+recentf: persistent errors due to expand-file-name
Date: Mon, 11 Aug 2008 21:18:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

David Reitter <address@hidden> writes:

> I've been playing around with tramp, which does not recognize a
> location such as /address@hidden:/tmp/123123//bar  as a local /bar file.
>
> Worse than that, the error that ensues (in combination with recentf-
> mode) prevents users from saving or openeing other files in the future:
>
> Debugger entered--Lisp error: (error "Not a tramp file name: /qweqwe")
>   signal(error ("Not a tramp file name: /qweqwe"))
>   ad-Orig-error("Not a tramp file name: %s" "/qweqwe")
>   apply(ad-Orig-error ("Not a tramp file name: %s" "/qweqwe"))
>   error("Not a tramp file name: %s" "/qweqwe")
>   tramp-dissect-file-name("/qweqwe")
>   tramp-file-name-handler(expand-file-name "/address@hidden:/tmp/
> 123123//qweqwe" nil)
>   expand-file-name("/address@hidden:/tmp/123123//qweqwe")
>   recentf-expand-file-name("/address@hidden:/tmp/123123//qweqwe")
>   recentf-track-opened-file()
>   run-hook-with-args-until-success(recentf-track-opened-file)
>   basic-save-buffer()
>   save-buffer()
>   mac-key-save-file()
>   call-interactively(mac-key-save-file)

I cannot reproduce it here:

(recentf-expand-file-name "/address@hidden:/tmp/123123//qweqwe")
  => "/scp:address@hidden:/tmp/123123/qweqwe"

(expand-file-name "/address@hidden:/tmp/123123//qweqwe")
  => "/scp:address@hidden:/tmp/123123/qweqwe"

(expand-file-name "/tmp/123123//qweqwe")
  => "/tmp/123123/qweqwe"

Btw, where does the "//" comes from?

> The patch below fixes this - comments appreciated.
>
> The alternative would be to fix tramp so it doesn't throw an error
> when expand-file-name is called, but this might prevent it from giving
> proper feedback to the user.
>
> *** lisp/recentf.el   06 Apr 2008 13:51:37 +0200      1.56.2.2
> --- lisp/recentf.el   10 Aug 2008 19:04:41 +0200      
> ***************
> *** 394,400 ****
>     "Convert file NAME to absolute, and canonicalize it.
>   NAME is first passed to the function `expand-file-name', then to
>   `recentf-filename-handlers' to post process it."
> !   (recentf-apply-filename-handlers (expand-file-name name)))
>
>   (defun recentf-include-p (filename)
>     "Return non-nil if FILENAME should be included in the recent list.
> --- 394,402 ----
>     "Convert file NAME to absolute, and canonicalize it.
>   NAME is first passed to the function `expand-file-name', then to
>   `recentf-filename-handlers' to post process it."
> !   (condition-case nil
> !       (recentf-apply-filename-handlers (expand-file-name name))
> !     (error name)))
>
>   (defun recentf-include-p (filename)
>     "Return non-nil if FILENAME should be included in the recent list.

This leaves `name' in an unexpanded state, which might be not
desirable. I would prefer to find the reason, why Tramp returns it the
way you have shown (and I cannot reproduce).

Could you, please, provide me a recipe for reproducing, w/o mac
specifics?

Best regards, Michael.




reply via email to

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