emacs-devel
[Top][All Lists]
Advanced

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

Re: Tramp, "[]" in file names, and file-expand-wildcards


From: Kai Großjohann
Subject: Re: Tramp, "[]" in file names, and file-expand-wildcards
Date: Tue, 09 Oct 2001 10:12:53 +0200
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.107

"Stefan Monnier" <monnier+gnu/address@hidden> writes:

>> So I changed it to "/address@hidden/path/to/file".
>> 
>> But this one collides with file-expand-wildcards: if it finds "[", it
>> extracts the directory component of the filename and expands wildcards
>> there.  Of course, the directory component still contains
>> "/address@hidden", and hence, still a "[", and so an infloop results.
> 
> Sounds like a bug.  Can you show a backtrace ?

I started "emacs -q -no-site-file -nw" and typed some stuff into the
*scratch* buffer.  I think you can see what was happening by just
looking at the buffer:

/----[ *scratch* ]
| ;; This buffer is for notes you don't want to save, and for Lisp evaluation.
| ;; If you want to create a file, visit that file with C-x C-f,
| ;; then enter the text in that file's own buffer.
| 
| (add-to-list 'load-path "~/work/kai/tramp/tramp/lisp/")
| ("~/work/kai/tramp/tramp/lisp/" 
"/home-local/grossjoh/sw/emacs-21.0/share/emacs\
| /21.0.107/site-lisp" 
"/home-local/grossjoh/sw/emacs-21.0/share/emacs/site-lisp"\
|  "/home-local/grossjoh/sw/emacs-21.0/share/emacs/21.0.107/leim" 
"/home-local/gr\
| ossjoh/sw/emacs-21.0/share/emacs/21.0.107/lisp" 
"/home-local/grossjoh/sw/emacs-\
| 21.0/share/emacs/21.0.107/lisp/toolbar" 
"/home-local/grossjoh/sw/emacs-21.0/sha\
| re/emacs/21.0.107/lisp/textmodes" 
"/home-local/grossjoh/sw/emacs-21.0/share/ema\
| cs/21.0.107/lisp/progmodes" 
"/home-local/grossjoh/sw/emacs-21.0/share/emacs/21.\
| 0.107/lisp/play" 
"/home-local/grossjoh/sw/emacs-21.0/share/emacs/21.0.107/lisp/\
| obsolete" "/home-local/grossjoh/sw/emacs-21.0/share/emacs/21.0.107/lisp/net" 
"/\
| home-local/grossjoh/sw/emacs-21.0/share/emacs/21.0.107/lisp/mail" ...)
| (require 'tramp)
| tramp
| (setq debug-on-error t)
| t
| (file-expand-wildcards "/[foo]")
\----

After evaling the last expression, I got the following backtrace:

/----
| Debugger entered--Lisp error: (error "Variable binding depth exceeds 
max-specpd$
|   match-string(1)
|   format-spec("/[%m/%h]%p" ((109 . "rcp") (104 . "foo") (112 . "")))
|   tramp-make-tramp-file-name(nil "rcp" nil "foo" "")
|   tramp-handle-file-name-directory("/[rcp/foo]")
|   apply(tramp-handle-file-name-directory "/[rcp/foo]")
|   tramp-file-name-handler(file-name-directory "/[rcp/foo]")
|   file-name-directory("/[rcp/foo]")
|   file-expand-wildcards("/[rcp/foo]")
| [[...approx 50 lines snipped...]]
|   file-expand-wildcards("/[rcp/foo]")
|   file-expand-wildcards("/[foo]")
|   eval((file-expand-wildcards "/[foo]"))
|   eval-last-sexp-1(t)
|   eval-last-sexp(t)
|   eval-print-last-sexp()
|   call-interactively(eval-print-last-sexp)
\----

I hope it isn't really important how often file-expand-wildcards
called itself :-)

In file-expand-wildcards you can see that file-name-directory is
called, and it seems the function assumes that, for all X, if
(file-name-directory X) == X, then X does not contain "[]".

kai
-- 
Linux provides a nice `poweroff' command, but where is `poweron'?



reply via email to

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