[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `tramp-handle-vc-registered' is problematic
From: |
Michael Albinus |
Subject: |
Re: `tramp-handle-vc-registered' is problematic |
Date: |
Tue, 10 Aug 2010 10:21:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Toru TSUNEYOSHI <address@hidden> writes:
> Hello.
Hi,
> I think that function `tramp-handle-vc-registered' is problematic.
>
> The reason is that COMMAND
>
> (mapconcat 'tramp-shell-quote-argument
> tramp-vc-registered-file-names
> " ")
>
> of `tramp-send-command-and-read' become too long (>= 4096 characters)
> easily. Indeed, `tramp-send-command-and-read' hangs up often.
I see.
> Please fix it.
Could you, please, check the appended patch? (You might need to restart
Emacs, because a defconst has been changed)
--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp/lisp/tramp.el.~2.811~ 2010-08-10
10:09:52.830260555 +0200
--- /home/albinus/src/tramp/lisp/tramp.el 2010-08-10 10:04:39.000000000
+0200
***************
*** 1983,1995 ****
(defconst tramp-vc-registered-read-file-names
"echo \"(\"
! for file in \"address@hidden"; do
! if %s $file; then
echo \"(\\\"$file\\\" \\\"file-exists-p\\\" t)\"
else
echo \"(\\\"$file\\\" \\\"file-exists-p\\\" nil)\"
fi
! if %s $file; then
echo \"(\\\"$file\\\" \\\"file-readable-p\\\" t)\"
else
echo \"(\\\"$file\\\" \\\"file-readable-p\\\" nil)\"
--- 1983,1995 ----
(defconst tramp-vc-registered-read-file-names
"echo \"(\"
! while read file; do
! if %s \"$file\"; then
echo \"(\\\"$file\\\" \\\"file-exists-p\\\" t)\"
else
echo \"(\\\"$file\\\" \\\"file-exists-p\\\" nil)\"
fi
! if %s \"$file\"; then
echo \"(\\\"$file\\\" \\\"file-readable-p\\\" t)\"
else
echo \"(\\\"$file\\\" \\\"file-readable-p\\\" nil)\"
***************
*** 1998,2004 ****
echo \")\""
"Script to check existence of VC related files.
It must be send formatted with two strings; the tests for file
! existence, and file readability.")
(defconst tramp-file-mode-type-map
'((0 . "-") ; Normal file (SVID-v2 and XPG2)
--- 1998,2006 ----
echo \")\""
"Script to check existence of VC related files.
It must be send formatted with two strings; the tests for file
! existence, and file readability. Input shall be read via
! here-document, otherwise the command could exceed maximum length
! of command line.")
(defconst tramp-file-mode-type-map
'((0 . "-") ; Normal file (SVID-v2 and XPG2)
***************
*** 5419,5428 ****
(tramp-send-command-and-read
v
(format
! "tramp_vc_registered_read_file_names %s"
(mapconcat 'tramp-shell-quote-argument
tramp-vc-registered-file-names
! " "))))
(tramp-set-file-property
v (car elt) (cadr elt) (cadr (cdr elt))))))
--- 5421,5430 ----
(tramp-send-command-and-read
v
(format
! "tramp_vc_registered_read_file_names <<'EOF'\n%s\nEOF\n"
(mapconcat 'tramp-shell-quote-argument
tramp-vc-registered-file-names
! "\n"))))
(tramp-set-file-property
v (car elt) (cadr elt) (cadr (cdr elt))))))
--8<---------------cut here---------------end--------------->8---
Thanks for the report, and best regards, Michael.