Variable: tramp-perl-file-name-all-completions
tramp-perl-file-name-all-completions is a variable defined in
tramp-sh.el.gz.
Value
"%p -e '\n$dir = $ARGV[0];\nif ($dir ne \"/\") {\n $dir =~ s#/+$##;\n}\nopendir(d, $dir) || die(\"$dir: $!\\nfail\\n\");\n@files = readdir(d); closedir(d);\nprint \"(\\n\";\nforeach $f (@files) {\n ($p = $f) =~ s/\\\"/\\\\\\\"/g;\n ($q = \"$dir/$f\") =~ s/\\\"/\\\\\\\"/g;\n print \"(\",\n ((-d \"$q\") ? \"\\\"$p/\\\" \\\"$q\\\" t\" : \"\\\"$p\\\" \\\"$q\\\" nil\"),\n ((-e \"$q\") ? \" t\" : \" nil\"),\n ((-r \"$q\") ? \" t\" : \" nil\"),\n \")\\n\";\n}\nprint \")\\n\";\n' \"$1\" %n"
Documentation
Perl script to produce output suitable for use with
file-name-all-completions on the remote file system.
Format specifiers are replaced by tramp-expand-script, percent
characters need to be doubled.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defconst tramp-perl-file-name-all-completions
"%p -e '
$dir = $ARGV[0];
if ($dir ne \"/\") {
$dir =~ s#/+$##;
}
opendir(d, $dir) || die(\"$dir: $!\\nfail\\n\");
@files = readdir(d); closedir(d);
print \"(\\n\";
foreach $f (@files) {
($p = $f) =~ s/\\\"/\\\\\\\"/g;
($q = \"$dir/$f\") =~ s/\\\"/\\\\\\\"/g;
print \"(\",
((-d \"$q\") ? \"\\\"$p/\\\" \\\"$q\\\" t\" : \"\\\"$p\\\" \\\"$q\\\" nil\"),
((-e \"$q\") ? \" t\" : \" nil\"),
((-r \"$q\") ? \" t\" : \" nil\"),
\")\\n\";
}
print \")\\n\";
' \"$1\" %n"
"Perl script to produce output suitable for use with
`file-name-all-completions' on the remote file system.
Format specifiers are replaced by `tramp-expand-script', percent
characters need to be doubled.")